diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6558e5b..b2bd575 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,5 +23,19 @@ jobs: - name: Set up go uses: actions/setup-go@v4 + - name: Start WireMock + run: docker compose -f wiremock/docker-compose.test.yml up -d + + - name: Wait for WireMock + run: | + timeout 30 bash -c 'until curl -f http://localhost:8080/__admin/health; do sleep 1; done' + - name: Test run: go test ./... + env: + MERGE_API_KEY_FILESTORAGE: ${{ secrets.MERGE_API_KEY_FILESTORAGE }} + MERGE_ACCOUNT_TOKEN_FILESTORAGE: ${{ secrets.MERGE_ACCOUNT_TOKEN_FILESTORAGE }} + + - name: Stop WireMock + if: always() + run: docker compose -f wiremock/docker-compose.test.yml down \ No newline at end of file diff --git a/.mock/accounting_v3.yml b/.mock/accounting_v3.yml new file mode 100644 index 0000000..455d27c --- /dev/null +++ b/.mock/accounting_v3.yml @@ -0,0 +1,32829 @@ +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 new file mode 100644 index 0000000..c478403 --- /dev/null +++ b/.mock/ats_v3.yml @@ -0,0 +1,10845 @@ +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 new file mode 100644 index 0000000..4e754eb --- /dev/null +++ b/.mock/crm_v3.yml @@ -0,0 +1,12652 @@ +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 similarity index 84% rename from .mock/definition/ats/__package__.yml rename to .mock/definition/ATS/__package__.yml index 2056295..791d099 100644 --- a/.mock/definition/ats/__package__.yml +++ b/.mock/definition/ATS/__package__.yml @@ -13,7 +13,15 @@ types: * `LIMITED_TEAM_MEMBER` - LIMITED_TEAM_MEMBER * `INTERVIEWER` - INTERVIEWER source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml + AccountDetailsCategory: + discriminated: false + union: + - CategoryEnum + - string + source: + openapi: ats_v3.yml + inline: true AccountDetails: properties: id: @@ -27,7 +35,7 @@ types: integration_slug: type: optional access: read-only - category: optional + category: optional end_user_origin_id: type: optional access: read-only @@ -62,7 +70,23 @@ types: type: optional docs: The time at which account completes the linking flow. source: - openapi: openapi/openapi.yml + 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 @@ -78,8 +102,8 @@ types: View a list of your organization's `LinkedAccount` objects. properties: id: string - category: optional - status: AccountDetailsAndActionsStatusEnum + category: optional + status: AccountDetailsAndActionsStatus status_detail: optional end_user_origin_id: optional end_user_organization_name: string @@ -98,9 +122,8 @@ types: integration: optional account_type: string completed_at: datetime - integration_specific_fields: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml AccountDetailsAndActionsIntegration: properties: name: string @@ -112,7 +135,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml AccountDetailsAndActionsStatusEnum: enum: - COMPLETE @@ -125,7 +148,7 @@ types: * `RELINK_NEEDED` - RELINK_NEEDED * `IDLE` - IDLE source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml AccountIntegration: properties: name: @@ -183,14 +206,14 @@ types: docs: Category or categories this integration is in beta status for. access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml AccountToken: properties: account_token: string integration: AccountIntegration id: string source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ActivityUser: discriminated: false docs: The user that performed the action. @@ -200,7 +223,35 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + 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: >- @@ -239,7 +290,7 @@ types: type: optional docs: When the third party's activity was created. activity_type: - type: optional + type: optional docs: |- The activity's type. @@ -253,7 +304,7 @@ types: type: optional docs: The activity's body. visibility: - type: optional + type: optional docs: |- The activity's visibility. @@ -280,7 +331,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ActivityRequestUser: discriminated: false docs: The user that performed the action. @@ -290,7 +341,21 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + 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: >- @@ -324,7 +389,7 @@ types: type: optional docs: The activity's body. visibility: - type: optional + type: optional docs: |- The activity's visibility. @@ -342,7 +407,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ActivityResponse: properties: model: Activity @@ -350,7 +415,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ActivityTypeEnum: enum: - NOTE @@ -361,7 +426,7 @@ types: * `EMAIL` - EMAIL * `OTHER` - OTHER source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml AdvancedMetadata: properties: id: @@ -374,7 +439,7 @@ types: is_custom: optional field_choices: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ApplicationCandidate: discriminated: false docs: The candidate applying. @@ -384,7 +449,7 @@ types: format: uuid - Candidate source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationJob: discriminated: false @@ -395,7 +460,7 @@ types: format: uuid - Job source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationOffersItem: discriminated: false @@ -405,7 +470,7 @@ types: format: uuid - Offer source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationCreditedTo: discriminated: false @@ -416,7 +481,7 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationScreeningQuestionAnswersItem: discriminated: false @@ -426,7 +491,7 @@ types: format: uuid - ScreeningQuestionAnswer source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationCurrentStage: discriminated: false @@ -437,7 +502,7 @@ types: format: uuid - JobInterviewStage source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationRejectReason: discriminated: false @@ -448,7 +513,7 @@ types: format: uuid - RejectReason source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true Application: docs: >- @@ -525,7 +590,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ApplicationRequestCandidate: discriminated: false docs: The candidate applying. @@ -535,7 +600,7 @@ types: format: uuid - Candidate source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationRequestJob: discriminated: false @@ -546,7 +611,7 @@ types: format: uuid - Job source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationRequestOffersItem: discriminated: false @@ -556,7 +621,7 @@ types: format: uuid - Offer source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationRequestCreditedTo: discriminated: false @@ -567,7 +632,7 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationRequestScreeningQuestionAnswersItem: discriminated: false @@ -577,7 +642,7 @@ types: format: uuid - ScreeningQuestionAnswerRequest source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationRequestCurrentStage: discriminated: false @@ -588,7 +653,7 @@ types: format: uuid - JobInterviewStage source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationRequestRejectReason: discriminated: false @@ -599,7 +664,7 @@ types: format: uuid - RejectReason source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ApplicationRequest: docs: >- @@ -656,7 +721,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ApplicationResponse: properties: model: Application @@ -664,7 +729,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml AsyncPassthroughReciept: properties: async_passthrough_receipt_id: @@ -672,7 +737,22 @@ types: validation: format: uuid source: - openapi: openapi/openapi.yml + 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 @@ -718,7 +798,7 @@ types: validation: format: uuid attachment_type: - type: optional + type: optional docs: |- The attachment's type. @@ -742,7 +822,22 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + 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 @@ -772,7 +867,7 @@ types: validation: format: uuid attachment_type: - type: optional + type: optional docs: |- The attachment's type. @@ -787,7 +882,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml AttachmentResponse: properties: model: Attachment @@ -795,7 +890,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml AttachmentTypeEnum: enum: - RESUME @@ -808,7 +903,142 @@ types: * `OFFER_LETTER` - OFFER_LETTER * `OTHER` - OTHER source: - openapi: openapi/openapi.yml + 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: @@ -828,7 +1058,7 @@ types: format: email maxLength: 254 role: - type: RoleEnum + 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. @@ -850,7 +1080,7 @@ types: validation: maxLength: 45 event_type: - type: EventTypeEnum + type: AuditLogEventEventType docs: >- Designates the type of event that occurred. @@ -961,7 +1191,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml AvailableActions: docs: >- # The AvailableActions Object @@ -980,7 +1210,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml CandidateApplicationsItem: discriminated: false union: @@ -989,7 +1219,7 @@ types: format: uuid - Application source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true CandidateAttachmentsItem: discriminated: false @@ -999,7 +1229,7 @@ types: format: uuid - Attachment source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true Candidate: docs: >- @@ -1089,7 +1319,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml CandidateRequestApplicationsItem: discriminated: false union: @@ -1098,7 +1328,7 @@ types: format: uuid - Application source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true CandidateRequestAttachmentsItem: discriminated: false @@ -1108,7 +1338,7 @@ types: format: uuid - Attachment source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true CandidateRequest: docs: >- @@ -1173,7 +1403,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml CandidateResponse: properties: model: Candidate @@ -1181,7 +1411,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml CategoriesEnum: enum: - hris @@ -1200,7 +1430,7 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml CategoryEnum: enum: - hris @@ -1219,14 +1449,14 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml CommonModelScopeApi: properties: common_models: docs: The common models you want to update the scopes for type: list source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml CommonModelScopesBodyRequest: properties: model_id: @@ -1236,7 +1466,7 @@ types: enabled_actions: list disabled_fields: list source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml DataPassthroughRequest: docs: >- # The DataPassthrough Object @@ -1290,21 +1520,21 @@ types: `{"type": T, "value": ...}` where `T` will be one of `string, boolean, number, null, array, object`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml DebugModeLog: properties: log_id: string dashboard_view: string log_summary: DebugModelLogSummary source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml DebugModelLogSummary: properties: url: string method: string status_code: integer source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml Department: docs: >- # The Department Object @@ -1354,7 +1584,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml DisabilityStatusEnum: enum: - YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY @@ -1368,7 +1598,7 @@ types: * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml EeocCandidate: discriminated: false docs: The candidate being represented. @@ -1378,7 +1608,88 @@ types: format: uuid - Candidate source: - openapi: openapi/openapi.yml + 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: >- @@ -1418,7 +1729,7 @@ types: type: optional docs: When the information was submitted. race: - type: optional + type: optional docs: >- The candidate's race. @@ -1441,7 +1752,7 @@ types: * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY gender: - type: optional + type: optional docs: |- The candidate's gender. @@ -1451,7 +1762,7 @@ types: * `OTHER` - OTHER * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY veteran_status: - type: optional + type: optional docs: >- The candidate's veteran status. @@ -1465,7 +1776,7 @@ types: * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER disability_status: - type: optional + type: optional docs: >- The candidate's disability status. @@ -1492,7 +1803,21 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + 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 @@ -1521,7 +1846,7 @@ types: format: email maxLength: 254 email_address_type: - type: optional + type: optional docs: |- The type of email address. @@ -1538,7 +1863,21 @@ types: more](https://docs.merge.dev/integrations/hris/supported-features/). access: read-only source: - openapi: openapi/openapi.yml + 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 @@ -1559,7 +1898,7 @@ types: format: email maxLength: 254 email_address_type: - type: optional + type: optional docs: |- The type of email address. @@ -1573,7 +1912,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml EmailAddressTypeEnum: enum: - PERSONAL @@ -1584,7 +1923,7 @@ types: * `WORK` - WORK * `OTHER` - OTHER source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml EnabledActionsEnum: enum: - READ @@ -1593,7 +1932,7 @@ types: * `READ` - READ * `WRITE` - WRITE source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml EncodingEnum: enum: - RAW @@ -1604,7 +1943,7 @@ types: * `BASE64` - BASE64 * `GZIP_BASE64` - GZIP_BASE64 source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ErrorValidationProblem: properties: source: optional @@ -1612,7 +1951,7 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml EventTypeEnum: enum: - CREATED_REMOTE_PRODUCTION_API_KEY @@ -1620,6 +1959,7 @@ types: - 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 @@ -1758,7 +2098,7 @@ types: * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ExternalTargetFieldApi: properties: name: @@ -1771,7 +2111,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ExternalTargetFieldApiResponse: properties: Activity: optional> @@ -1791,14 +2131,14 @@ types: Tag: optional> RemoteUser: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml FieldMappingApiInstanceTargetField: properties: name: string description: string is_organization_wide: boolean source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: properties: @@ -1806,7 +2146,7 @@ types: url_path: optional field_traversal_path: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true FieldMappingApiInstanceRemoteField: properties: @@ -1814,7 +2154,7 @@ types: schema: optional> remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true FieldMappingApiInstance: properties: @@ -1833,7 +2173,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml FieldMappingApiInstanceResponse: properties: Activity: optional> @@ -1853,7 +2193,7 @@ types: Tag: optional> RemoteUser: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml FieldMappingInstanceResponse: properties: model: FieldMappingApiInstance @@ -1861,19 +2201,19 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml FieldPermissionDeserializer: properties: enabled_fields: optional> disabled_fields: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml FieldPermissionDeserializerRequest: properties: enabled_fields: optional> disabled_fields: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml GenderEnum: enum: - MALE @@ -1889,14 +2229,32 @@ types: * `OTHER` - OTHER * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY source: - openapi: openapi/openapi.yml + 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: openapi/openapi.yml + openapi: ats_v3.yml IndividualCommonModelScopeDeserializerRequest: properties: model_name: @@ -1906,7 +2264,20 @@ types: model_permissions: optional> field_permissions: optional source: - openapi: openapi/openapi.yml + 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: @@ -1915,7 +2286,7 @@ types: format: uuid access: read-only status: - type: optional + type: optional docs: |- Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -1934,7 +2305,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml IssueStatusEnum: enum: - ONGOING @@ -1943,7 +2314,37 @@ types: * `ONGOING` - ONGOING * `RESOLVED` - RESOLVED source: - openapi: openapi/openapi.yml + 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: @@ -1952,7 +2353,7 @@ types: format: uuid - Department source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true JobOfficesItem: discriminated: false @@ -1962,7 +2363,7 @@ types: format: uuid - Office source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true JobHiringManagersItem: discriminated: false @@ -1972,7 +2373,7 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true JobRecruitersItem: discriminated: false @@ -1982,7 +2383,7 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true Job: docs: >- @@ -2025,7 +2426,7 @@ types: The job's code. Typically an additional identifier used to reference the particular job that is displayed on the ATS. status: - type: optional + type: optional docs: |- The job's status. @@ -2035,7 +2436,7 @@ types: * `ARCHIVED` - ARCHIVED * `PENDING` - PENDING type: - type: optional + type: optional docs: |- The job's type. @@ -2085,7 +2486,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml JobInterviewStageJob: discriminated: false docs: >- @@ -2097,7 +2498,7 @@ types: format: uuid - Job source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true JobInterviewStage: docs: >- @@ -2165,7 +2566,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml JobPostingJobPostingUrlsItem: discriminated: false union: @@ -2174,7 +2575,7 @@ types: format: uuid - Url source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true JobPostingJob: discriminated: false @@ -2185,7 +2586,23 @@ types: format: uuid - Job source: - openapi: openapi/openapi.yml + 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: >- @@ -2229,7 +2646,7 @@ types: type: optional docs: ID of `Job` object for this `JobPosting`. status: - type: optional + type: optional docs: |- The job posting's status. @@ -2266,7 +2683,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml JobPostingStatusEnum: enum: - PUBLISHED @@ -2281,7 +2698,7 @@ types: * `INTERNAL` - INTERNAL * `PENDING` - PENDING source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml JobStatusEnum: enum: - OPEN @@ -2296,7 +2713,7 @@ types: * `ARCHIVED` - ARCHIVED * `PENDING` - PENDING source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml JobTypeEnum: enum: - POSTING @@ -2307,7 +2724,7 @@ types: * `REQUISITION` - REQUISITION * `PROFILE` - PROFILE source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml LanguageEnum: enum: - en @@ -2316,7 +2733,7 @@ types: * `en` - en * `de` - de source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml LastSyncResultEnum: enum: - SYNCING @@ -2333,20 +2750,20 @@ types: * `PAUSED` - PAUSED * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml LinkToken: properties: link_token: string integration_name: optional magic_link_url: optional source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml LinkedAccountStatus: properties: linked_account_status: string can_make_request: boolean source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml MetaResponse: properties: request_schema: map @@ -2355,7 +2772,7 @@ types: has_conditional_params: boolean has_required_linked_account_params: boolean source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml MethodEnum: enum: - GET @@ -2374,7 +2791,7 @@ types: * `PATCH` - PATCH * `DELETE` - DELETE source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ModelOperation: docs: >- # The ModelOperation Object @@ -2394,17 +2811,31 @@ types: required_post_parameters: list supported_fields: list source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ModelPermissionDeserializer: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ModelPermissionDeserializerRequest: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + 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 @@ -2430,7 +2861,7 @@ types: validation: minLength: 1 encoding: - type: optional + type: optional docs: |- The encoding of the value of `data`. Defaults to `RAW` if not defined. @@ -2448,7 +2879,7 @@ types: validation: minLength: 1 source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml OfferApplication: discriminated: false docs: The application who is receiving the offer. @@ -2458,7 +2889,7 @@ types: format: uuid - Application source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true OfferCreator: discriminated: false @@ -2469,7 +2900,27 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + 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: >- @@ -2520,7 +2971,7 @@ types: type: optional docs: The employment start date on the offer. status: - type: optional + type: optional docs: |- The offer's status. @@ -2549,7 +3000,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml OfferStatusEnum: enum: - DRAFT @@ -2574,7 +3025,7 @@ types: * `SIGNED` - SIGNED * `DEPRECATED` - DEPRECATED source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml Office: docs: >- # The Office Object @@ -2627,7 +3078,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml OverallRecommendationEnum: enum: - DEFINITELY_NO @@ -2642,154 +3093,154 @@ types: * `STRONG_YES` - STRONG_YES * `NO_DECISION` - NO_DECISION source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedAccountDetailsAndActionsList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedActivityList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedApplicationList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedAttachmentList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedAuditLogEventList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedCandidateList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedDepartmentList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedEeocList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedIssueList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedJobInterviewStageList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedJobList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedJobPostingList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedOfferList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedOfficeList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedRejectReasonList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedRemoteUserList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedScheduledInterviewList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedScorecardList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedScreeningQuestionList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedSyncStatusList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PaginatedTagList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PatchedCandidateRequest: docs: >- # The Candidate Object @@ -2853,7 +3304,23 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + 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 @@ -2874,7 +3341,7 @@ types: type: optional docs: The phone number. phone_number_type: - type: optional + type: optional docs: |- The type of phone number. @@ -2893,7 +3360,23 @@ types: more](https://docs.merge.dev/integrations/hris/supported-features/). access: read-only source: - openapi: openapi/openapi.yml + 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 @@ -2906,7 +3389,7 @@ types: type: optional docs: The phone number. phone_number_type: - type: optional + type: optional docs: |- The type of phone number. @@ -2922,7 +3405,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml PhoneNumberTypeEnum: enum: - HOME @@ -2937,7 +3420,7 @@ types: * `SKYPE` - SKYPE * `OTHER` - OTHER source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml RaceEnum: enum: - AMERICAN_INDIAN_OR_ALASKAN_NATIVE @@ -2966,7 +3449,7 @@ types: * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ReasonEnum: enum: - GENERAL_CUSTOMER_REQUEST @@ -2977,7 +3460,7 @@ types: * `GDPR` - GDPR * `OTHER` - OTHER source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml RejectReason: docs: >- # The RejectReason Object @@ -3027,7 +3510,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml RemoteData: docs: >- # The RemoteData Object @@ -3049,21 +3532,21 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml RemoteEndpointInfo: properties: method: string url_path: string field_traversal_path: list source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml RemoteFieldApiCoverage: discriminated: false union: - integer - double source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true RemoteFieldApi: properties: @@ -3076,7 +3559,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml RemoteFieldApiResponse: properties: Activity: optional> @@ -3096,7 +3579,7 @@ types: Tag: optional> RemoteUser: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml RemoteKey: docs: >- # The RemoteKey Object @@ -3114,7 +3597,15 @@ types: name: string key: string source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml + RemoteResponseResponseType: + discriminated: false + union: + - ResponseTypeEnum + - string + source: + openapi: ats_v3.yml + inline: true RemoteResponse: docs: >- # The RemoteResponse Object @@ -3134,10 +3625,26 @@ types: status: integer response: unknown response_headers: optional> - response_type: optional + response_type: optional headers: optional> source: - openapi: openapi/openapi.yml + 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 @@ -3187,7 +3694,7 @@ types: type: optional docs: When the third party's user was created. access_role: - type: optional + type: optional docs: |- The user's role. @@ -3212,7 +3719,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml RequestFormatEnum: enum: - JSON @@ -3223,7 +3730,7 @@ types: * `XML` - XML * `MULTIPART` - MULTIPART source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ResponseTypeEnum: enum: - JSON @@ -3232,7 +3739,7 @@ types: * `JSON` - JSON * `BASE64_GZIP` - BASE64_GZIP source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml RoleEnum: enum: - ADMIN @@ -3249,7 +3756,7 @@ types: * `SYSTEM` - SYSTEM * `MERGE_TEAM` - MERGE_TEAM source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScheduledInterviewApplication: discriminated: false docs: The application being interviewed. @@ -3259,7 +3766,7 @@ types: format: uuid - Application source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScheduledInterviewJobInterviewStage: discriminated: false @@ -3270,7 +3777,7 @@ types: format: uuid - JobInterviewStage source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScheduledInterviewOrganizer: discriminated: false @@ -3281,7 +3788,7 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScheduledInterviewInterviewersItem: discriminated: false @@ -3291,7 +3798,21 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + 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: >- @@ -3352,7 +3873,7 @@ types: type: optional docs: When the third party's interview was updated. status: - type: optional + type: optional docs: |- The interview's status. @@ -3375,7 +3896,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScheduledInterviewRequestApplication: discriminated: false docs: The application being interviewed. @@ -3385,7 +3906,7 @@ types: format: uuid - Application source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScheduledInterviewRequestJobInterviewStage: discriminated: false @@ -3396,7 +3917,7 @@ types: format: uuid - JobInterviewStage source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScheduledInterviewRequestOrganizer: discriminated: false @@ -3407,7 +3928,7 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScheduledInterviewRequestInterviewersItem: discriminated: false @@ -3417,7 +3938,21 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + 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: >- @@ -3456,7 +3991,7 @@ types: type: optional docs: When the interview was ended. status: - type: optional + type: optional docs: |- The interview's status. @@ -3470,7 +4005,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScheduledInterviewResponse: properties: model: ScheduledInterview @@ -3478,7 +4013,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScheduledInterviewStatusEnum: enum: - SCHEDULED @@ -3489,7 +4024,7 @@ types: * `AWAITING_FEEDBACK` - AWAITING_FEEDBACK * `COMPLETE` - COMPLETE source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScorecardApplication: discriminated: false docs: The application being scored. @@ -3499,7 +4034,7 @@ types: format: uuid - Application source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScorecardInterview: discriminated: false @@ -3510,7 +4045,7 @@ types: format: uuid - ScheduledInterview source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScorecardInterviewer: discriminated: false @@ -3521,7 +4056,23 @@ types: format: uuid - RemoteUser source: - openapi: openapi/openapi.yml + 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: >- @@ -3569,7 +4120,7 @@ types: type: optional docs: When the scorecard was submitted. overall_recommendation: - type: optional + type: optional docs: |- The inteviewer's recommendation. @@ -3594,7 +4145,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScreeningQuestionJob: discriminated: false docs: The job associated with the screening question. @@ -3604,7 +4155,26 @@ types: format: uuid - Job source: - openapi: openapi/openapi.yml + 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: >- @@ -3650,7 +4220,7 @@ types: validation: maxLength: 2500 type: - type: optional + type: optional docs: |- The data type for the screening question. @@ -3675,7 +4245,7 @@ types: [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScreeningQuestionAnswerQuestion: discriminated: false docs: >- @@ -3689,7 +4259,7 @@ types: format: uuid - ScreeningQuestion source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScreeningQuestionAnswer: docs: >- @@ -3743,7 +4313,7 @@ types: more](https://docs.merge.dev/integrations/hris/supported-features/). access: read-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScreeningQuestionAnswerRequestQuestion: discriminated: false docs: >- @@ -3757,7 +4327,7 @@ types: format: uuid - ScreeningQuestion source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml inline: true ScreeningQuestionAnswerRequest: docs: >- @@ -3795,7 +4365,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScreeningQuestionOption: docs: >- # The ScreeningQuestionOption Object @@ -3840,7 +4410,7 @@ types: [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ScreeningQuestionTypeEnum: enum: - DATE @@ -3861,7 +4431,7 @@ types: * `NUMERIC` - NUMERIC * `BOOLEAN` - BOOLEAN source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml SelectiveSyncConfigurationsUsageEnum: enum: - IN_NEXT_SYNC @@ -3870,7 +4440,7 @@ types: * `IN_NEXT_SYNC` - IN_NEXT_SYNC * `IN_LAST_SYNC` - IN_LAST_SYNC source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml StatusFd5Enum: enum: - SYNCING @@ -3887,7 +4457,23 @@ types: * `PAUSED` - PAUSED * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED source: - openapi: openapi/openapi.yml + 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 @@ -3907,13 +4493,13 @@ types: model_id: string last_sync_start: optional next_sync_start: optional - last_sync_result: optional + last_sync_result: optional last_sync_finished: optional - status: StatusFd5Enum + status: SyncStatusStatus is_initial_sync: boolean selective_sync_configurations_usage: optional source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml Tag: docs: >- # The Tag Object @@ -3955,7 +4541,25 @@ types: access: read-only remote_data: optional>>> source: - openapi: openapi/openapi.yml + 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 @@ -3984,7 +4588,7 @@ types: format: uri maxLength: 2000 url_type: - type: optional + type: optional docs: |- The type of site. @@ -4005,7 +4609,25 @@ types: more](https://docs.merge.dev/integrations/hris/supported-features/). access: read-only source: - openapi: openapi/openapi.yml + 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 @@ -4026,7 +4648,7 @@ types: format: uri maxLength: 2000 url_type: - type: optional + type: optional docs: |- The type of site. @@ -4044,7 +4666,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml UrlTypeEnum: enum: - PERSONAL @@ -4063,12 +4685,12 @@ types: * `OTHER` - OTHER * `JOB_POSTING` - JOB_POSTING source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ValidationProblemSource: properties: pointer: string source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml VeteranStatusEnum: enum: - I_AM_NOT_A_PROTECTED_VETERAN @@ -4083,7 +4705,7 @@ types: * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml VisibilityEnum: enum: - ADMIN_ONLY @@ -4094,7 +4716,7 @@ types: * `PUBLIC` - PUBLIC * `PRIVATE` - PRIVATE source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml WarningValidationProblem: properties: source: optional @@ -4102,11 +4724,11 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml WebhookReceiver: properties: event: string is_active: boolean key: optional source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/accountDetails.yml b/.mock/definition/ATS/accountDetails.yml similarity index 81% rename from .mock/definition/ats/accountDetails.yml rename to .mock/definition/ATS/accountDetails.yml index fe37fa6..4842845 100644 --- a/.mock/definition/ats/accountDetails.yml +++ b/.mock/definition/ATS/accountDetails.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /ats/v1/account-details method: GET - auth: true + auth: + - tokenAuth: [] docs: Get details for a linked account. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: root.AccountDetails + type: atsRoot.AccountDetails status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd @@ -33,4 +35,4 @@ service: account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/accountToken.yml b/.mock/definition/ATS/accountToken.yml similarity index 83% rename from .mock/definition/ats/accountToken.yml rename to .mock/definition/ATS/accountToken.yml index 0c37279..ae8d930 100644 --- a/.mock/definition/ats/accountToken.yml +++ b/.mock/definition/ATS/accountToken.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,24 @@ service: retrieve: path: /ats/v1/account-token/{public_token} method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Returns the account token for the end user with the provided public token. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: public_token: string response: docs: '' - type: root.AccountToken + type: atsRoot.AccountToken status-code: 200 examples: - path-parameters: public_token: public_token + headers: + X-Account-Token: '[object Object]' response: body: account_token: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB @@ -41,4 +44,4 @@ service: key: value id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/activities.yml b/.mock/definition/ATS/activities.yml similarity index 90% rename from .mock/definition/ats/activities.yml rename to .mock/definition/ATS/activities.yml index 362836a..99b916b 100644 --- a/.mock/definition/ats/activities.yml +++ b/.mock/definition/ATS/activities.yml @@ -6,7 +6,7 @@ types: name: ActivityTypeVisibility - visibility source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ActivitiesListRequestShowEnumOrigins: enum: - activity_type @@ -14,7 +14,7 @@ types: name: ActivityTypeVisibility - visibility source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ActivitiesRetrieveRequestRemoteFields: enum: - activity_type @@ -22,7 +22,7 @@ types: name: ActivityTypeVisibility - visibility source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml ActivitiesRetrieveRequestShowEnumOrigins: enum: - activity_type @@ -30,9 +30,9 @@ types: name: ActivityTypeVisibility - visibility source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -40,10 +40,15 @@ service: list: path: /ats/v1/activities method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Activity` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: ActivitiesListRequest query-parameters: @@ -60,6 +65,7 @@ service: 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. @@ -112,10 +118,25 @@ service: docs: If provided, will only return activities done by this user. response: docs: '' - type: root.PaginatedActivityList + type: atsRoot.PaginatedActivityList status-code: 200 examples: - - headers: {} + - 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 @@ -145,10 +166,11 @@ service: create: path: /ats/v1/activities method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `Activity` object with the given values. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: ActivityEndpointRequest query-parameters: @@ -162,15 +184,19 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.ActivityRequest + model: atsRoot.ActivityRequest remote_user_id: string content-type: application/json response: docs: '' - type: root.ActivityResponse + type: atsRoot.ActivityResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} remote_user_id: remote_user_id @@ -221,10 +247,11 @@ service: retrieve: path: /ats/v1/activities/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Activity` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -232,6 +259,7 @@ service: 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. @@ -257,12 +285,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Activity + type: atsRoot.Activity status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -289,16 +323,18 @@ service: metaPostRetrieve: path: /ats/v1/activities/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Activity` POSTs. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: root.MetaResponse + type: atsRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -471,4 +507,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ATS/applications.yml b/.mock/definition/ATS/applications.yml new file mode 100644 index 0000000..c0347b5 --- /dev/null +++ b/.mock/definition/ATS/applications.yml @@ -0,0 +1,639 @@ +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 similarity index 77% rename from .mock/definition/ats/asyncPassthrough.yml rename to .mock/definition/ATS/asyncPassthrough.yml index 94686f1..b84e9da 100644 --- a/.mock/definition/ats/asyncPassthrough.yml +++ b/.mock/definition/ATS/asyncPassthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,23 @@ service: create: path: /ats/v1/async-passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: >- Asynchronously pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: - body: root.DataPassthroughRequest + body: atsRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.AsyncPassthroughReciept + type: atsRoot.AsyncPassthroughReciept status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -31,10 +33,11 @@ service: retrieve: path: /ats/v1/async-passthrough/{async_passthrough_receipt_id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Retrieves data from earlier async-passthrough POST request source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: async_passthrough_receipt_id: string response: @@ -44,7 +47,8 @@ service: examples: - path-parameters: async_passthrough_receipt_id: async_passthrough_receipt_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: method: GET @@ -59,12 +63,12 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml types: AsyncPassthroughRetrieveResponse: discriminated: false union: - - root.RemoteResponse + - atsRoot.RemoteResponse - string source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/attachments.yml b/.mock/definition/ATS/attachments.yml similarity index 90% rename from .mock/definition/ats/attachments.yml rename to .mock/definition/ATS/attachments.yml index 14b45b1..61e0a1e 100644 --- a/.mock/definition/ats/attachments.yml +++ b/.mock/definition/ATS/attachments.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ats/v1/attachments method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Attachment` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: AttachmentsListRequest query-parameters: @@ -30,6 +35,7 @@ service: 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. @@ -79,10 +85,25 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedAttachmentList + type: atsRoot.PaginatedAttachmentList status-code: 200 examples: - - headers: {} + - 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 @@ -109,10 +130,11 @@ service: create: path: /ats/v1/attachments method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `Attachment` object with the given values. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: AttachmentEndpointRequest query-parameters: @@ -126,15 +148,19 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.AttachmentRequest + model: atsRoot.AttachmentRequest remote_user_id: string content-type: application/json response: docs: '' - type: root.AttachmentResponse + type: atsRoot.AttachmentResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} remote_user_id: remote_user_id @@ -182,10 +208,11 @@ service: retrieve: path: /ats/v1/attachments/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Attachment` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -193,6 +220,7 @@ service: 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. @@ -218,12 +246,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Attachment + type: atsRoot.Attachment status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -247,16 +281,18 @@ service: metaPostRetrieve: path: /ats/v1/attachments/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Attachment` POSTs. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: root.MetaResponse + type: atsRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -429,4 +465,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/auditTrail.yml b/.mock/definition/ATS/auditTrail.yml similarity index 86% rename from .mock/definition/ats/auditTrail.yml rename to .mock/definition/ATS/auditTrail.yml index 36833ff..3a53d38 100644 --- a/.mock/definition/ats/auditTrail.yml +++ b/.mock/definition/ATS/auditTrail.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ats/v1/audit-trail method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets a list of audit trail events. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: AuditTrailListRequest query-parameters: @@ -72,10 +77,19 @@ service: email. response: docs: '' - type: root.PaginatedAuditLogEventList + type: atsRoot.PaginatedAuditLogEventList status-code: 200 examples: - - response: + - 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 @@ -91,4 +105,4 @@ service: from Read to Read+Write created_at: '2024-01-15T09:30:00Z' source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/availableActions.yml b/.mock/definition/ATS/availableActions.yml similarity index 85% rename from .mock/definition/ats/availableActions.yml rename to .mock/definition/ATS/availableActions.yml index 8e529df..7cc26f4 100644 --- a/.mock/definition/ats/availableActions.yml +++ b/.mock/definition/ATS/availableActions.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /ats/v1/available-actions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of models and actions available for an account. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: root.AvailableActions + type: atsRoot.AvailableActions status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: integration: @@ -47,4 +49,4 @@ service: - company - title source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/candidates.yml b/.mock/definition/ATS/candidates.yml similarity index 92% rename from .mock/definition/ats/candidates.yml rename to .mock/definition/ATS/candidates.yml index b4312f2..a757ff0 100644 --- a/.mock/definition/ats/candidates.yml +++ b/.mock/definition/ATS/candidates.yml @@ -1,22 +1,18 @@ types: - CandidatesListRequestExpand: + CandidatesListRequestExpandItem: enum: - applications - - value: applications,attachments - name: ApplicationsAttachments - attachments source: - openapi: openapi/openapi.yml - CandidatesRetrieveRequestExpand: + openapi: ats_v3.yml + CandidatesRetrieveRequestExpandItem: enum: - applications - - value: applications,attachments - name: ApplicationsAttachments - attachments source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -24,10 +20,15 @@ service: list: path: /ats/v1/candidates method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Candidate` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: CandidatesListRequest query-parameters: @@ -48,7 +49,8 @@ service: If provided, will only return candidates with these email addresses; multiple addresses can be separated by commas. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -99,10 +101,26 @@ service: tags can be separated by commas. response: docs: '' - type: root.PaginatedCandidateList + type: atsRoot.PaginatedCandidateList status-code: 200 examples: - - headers: {} + - 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 @@ -161,10 +179,11 @@ service: create: path: /ats/v1/candidates method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Candidate` object with the given values. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: CandidateEndpointRequest query-parameters: @@ -178,15 +197,19 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.CandidateRequest + model: atsRoot.CandidateRequest remote_user_id: string content-type: application/json response: docs: '' - type: root.CandidateResponse + type: atsRoot.CandidateResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} remote_user_id: remote_user_id @@ -266,17 +289,19 @@ service: retrieve: path: /ats/v1/candidates/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Candidate` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: name: CandidatesRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -292,12 +317,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Candidate + type: atsRoot.Candidate status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -356,10 +385,11 @@ service: partialUpdate: path: /ats/v1/candidates/{id} method: PATCH - auth: true + auth: + - tokenAuth: [] docs: Updates a `Candidate` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -375,17 +405,21 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.PatchedCandidateRequest + model: atsRoot.PatchedCandidateRequest remote_user_id: string content-type: application/json response: docs: '' - type: root.CandidateResponse + type: atsRoot.CandidateResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} remote_user_id: remote_user_id @@ -465,50 +499,46 @@ service: ignoreCreate: path: /ats/v1/candidates/ignore/{model_id} method: POST - auth: true + 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: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: model_id: string request: - name: IgnoreCommonModelRequest - body: - properties: - reason: root.ReasonEnum - message: - type: optional - validation: - minLength: 1 - maxLength: 256 + body: atsRoot.IgnoreCommonModelRequest content-type: application/json examples: - path-parameters: model_id: model_id - headers: {} + headers: + X-Account-Token: X-Account-Token request: reason: GENERAL_CUSTOMER_REQUEST metaPatchRetrieve: path: /ats/v1/candidates/meta/patch/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Candidate` PATCHs. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string response: docs: '' - type: root.MetaResponse + type: atsRoot.MetaResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -683,16 +713,18 @@ service: metaPostRetrieve: path: /ats/v1/candidates/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Candidate` POSTs. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: root.MetaResponse + type: atsRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -865,4 +897,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/deleteAccount.yml b/.mock/definition/ATS/deleteAccount.yml similarity index 56% rename from .mock/definition/ats/deleteAccount.yml rename to .mock/definition/ATS/deleteAccount.yml index 6255a39..b902b54 100644 --- a/.mock/definition/ats/deleteAccount.yml +++ b/.mock/definition/ATS/deleteAccount.yml @@ -5,11 +5,13 @@ service: delete: path: /ats/v1/delete-account method: POST - auth: true + auth: + - tokenAuth: [] docs: Delete a linked account. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/departments.yml b/.mock/definition/ATS/departments.yml similarity index 81% rename from .mock/definition/ats/departments.yml rename to .mock/definition/ATS/departments.yml index 8f001f4..d8eee7e 100644 --- a/.mock/definition/ats/departments.yml +++ b/.mock/definition/ATS/departments.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ats/v1/departments method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Department` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: DepartmentsListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedDepartmentList + type: atsRoot.PaginatedDepartmentList status-code: 200 examples: - - headers: {} + - 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 @@ -88,10 +105,11 @@ service: retrieve: path: /ats/v1/departments/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Department` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -109,12 +127,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Department + type: atsRoot.Department status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -133,4 +155,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/eeocs.yml b/.mock/definition/ATS/eeocs.yml similarity index 88% rename from .mock/definition/ats/eeocs.yml rename to .mock/definition/ATS/eeocs.yml index 91dbf6b..a5b85dc 100644 --- a/.mock/definition/ats/eeocs.yml +++ b/.mock/definition/ATS/eeocs.yml @@ -28,7 +28,7 @@ types: name: RaceVeteranStatus - veteran_status source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml EeocsListRequestShowEnumOrigins: enum: - disability_status @@ -58,7 +58,7 @@ types: name: RaceVeteranStatus - veteran_status source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml EeocsRetrieveRequestRemoteFields: enum: - disability_status @@ -88,7 +88,7 @@ types: name: RaceVeteranStatus - veteran_status source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml EeocsRetrieveRequestShowEnumOrigins: enum: - disability_status @@ -118,9 +118,9 @@ types: name: RaceVeteranStatus - veteran_status source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -128,10 +128,15 @@ service: list: path: /ats/v1/eeocs method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `EEOC` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: EeocsListRequest query-parameters: @@ -151,6 +156,7 @@ service: 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. @@ -200,10 +206,25 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedEeocList + type: atsRoot.PaginatedEeocList status-code: 200 examples: - - headers: {} + - 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 @@ -232,10 +253,11 @@ service: retrieve: path: /ats/v1/eeocs/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `EEOC` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -243,6 +265,7 @@ service: 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. @@ -268,12 +291,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Eeoc + type: atsRoot.Eeoc status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -297,4 +326,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/fieldMapping.yml b/.mock/definition/ATS/fieldMapping.yml similarity index 96% rename from .mock/definition/ats/fieldMapping.yml rename to .mock/definition/ATS/fieldMapping.yml index 9d92fea..bda9917 100644 --- a/.mock/definition/ats/fieldMapping.yml +++ b/.mock/definition/ATS/fieldMapping.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,14 +7,15 @@ service: field_mappings_retrieve: path: /ats/v1/field-mappings method: GET - auth: true + 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: openapi/openapi.yml + openapi: ats_v3.yml request: name: FieldMappingsRetrieveRequest query-parameters: @@ -27,10 +28,13 @@ service: of the request since these fields require some calculations. response: docs: '' - type: root.FieldMappingApiInstanceResponse + type: atsRoot.FieldMappingApiInstanceResponse status-code: 200 examples: - - headers: {} + - query-parameters: + exclude_remote_field_metadata: true + headers: + X-Account-Token: X-Account-Token response: body: Activity: @@ -292,13 +296,14 @@ service: field_mappings_create: path: /ats/v1/field-mappings method: POST - auth: true + 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: openapi/openapi.yml + openapi: ats_v3.yml request: name: CreateFieldMappingRequest query-parameters: @@ -354,10 +359,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: atsRoot.FieldMappingInstanceResponse status-code: 201 examples: - - headers: {} + - 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 @@ -407,24 +415,26 @@ service: field_mappings_destroy: path: /ats/v1/field-mappings/{field_mapping_id} method: DELETE - auth: true + 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: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: field_mapping_id: string response: docs: '' - type: root.FieldMappingInstanceResponse + type: atsRoot.FieldMappingInstanceResponse status-code: 204 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: model: @@ -466,13 +476,14 @@ service: field_mappings_partial_update: path: /ats/v1/field-mappings/{field_mapping_id} method: PATCH - auth: true + 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: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: field_mapping_id: string request: @@ -501,12 +512,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: atsRoot.FieldMappingInstanceResponse status-code: 200 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token request: {} response: body: @@ -549,7 +561,8 @@ service: remote_fields_retrieve: path: /ats/v1/remote-fields method: GET - auth: true + 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 @@ -557,7 +570,7 @@ service: or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: RemoteFieldsRetrieveRequest query-parameters: @@ -574,10 +587,14 @@ service: data from your customers. response: docs: '' - type: root.RemoteFieldApiResponse + type: atsRoot.RemoteFieldApiResponse status-code: 200 examples: - - headers: {} + - query-parameters: + common_models: common_models + include_example_values: include_example_values + headers: + X-Account-Token: X-Account-Token response: body: Activity: @@ -807,7 +824,8 @@ service: target_fields_retrieve: path: /ats/v1/target-fields method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields @@ -815,13 +833,14 @@ service: Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: root.ExternalTargetFieldApiResponse + type: atsRoot.ExternalTargetFieldApiResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: Activity: @@ -889,4 +908,4 @@ service: description: this is a example description of a target field is_mapped: is_mapped source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/forceResync.yml b/.mock/definition/ATS/forceResync.yml similarity index 83% rename from .mock/definition/ats/forceResync.yml rename to .mock/definition/ATS/forceResync.yml index 8a60399..c19f53b 100644 --- a/.mock/definition/ats/forceResync.yml +++ b/.mock/definition/ATS/forceResync.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: sync_status_resync_create: path: /ats/v1/sync-status/resync method: POST - auth: true + 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 @@ -15,13 +16,14 @@ service: linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - model_name: Candidate @@ -34,4 +36,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/generateKey.yml b/.mock/definition/ATS/generateKey.yml similarity index 75% rename from .mock/definition/ats/generateKey.yml rename to .mock/definition/ATS/generateKey.yml index 40a39dc..b9f011f 100644 --- a/.mock/definition/ats/generateKey.yml +++ b/.mock/definition/ATS/generateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /ats/v1/generate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Create a remote key. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: GenerateRemoteKeyRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: atsRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/interviews.yml b/.mock/definition/ATS/interviews.yml similarity index 86% rename from .mock/definition/ats/interviews.yml rename to .mock/definition/ATS/interviews.yml index aa95289..9fb16f5 100644 --- a/.mock/definition/ats/interviews.yml +++ b/.mock/definition/ATS/interviews.yml @@ -1,66 +1,22 @@ types: - InterviewsListRequestExpand: + InterviewsListRequestExpandItem: enum: - application - - value: application,job_interview_stage - name: ApplicationJobInterviewStage - interviewers - - value: interviewers,application - name: InterviewersApplication - - value: interviewers,application,job_interview_stage - name: InterviewersApplicationJobInterviewStage - - value: interviewers,job_interview_stage - name: InterviewersJobInterviewStage - - value: interviewers,organizer - name: InterviewersOrganizer - - value: interviewers,organizer,application - name: InterviewersOrganizerApplication - - value: interviewers,organizer,application,job_interview_stage - name: InterviewersOrganizerApplicationJobInterviewStage - - value: interviewers,organizer,job_interview_stage - name: InterviewersOrganizerJobInterviewStage - job_interview_stage - organizer - - value: organizer,application - name: OrganizerApplication - - value: organizer,application,job_interview_stage - name: OrganizerApplicationJobInterviewStage - - value: organizer,job_interview_stage - name: OrganizerJobInterviewStage source: - openapi: openapi/openapi.yml - InterviewsRetrieveRequestExpand: + openapi: ats_v3.yml + InterviewsRetrieveRequestExpandItem: enum: - application - - value: application,job_interview_stage - name: ApplicationJobInterviewStage - interviewers - - value: interviewers,application - name: InterviewersApplication - - value: interviewers,application,job_interview_stage - name: InterviewersApplicationJobInterviewStage - - value: interviewers,job_interview_stage - name: InterviewersJobInterviewStage - - value: interviewers,organizer - name: InterviewersOrganizer - - value: interviewers,organizer,application - name: InterviewersOrganizerApplication - - value: interviewers,organizer,application,job_interview_stage - name: InterviewersOrganizerApplicationJobInterviewStage - - value: interviewers,organizer,job_interview_stage - name: InterviewersOrganizerJobInterviewStage - job_interview_stage - organizer - - value: organizer,application - name: OrganizerApplication - - value: organizer,application,job_interview_stage - name: OrganizerApplicationJobInterviewStage - - value: organizer,job_interview_stage - name: OrganizerJobInterviewStage source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -68,10 +24,15 @@ service: list: path: /ats/v1/interviews method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `ScheduledInterview` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: InterviewsListRequest query-parameters: @@ -90,7 +51,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -149,10 +111,28 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedScheduledInterviewList + type: atsRoot.PaginatedScheduledInterviewList status-code: 200 examples: - - headers: {} + - 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 @@ -187,10 +167,11 @@ service: create: path: /ats/v1/interviews method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `ScheduledInterview` object with the given values. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: ScheduledInterviewEndpointRequest query-parameters: @@ -204,15 +185,19 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.ScheduledInterviewRequest + model: atsRoot.ScheduledInterviewRequest remote_user_id: string content-type: application/json response: docs: '' - type: root.ScheduledInterviewResponse + type: atsRoot.ScheduledInterviewResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} remote_user_id: remote_user_id @@ -268,17 +253,19 @@ service: retrieve: path: /ats/v1/interviews/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `ScheduledInterview` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: name: InterviewsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -304,12 +291,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.ScheduledInterview + type: atsRoot.ScheduledInterview status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -341,16 +334,18 @@ service: metaPostRetrieve: path: /ats/v1/interviews/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `ScheduledInterview` POSTs. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: root.MetaResponse + type: atsRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -523,4 +518,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/issues.yml b/.mock/definition/ATS/issues.yml similarity index 76% rename from .mock/definition/ats/issues.yml rename to .mock/definition/ATS/issues.yml index 4984ce4..b446519 100644 --- a/.mock/definition/ats/issues.yml +++ b/.mock/definition/ATS/issues.yml @@ -4,9 +4,9 @@ types: - ONGOING - RESOLVED source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -14,10 +14,15 @@ service: list: path: /ats/v1/issues method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets all issues for Organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: IssuesListRequest query-parameters: @@ -77,10 +82,27 @@ service: * `RESOLVED` - RESOLVED response: docs: '' - type: root.PaginatedIssueList + type: atsRoot.PaginatedIssueList status-code: 200 examples: - - response: + - 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 @@ -99,19 +121,22 @@ service: retrieve: path: /ats/v1/issues/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Get a specific issue. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string response: docs: '' - type: root.Issue + 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 @@ -126,4 +151,4 @@ service: - Missing employee permissions. - Missing time off permissions. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/jobInterviewStages.yml b/.mock/definition/ATS/jobInterviewStages.yml similarity index 81% rename from .mock/definition/ats/jobInterviewStages.yml rename to .mock/definition/ATS/jobInterviewStages.yml index 5753b28..413ae6f 100644 --- a/.mock/definition/ats/jobInterviewStages.yml +++ b/.mock/definition/ATS/jobInterviewStages.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ats/v1/job-interview-stages method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `JobInterviewStage` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: JobInterviewStagesListRequest query-parameters: @@ -27,6 +32,7 @@ service: 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. @@ -69,10 +75,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedJobInterviewStageList + type: atsRoot.PaginatedJobInterviewStageList status-code: 200 examples: - - headers: {} + - 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 @@ -98,10 +117,11 @@ service: retrieve: path: /ats/v1/job-interview-stages/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `JobInterviewStage` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -109,6 +129,7 @@ service: 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. @@ -124,12 +145,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.JobInterviewStage + type: atsRoot.JobInterviewStage status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -150,4 +175,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/jobPostings.yml b/.mock/definition/ATS/jobPostings.yml similarity index 84% rename from .mock/definition/ats/jobPostings.yml rename to .mock/definition/ATS/jobPostings.yml index 859b5bb..3863a2d 100644 --- a/.mock/definition/ats/jobPostings.yml +++ b/.mock/definition/ATS/jobPostings.yml @@ -7,9 +7,9 @@ types: - PENDING - PUBLISHED source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -17,10 +17,15 @@ service: list: path: /ats/v1/job-postings method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `JobPosting` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: JobPostingsListRequest query-parameters: @@ -37,6 +42,7 @@ service: 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. @@ -92,10 +98,23 @@ service: * `PENDING` - PENDING response: docs: '' - type: root.PaginatedJobPostingList + type: atsRoot.PaginatedJobPostingList status-code: 200 examples: - - headers: {} + - 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 @@ -130,10 +149,11 @@ service: retrieve: path: /ats/v1/job-postings/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `JobPosting` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -141,6 +161,7 @@ service: 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. @@ -156,12 +177,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.JobPosting + type: atsRoot.JobPosting status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -192,4 +217,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/jobs.yml b/.mock/definition/ATS/jobs.yml similarity index 68% rename from .mock/definition/ats/jobs.yml rename to .mock/definition/ATS/jobs.yml index 7ec7441..3c8d1a7 100644 --- a/.mock/definition/ats/jobs.yml +++ b/.mock/definition/ATS/jobs.yml @@ -1,65 +1,13 @@ types: - JobsListRequestExpand: + JobsListRequestExpandItem: enum: - departments - - value: departments,hiring_managers - name: DepartmentsHiringManagers - - value: departments,hiring_managers,job_postings - name: DepartmentsHiringManagersJobPostings - - value: departments,hiring_managers,job_postings,recruiters - name: DepartmentsHiringManagersJobPostingsRecruiters - - value: departments,hiring_managers,recruiters - name: DepartmentsHiringManagersRecruiters - - value: departments,job_postings - name: DepartmentsJobPostings - - value: departments,job_postings,recruiters - name: DepartmentsJobPostingsRecruiters - - value: departments,offices - name: DepartmentsOffices - - value: departments,offices,hiring_managers - name: DepartmentsOfficesHiringManagers - - value: departments,offices,hiring_managers,job_postings - name: DepartmentsOfficesHiringManagersJobPostings - - value: departments,offices,hiring_managers,job_postings,recruiters - name: DepartmentsOfficesHiringManagersJobPostingsRecruiters - - value: departments,offices,hiring_managers,recruiters - name: DepartmentsOfficesHiringManagersRecruiters - - value: departments,offices,job_postings - name: DepartmentsOfficesJobPostings - - value: departments,offices,job_postings,recruiters - name: DepartmentsOfficesJobPostingsRecruiters - - value: departments,offices,recruiters - name: DepartmentsOfficesRecruiters - - value: departments,recruiters - name: DepartmentsRecruiters - hiring_managers - - value: hiring_managers,job_postings - name: HiringManagersJobPostings - - value: hiring_managers,job_postings,recruiters - name: HiringManagersJobPostingsRecruiters - - value: hiring_managers,recruiters - name: HiringManagersRecruiters - job_postings - - value: job_postings,recruiters - name: JobPostingsRecruiters - offices - - value: offices,hiring_managers - name: OfficesHiringManagers - - value: offices,hiring_managers,job_postings - name: OfficesHiringManagersJobPostings - - value: offices,hiring_managers,job_postings,recruiters - name: OfficesHiringManagersJobPostingsRecruiters - - value: offices,hiring_managers,recruiters - name: OfficesHiringManagersRecruiters - - value: offices,job_postings - name: OfficesJobPostings - - value: offices,job_postings,recruiters - name: OfficesJobPostingsRecruiters - - value: offices,recruiters - name: OfficesRecruiters - recruiters source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml JobsListRequestStatus: enum: - ARCHIVED @@ -68,78 +16,24 @@ types: - OPEN - PENDING source: - openapi: openapi/openapi.yml - JobsRetrieveRequestExpand: + openapi: ats_v3.yml + JobsRetrieveRequestExpandItem: enum: - departments - - value: departments,hiring_managers - name: DepartmentsHiringManagers - - value: departments,hiring_managers,job_postings - name: DepartmentsHiringManagersJobPostings - - value: departments,hiring_managers,job_postings,recruiters - name: DepartmentsHiringManagersJobPostingsRecruiters - - value: departments,hiring_managers,recruiters - name: DepartmentsHiringManagersRecruiters - - value: departments,job_postings - name: DepartmentsJobPostings - - value: departments,job_postings,recruiters - name: DepartmentsJobPostingsRecruiters - - value: departments,offices - name: DepartmentsOffices - - value: departments,offices,hiring_managers - name: DepartmentsOfficesHiringManagers - - value: departments,offices,hiring_managers,job_postings - name: DepartmentsOfficesHiringManagersJobPostings - - value: departments,offices,hiring_managers,job_postings,recruiters - name: DepartmentsOfficesHiringManagersJobPostingsRecruiters - - value: departments,offices,hiring_managers,recruiters - name: DepartmentsOfficesHiringManagersRecruiters - - value: departments,offices,job_postings - name: DepartmentsOfficesJobPostings - - value: departments,offices,job_postings,recruiters - name: DepartmentsOfficesJobPostingsRecruiters - - value: departments,offices,recruiters - name: DepartmentsOfficesRecruiters - - value: departments,recruiters - name: DepartmentsRecruiters - hiring_managers - - value: hiring_managers,job_postings - name: HiringManagersJobPostings - - value: hiring_managers,job_postings,recruiters - name: HiringManagersJobPostingsRecruiters - - value: hiring_managers,recruiters - name: HiringManagersRecruiters - job_postings - - value: job_postings,recruiters - name: JobPostingsRecruiters - offices - - value: offices,hiring_managers - name: OfficesHiringManagers - - value: offices,hiring_managers,job_postings - name: OfficesHiringManagersJobPostings - - value: offices,hiring_managers,job_postings,recruiters - name: OfficesHiringManagersJobPostingsRecruiters - - value: offices,hiring_managers,recruiters - name: OfficesHiringManagersRecruiters - - value: offices,job_postings - name: OfficesJobPostings - - value: offices,job_postings,recruiters - name: OfficesJobPostingsRecruiters - - value: offices,recruiters - name: OfficesRecruiters - recruiters source: - openapi: openapi/openapi.yml - JobsScreeningQuestionsListRequestExpand: + openapi: ats_v3.yml + JobsScreeningQuestionsListRequestExpandItem: enum: - job - options - - value: options,job - name: OptionsJob source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -147,10 +41,15 @@ service: list: path: /ats/v1/jobs method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Job` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: JobsListRequest query-parameters: @@ -169,7 +68,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -240,10 +140,27 @@ service: * `PENDING` - PENDING response: docs: '' - type: root.PaginatedJobList + type: atsRoot.PaginatedJobList status-code: 200 examples: - - headers: {} + - 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 @@ -293,17 +210,19 @@ service: retrieve: path: /ats/v1/jobs/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Job` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: name: JobsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -329,12 +248,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Job + type: atsRoot.Job status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -382,10 +307,15 @@ service: screeningQuestionsList: path: /ats/v1/jobs/{job_id}/screening-questions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `ScreeningQuestion` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: job_id: string request: @@ -395,7 +325,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -422,12 +353,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedScreeningQuestionList + type: atsRoot.PaginatedScreeningQuestionList status-code: 200 examples: - path-parameters: job_id: job_id - headers: {} + 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 @@ -451,4 +389,4 @@ service: label: I am currently not eligible remote_was_deleted: true source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/linkToken.yml b/.mock/definition/ATS/linkToken.yml similarity index 85% rename from .mock/definition/ats/linkToken.yml rename to .mock/definition/ATS/linkToken.yml index 2fa09e3..df4d0a8 100644 --- a/.mock/definition/ats/linkToken.yml +++ b/.mock/definition/ATS/linkToken.yml @@ -1,5 +1,22 @@ imports: - root: __package__.yml + 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: '' @@ -7,10 +24,11 @@ service: create: path: /ats/v1/link-token method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a link token to be used when linking a new end user. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: EndUserDetailsRequest body: @@ -41,7 +59,7 @@ service: maxLength: 100 categories: docs: The integration categories to show in Merge Link. - type: list + type: list integration: type: optional docs: >- @@ -76,7 +94,7 @@ service: https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. default: false common_models: - type: optional> + 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 @@ -86,14 +104,14 @@ service: category_common_model_scopes: type: >- optional>>> + 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 + type: optional docs: >- The following subset of IETF language tags can be used to configure localization. @@ -116,10 +134,12 @@ service: content-type: application/json response: docs: '' - type: root.LinkToken + type: atsRoot.LinkToken status-code: 200 examples: - - request: + - 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' @@ -132,4 +152,4 @@ service: integration_name: Lever magic_link_url: https://link.merge.dev/asdfjkl12345jsndfgi2i83n source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/linkedAccounts.yml b/.mock/definition/ATS/linkedAccounts.yml similarity index 83% rename from .mock/definition/ats/linkedAccounts.yml rename to .mock/definition/ATS/linkedAccounts.yml index 7acf309..fec205e 100644 --- a/.mock/definition/ats/linkedAccounts.yml +++ b/.mock/definition/ATS/linkedAccounts.yml @@ -9,9 +9,9 @@ types: - mktg - ticketing source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -19,10 +19,15 @@ service: list: path: /ats/v1/linked-accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: List linked accounts for your organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: LinkedAccountsListRequest query-parameters: @@ -104,10 +109,26 @@ service: `RELINK_NEEDED` response: docs: '' - type: root.PaginatedAccountDetailsAndActionsList + type: atsRoot.PaginatedAccountDetailsAndActionsList status-code: 200 examples: - - response: + - 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 @@ -144,7 +165,5 @@ service: - title account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' - integration_specific_fields: - integration_specific_field: Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/offers.yml b/.mock/definition/ATS/offers.yml similarity index 81% rename from .mock/definition/ats/offers.yml rename to .mock/definition/ATS/offers.yml index cb2591c..3773376 100644 --- a/.mock/definition/ats/offers.yml +++ b/.mock/definition/ATS/offers.yml @@ -1,22 +1,18 @@ types: - OffersListRequestExpand: + OffersListRequestExpandItem: enum: - application - - value: application,creator - name: ApplicationCreator - creator source: - openapi: openapi/openapi.yml - OffersRetrieveRequestExpand: + openapi: ats_v3.yml + OffersRetrieveRequestExpandItem: enum: - application - - value: application,creator - name: ApplicationCreator - creator source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -24,10 +20,15 @@ service: list: path: /ats/v1/offers method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Offer` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: OffersListRequest query-parameters: @@ -49,7 +50,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -99,10 +101,26 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedOfferList + type: atsRoot.PaginatedOfferList status-code: 200 examples: - - headers: {} + - 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 @@ -132,17 +150,19 @@ service: retrieve: path: /ats/v1/offers/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Offer` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: name: OffersRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -168,12 +188,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Offer + type: atsRoot.Offer status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -198,4 +224,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/offices.yml b/.mock/definition/ATS/offices.yml similarity index 81% rename from .mock/definition/ats/offices.yml rename to .mock/definition/ATS/offices.yml index 080386b..9d144f2 100644 --- a/.mock/definition/ats/offices.yml +++ b/.mock/definition/ATS/offices.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ats/v1/offices method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Office` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: OfficesListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedOfficeList + type: atsRoot.PaginatedOfficeList status-code: 200 examples: - - headers: {} + - 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 @@ -89,10 +106,11 @@ service: retrieve: path: /ats/v1/offices/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Office` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -110,12 +128,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Office + type: atsRoot.Office status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -135,4 +157,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/passthrough.yml b/.mock/definition/ATS/passthrough.yml similarity index 75% rename from .mock/definition/ats/passthrough.yml rename to .mock/definition/ATS/passthrough.yml index 7141a6b..52615aa 100644 --- a/.mock/definition/ats/passthrough.yml +++ b/.mock/definition/ATS/passthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,21 @@ service: create: path: /ats/v1/passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: Pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: - body: root.DataPassthroughRequest + body: atsRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.RemoteResponse + type: atsRoot.RemoteResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -37,4 +39,4 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/regenerateKey.yml b/.mock/definition/ATS/regenerateKey.yml similarity index 76% rename from .mock/definition/ats/regenerateKey.yml rename to .mock/definition/ATS/regenerateKey.yml index 1ea4149..08d6464 100644 --- a/.mock/definition/ats/regenerateKey.yml +++ b/.mock/definition/ATS/regenerateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /ats/v1/regenerate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Exchange remote keys. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: RemoteKeyForRegenerationRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: atsRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/rejectReasons.yml b/.mock/definition/ATS/rejectReasons.yml similarity index 81% rename from .mock/definition/ats/rejectReasons.yml rename to .mock/definition/ATS/rejectReasons.yml index 1552c46..563303a 100644 --- a/.mock/definition/ats/rejectReasons.yml +++ b/.mock/definition/ATS/rejectReasons.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ats/v1/reject-reasons method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RejectReason` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: RejectReasonsListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedRejectReasonList + type: atsRoot.PaginatedRejectReasonList status-code: 200 examples: - - headers: {} + - 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 @@ -88,10 +105,11 @@ service: retrieve: path: /ats/v1/reject-reasons/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `RejectReason` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -109,12 +127,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.RejectReason + type: atsRoot.RejectReason status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -133,4 +155,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/scopes.yml b/.mock/definition/ATS/scopes.yml similarity index 87% rename from .mock/definition/ats/scopes.yml rename to .mock/definition/ATS/scopes.yml index 422d3fa..9fc4d12 100644 --- a/.mock/definition/ats/scopes.yml +++ b/.mock/definition/ATS/scopes.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,22 @@ service: default_scopes_retrieve: path: /ats/v1/default-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: atsRoot.CommonModelScopeApi status-code: 200 examples: - - response: + - headers: + X-Account-Token: '[object Object]' + response: body: common_models: - model_name: Employee @@ -48,19 +51,21 @@ service: linked_account_scopes_retrieve: path: /ats/v1/linked-account-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: atsRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: common_models: @@ -90,28 +95,30 @@ service: linked_account_scopes_create: path: /ats/v1/linked-account-scopes method: POST - auth: true + 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: openapi/openapi.yml + openapi: ats_v3.yml request: name: LinkedAccountCommonModelScopeDeserializerRequest body: properties: common_models: docs: The common models you want to update the scopes for - type: list + type: list content-type: application/json response: docs: '' - type: root.CommonModelScopeApi + type: atsRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: common_models: - model_name: Employee @@ -157,4 +164,4 @@ service: - manager - work_location source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/scorecards.yml b/.mock/definition/ATS/scorecards.yml similarity index 80% rename from .mock/definition/ats/scorecards.yml rename to .mock/definition/ATS/scorecards.yml index 6f83e85..5856ace 100644 --- a/.mock/definition/ats/scorecards.yml +++ b/.mock/definition/ATS/scorecards.yml @@ -1,36 +1,20 @@ types: - ScorecardsListRequestExpand: + ScorecardsListRequestExpandItem: enum: - application - - value: application,interview - name: ApplicationInterview - - value: application,interview,interviewer - name: ApplicationInterviewInterviewer - - value: application,interviewer - name: ApplicationInterviewer - interview - - value: interview,interviewer - name: InterviewInterviewer - interviewer source: - openapi: openapi/openapi.yml - ScorecardsRetrieveRequestExpand: + openapi: ats_v3.yml + ScorecardsRetrieveRequestExpandItem: enum: - application - - value: application,interview - name: ApplicationInterview - - value: application,interview,interviewer - name: ApplicationInterviewInterviewer - - value: application,interviewer - name: ApplicationInterviewer - interview - - value: interview,interviewer - name: InterviewInterviewer - interviewer source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -38,10 +22,15 @@ service: list: path: /ats/v1/scorecards method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Scorecard` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: ScorecardsListRequest query-parameters: @@ -60,7 +49,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -116,10 +106,27 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedScorecardList + type: atsRoot.PaginatedScorecardList status-code: 200 examples: - - headers: {} + - 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 @@ -148,17 +155,19 @@ service: retrieve: path: /ats/v1/scorecards/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Scorecard` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: name: ScorecardsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -184,12 +193,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Scorecard + type: atsRoot.Scorecard status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -213,4 +228,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/syncStatus.yml b/.mock/definition/ATS/syncStatus.yml similarity index 80% rename from .mock/definition/ats/syncStatus.yml rename to .mock/definition/ATS/syncStatus.yml index 99b9bd5..6430f8d 100644 --- a/.mock/definition/ats/syncStatus.yml +++ b/.mock/definition/ATS/syncStatus.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: list: path: /ats/v1/sync-status method: GET - auth: true + 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. @@ -20,8 +21,12 @@ service: `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: openapi/openapi.yml + openapi: ats_v3.yml request: name: SyncStatusListRequest query-parameters: @@ -33,10 +38,14 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedSyncStatusList + type: atsRoot.PaginatedSyncStatusList status-code: 200 examples: - - headers: {} + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + page_size: 1 + headers: + X-Account-Token: X-Account-Token response: body: next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw @@ -52,4 +61,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/tags.yml b/.mock/definition/ATS/tags.yml similarity index 78% rename from .mock/definition/ats/tags.yml rename to .mock/definition/ATS/tags.yml index f6007d9..33e751f 100644 --- a/.mock/definition/ats/tags.yml +++ b/.mock/definition/ATS/tags.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ats/v1/tags method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Tag` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: TagsListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedTagList + type: atsRoot.PaginatedTagList status-code: 200 examples: - - headers: {} + - 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 @@ -85,4 +102,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/users.yml b/.mock/definition/ATS/users.yml similarity index 83% rename from .mock/definition/ats/users.yml rename to .mock/definition/ATS/users.yml index 3bd2db1..13abe7c 100644 --- a/.mock/definition/ats/users.yml +++ b/.mock/definition/ATS/users.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ats/v1/users method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteUser` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: UsersListRequest query-parameters: @@ -78,10 +83,25 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedRemoteUserList + type: atsRoot.PaginatedRemoteUserList status-code: 200 examples: - - headers: {} + - 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 @@ -110,10 +130,11 @@ service: retrieve: path: /ats/v1/users/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `RemoteUser` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml path-parameters: id: string request: @@ -141,12 +162,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.RemoteUser + type: atsRoot.RemoteUser status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -170,4 +197,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/ats/webhookReceivers.yml b/.mock/definition/ATS/webhookReceivers.yml similarity index 75% rename from .mock/definition/ats/webhookReceivers.yml rename to .mock/definition/ATS/webhookReceivers.yml index 91d2ae6..b65ab6c 100644 --- a/.mock/definition/ats/webhookReceivers.yml +++ b/.mock/definition/ATS/webhookReceivers.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + atsRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: list: path: /ats/v1/webhook-receivers method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `WebhookReceiver` objects. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - event: event @@ -25,10 +27,11 @@ service: create: path: /ats/v1/webhook-receivers method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `WebhookReceiver` object with the given values. source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml request: name: WebhookReceiverRequest body: @@ -45,10 +48,11 @@ service: content-type: application/json response: docs: '' - type: root.WebhookReceiver + type: atsRoot.WebhookReceiver status-code: 201 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: event: event is_active: true @@ -58,4 +62,4 @@ service: is_active: true key: key source: - openapi: openapi/openapi.yml + openapi: ats_v3.yml diff --git a/.mock/definition/accounting/__package__.yml b/.mock/definition/Accounting/__package__.yml similarity index 64% rename from .mock/definition/accounting/__package__.yml rename to .mock/definition/Accounting/__package__.yml index 70df743..231b831 100644 --- a/.mock/definition/accounting/__package__.yml +++ b/.mock/definition/Accounting/__package__.yml @@ -1,963 +1,697 @@ types: - Account: + 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: >- - # The Account Object + Normalized account type- which is a narrower and more specific grouping + within the account's classification. - ### 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**. + * `BANK` - BANK + * `CREDIT_CARD` - CREDIT_CARD - An `Account` can be classified into one of the following categories, - determined through the `classification` field: + * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * __Asset:__ Accounts Receivable and Bank Accounts + * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * __Liability:__ Accounts Payable and Credit Card Accounts + * `FIXED_ASSET` - FIXED_ASSET - * __Equity:__ Treasury Accounts and Retained Earnings + * `OTHER_ASSET` - OTHER_ASSET - * __Revenue:__ Income and Other Income + * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - * __Expense:__ Cost of Goods Sold and Office Expenses + * `OTHER_EXPENSE` - OTHER_EXPENSE + * `OTHER_INCOME` - OTHER_INCOME - ### Usage Example + * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - 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. + * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - * `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. + * `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. - * `BANK` - BANK + * `ACTIVE` - ACTIVE + * `PENDING` - PENDING + * `INACTIVE` - INACTIVE + union: + - AccountStatusEnum + - string + source: + openapi: accounting_v3.yml + inline: true + AccountCurrency: + discriminated: false + docs: >- + The account's currency. - * `CREDIT_CARD` - CREDIT_CARD - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE + * `XUA` - ADB Unit of Account - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE + * `AFN` - Afghan Afghani - * `FIXED_ASSET` - FIXED_ASSET + * `AFA` - Afghan Afghani (1927–2002) - * `OTHER_ASSET` - OTHER_ASSET + * `ALL` - Albanian Lek - * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET + * `ALK` - Albanian Lek (1946–1965) - * `OTHER_EXPENSE` - OTHER_EXPENSE + * `DZD` - Algerian Dinar - * `OTHER_INCOME` - OTHER_INCOME + * `ADP` - Andorran Peseta - * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD + * `AOA` - Angolan Kwanza - * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY + * `AOK` - Angolan Kwanza (1977–1991) - * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY + * `AON` - Angolan New Kwanza (1990–2000) - * `NON_POSTING` - NON_POSTING - status: - type: optional - docs: |- - The account's status. + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - current_balance: - type: optional - docs: The account's current balance. - currency: - type: optional - docs: >- - The account's currency. + * `ARA` - Argentine Austral + * `ARS` - Argentine Peso - * `XUA` - ADB Unit of Account + * `ARM` - Argentine Peso (1881–1970) - * `AFN` - Afghan Afghani + * `ARP` - Argentine Peso (1983–1985) - * `AFA` - Afghan Afghani (1927–2002) + * `ARL` - Argentine Peso Ley (1970–1983) - * `ALL` - Albanian Lek + * `AMD` - Armenian Dram - * `ALK` - Albanian Lek (1946–1965) + * `AWG` - Aruban Florin - * `DZD` - Algerian Dinar + * `AUD` - Australian Dollar - * `ADP` - Andorran Peseta + * `ATS` - Austrian Schilling - * `AOA` - Angolan Kwanza + * `AZN` - Azerbaijani Manat - * `AOK` - Angolan Kwanza (1977–1991) + * `AZM` - Azerbaijani Manat (1993–2006) - * `AON` - Angolan New Kwanza (1990–2000) + * `BSD` - Bahamian Dollar - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `BHD` - Bahraini Dinar - * `ARA` - Argentine Austral + * `BDT` - Bangladeshi Taka - * `ARS` - Argentine Peso + * `BBD` - Barbadian Dollar - * `ARM` - Argentine Peso (1881–1970) + * `BYN` - Belarusian Ruble - * `ARP` - Argentine Peso (1983–1985) + * `BYB` - Belarusian Ruble (1994–1999) - * `ARL` - Argentine Peso Ley (1970–1983) + * `BYR` - Belarusian Ruble (2000–2016) - * `AMD` - Armenian Dram + * `BEF` - Belgian Franc - * `AWG` - Aruban Florin + * `BEC` - Belgian Franc (convertible) - * `AUD` - Australian Dollar + * `BEL` - Belgian Franc (financial) - * `ATS` - Austrian Schilling + * `BZD` - Belize Dollar - * `AZN` - Azerbaijani Manat + * `BMD` - Bermudan Dollar - * `AZM` - Azerbaijani Manat (1993–2006) + * `BTN` - Bhutanese Ngultrum - * `BSD` - Bahamian Dollar + * `BOB` - Bolivian Boliviano - * `BHD` - Bahraini Dinar + * `BOL` - Bolivian Boliviano (1863–1963) - * `BDT` - Bangladeshi Taka + * `BOV` - Bolivian Mvdol - * `BBD` - Barbadian Dollar + * `BOP` - Bolivian Peso - * `BYN` - Belarusian Ruble + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BYB` - Belarusian Ruble (1994–1999) + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BYR` - Belarusian Ruble (2000–2016) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BEF` - Belgian Franc + * `BWP` - Botswanan Pula - * `BEC` - Belgian Franc (convertible) + * `BRC` - Brazilian Cruzado (1986–1989) - * `BEL` - Belgian Franc (financial) + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BZD` - Belize Dollar + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BMD` - Bermudan Dollar + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BTN` - Bhutanese Ngultrum + * `BRN` - Brazilian New Cruzado (1989–1990) - * `BOB` - Bolivian Boliviano + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BOL` - Bolivian Boliviano (1863–1963) + * `BRL` - Brazilian Real - * `BOV` - Bolivian Mvdol + * `GBP` - British Pound - * `BOP` - Bolivian Peso + * `BND` - Brunei Dollar - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BGL` - Bulgarian Hard Lev - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BGN` - Bulgarian Lev - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BGO` - Bulgarian Lev (1879–1952) - * `BWP` - Botswanan Pula + * `BGM` - Bulgarian Socialist Lev - * `BRC` - Brazilian Cruzado (1986–1989) + * `BUK` - Burmese Kyat - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BIF` - Burundian Franc - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `XPF` - CFP Franc - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `KHR` - Cambodian Riel - * `BRN` - Brazilian New Cruzado (1989–1990) + * `CAD` - Canadian Dollar - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `CVE` - Cape Verdean Escudo - * `BRL` - Brazilian Real + * `KYD` - Cayman Islands Dollar - * `GBP` - British Pound + * `XAF` - Central African CFA Franc - * `BND` - Brunei Dollar + * `CLE` - Chilean Escudo - * `BGL` - Bulgarian Hard Lev + * `CLP` - Chilean Peso - * `BGN` - Bulgarian Lev + * `CLF` - Chilean Unit of Account (UF) - * `BGO` - Bulgarian Lev (1879–1952) + * `CNX` - Chinese People’s Bank Dollar - * `BGM` - Bulgarian Socialist Lev + * `CNY` - Chinese Yuan - * `BUK` - Burmese Kyat + * `CNH` - Chinese Yuan (offshore) - * `BIF` - Burundian Franc + * `COP` - Colombian Peso - * `XPF` - CFP Franc + * `COU` - Colombian Real Value Unit - * `KHR` - Cambodian Riel + * `KMF` - Comorian Franc - * `CAD` - Canadian Dollar + * `CDF` - Congolese Franc - * `CVE` - Cape Verdean Escudo + * `CRC` - Costa Rican Colón - * `KYD` - Cayman Islands Dollar + * `HRD` - Croatian Dinar - * `XAF` - Central African CFA Franc + * `HRK` - Croatian Kuna - * `CLE` - Chilean Escudo + * `CUC` - Cuban Convertible Peso - * `CLP` - Chilean Peso + * `CUP` - Cuban Peso - * `CLF` - Chilean Unit of Account (UF) + * `CYP` - Cypriot Pound - * `CNX` - Chinese People’s Bank Dollar + * `CZK` - Czech Koruna - * `CNY` - Chinese Yuan + * `CSK` - Czechoslovak Hard Koruna - * `CNH` - Chinese Yuan (offshore) + * `DKK` - Danish Krone - * `COP` - Colombian Peso + * `DJF` - Djiboutian Franc - * `COU` - Colombian Real Value Unit + * `DOP` - Dominican Peso - * `KMF` - Comorian Franc + * `NLG` - Dutch Guilder - * `CDF` - Congolese Franc + * `XCD` - East Caribbean Dollar - * `CRC` - Costa Rican Colón + * `DDM` - East German Mark - * `HRD` - Croatian Dinar + * `ECS` - Ecuadorian Sucre - * `HRK` - Croatian Kuna + * `ECV` - Ecuadorian Unit of Constant Value - * `CUC` - Cuban Convertible Peso + * `EGP` - Egyptian Pound - * `CUP` - Cuban Peso + * `GQE` - Equatorial Guinean Ekwele - * `CYP` - Cypriot Pound + * `ERN` - Eritrean Nakfa - * `CZK` - Czech Koruna + * `EEK` - Estonian Kroon - * `CSK` - Czechoslovak Hard Koruna + * `ETB` - Ethiopian Birr - * `DKK` - Danish Krone + * `EUR` - Euro - * `DJF` - Djiboutian Franc + * `XBA` - European Composite Unit - * `DOP` - Dominican Peso + * `XEU` - European Currency Unit - * `NLG` - Dutch Guilder + * `XBB` - European Monetary Unit - * `XCD` - East Caribbean Dollar + * `XBC` - European Unit of Account (XBC) - * `DDM` - East German Mark + * `XBD` - European Unit of Account (XBD) - * `ECS` - Ecuadorian Sucre + * `FKP` - Falkland Islands Pound - * `ECV` - Ecuadorian Unit of Constant Value + * `FJD` - Fijian Dollar - * `EGP` - Egyptian Pound + * `FIM` - Finnish Markka - * `GQE` - Equatorial Guinean Ekwele + * `FRF` - French Franc - * `ERN` - Eritrean Nakfa + * `XFO` - French Gold Franc - * `EEK` - Estonian Kroon + * `XFU` - French UIC-Franc - * `ETB` - Ethiopian Birr + * `GMD` - Gambian Dalasi - * `EUR` - Euro + * `GEK` - Georgian Kupon Larit - * `XBA` - European Composite Unit + * `GEL` - Georgian Lari - * `XEU` - European Currency Unit + * `DEM` - German Mark - * `XBB` - European Monetary Unit + * `GHS` - Ghanaian Cedi - * `XBC` - European Unit of Account (XBC) + * `GHC` - Ghanaian Cedi (1979–2007) - * `XBD` - European Unit of Account (XBD) + * `GIP` - Gibraltar Pound - * `FKP` - Falkland Islands Pound + * `XAU` - Gold - * `FJD` - Fijian Dollar + * `GRD` - Greek Drachma - * `FIM` - Finnish Markka + * `GTQ` - Guatemalan Quetzal - * `FRF` - French Franc + * `GWP` - Guinea-Bissau Peso - * `XFO` - French Gold Franc + * `GNF` - Guinean Franc - * `XFU` - French UIC-Franc + * `GNS` - Guinean Syli - * `GMD` - Gambian Dalasi + * `GYD` - Guyanaese Dollar - * `GEK` - Georgian Kupon Larit + * `HTG` - Haitian Gourde - * `GEL` - Georgian Lari + * `HNL` - Honduran Lempira - * `DEM` - German Mark + * `HKD` - Hong Kong Dollar - * `GHS` - Ghanaian Cedi + * `HUF` - Hungarian Forint - * `GHC` - Ghanaian Cedi (1979–2007) + * `IMP` - IMP - * `GIP` - Gibraltar Pound + * `ISK` - Icelandic Króna - * `XAU` - Gold + * `ISJ` - Icelandic Króna (1918–1981) - * `GRD` - Greek Drachma + * `INR` - Indian Rupee - * `GTQ` - Guatemalan Quetzal + * `IDR` - Indonesian Rupiah - * `GWP` - Guinea-Bissau Peso + * `IRR` - Iranian Rial - * `GNF` - Guinean Franc + * `IQD` - Iraqi Dinar - * `GNS` - Guinean Syli + * `IEP` - Irish Pound - * `GYD` - Guyanaese Dollar + * `ILS` - Israeli New Shekel - * `HTG` - Haitian Gourde + * `ILP` - Israeli Pound - * `HNL` - Honduran Lempira + * `ILR` - Israeli Shekel (1980–1985) - * `HKD` - Hong Kong Dollar + * `ITL` - Italian Lira - * `HUF` - Hungarian Forint + * `JMD` - Jamaican Dollar - * `IMP` - IMP + * `JPY` - Japanese Yen - * `ISK` - Icelandic Króna + * `JOD` - Jordanian Dinar - * `ISJ` - Icelandic Króna (1918–1981) + * `KZT` - Kazakhstani Tenge - * `INR` - Indian Rupee + * `KES` - Kenyan Shilling - * `IDR` - Indonesian Rupiah + * `KWD` - Kuwaiti Dinar - * `IRR` - Iranian Rial + * `KGS` - Kyrgystani Som - * `IQD` - Iraqi Dinar + * `LAK` - Laotian Kip - * `IEP` - Irish Pound + * `LVL` - Latvian Lats - * `ILS` - Israeli New Shekel + * `LVR` - Latvian Ruble - * `ILP` - Israeli Pound + * `LBP` - Lebanese Pound - * `ILR` - Israeli Shekel (1980–1985) + * `LSL` - Lesotho Loti - * `ITL` - Italian Lira + * `LRD` - Liberian Dollar - * `JMD` - Jamaican Dollar + * `LYD` - Libyan Dinar - * `JPY` - Japanese Yen + * `LTL` - Lithuanian Litas - * `JOD` - Jordanian Dinar + * `LTT` - Lithuanian Talonas - * `KZT` - Kazakhstani Tenge + * `LUL` - Luxembourg Financial Franc - * `KES` - Kenyan Shilling + * `LUC` - Luxembourgian Convertible Franc - * `KWD` - Kuwaiti Dinar + * `LUF` - Luxembourgian Franc - * `KGS` - Kyrgystani Som + * `MOP` - Macanese Pataca - * `LAK` - Laotian Kip + * `MKD` - Macedonian Denar - * `LVL` - Latvian Lats + * `MKN` - Macedonian Denar (1992–1993) - * `LVR` - Latvian Ruble + * `MGA` - Malagasy Ariary - * `LBP` - Lebanese Pound + * `MGF` - Malagasy Franc - * `LSL` - Lesotho Loti + * `MWK` - Malawian Kwacha - * `LRD` - Liberian Dollar + * `MYR` - Malaysian Ringgit - * `LYD` - Libyan Dinar + * `MVR` - Maldivian Rufiyaa - * `LTL` - Lithuanian Litas + * `MVP` - Maldivian Rupee (1947–1981) - * `LTT` - Lithuanian Talonas + * `MLF` - Malian Franc - * `LUL` - Luxembourg Financial Franc + * `MTL` - Maltese Lira - * `LUC` - Luxembourgian Convertible Franc + * `MTP` - Maltese Pound - * `LUF` - Luxembourgian Franc + * `MRU` - Mauritanian Ouguiya - * `MOP` - Macanese Pataca + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MKD` - Macedonian Denar + * `MUR` - Mauritian Rupee - * `MKN` - Macedonian Denar (1992–1993) + * `MXV` - Mexican Investment Unit - * `MGA` - Malagasy Ariary + * `MXN` - Mexican Peso - * `MGF` - Malagasy Franc + * `MXP` - Mexican Silver Peso (1861–1992) - * `MWK` - Malawian Kwacha + * `MDC` - Moldovan Cupon - * `MYR` - Malaysian Ringgit + * `MDL` - Moldovan Leu - * `MVR` - Maldivian Rufiyaa + * `MCF` - Monegasque Franc - * `MVP` - Maldivian Rupee (1947–1981) + * `MNT` - Mongolian Tugrik - * `MLF` - Malian Franc + * `MAD` - Moroccan Dirham - * `MTL` - Maltese Lira + * `MAF` - Moroccan Franc - * `MTP` - Maltese Pound + * `MZE` - Mozambican Escudo - * `MRU` - Mauritanian Ouguiya + * `MZN` - Mozambican Metical - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MZM` - Mozambican Metical (1980–2006) - * `MUR` - Mauritian Rupee + * `MMK` - Myanmar Kyat - * `MXV` - Mexican Investment Unit + * `NAD` - Namibian Dollar - * `MXN` - Mexican Peso + * `NPR` - Nepalese Rupee - * `MXP` - Mexican Silver Peso (1861–1992) + * `ANG` - Netherlands Antillean Guilder - * `MDC` - Moldovan Cupon + * `TWD` - New Taiwan Dollar - * `MDL` - Moldovan Leu + * `NZD` - New Zealand Dollar - * `MCF` - Monegasque Franc + * `NIO` - Nicaraguan Córdoba - * `MNT` - Mongolian Tugrik + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `MAD` - Moroccan Dirham + * `NGN` - Nigerian Naira - * `MAF` - Moroccan Franc + * `KPW` - North Korean Won - * `MZE` - Mozambican Escudo + * `NOK` - Norwegian Krone - * `MZN` - Mozambican Metical + * `OMR` - Omani Rial - * `MZM` - Mozambican Metical (1980–2006) + * `PKR` - Pakistani Rupee - * `MMK` - Myanmar Kyat + * `XPD` - Palladium - * `NAD` - Namibian Dollar + * `PAB` - Panamanian Balboa - * `NPR` - Nepalese Rupee + * `PGK` - Papua New Guinean Kina - * `ANG` - Netherlands Antillean Guilder + * `PYG` - Paraguayan Guarani - * `TWD` - New Taiwan Dollar + * `PEI` - Peruvian Inti - * `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) + * `PEN` - Peruvian Sol - * `PTE` - Portuguese Escudo + * `PES` - Peruvian Sol (1863–1965) - * `GWE` - Portuguese Guinea Escudo + * `PHP` - Philippine Peso - * `QAR` - Qatari Rial + * `XPT` - Platinum - * `XRE` - RINET Funds + * `PLN` - Polish Zloty - * `RHD` - Rhodesian Dollar + * `PLZ` - Polish Zloty (1950–1995) - * `RON` - Romanian Leu + * `PTE` - Portuguese Escudo - * `ROL` - Romanian Leu (1952–2006) + * `GWE` - Portuguese Guinea Escudo - * `RUB` - Russian Ruble + * `QAR` - Qatari Rial - * `RUR` - Russian Ruble (1991–1998) + * `XRE` - RINET Funds - * `RWF` - Rwandan Franc + * `RHD` - Rhodesian Dollar - * `SVC` - Salvadoran Colón + * `RON` - Romanian Leu - * `WST` - Samoan Tala + * `ROL` - Romanian Leu (1952–2006) - * `SAR` - Saudi Riyal + * `RUB` - Russian Ruble - * `RSD` - Serbian Dinar + * `RUR` - Russian Ruble (1991–1998) - * `CSD` - Serbian Dinar (2002–2006) + * `RWF` - Rwandan Franc - * `SCR` - Seychellois Rupee + * `SVC` - Salvadoran Colón - * `SLL` - Sierra Leonean Leone + * `WST` - Samoan Tala - * `XAG` - Silver + * `SAR` - Saudi Riyal - * `SGD` - Singapore Dollar + * `RSD` - Serbian Dinar - * `SKK` - Slovak Koruna + * `CSD` - Serbian Dinar (2002–2006) - * `SIT` - Slovenian Tolar + * `SCR` - Seychellois Rupee - * `SBD` - Solomon Islands Dollar + * `SLL` - Sierra Leonean Leone - * `SOS` - Somali Shilling + * `XAG` - Silver - * `ZAR` - South African Rand + * `SGD` - Singapore Dollar - * `ZAL` - South African Rand (financial) + * `SKK` - Slovak Koruna - * `KRH` - South Korean Hwan (1953–1962) + * `SIT` - Slovenian Tolar - * `KRW` - South Korean Won + * `SBD` - Solomon Islands Dollar - * `KRO` - South Korean Won (1945–1953) + * `SOS` - Somali Shilling - * `SSP` - South Sudanese Pound + * `ZAR` - South African Rand - * `SUR` - Soviet Rouble + * `ZAL` - South African Rand (financial) - * `ESP` - Spanish Peseta + * `KRH` - South Korean Hwan (1953–1962) - * `ESA` - Spanish Peseta (A account) + * `KRW` - South Korean Won - * `ESB` - Spanish Peseta (convertible account) + * `KRO` - South Korean Won (1945–1953) - * `XDR` - Special Drawing Rights + * `SSP` - South Sudanese Pound - * `LKR` - Sri Lankan Rupee + * `SUR` - Soviet Rouble - * `SHP` - St. Helena Pound + * `ESP` - Spanish Peseta - * `XSU` - Sucre + * `ESA` - Spanish Peseta (A account) - * `SDD` - Sudanese Dinar (1992–2007) + * `ESB` - Spanish Peseta (convertible account) - * `SDG` - Sudanese Pound + * `XDR` - Special Drawing Rights - * `SDP` - Sudanese Pound (1957–1998) + * `LKR` - Sri Lankan Rupee - * `SRD` - Surinamese Dollar + * `SHP` - St. Helena Pound - * `SRG` - Surinamese Guilder + * `XSU` - Sucre - * `SZL` - Swazi Lilangeni + * `SDD` - Sudanese Dinar (1992–2007) - * `SEK` - Swedish Krona + * `SDG` - Sudanese Pound - * `CHF` - Swiss Franc + * `SDP` - Sudanese Pound (1957–1998) - * `SYP` - Syrian Pound + * `SRD` - Surinamese Dollar - * `STN` - São Tomé & Príncipe Dobra + * `SRG` - Surinamese Guilder - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `SZL` - Swazi Lilangeni - * `TVD` - TVD + * `SEK` - Swedish Krona - * `TJR` - Tajikistani Ruble + * `CHF` - Swiss Franc - * `TJS` - Tajikistani Somoni + * `SYP` - Syrian Pound - * `TZS` - Tanzanian Shilling + * `STN` - São Tomé & Príncipe Dobra - * `XTS` - Testing Currency Code + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `THB` - Thai Baht + * `TVD` - TVD - * `XXX` - The codes assigned for transactions where no currency is - involved + * `TJR` - Tajikistani Ruble - * `TPE` - Timorese Escudo + * `TJS` - Tajikistani Somoni - * `TOP` - Tongan Paʻanga + * `TZS` - Tanzanian Shilling - * `TTD` - Trinidad & Tobago Dollar + * `XTS` - Testing Currency Code - * `TND` - Tunisian Dinar + * `THB` - Thai Baht - * `TRY` - Turkish Lira + * `XXX` - The codes assigned for transactions where no currency is + involved - * `TRL` - Turkish Lira (1922–2005) + * `TPE` - Timorese Escudo - * `TMT` - Turkmenistani Manat + * `TOP` - Tongan Paʻanga - * `TMM` - Turkmenistani Manat (1993–2009) + * `TTD` - Trinidad & Tobago Dollar - * `USD` - US Dollar + * `TND` - Tunisian Dinar - * `USN` - US Dollar (Next day) + * `TRY` - Turkish Lira - * `USS` - US Dollar (Same day) + * `TRL` - Turkish Lira (1922–2005) - * `UGX` - Ugandan Shilling + * `TMT` - Turkmenistani Manat - * `UGS` - Ugandan Shilling (1966–1987) + * `TMM` - Turkmenistani Manat (1993–2009) - * `UAH` - Ukrainian Hryvnia + * `USD` - US Dollar - * `UAK` - Ukrainian Karbovanets + * `USN` - US Dollar (Next day) - * `AED` - United Arab Emirates Dirham + * `USS` - US Dollar (Same day) - * `UYW` - Uruguayan Nominal Wage Index Unit + * `UGX` - Ugandan Shilling - * `UYU` - Uruguayan Peso + * `UGS` - Ugandan Shilling (1966–1987) - * `UYP` - Uruguayan Peso (1975–1993) + * `UAH` - Ukrainian Hryvnia - * `UYI` - Uruguayan Peso (Indexed Units) + * `UAK` - Ukrainian Karbovanets - * `UZS` - Uzbekistani Som + * `AED` - United Arab Emirates Dirham - * `VUV` - Vanuatu Vatu + * `UYW` - Uruguayan Nominal Wage Index Unit - * `VES` - Venezuelan Bolívar + * `UYU` - Uruguayan Peso - * `VEB` - Venezuelan Bolívar (1871–2008) + * `UYP` - Uruguayan Peso (1975–1993) - * `VEF` - Venezuelan Bolívar (2008–2018) + * `UYI` - Uruguayan Peso (Indexed Units) - * `VND` - Vietnamese Dong + * `UZS` - Uzbekistani Som - * `VNN` - Vietnamese Dong (1978–1985) + * `VUV` - Vanuatu Vatu - * `CHE` - WIR Euro + * `VES` - Venezuelan Bolívar - * `CHW` - WIR Franc + * `VEB` - Venezuelan Bolívar (1871–2008) - * `XOF` - West African CFA Franc + * `VEF` - Venezuelan Bolívar (2008–2018) - * `YDD` - Yemeni Dinar + * `VND` - Vietnamese Dong - * `YER` - Yemeni Rial + * `VNN` - Vietnamese Dong (1978–1985) - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `CHE` - WIR Euro - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `CHW` - WIR Franc - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `XOF` - West African CFA Franc - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `YDD` - Yemeni Dinar - * `ZWN` - ZWN + * `YER` - Yemeni Rial - * `ZRN` - Zairean New Zaire (1993–1998) + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `ZRZ` - Zairean Zaire (1971–1993) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `ZMW` - Zambian Kwacha + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `ZMK` - Zambian Kwacha (1968–2012) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZWN` - ZWN - * `ZWR` - Zimbabwean Dollar (2008) + * `ZRN` - Zairean New Zaire (1993–1998) - * `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: openapi/openapi.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: openapi/openapi.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: openapi/openapi.yml - AccountDetailsAndActions: - docs: >- - # The LinkedAccount Object + * `ZRZ` - Zairean Zaire (1971–1993) - ### Description + * `ZMW` - Zambian Kwacha - The `LinkedAccount` object is used to represent an end user's link with a - specific integration. + * `ZMK` - Zambian Kwacha (1968–2012) + * `ZWD` - Zimbabwean Dollar (1980–2008) - ### Usage Example + * `ZWR` - Zimbabwean Dollar (2008) - View a list of your organization's `LinkedAccount` objects. - properties: - id: string - category: optional - status: AccountDetailsAndActionsStatusEnum - status_detail: optional - end_user_origin_id: optional - end_user_organization_name: string - end_user_email_address: string - subdomain: - type: optional - docs: The tenant or domain the customer has provided access to. - webhook_listener_url: string - is_duplicate: - type: optional - docs: >- - Whether a Production Linked Account's credentials match another - existing Production Linked Account. This field is `null` for Test - Linked Accounts, incomplete Production Linked Accounts, and ignored - duplicate Production Linked Account sets. - integration: optional - account_type: string - completed_at: datetime - integration_specific_fields: optional> - source: - openapi: openapi/openapi.yml - AccountDetailsAndActionsIntegration: - properties: - name: string - categories: list - image: optional - square_image: optional - color: string - slug: string - passthrough_available: boolean - available_model_operations: optional> - source: - openapi: openapi/openapi.yml - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - docs: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - source: - openapi: openapi/openapi.yml - AccountIntegration: - properties: - name: - type: string - docs: Company name. - abbreviated_name: - type: optional - docs: >- - Optional. This shortened name appears in places with limited space, - usually in conjunction with the platform's logo (e.g., Merge Link - menu).

Example: Workforce Now (in lieu of ADP Workforce - Now), SuccessFactors (in lieu of SAP SuccessFactors) - categories: - type: optional> - docs: >- - Category or categories this integration belongs to. Multiple - categories should be comma separated, i.e. [ats, hris]. - access: read-only - image: - type: optional - docs: Company logo in rectangular shape. - validation: - format: uri - square_image: - type: optional - docs: Company logo in square shape. - validation: - format: uri - color: - type: optional - docs: >- - The color of this integration used for buttons and text throughout the - app and landing pages. Choose a darker, saturated color. - validation: - pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ - maxLength: 18 - slug: - type: optional - access: read-only - api_endpoints_to_documentation_urls: - type: optional> - docs: >- - Mapping of API endpoints to documentation urls for support. Example: - {'GET': [['/common-model-scopes', - 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', - 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], - 'POST': []} - webhook_setup_guide_url: - type: optional - docs: >- - Setup guide URL for third party webhook creation. Exposed in Merge - Docs. - category_beta_status: - type: optional> - docs: Category or categories this integration is in beta status for. - access: read-only + * `ZWL` - Zimbabwean Dollar (2009) + union: + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml - AccountRequest: + openapi: accounting_v3.yml + inline: true + Account: docs: >- # The Account Object @@ -986,6 +720,22 @@ types: 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. @@ -993,7 +743,7 @@ types: type: optional docs: The account's description. classification: - type: optional + type: optional docs: |- The account's broadest grouping. @@ -1008,7 +758,7 @@ types: The account's type is a narrower and more specific grouping within the account's classification. account_type: - type: optional + type: optional docs: >- Normalized account type- which is a narrower and more specific grouping within the account's classification. @@ -1040,7 +790,7 @@ types: * `NON_POSTING` - NON_POSTING status: - type: optional + type: optional docs: |- The account's status. @@ -1051,7 +801,7 @@ types: type: optional docs: The account's current balance. currency: - type: optional + type: optional docs: >- The account's currency. @@ -1681,1860 +1431,1028 @@ types: docs: The company the account belongs to. validation: format: uuid - integration_params: - type: optional> - access: write-only - linked_account_params: + 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: write-only - source: - openapi: openapi/openapi.yml - AccountResponse: - properties: - model: Account - warnings: list - errors: list - logs: optional> + access: read-only + remote_data: + type: optional> + access: read-only source: - openapi: openapi/openapi.yml - AccountStatusEnum: + openapi: accounting_v3.yml + AccountAccountTypeEnum: enum: - - ACTIVE - - PENDING - - INACTIVE - docs: |- - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - source: - openapi: openapi/openapi.yml - AccountToken: - properties: - account_token: string - integration: AccountIntegration - id: string + - 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: openapi/openapi.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. + openapi: accounting_v3.yml + AccountDetails: properties: id: type: optional validation: format: uuid access: read-only - remote_id: + integration: 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. + integration_slug: + type: optional access: read-only - file_name: + category: optional + end_user_origin_id: type: optional - docs: The attachment's name. - file_url: + access: read-only + end_user_organization_name: + type: optional + access: read-only + end_user_email_address: type: optional - docs: The attachment's url. validation: - format: uri - maxLength: 2000 - company: + format: email + access: read-only + status: + type: optional + access: read-only + webhook_listener_url: type: optional - docs: The company the accounting attachment belongs to. validation: - format: uuid - remote_was_deleted: + format: uri + access: read-only + is_duplicate: type: optional docs: >- - Indicates whether or not this object has been deleted in the third - party platform. Full coverage deletion detection is 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> + 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 - remote_data: - type: optional> + account_type: + type: optional access: read-only + completed_at: + type: optional + docs: The time at which account completes the linking flow. source: - openapi: openapi/openapi.yml - AccountingAttachmentRequest: + 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 Accounting Attachment Object + # The LinkedAccount Object ### Description - The `AccountingAttachment` object is used to represent a company's - attachments. + The `LinkedAccount` object is used to represent an end user's link with a + specific integration. ### Usage Example - Fetch from the `LIST AccountingAttachments` endpoint and view a company's - attachments. + View a list of your organization's `LinkedAccount` objects. properties: - file_name: + 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 attachment's name. - file_url: + 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: The attachment's url. + 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 - maxLength: 2000 - company: + square_image: type: optional - docs: The company the accounting attachment belongs to. + docs: Company logo in square shape. validation: - format: uuid - integration_params: + 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> - access: write-only - linked_account_params: + 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> - access: write-only + docs: Category or categories this integration is in beta status for. + access: read-only source: - openapi: openapi/openapi.yml - AccountingAttachmentResponse: - properties: - model: AccountingAttachment - warnings: list - errors: list - logs: optional> + 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: openapi/openapi.yml - AccountingPeriod: + openapi: accounting_v3.yml + inline: true + AccountRequestAccountType: + discriminated: false docs: >- - # The AccountingPeriod Object + Normalized account type- which is a narrower and more specific grouping + within the account's classification. - ### Description - The `AccountingPeriod` object is used to define a period of time in which - events occurred. + * `BANK` - BANK + * `CREDIT_CARD` - CREDIT_CARD - ### Usage Example + * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - 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: openapi/openapi.yml - AccountingPhoneNumber: - docs: >- - # The AccountingPhoneNumber Object + * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - ### Description + * `FIXED_ASSET` - FIXED_ASSET - The `AccountingPhoneNumber` object is used to represent a contact's or - company's phone number. + * `OTHER_ASSET` - OTHER_ASSET + * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - ### Usage Example + * `OTHER_EXPENSE` - OTHER_EXPENSE - 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: openapi/openapi.yml - AccountingPhoneNumberRequest: - docs: >- - # The AccountingPhoneNumber Object + * `OTHER_INCOME` - OTHER_INCOME - ### Description + * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - The `AccountingPhoneNumber` object is used to represent a contact's or - company's phone number. + * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY + * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - ### Usage Example + * `NON_POSTING` - NON_POSTING + union: + - AccountAccountTypeEnum + - string + source: + openapi: accounting_v3.yml + inline: true + AccountRequestStatus: + discriminated: false + docs: |- + The account's status. - 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 + * `ACTIVE` - ACTIVE + * `PENDING` - PENDING + * `INACTIVE` - INACTIVE + union: + - AccountStatusEnum + - string source: - openapi: openapi/openapi.yml - Address: + openapi: accounting_v3.yml + inline: true + AccountRequestCurrency: + discriminated: false docs: >- - # The Address Object + The account's currency. - ### Description - The `Address` object is used to represent a contact's or company's - address. + * `XUA` - ADB Unit of Account + * `AFN` - Afghan Afghani - ### Usage Example + * `AFA` - Afghan Afghani (1927–2002) - 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. + * `ALL` - Albanian Lek - * `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. + * `ALK` - Albanian Lek (1946–1965) - * `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: openapi/openapi.yml - AddressRequest: - docs: >- - # The Address Object + * `DZD` - Algerian Dinar - ### Description + * `ADP` - Andorran Peseta - The `Address` object is used to represent a contact's or company's - address. + * `AOA` - Angolan Kwanza + * `AOK` - Angolan Kwanza (1977–1991) - ### Usage Example + * `AON` - Angolan New Kwanza (1990–2000) - Fetch from the `GET CompanyInfo` endpoint and view the company's - addresses. - properties: - type: - type: optional - docs: |- - The address type. + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `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. + * `ARA` - Argentine Austral - * `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: openapi/openapi.yml - AddressTypeEnum: - enum: - - BILLING - - SHIPPING - docs: |- - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - source: - openapi: openapi/openapi.yml - AdvancedMetadata: - properties: - id: - type: string - validation: - format: uuid - display_name: optional - description: optional - is_required: optional - is_custom: optional - field_choices: optional> - source: - openapi: openapi/openapi.yml - AsyncPassthroughReciept: - properties: - async_passthrough_receipt_id: - type: string - validation: - format: uuid - source: - openapi: openapi/openapi.yml - AsyncPostTask: - properties: - status: AsyncPostTaskStatusEnum - result: AsyncPostTaskResult - source: - openapi: openapi/openapi.yml - AsyncPostTaskResult: - properties: - status_code: optional - response: optional> - source: - openapi: openapi/openapi.yml - AsyncPostTaskStatusEnum: - enum: - - QUEUED - - IN_PROGRESS - - COMPLETED - - FAILURE - docs: |- - * `QUEUED` - QUEUED - * `IN_PROGRESS` - IN_PROGRESS - * `COMPLETED` - COMPLETED - * `FAILURE` - FAILURE - source: - openapi: openapi/openapi.yml - 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: RoleEnum - docs: >- - Designates the role of the user (or SYSTEM/API if action not taken by - a user) at the time of this Event occurring. + * `ARS` - Argentine Peso + * `ARM` - Argentine Peso (1881–1970) - * `ADMIN` - ADMIN + * `ARP` - Argentine Peso (1983–1985) - * `DEVELOPER` - DEVELOPER + * `ARL` - Argentine Peso Ley (1970–1983) - * `MEMBER` - MEMBER + * `AMD` - Armenian Dram - * `API` - API + * `AWG` - Aruban Florin - * `SYSTEM` - SYSTEM + * `AUD` - Australian Dollar - * `MERGE_TEAM` - MERGE_TEAM - ip_address: - type: string - validation: - maxLength: 45 - event_type: - type: EventTypeEnum - docs: >- - Designates the type of event that occurred. + * `ATS` - Austrian Schilling + * `AZN` - Azerbaijani Manat - * `CREATED_REMOTE_PRODUCTION_API_KEY` - - CREATED_REMOTE_PRODUCTION_API_KEY + * `AZM` - Azerbaijani Manat (1993–2006) - * `DELETED_REMOTE_PRODUCTION_API_KEY` - - DELETED_REMOTE_PRODUCTION_API_KEY + * `BSD` - Bahamian Dollar - * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY + * `BHD` - Bahraini Dinar - * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY + * `BDT` - Bangladeshi Taka - * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY + * `BBD` - Barbadian Dollar - * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE + * `BYN` - Belarusian Ruble - * `INVITED_USER` - INVITED_USER + * `BYB` - Belarusian Ruble (1994–1999) - * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED + * `BYR` - Belarusian Ruble (2000–2016) - * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED + * `BEF` - Belgian Franc - * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT + * `BEC` - Belgian Franc (convertible) - * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT + * `BEL` - Belgian Franc (financial) - * `CREATED_DESTINATION` - CREATED_DESTINATION + * `BZD` - Belize Dollar - * `DELETED_DESTINATION` - DELETED_DESTINATION + * `BMD` - Bermudan Dollar - * `CHANGED_DESTINATION` - CHANGED_DESTINATION + * `BTN` - Bhutanese Ngultrum - * `CHANGED_SCOPES` - CHANGED_SCOPES + * `BOB` - Bolivian Boliviano - * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION + * `BOL` - Bolivian Boliviano (1863–1963) - * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS + * `BOV` - Bolivian Mvdol - * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION + * `BOP` - Bolivian Peso - * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `ENABLED_CATEGORY` - ENABLED_CATEGORY + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `DISABLED_CATEGORY` - DISABLED_CATEGORY + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `CHANGED_PASSWORD` - CHANGED_PASSWORD + * `BWP` - Botswanan Pula - * `RESET_PASSWORD` - RESET_PASSWORD + * `BRC` - Brazilian Cruzado (1986–1989) - * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `BRN` - Brazilian New Cruzado (1989–1990) - * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING + * `BRL` - Brazilian Real - * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + * `GBP` - British Pound - * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + * `BND` - Brunei Dollar - * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING + * `BGL` - Bulgarian Hard Lev - * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING + * `BGN` - Bulgarian Lev - * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `BGO` - Bulgarian Lev (1879–1952) - * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `BGM` - Bulgarian Socialist Lev - * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `BUK` - Burmese Kyat - * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC + * `BIF` - Burundian Franc - * `MUTED_ISSUE` - MUTED_ISSUE + * `XPF` - CFP Franc - * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + * `KHR` - Cambodian Riel - * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + * `CAD` - Canadian Dollar - * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + * `CVE` - Cape Verdean Escudo - * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED + * `KYD` - Cayman Islands Dollar - * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED - event_description: string - created_at: - type: optional - access: read-only - source: - openapi: openapi/openapi.yml - AvailableActions: - docs: >- - # The AvailableActions Object + * `XAF` - Central African CFA Franc - ### Description + * `CLE` - Chilean Escudo - The `Activity` object is used to see all available model/operation - combinations for an integration. + * `CLP` - Chilean Peso + * `CLF` - Chilean Unit of Account (UF) - ### Usage Example + * `CNX` - Chinese People’s Bank Dollar - Fetch all the actions available for the `Zenefits` integration. - properties: - integration: AccountIntegration - passthrough_available: boolean - available_model_operations: optional> - source: - openapi: openapi/openapi.yml - BalanceSheetCompany: - discriminated: false - docs: '`Company` object for the given `BalanceSheet` object.' - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - BalanceSheet: - docs: >- - # The BalanceSheet Object + * `CNY` - Chinese Yuan - ### Description + * `CNH` - Chinese Yuan (offshore) - 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. + * `COP` - Colombian Peso + * `COU` - Colombian Real Value Unit - ### Usage Example + * `KMF` - Comorian Franc - 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. + * `CDF` - Congolese Franc + * `CRC` - Costa Rican Colón - * `XUA` - ADB Unit of Account + * `HRD` - Croatian Dinar - * `AFN` - Afghan Afghani + * `HRK` - Croatian Kuna - * `AFA` - Afghan Afghani (1927–2002) + * `CUC` - Cuban Convertible Peso - * `ALL` - Albanian Lek + * `CUP` - Cuban Peso - * `ALK` - Albanian Lek (1946–1965) + * `CYP` - Cypriot Pound - * `DZD` - Algerian Dinar + * `CZK` - Czech Koruna - * `ADP` - Andorran Peseta + * `CSK` - Czechoslovak Hard Koruna - * `AOA` - Angolan Kwanza + * `DKK` - Danish Krone - * `AOK` - Angolan Kwanza (1977–1991) + * `DJF` - Djiboutian Franc - * `AON` - Angolan New Kwanza (1990–2000) + * `DOP` - Dominican Peso - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `NLG` - Dutch Guilder - * `ARA` - Argentine Austral + * `XCD` - East Caribbean Dollar - * `ARS` - Argentine Peso + * `DDM` - East German Mark - * `ARM` - Argentine Peso (1881–1970) + * `ECS` - Ecuadorian Sucre - * `ARP` - Argentine Peso (1983–1985) + * `ECV` - Ecuadorian Unit of Constant Value - * `ARL` - Argentine Peso Ley (1970–1983) + * `EGP` - Egyptian Pound - * `AMD` - Armenian Dram + * `GQE` - Equatorial Guinean Ekwele - * `AWG` - Aruban Florin + * `ERN` - Eritrean Nakfa - * `AUD` - Australian Dollar + * `EEK` - Estonian Kroon - * `ATS` - Austrian Schilling + * `ETB` - Ethiopian Birr - * `AZN` - Azerbaijani Manat + * `EUR` - Euro - * `AZM` - Azerbaijani Manat (1993–2006) + * `XBA` - European Composite Unit - * `BSD` - Bahamian Dollar + * `XEU` - European Currency Unit - * `BHD` - Bahraini Dinar + * `XBB` - European Monetary Unit - * `BDT` - Bangladeshi Taka + * `XBC` - European Unit of Account (XBC) - * `BBD` - Barbadian Dollar + * `XBD` - European Unit of Account (XBD) - * `BYN` - Belarusian Ruble + * `FKP` - Falkland Islands Pound - * `BYB` - Belarusian Ruble (1994–1999) + * `FJD` - Fijian Dollar - * `BYR` - Belarusian Ruble (2000–2016) + * `FIM` - Finnish Markka - * `BEF` - Belgian Franc + * `FRF` - French Franc - * `BEC` - Belgian Franc (convertible) + * `XFO` - French Gold Franc - * `BEL` - Belgian Franc (financial) + * `XFU` - French UIC-Franc - * `BZD` - Belize Dollar + * `GMD` - Gambian Dalasi - * `BMD` - Bermudan Dollar + * `GEK` - Georgian Kupon Larit - * `BTN` - Bhutanese Ngultrum + * `GEL` - Georgian Lari - * `BOB` - Bolivian Boliviano + * `DEM` - German Mark - * `BOL` - Bolivian Boliviano (1863–1963) + * `GHS` - Ghanaian Cedi - * `BOV` - Bolivian Mvdol + * `GHC` - Ghanaian Cedi (1979–2007) - * `BOP` - Bolivian Peso + * `GIP` - Gibraltar Pound - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `XAU` - Gold - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `GRD` - Greek Drachma - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `GTQ` - Guatemalan Quetzal - * `BWP` - Botswanan Pula + * `GWP` - Guinea-Bissau Peso - * `BRC` - Brazilian Cruzado (1986–1989) + * `GNF` - Guinean Franc - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `GNS` - Guinean Syli - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `GYD` - Guyanaese Dollar - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `HTG` - Haitian Gourde - * `BRN` - Brazilian New Cruzado (1989–1990) + * `HNL` - Honduran Lempira - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `HKD` - Hong Kong Dollar - * `BRL` - Brazilian Real + * `HUF` - Hungarian Forint - * `GBP` - British Pound + * `IMP` - IMP - * `BND` - Brunei Dollar + * `ISK` - Icelandic Króna - * `BGL` - Bulgarian Hard Lev + * `ISJ` - Icelandic Króna (1918–1981) - * `BGN` - Bulgarian Lev + * `INR` - Indian Rupee - * `BGO` - Bulgarian Lev (1879–1952) + * `IDR` - Indonesian Rupiah - * `BGM` - Bulgarian Socialist Lev + * `IRR` - Iranian Rial - * `BUK` - Burmese Kyat + * `IQD` - Iraqi Dinar - * `BIF` - Burundian Franc + * `IEP` - Irish Pound - * `XPF` - CFP Franc + * `ILS` - Israeli New Shekel - * `KHR` - Cambodian Riel + * `ILP` - Israeli Pound - * `CAD` - Canadian Dollar + * `ILR` - Israeli Shekel (1980–1985) - * `CVE` - Cape Verdean Escudo + * `ITL` - Italian Lira - * `KYD` - Cayman Islands Dollar + * `JMD` - Jamaican Dollar - * `XAF` - Central African CFA Franc + * `JPY` - Japanese Yen - * `CLE` - Chilean Escudo + * `JOD` - Jordanian Dinar - * `CLP` - Chilean Peso + * `KZT` - Kazakhstani Tenge - * `CLF` - Chilean Unit of Account (UF) + * `KES` - Kenyan Shilling - * `CNX` - Chinese People’s Bank Dollar + * `KWD` - Kuwaiti Dinar - * `CNY` - Chinese Yuan + * `KGS` - Kyrgystani Som - * `CNH` - Chinese Yuan (offshore) + * `LAK` - Laotian Kip - * `COP` - Colombian Peso + * `LVL` - Latvian Lats - * `COU` - Colombian Real Value Unit + * `LVR` - Latvian Ruble - * `KMF` - Comorian Franc + * `LBP` - Lebanese Pound - * `CDF` - Congolese Franc + * `LSL` - Lesotho Loti - * `CRC` - Costa Rican Colón + * `LRD` - Liberian Dollar - * `HRD` - Croatian Dinar + * `LYD` - Libyan Dinar - * `HRK` - Croatian Kuna + * `LTL` - Lithuanian Litas - * `CUC` - Cuban Convertible Peso + * `LTT` - Lithuanian Talonas - * `CUP` - Cuban Peso + * `LUL` - Luxembourg Financial Franc - * `CYP` - Cypriot Pound + * `LUC` - Luxembourgian Convertible Franc - * `CZK` - Czech Koruna + * `LUF` - Luxembourgian Franc - * `CSK` - Czechoslovak Hard Koruna + * `MOP` - Macanese Pataca - * `DKK` - Danish Krone + * `MKD` - Macedonian Denar - * `DJF` - Djiboutian Franc + * `MKN` - Macedonian Denar (1992–1993) - * `DOP` - Dominican Peso + * `MGA` - Malagasy Ariary - * `NLG` - Dutch Guilder + * `MGF` - Malagasy Franc - * `XCD` - East Caribbean Dollar + * `MWK` - Malawian Kwacha - * `DDM` - East German Mark + * `MYR` - Malaysian Ringgit - * `ECS` - Ecuadorian Sucre + * `MVR` - Maldivian Rufiyaa - * `ECV` - Ecuadorian Unit of Constant Value + * `MVP` - Maldivian Rupee (1947–1981) - * `EGP` - Egyptian Pound + * `MLF` - Malian Franc - * `GQE` - Equatorial Guinean Ekwele + * `MTL` - Maltese Lira - * `ERN` - Eritrean Nakfa + * `MTP` - Maltese Pound - * `EEK` - Estonian Kroon + * `MRU` - Mauritanian Ouguiya - * `ETB` - Ethiopian Birr + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `EUR` - Euro + * `MUR` - Mauritian Rupee - * `XBA` - European Composite Unit + * `MXV` - Mexican Investment Unit - * `XEU` - European Currency Unit + * `MXN` - Mexican Peso - * `XBB` - European Monetary Unit + * `MXP` - Mexican Silver Peso (1861–1992) - * `XBC` - European Unit of Account (XBC) + * `MDC` - Moldovan Cupon - * `XBD` - European Unit of Account (XBD) + * `MDL` - Moldovan Leu - * `FKP` - Falkland Islands Pound + * `MCF` - Monegasque Franc - * `FJD` - Fijian Dollar + * `MNT` - Mongolian Tugrik - * `FIM` - Finnish Markka + * `MAD` - Moroccan Dirham - * `FRF` - French Franc + * `MAF` - Moroccan Franc - * `XFO` - French Gold Franc + * `MZE` - Mozambican Escudo - * `XFU` - French UIC-Franc + * `MZN` - Mozambican Metical - * `GMD` - Gambian Dalasi + * `MZM` - Mozambican Metical (1980–2006) - * `GEK` - Georgian Kupon Larit + * `MMK` - Myanmar Kyat - * `GEL` - Georgian Lari + * `NAD` - Namibian Dollar - * `DEM` - German Mark + * `NPR` - Nepalese Rupee - * `GHS` - Ghanaian Cedi + * `ANG` - Netherlands Antillean Guilder - * `GHC` - Ghanaian Cedi (1979–2007) + * `TWD` - New Taiwan Dollar - * `GIP` - Gibraltar Pound + * `NZD` - New Zealand Dollar - * `XAU` - Gold + * `NIO` - Nicaraguan Córdoba - * `GRD` - Greek Drachma + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `GTQ` - Guatemalan Quetzal + * `NGN` - Nigerian Naira - * `GWP` - Guinea-Bissau Peso + * `KPW` - North Korean Won - * `GNF` - Guinean Franc + * `NOK` - Norwegian Krone - * `GNS` - Guinean Syli + * `OMR` - Omani Rial - * `GYD` - Guyanaese Dollar + * `PKR` - Pakistani Rupee - * `HTG` - Haitian Gourde + * `XPD` - Palladium - * `HNL` - Honduran Lempira + * `PAB` - Panamanian Balboa - * `HKD` - Hong Kong Dollar + * `PGK` - Papua New Guinean Kina - * `HUF` - Hungarian Forint + * `PYG` - Paraguayan Guarani - * `IMP` - IMP + * `PEI` - Peruvian Inti - * `ISK` - Icelandic Króna + * `PEN` - Peruvian Sol - * `ISJ` - Icelandic Króna (1918–1981) + * `PES` - Peruvian Sol (1863–1965) - * `INR` - Indian Rupee + * `PHP` - Philippine Peso - * `IDR` - Indonesian Rupiah + * `XPT` - Platinum - * `IRR` - Iranian Rial + * `PLN` - Polish Zloty - * `IQD` - Iraqi Dinar + * `PLZ` - Polish Zloty (1950–1995) - * `IEP` - Irish Pound + * `PTE` - Portuguese Escudo - * `ILS` - Israeli New Shekel + * `GWE` - Portuguese Guinea Escudo - * `ILP` - Israeli Pound + * `QAR` - Qatari Rial - * `ILR` - Israeli Shekel (1980–1985) + * `XRE` - RINET Funds - * `ITL` - Italian Lira + * `RHD` - Rhodesian Dollar - * `JMD` - Jamaican Dollar + * `RON` - Romanian Leu - * `JPY` - Japanese Yen + * `ROL` - Romanian Leu (1952–2006) - * `JOD` - Jordanian Dinar + * `RUB` - Russian Ruble - * `KZT` - Kazakhstani Tenge + * `RUR` - Russian Ruble (1991–1998) - * `KES` - Kenyan Shilling + * `RWF` - Rwandan Franc - * `KWD` - Kuwaiti Dinar + * `SVC` - Salvadoran Colón - * `KGS` - Kyrgystani Som + * `WST` - Samoan Tala - * `LAK` - Laotian Kip + * `SAR` - Saudi Riyal - * `LVL` - Latvian Lats + * `RSD` - Serbian Dinar - * `LVR` - Latvian Ruble + * `CSD` - Serbian Dinar (2002–2006) - * `LBP` - Lebanese Pound + * `SCR` - Seychellois Rupee - * `LSL` - Lesotho Loti + * `SLL` - Sierra Leonean Leone - * `LRD` - Liberian Dollar + * `XAG` - Silver - * `LYD` - Libyan Dinar + * `SGD` - Singapore Dollar - * `LTL` - Lithuanian Litas + * `SKK` - Slovak Koruna - * `LTT` - Lithuanian Talonas + * `SIT` - Slovenian Tolar - * `LUL` - Luxembourg Financial Franc + * `SBD` - Solomon Islands Dollar - * `LUC` - Luxembourgian Convertible Franc + * `SOS` - Somali Shilling - * `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) + * `ZAR` - South African Rand - * `PHP` - Philippine Peso + * `ZAL` - South African Rand (financial) - * `XPT` - Platinum + * `KRH` - South Korean Hwan (1953–1962) - * `PLN` - Polish Zloty + * `KRW` - South Korean Won - * `PLZ` - Polish Zloty (1950–1995) + * `KRO` - South Korean Won (1945–1953) - * `PTE` - Portuguese Escudo + * `SSP` - South Sudanese Pound - * `GWE` - Portuguese Guinea Escudo + * `SUR` - Soviet Rouble - * `QAR` - Qatari Rial + * `ESP` - Spanish Peseta - * `XRE` - RINET Funds + * `ESA` - Spanish Peseta (A account) - * `RHD` - Rhodesian Dollar + * `ESB` - Spanish Peseta (convertible account) - * `RON` - Romanian Leu + * `XDR` - Special Drawing Rights - * `ROL` - Romanian Leu (1952–2006) + * `LKR` - Sri Lankan Rupee - * `RUB` - Russian Ruble + * `SHP` - St. Helena Pound - * `RUR` - Russian Ruble (1991–1998) + * `XSU` - Sucre - * `RWF` - Rwandan Franc + * `SDD` - Sudanese Dinar (1992–2007) - * `SVC` - Salvadoran Colón + * `SDG` - Sudanese Pound - * `WST` - Samoan Tala + * `SDP` - Sudanese Pound (1957–1998) - * `SAR` - Saudi Riyal + * `SRD` - Surinamese Dollar - * `RSD` - Serbian Dinar + * `SRG` - Surinamese Guilder - * `CSD` - Serbian Dinar (2002–2006) + * `SZL` - Swazi Lilangeni - * `SCR` - Seychellois Rupee + * `SEK` - Swedish Krona - * `SLL` - Sierra Leonean Leone + * `CHF` - Swiss Franc - * `XAG` - Silver + * `SYP` - Syrian Pound - * `SGD` - Singapore Dollar + * `STN` - São Tomé & Príncipe Dobra - * `SKK` - Slovak Koruna + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `SIT` - Slovenian Tolar + * `TVD` - TVD - * `SBD` - Solomon Islands Dollar + * `TJR` - Tajikistani Ruble - * `SOS` - Somali Shilling + * `TJS` - Tajikistani Somoni - * `ZAR` - South African Rand + * `TZS` - Tanzanian Shilling - * `ZAL` - South African Rand (financial) + * `XTS` - Testing Currency Code - * `KRH` - South Korean Hwan (1953–1962) + * `THB` - Thai Baht - * `KRW` - South Korean Won + * `XXX` - The codes assigned for transactions where no currency is + involved - * `KRO` - South Korean Won (1945–1953) + * `TPE` - Timorese Escudo - * `SSP` - South Sudanese Pound + * `TOP` - Tongan Paʻanga - * `SUR` - Soviet Rouble + * `TTD` - Trinidad & Tobago Dollar - * `ESP` - Spanish Peseta + * `TND` - Tunisian Dinar - * `ESA` - Spanish Peseta (A account) + * `TRY` - Turkish Lira - * `ESB` - Spanish Peseta (convertible account) + * `TRL` - Turkish Lira (1922–2005) - * `XDR` - Special Drawing Rights + * `TMT` - Turkmenistani Manat - * `LKR` - Sri Lankan Rupee + * `TMM` - Turkmenistani Manat (1993–2009) - * `SHP` - St. Helena Pound + * `USD` - US Dollar - * `XSU` - Sucre + * `USN` - US Dollar (Next day) - * `SDD` - Sudanese Dinar (1992–2007) + * `USS` - US Dollar (Same day) - * `SDG` - Sudanese Pound + * `UGX` - Ugandan Shilling - * `SDP` - Sudanese Pound (1957–1998) + * `UGS` - Ugandan Shilling (1966–1987) - * `SRD` - Surinamese Dollar + * `UAH` - Ukrainian Hryvnia - * `SRG` - Surinamese Guilder + * `UAK` - Ukrainian Karbovanets - * `SZL` - Swazi Lilangeni + * `AED` - United Arab Emirates Dirham - * `SEK` - Swedish Krona + * `UYW` - Uruguayan Nominal Wage Index Unit - * `CHF` - Swiss Franc + * `UYU` - Uruguayan Peso - * `SYP` - Syrian Pound + * `UYP` - Uruguayan Peso (1975–1993) - * `STN` - São Tomé & Príncipe Dobra + * `UYI` - Uruguayan Peso (Indexed Units) - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `UZS` - Uzbekistani Som - * `TVD` - TVD + * `VUV` - Vanuatu Vatu - * `TJR` - Tajikistani Ruble + * `VES` - Venezuelan Bolívar - * `TJS` - Tajikistani Somoni + * `VEB` - Venezuelan Bolívar (1871–2008) - * `TZS` - Tanzanian Shilling + * `VEF` - Venezuelan Bolívar (2008–2018) - * `XTS` - Testing Currency Code + * `VND` - Vietnamese Dong - * `THB` - Thai Baht + * `VNN` - Vietnamese Dong (1978–1985) - * `XXX` - The codes assigned for transactions where no currency is - involved + * `CHE` - WIR Euro - * `TPE` - Timorese Escudo + * `CHW` - WIR Franc - * `TOP` - Tongan Paʻanga + * `XOF` - West African CFA Franc - * `TTD` - Trinidad & Tobago Dollar + * `YDD` - Yemeni Dinar - * `TND` - Tunisian Dinar + * `YER` - Yemeni Rial - * `TRY` - Turkish Lira + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `TRL` - Turkish Lira (1922–2005) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `TMT` - Turkmenistani Manat + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `TMM` - Turkmenistani Manat (1993–2009) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `USD` - US Dollar + * `ZWN` - ZWN - * `USN` - US Dollar (Next day) + * `ZRN` - Zairean New Zaire (1993–1998) - * `USS` - US Dollar (Same day) + * `ZRZ` - Zairean Zaire (1971–1993) - * `UGX` - Ugandan Shilling + * `ZMW` - Zambian Kwacha - * `UGS` - Ugandan Shilling (1966–1987) + * `ZMK` - Zambian Kwacha (1968–2012) - * `UAH` - Ukrainian Hryvnia + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `UAK` - Ukrainian Karbovanets + * `ZWR` - Zimbabwean Dollar (2008) - * `AED` - United Arab Emirates Dirham + * `ZWL` - Zimbabwean Dollar (2009) + union: + - TransactionCurrencyEnum + - string + source: + openapi: accounting_v3.yml + inline: true + AccountRequest: + docs: >- + # The Account Object - * `UYW` - Uruguayan Nominal Wage Index Unit + ### Description - * `UYU` - Uruguayan Peso + 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**. - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) + An `Account` can be classified into one of the following categories, + determined through the `classification` field: - * `UZS` - Uzbekistani Som + * __Asset:__ Accounts Receivable and Bank Accounts - * `VUV` - Vanuatu Vatu + * __Liability:__ Accounts Payable and Credit Card Accounts - * `VES` - Venezuelan Bolívar + * __Equity:__ Treasury Accounts and Retained Earnings - * `VEB` - Venezuelan Bolívar (1871–2008) + * __Revenue:__ Income and Other Income - * `VEF` - Venezuelan Bolívar (2008–2018) + * __Expense:__ Cost of Goods Sold and Office Expenses - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) + ### Usage Example - * `CHE` - WIR Euro + 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. - * `CHW` - WIR Franc + * `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. - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar + * `BANK` - BANK - * `YER` - Yemeni Rial + * `CREDIT_CARD` - CREDIT_CARD - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `FIXED_ASSET` - FIXED_ASSET - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `OTHER_ASSET` - OTHER_ASSET - * `ZWN` - ZWN + * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - * `ZRN` - Zairean New Zaire (1993–1998) + * `OTHER_EXPENSE` - OTHER_EXPENSE - * `ZRZ` - Zairean Zaire (1971–1993) + * `OTHER_INCOME` - OTHER_INCOME - * `ZMW` - Zambian Kwacha + * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - * `ZMK` - Zambian Kwacha (1968–2012) + * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - * `ZWR` - Zimbabwean Dollar (2008) + * `NON_POSTING` - NON_POSTING + status: + type: optional + docs: |- + The account's status. - * `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: + * `ACTIVE` - ACTIVE + * `PENDING` - PENDING + * `INACTIVE` - INACTIVE + current_balance: 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: openapi/openapi.yml - 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 + docs: The account's current balance. currency: - type: optional + type: optional docs: >- - The currency code of the bank feed. + The account's currency. * `XUA` - ADB Unit of Account @@ -4149,1800 +3067,2485 @@ types: * `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: + 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: read-only - remote_data: optional>>> + access: write-only + linked_account_params: + type: optional> + access: write-only source: - openapi: openapi/openapi.yml - BankFeedAccountAccountTypeEnum: + openapi: accounting_v3.yml + AccountResponse: + properties: + model: Account + warnings: list + errors: list + logs: optional> + source: + openapi: accounting_v3.yml + AccountStatusEnum: enum: - - BANK - - CREDIT_CARD + - ACTIVE + - PENDING + - INACTIVE docs: |- - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD + * `ACTIVE` - ACTIVE + * `PENDING` - PENDING + * `INACTIVE` - INACTIVE source: - openapi: openapi/openapi.yml - BankFeedAccountRequest: + openapi: accounting_v3.yml + AccountToken: + properties: + account_token: string + integration: AccountIntegration + id: string + source: + openapi: accounting_v3.yml + AccountingAttachment: docs: >- - # The BankFeedAccount Object + # The Accounting Attachment 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. + The `AccountingAttachment` object is used to represent a company's + attachments. ### Usage Example - Fetch from the `GET BankFeedAccount` endpoint to view details of a bank - feed account. + Fetch from the `LIST AccountingAttachments` endpoint and view a company's + attachments. properties: - source_account_id: + id: type: optional - docs: >- - The unique identifier of the source account from our customer’s - platform. validation: - maxLength: 1024 - target_account_id: + format: uuid + access: read-only + remote_id: type: optional - docs: >- - The unique identifier of the target account from the third party - software. - validation: - maxLength: 1024 - source_account_name: + 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 name of the source account as stored in our customer’s platform. - validation: - maxLength: 1024 - source_account_number: + docs: The attachment's name. + file_url: type: optional - docs: >- - The human-readable account number of the source account as stored in - our customer’s platform. + docs: The attachment's url. validation: - maxLength: 1024 - target_account_name: + format: uri + maxLength: 2000 + company: type: optional - docs: The name of the target account from the third party software. + docs: The company the accounting attachment belongs to. validation: - maxLength: 1024 - currency: - type: optional + format: uuid + remote_was_deleted: + type: optional docs: >- - The currency code of the bank feed. + Indicates whether or not this object has been deleted in the third + party platform. Full coverage deletion detection is 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 - * `XUA` - ADB Unit of Account + The `AccountingAttachment` object is used to represent a company's + attachments. - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) + ### Usage Example - * `ALL` - Albanian Lek + 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 - * `ALK` - Albanian Lek (1946–1965) + ### Description - * `DZD` - Algerian Dinar + The `AccountingPeriod` object is used to define a period of time in which + events occurred. - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza + ### Usage Example - * `AOK` - Angolan Kwanza (1977–1991) + 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 - * `AON` - Angolan New Kwanza (1990–2000) + ### Description - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + The `AccountingPhoneNumber` object is used to represent a contact's or + company's phone number. - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso + ### Usage Example - * `ARM` - Argentine Peso (1881–1970) + 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 - * `ARP` - Argentine Peso (1983–1985) + ### Description - * `ARL` - Argentine Peso Ley (1970–1983) + The `AccountingPhoneNumber` object is used to represent a contact's or + company's phone number. - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin + ### Usage Example - * `AUD` - Australian Dollar + 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. - * `ATS` - Austrian Schilling + * `BILLING` - BILLING + * `SHIPPING` - SHIPPING + union: + - AddressTypeEnum + - string + source: + openapi: accounting_v3.yml + inline: true + AddressCountry: + discriminated: false + docs: |- + The address's country. - * `AZN` - Azerbaijani Manat + * `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 - * `AZM` - Azerbaijani Manat (1993–2006) + ### Description - * `BSD` - Bahamian Dollar + The `Address` object is used to represent a contact's or company's + address. - * `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 + ### Usage Example - * `IRR` - Iranian Rial + 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. - * `IQD` - Iraqi Dinar + * `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. - * `IEP` - Irish Pound + * `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. - * `ILS` - Israeli New Shekel + * `BILLING` - BILLING + * `SHIPPING` - SHIPPING + union: + - AddressTypeEnum + - string + source: + openapi: accounting_v3.yml + inline: true + AddressRequestCountry: + discriminated: false + docs: |- + The address's country. - * `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 + * `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 - * `SDP` - Sudanese Pound (1957–1998) + ### Description - * `SRD` - Surinamese Dollar + The `Address` object is used to represent a contact's or company's + address. - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni + ### Usage Example - * `SEK` - Swedish Krona + Fetch from the `GET CompanyInfo` endpoint and view the company's + addresses. + properties: + type: + type: optional + docs: |- + The address type. - * `CHF` - Swiss Franc + * `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. - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble + * `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. - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling + * `ADMIN` - ADMIN - * `XTS` - Testing Currency Code + * `DEVELOPER` - DEVELOPER - * `THB` - Thai Baht + * `MEMBER` - MEMBER - * `XXX` - The codes assigned for transactions where no currency is - involved + * `API` - API - * `TPE` - Timorese Escudo + * `SYSTEM` - SYSTEM - * `TOP` - Tongan Paʻanga + * `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. - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar + * `CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY - * `TRY` - Turkish Lira + * `DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY - * `TRL` - Turkish Lira (1922–2005) + * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY - * `TMT` - Turkmenistani Manat + * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY - * `TMM` - Turkmenistani Manat (1993–2009) + * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY - * `USD` - US Dollar + * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE - * `USN` - US Dollar (Next day) + * `INVITED_USER` - INVITED_USER - * `USS` - US Dollar (Same day) + * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED - * `UGX` - Ugandan Shilling + * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED - * `UGS` - Ugandan Shilling (1966–1987) + * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT - * `UAH` - Ukrainian Hryvnia + * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - * `UAK` - Ukrainian Karbovanets + * `CREATED_DESTINATION` - CREATED_DESTINATION - * `AED` - United Arab Emirates Dirham + * `DELETED_DESTINATION` - DELETED_DESTINATION - * `UYW` - Uruguayan Nominal Wage Index Unit + * `CHANGED_DESTINATION` - CHANGED_DESTINATION - * `UYU` - Uruguayan Peso + * `CHANGED_SCOPES` - CHANGED_SCOPES - * `UYP` - Uruguayan Peso (1975–1993) + * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION - * `UYI` - Uruguayan Peso (Indexed Units) + * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS - * `UZS` - Uzbekistani Som + * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION - * `VUV` - Vanuatu Vatu + * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION - * `VES` - Venezuelan Bolívar + * `ENABLED_CATEGORY` - ENABLED_CATEGORY - * `VEB` - Venezuelan Bolívar (1871–2008) + * `DISABLED_CATEGORY` - DISABLED_CATEGORY - * `VEF` - Venezuelan Bolívar (2008–2018) + * `CHANGED_PASSWORD` - CHANGED_PASSWORD - * `VND` - Vietnamese Dong + * `RESET_PASSWORD` - RESET_PASSWORD - * `VNN` - Vietnamese Dong (1978–1985) + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - * `CHE` - WIR Euro + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - * `CHW` - WIR Franc + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - * `XOF` - West African CFA Franc + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - * `YDD` - Yemeni Dinar + * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - + CREATED_INTEGRATION_WIDE_FIELD_MAPPING - * `YER` - Yemeni Rial + * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - + CREATED_LINKED_ACCOUNT_FIELD_MAPPING - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - + DELETED_INTEGRATION_WIDE_FIELD_MAPPING - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - + DELETED_LINKED_ACCOUNT_FIELD_MAPPING - * `ZWN` - ZWN + * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - * `ZRN` - Zairean New Zaire (1993–1998) + * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - * `ZRZ` - Zairean Zaire (1971–1993) + * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - * `ZMW` - Zambian Kwacha + * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC - * `ZMK` - Zambian Kwacha (1968–2012) + * `MUTED_ISSUE` - MUTED_ISSUE - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK - * `ZWR` - Zimbabwean Dollar (2008) + * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK - * `ZWL` - Zimbabwean Dollar (2009) - feed_status: - type: optional - docs: |- - The status of the bank feed. + * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK - * `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. + * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: openapi/openapi.yml - BankFeedAccountResponse: - properties: - model: BankFeedAccount - warnings: list - errors: list - logs: optional> - source: - openapi: openapi/openapi.yml - BankFeedTransactionBankFeedAccount: - discriminated: false - docs: The bank feed account associated with the transaction. + * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED union: - - type: string - validation: - format: uuid - - BankFeedAccount + - EventTypeEnum + - string source: - openapi: openapi/openapi.yml + 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. + AuditLogEvent: properties: id: type: optional validation: format: uuid access: read-only - remote_id: + user_name: 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. + docs: The User's full name at the time of this Event occurring. validation: - maxLength: 1024 - transaction_type: + maxLength: 200 + user_email: type: optional - docs: The underlying type of the transaction. + docs: The User's email at the time of this Event occurring. validation: - maxLength: 1024 - payee: - type: optional + format: email + maxLength: 254 + role: + type: AuditLogEventRole 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. + Designates the role of the user (or SYSTEM/API if action not taken by + a user) at the time of this Event occurring. - * `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: openapi/openapi.yml - BankFeedTransactionRequestRequestBankFeedAccount: - discriminated: false - docs: The bank feed account associated with the transaction. - union: - - type: string - validation: - format: uuid - - BankFeedAccount - source: - openapi: openapi/openapi.yml - inline: true - BankFeedTransactionRequestRequest: - docs: >- - # The BankFeedTransaction Object - ### Description + * `ADMIN` - ADMIN - 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. + * `DEVELOPER` - DEVELOPER + * `MEMBER` - MEMBER - ### Usage Example + * `API` - API - 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. + * `SYSTEM` - SYSTEM + + * `MERGE_TEAM` - MERGE_TEAM + ip_address: + type: string validation: - maxLength: 1024 - payee: - type: optional + maxLength: 45 + event_type: + type: AuditLogEventEventType 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. + Designates the type of event that occurred. - * `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: openapi/openapi.yml - BankFeedTransactionResponse: - properties: - model: BankFeedTransaction - warnings: list - errors: list - logs: optional> - source: - openapi: openapi/openapi.yml - CashFlowStatementCompany: - discriminated: false - docs: The company the cash flow statement belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - CashFlowStatement: - docs: >- - # The CashFlowStatement Object - ### Description + * `CREATED_REMOTE_PRODUCTION_API_KEY` - + CREATED_REMOTE_PRODUCTION_API_KEY - The `CashFlowStatement` object shows operating activities, investing - activities, and financing activities over a period of time (month, - quarter, or year). + * `DELETED_REMOTE_PRODUCTION_API_KEY` - + DELETED_REMOTE_PRODUCTION_API_KEY + * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY - ### Usage Example + * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY - 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. + * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY + * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE - * `XUA` - ADB Unit of Account + * `INVITED_USER` - INVITED_USER - * `AFN` - Afghan Afghani + * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED - * `AFA` - Afghan Afghani (1927–2002) + * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED - * `ALL` - Albanian Lek + * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT - * `ALK` - Albanian Lek (1946–1965) + * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - * `DZD` - Algerian Dinar + * `CREATED_DESTINATION` - CREATED_DESTINATION - * `ADP` - Andorran Peseta + * `DELETED_DESTINATION` - DELETED_DESTINATION - * `AOA` - Angolan Kwanza + * `CHANGED_DESTINATION` - CHANGED_DESTINATION - * `AOK` - Angolan Kwanza (1977–1991) + * `CHANGED_SCOPES` - CHANGED_SCOPES - * `AON` - Angolan New Kwanza (1990–2000) + * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS - * `ARA` - Argentine Austral + * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION - * `ARS` - Argentine Peso + * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION - * `ARM` - Argentine Peso (1881–1970) + * `ENABLED_CATEGORY` - ENABLED_CATEGORY - * `ARP` - Argentine Peso (1983–1985) + * `DISABLED_CATEGORY` - DISABLED_CATEGORY - * `ARL` - Argentine Peso Ley (1970–1983) + * `CHANGED_PASSWORD` - CHANGED_PASSWORD - * `AMD` - Armenian Dram + * `RESET_PASSWORD` - RESET_PASSWORD - * `AWG` - Aruban Florin + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - * `AUD` - Australian Dollar + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - * `ATS` - Austrian Schilling + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - * `AZN` - Azerbaijani Manat + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - * `AZM` - Azerbaijani Manat (1993–2006) + * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - + CREATED_INTEGRATION_WIDE_FIELD_MAPPING - * `BSD` - Bahamian Dollar + * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - + CREATED_LINKED_ACCOUNT_FIELD_MAPPING - * `BHD` - Bahraini Dinar + * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - * `BDT` - Bangladeshi Taka + * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - * `BBD` - Barbadian Dollar + * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - + DELETED_INTEGRATION_WIDE_FIELD_MAPPING - * `BYN` - Belarusian Ruble + * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - + DELETED_LINKED_ACCOUNT_FIELD_MAPPING - * `BYB` - Belarusian Ruble (1994–1999) + * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - * `BYR` - Belarusian Ruble (2000–2016) + * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - * `BEF` - Belgian Franc + * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - * `BEC` - Belgian Franc (convertible) + * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC - * `BEL` - Belgian Franc (financial) + * `MUTED_ISSUE` - MUTED_ISSUE - * `BZD` - Belize Dollar + * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK - * `BMD` - Bermudan Dollar + * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK - * `BTN` - Bhutanese Ngultrum + * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK - * `BOB` - Bolivian Boliviano + * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED - * `BOL` - Bolivian Boliviano (1863–1963) + * `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 - * `BOV` - Bolivian Mvdol + ### Description - * `BOP` - Bolivian Peso + The `Activity` object is used to see all available model/operation + combinations for an integration. - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + ### Usage Example - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + 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. - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) + * `XUA` - ADB Unit of Account - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `AFN` - Afghan Afghani - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `AFA` - Afghan Afghani (1927–2002) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `ALL` - Albanian Lek - * `BRN` - Brazilian New Cruzado (1989–1990) + * `ALK` - Albanian Lek (1946–1965) - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `DZD` - Algerian Dinar - * `BRL` - Brazilian Real + * `ADP` - Andorran Peseta - * `GBP` - British Pound + * `AOA` - Angolan Kwanza - * `BND` - Brunei Dollar + * `AOK` - Angolan Kwanza (1977–1991) - * `BGL` - Bulgarian Hard Lev + * `AON` - Angolan New Kwanza (1990–2000) - * `BGN` - Bulgarian Lev + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `BGO` - Bulgarian Lev (1879–1952) + * `ARA` - Argentine Austral - * `BGM` - Bulgarian Socialist Lev + * `ARS` - Argentine Peso - * `BUK` - Burmese Kyat + * `ARM` - Argentine Peso (1881–1970) - * `BIF` - Burundian Franc + * `ARP` - Argentine Peso (1983–1985) - * `XPF` - CFP Franc + * `ARL` - Argentine Peso Ley (1970–1983) - * `KHR` - Cambodian Riel + * `AMD` - Armenian Dram - * `CAD` - Canadian Dollar + * `AWG` - Aruban Florin - * `CVE` - Cape Verdean Escudo + * `AUD` - Australian Dollar - * `KYD` - Cayman Islands Dollar + * `ATS` - Austrian Schilling - * `XAF` - Central African CFA Franc + * `AZN` - Azerbaijani Manat - * `CLE` - Chilean Escudo + * `AZM` - Azerbaijani Manat (1993–2006) - * `CLP` - Chilean Peso + * `BSD` - Bahamian Dollar - * `CLF` - Chilean Unit of Account (UF) + * `BHD` - Bahraini Dinar - * `CNX` - Chinese People’s Bank Dollar + * `BDT` - Bangladeshi Taka - * `CNY` - Chinese Yuan + * `BBD` - Barbadian Dollar - * `CNH` - Chinese Yuan (offshore) + * `BYN` - Belarusian Ruble - * `COP` - Colombian Peso + * `BYB` - Belarusian Ruble (1994–1999) - * `COU` - Colombian Real Value Unit + * `BYR` - Belarusian Ruble (2000–2016) - * `KMF` - Comorian Franc + * `BEF` - Belgian Franc - * `CDF` - Congolese Franc + * `BEC` - Belgian Franc (convertible) - * `CRC` - Costa Rican Colón + * `BEL` - Belgian Franc (financial) - * `HRD` - Croatian Dinar + * `BZD` - Belize Dollar - * `HRK` - Croatian Kuna + * `BMD` - Bermudan Dollar - * `CUC` - Cuban Convertible Peso + * `BTN` - Bhutanese Ngultrum - * `CUP` - Cuban Peso + * `BOB` - Bolivian Boliviano - * `CYP` - Cypriot Pound + * `BOL` - Bolivian Boliviano (1863–1963) - * `CZK` - Czech Koruna + * `BOV` - Bolivian Mvdol - * `CSK` - Czechoslovak Hard Koruna + * `BOP` - Bolivian Peso - * `DKK` - Danish Krone + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `DJF` - Djiboutian Franc + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `DOP` - Dominican Peso + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `NLG` - Dutch Guilder + * `BWP` - Botswanan Pula - * `XCD` - East Caribbean Dollar + * `BRC` - Brazilian Cruzado (1986–1989) - * `DDM` - East German Mark + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `ECS` - Ecuadorian Sucre + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `ECV` - Ecuadorian Unit of Constant Value + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `EGP` - Egyptian Pound + * `BRN` - Brazilian New Cruzado (1989–1990) - * `GQE` - Equatorial Guinean Ekwele + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `ERN` - Eritrean Nakfa + * `BRL` - Brazilian Real - * `EEK` - Estonian Kroon + * `GBP` - British Pound - * `ETB` - Ethiopian Birr + * `BND` - Brunei Dollar - * `EUR` - Euro + * `BGL` - Bulgarian Hard Lev - * `XBA` - European Composite Unit + * `BGN` - Bulgarian Lev - * `XEU` - European Currency Unit + * `BGO` - Bulgarian Lev (1879–1952) - * `XBB` - European Monetary Unit + * `BGM` - Bulgarian Socialist Lev - * `XBC` - European Unit of Account (XBC) + * `BUK` - Burmese Kyat - * `XBD` - European Unit of Account (XBD) + * `BIF` - Burundian Franc - * `FKP` - Falkland Islands Pound + * `XPF` - CFP Franc - * `FJD` - Fijian Dollar + * `KHR` - Cambodian Riel - * `FIM` - Finnish Markka + * `CAD` - Canadian Dollar - * `FRF` - French Franc + * `CVE` - Cape Verdean Escudo - * `XFO` - French Gold Franc + * `KYD` - Cayman Islands Dollar - * `XFU` - French UIC-Franc + * `XAF` - Central African CFA Franc - * `GMD` - Gambian Dalasi + * `CLE` - Chilean Escudo - * `GEK` - Georgian Kupon Larit + * `CLP` - Chilean Peso - * `GEL` - Georgian Lari + * `CLF` - Chilean Unit of Account (UF) - * `DEM` - German Mark + * `CNX` - Chinese People’s Bank Dollar - * `GHS` - Ghanaian Cedi + * `CNY` - Chinese Yuan - * `GHC` - Ghanaian Cedi (1979–2007) + * `CNH` - Chinese Yuan (offshore) - * `GIP` - Gibraltar Pound + * `COP` - Colombian Peso - * `XAU` - Gold + * `COU` - Colombian Real Value Unit - * `GRD` - Greek Drachma + * `KMF` - Comorian Franc - * `GTQ` - Guatemalan Quetzal + * `CDF` - Congolese Franc - * `GWP` - Guinea-Bissau Peso + * `CRC` - Costa Rican Colón - * `GNF` - Guinean Franc + * `HRD` - Croatian Dinar - * `GNS` - Guinean Syli + * `HRK` - Croatian Kuna - * `GYD` - Guyanaese Dollar + * `CUC` - Cuban Convertible Peso - * `HTG` - Haitian Gourde + * `CUP` - Cuban Peso - * `HNL` - Honduran Lempira + * `CYP` - Cypriot Pound - * `HKD` - Hong Kong Dollar + * `CZK` - Czech Koruna - * `HUF` - Hungarian Forint + * `CSK` - Czechoslovak Hard Koruna - * `IMP` - IMP + * `DKK` - Danish Krone - * `ISK` - Icelandic Króna + * `DJF` - Djiboutian Franc - * `ISJ` - Icelandic Króna (1918–1981) + * `DOP` - Dominican Peso - * `INR` - Indian Rupee + * `NLG` - Dutch Guilder - * `IDR` - Indonesian Rupiah + * `XCD` - East Caribbean Dollar - * `IRR` - Iranian Rial + * `DDM` - East German Mark - * `IQD` - Iraqi Dinar + * `ECS` - Ecuadorian Sucre - * `IEP` - Irish Pound + * `ECV` - Ecuadorian Unit of Constant Value - * `ILS` - Israeli New Shekel + * `EGP` - Egyptian Pound - * `ILP` - Israeli Pound + * `GQE` - Equatorial Guinean Ekwele - * `ILR` - Israeli Shekel (1980–1985) + * `ERN` - Eritrean Nakfa - * `ITL` - Italian Lira + * `EEK` - Estonian Kroon - * `JMD` - Jamaican Dollar + * `ETB` - Ethiopian Birr - * `JPY` - Japanese Yen + * `EUR` - Euro - * `JOD` - Jordanian Dinar + * `XBA` - European Composite Unit - * `KZT` - Kazakhstani Tenge + * `XEU` - European Currency Unit - * `KES` - Kenyan Shilling + * `XBB` - European Monetary Unit - * `KWD` - Kuwaiti Dinar + * `XBC` - European Unit of Account (XBC) - * `KGS` - Kyrgystani Som + * `XBD` - European Unit of Account (XBD) - * `LAK` - Laotian Kip + * `FKP` - Falkland Islands Pound - * `LVL` - Latvian Lats + * `FJD` - Fijian Dollar - * `LVR` - Latvian Ruble + * `FIM` - Finnish Markka - * `LBP` - Lebanese Pound + * `FRF` - French Franc - * `LSL` - Lesotho Loti + * `XFO` - French Gold Franc - * `LRD` - Liberian Dollar + * `XFU` - French UIC-Franc - * `LYD` - Libyan Dinar + * `GMD` - Gambian Dalasi - * `LTL` - Lithuanian Litas + * `GEK` - Georgian Kupon Larit - * `LTT` - Lithuanian Talonas + * `GEL` - Georgian Lari - * `LUL` - Luxembourg Financial Franc + * `DEM` - German Mark - * `LUC` - Luxembourgian Convertible Franc + * `GHS` - Ghanaian Cedi - * `LUF` - Luxembourgian Franc + * `GHC` - Ghanaian Cedi (1979–2007) - * `MOP` - Macanese Pataca + * `GIP` - Gibraltar Pound - * `MKD` - Macedonian Denar + * `XAU` - Gold - * `MKN` - Macedonian Denar (1992–1993) + * `GRD` - Greek Drachma - * `MGA` - Malagasy Ariary + * `GTQ` - Guatemalan Quetzal - * `MGF` - Malagasy Franc + * `GWP` - Guinea-Bissau Peso - * `MWK` - Malawian Kwacha + * `GNF` - Guinean Franc - * `MYR` - Malaysian Ringgit + * `GNS` - Guinean Syli - * `MVR` - Maldivian Rufiyaa + * `GYD` - Guyanaese Dollar - * `MVP` - Maldivian Rupee (1947–1981) + * `HTG` - Haitian Gourde - * `MLF` - Malian Franc + * `HNL` - Honduran Lempira - * `MTL` - Maltese Lira + * `HKD` - Hong Kong Dollar - * `MTP` - Maltese Pound + * `HUF` - Hungarian Forint - * `MRU` - Mauritanian Ouguiya + * `IMP` - IMP - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `ISK` - Icelandic Króna - * `MUR` - Mauritian Rupee + * `ISJ` - Icelandic Króna (1918–1981) - * `MXV` - Mexican Investment Unit + * `INR` - Indian Rupee - * `MXN` - Mexican Peso + * `IDR` - Indonesian Rupiah - * `MXP` - Mexican Silver Peso (1861–1992) + * `IRR` - Iranian Rial - * `MDC` - Moldovan Cupon + * `IQD` - Iraqi Dinar - * `MDL` - Moldovan Leu + * `IEP` - Irish Pound - * `MCF` - Monegasque Franc + * `ILS` - Israeli New Shekel - * `MNT` - Mongolian Tugrik + * `ILP` - Israeli Pound - * `MAD` - Moroccan Dirham + * `ILR` - Israeli Shekel (1980–1985) - * `MAF` - Moroccan Franc + * `ITL` - Italian Lira - * `MZE` - Mozambican Escudo + * `JMD` - Jamaican Dollar - * `MZN` - Mozambican Metical + * `JPY` - Japanese Yen - * `MZM` - Mozambican Metical (1980–2006) + * `JOD` - Jordanian Dinar - * `MMK` - Myanmar Kyat + * `KZT` - Kazakhstani Tenge - * `NAD` - Namibian Dollar + * `KES` - Kenyan Shilling - * `NPR` - Nepalese Rupee + * `KWD` - Kuwaiti Dinar - * `ANG` - Netherlands Antillean Guilder + * `KGS` - Kyrgystani Som - * `TWD` - New Taiwan Dollar + * `LAK` - Laotian Kip - * `NZD` - New Zealand Dollar + * `LVL` - Latvian Lats - * `NIO` - Nicaraguan Córdoba + * `LVR` - Latvian Ruble - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `LBP` - Lebanese Pound - * `NGN` - Nigerian Naira + * `LSL` - Lesotho Loti - * `KPW` - North Korean Won + * `LRD` - Liberian Dollar - * `NOK` - Norwegian Krone + * `LYD` - Libyan Dinar - * `OMR` - Omani Rial + * `LTL` - Lithuanian Litas - * `PKR` - Pakistani Rupee + * `LTT` - Lithuanian Talonas - * `XPD` - Palladium + * `LUL` - Luxembourg Financial Franc - * `PAB` - Panamanian Balboa + * `LUC` - Luxembourgian Convertible Franc - * `PGK` - Papua New Guinean Kina + * `LUF` - Luxembourgian Franc - * `PYG` - Paraguayan Guarani + * `MOP` - Macanese Pataca - * `PEI` - Peruvian Inti + * `MKD` - Macedonian Denar - * `PEN` - Peruvian Sol + * `MKN` - Macedonian Denar (1992–1993) - * `PES` - Peruvian Sol (1863–1965) + * `MGA` - Malagasy Ariary - * `PHP` - Philippine Peso + * `MGF` - Malagasy Franc - * `XPT` - Platinum + * `MWK` - Malawian Kwacha - * `PLN` - Polish Zloty + * `MYR` - Malaysian Ringgit - * `PLZ` - Polish Zloty (1950–1995) + * `MVR` - Maldivian Rufiyaa - * `PTE` - Portuguese Escudo + * `MVP` - Maldivian Rupee (1947–1981) - * `GWE` - Portuguese Guinea Escudo + * `MLF` - Malian Franc - * `QAR` - Qatari Rial + * `MTL` - Maltese Lira - * `XRE` - RINET Funds + * `MTP` - Maltese Pound - * `RHD` - Rhodesian Dollar + * `MRU` - Mauritanian Ouguiya - * `RON` - Romanian Leu + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `ROL` - Romanian Leu (1952–2006) + * `MUR` - Mauritian Rupee - * `RUB` - Russian Ruble + * `MXV` - Mexican Investment Unit - * `RUR` - Russian Ruble (1991–1998) + * `MXN` - Mexican Peso - * `RWF` - Rwandan Franc + * `MXP` - Mexican Silver Peso (1861–1992) - * `SVC` - Salvadoran Colón + * `MDC` - Moldovan Cupon - * `WST` - Samoan Tala + * `MDL` - Moldovan Leu - * `SAR` - Saudi Riyal + * `MCF` - Monegasque Franc - * `RSD` - Serbian Dinar + * `MNT` - Mongolian Tugrik - * `CSD` - Serbian Dinar (2002–2006) + * `MAD` - Moroccan Dirham - * `SCR` - Seychellois Rupee + * `MAF` - Moroccan Franc - * `SLL` - Sierra Leonean Leone + * `MZE` - Mozambican Escudo - * `XAG` - Silver + * `MZN` - Mozambican Metical - * `SGD` - Singapore Dollar + * `MZM` - Mozambican Metical (1980–2006) - * `SKK` - Slovak Koruna + * `MMK` - Myanmar Kyat - * `SIT` - Slovenian Tolar + * `NAD` - Namibian Dollar - * `SBD` - Solomon Islands Dollar + * `NPR` - Nepalese Rupee - * `SOS` - Somali Shilling + * `ANG` - Netherlands Antillean Guilder - * `ZAR` - South African Rand + * `TWD` - New Taiwan Dollar - * `ZAL` - South African Rand (financial) + * `NZD` - New Zealand Dollar - * `KRH` - South Korean Hwan (1953–1962) + * `NIO` - Nicaraguan Córdoba - * `KRW` - South Korean Won + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `KRO` - South Korean Won (1945–1953) + * `NGN` - Nigerian Naira - * `SSP` - South Sudanese Pound + * `KPW` - North Korean Won - * `SUR` - Soviet Rouble + * `NOK` - Norwegian Krone - * `ESP` - Spanish Peseta + * `OMR` - Omani Rial - * `ESA` - Spanish Peseta (A account) + * `PKR` - Pakistani Rupee - * `ESB` - Spanish Peseta (convertible account) + * `XPD` - Palladium - * `XDR` - Special Drawing Rights + * `PAB` - Panamanian Balboa - * `LKR` - Sri Lankan Rupee + * `PGK` - Papua New Guinean Kina - * `SHP` - St. Helena Pound + * `PYG` - Paraguayan Guarani - * `XSU` - Sucre + * `PEI` - Peruvian Inti - * `SDD` - Sudanese Dinar (1992–2007) + * `PEN` - Peruvian Sol - * `SDG` - Sudanese Pound + * `PES` - Peruvian Sol (1863–1965) - * `SDP` - Sudanese Pound (1957–1998) + * `PHP` - Philippine Peso - * `SRD` - Surinamese Dollar + * `XPT` - Platinum - * `SRG` - Surinamese Guilder + * `PLN` - Polish Zloty - * `SZL` - Swazi Lilangeni + * `PLZ` - Polish Zloty (1950–1995) - * `SEK` - Swedish Krona + * `PTE` - Portuguese Escudo - * `CHF` - Swiss Franc + * `GWE` - Portuguese Guinea Escudo - * `SYP` - Syrian Pound + * `QAR` - Qatari Rial - * `STN` - São Tomé & Príncipe Dobra + * `XRE` - RINET Funds - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `RHD` - Rhodesian Dollar - * `TVD` - TVD + * `RON` - Romanian Leu - * `TJR` - Tajikistani Ruble + * `ROL` - Romanian Leu (1952–2006) - * `TJS` - Tajikistani Somoni + * `RUB` - Russian Ruble - * `TZS` - Tanzanian Shilling + * `RUR` - Russian Ruble (1991–1998) - * `XTS` - Testing Currency Code + * `RWF` - Rwandan Franc - * `THB` - Thai Baht + * `SVC` - Salvadoran Colón - * `XXX` - The codes assigned for transactions where no currency is - involved + * `WST` - Samoan Tala - * `TPE` - Timorese Escudo + * `SAR` - Saudi Riyal - * `TOP` - Tongan Paʻanga + * `RSD` - Serbian Dinar - * `TTD` - Trinidad & Tobago Dollar + * `CSD` - Serbian Dinar (2002–2006) - * `TND` - Tunisian Dinar + * `SCR` - Seychellois Rupee - * `TRY` - Turkish Lira + * `SLL` - Sierra Leonean Leone - * `TRL` - Turkish Lira (1922–2005) + * `XAG` - Silver - * `TMT` - Turkmenistani Manat + * `SGD` - Singapore Dollar - * `TMM` - Turkmenistani Manat (1993–2009) + * `SKK` - Slovak Koruna - * `USD` - US Dollar + * `SIT` - Slovenian Tolar - * `USN` - US Dollar (Next day) + * `SBD` - Solomon Islands Dollar - * `USS` - US Dollar (Same day) + * `SOS` - Somali Shilling - * `UGX` - Ugandan Shilling + * `ZAR` - South African Rand - * `UGS` - Ugandan Shilling (1966–1987) + * `ZAL` - South African Rand (financial) - * `UAH` - Ukrainian Hryvnia + * `KRH` - South Korean Hwan (1953–1962) - * `UAK` - Ukrainian Karbovanets + * `KRW` - South Korean Won - * `AED` - United Arab Emirates Dirham + * `KRO` - South Korean Won (1945–1953) - * `UYW` - Uruguayan Nominal Wage Index Unit + * `SSP` - South Sudanese Pound - * `UYU` - Uruguayan Peso + * `SUR` - Soviet Rouble - * `UYP` - Uruguayan Peso (1975–1993) + * `ESP` - Spanish Peseta - * `UYI` - Uruguayan Peso (Indexed Units) + * `ESA` - Spanish Peseta (A account) - * `UZS` - Uzbekistani Som + * `ESB` - Spanish Peseta (convertible account) - * `VUV` - Vanuatu Vatu + * `XDR` - Special Drawing Rights - * `VES` - Venezuelan Bolívar + * `LKR` - Sri Lankan Rupee - * `VEB` - Venezuelan Bolívar (1871–2008) + * `SHP` - St. Helena Pound - * `VEF` - Venezuelan Bolívar (2008–2018) + * `XSU` - Sucre - * `VND` - Vietnamese Dong + * `SDD` - Sudanese Dinar (1992–2007) - * `VNN` - Vietnamese Dong (1978–1985) + * `SDG` - Sudanese Pound - * `CHE` - WIR Euro + * `SDP` - Sudanese Pound (1957–1998) - * `CHW` - WIR Franc + * `SRD` - Surinamese Dollar - * `XOF` - West African CFA Franc + * `SRG` - Surinamese Guilder - * `YDD` - Yemeni Dinar + * `SZL` - Swazi Lilangeni - * `YER` - Yemeni Rial + * `SEK` - Swedish Krona - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `CHF` - Swiss Franc - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `SYP` - Syrian Pound - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `STN` - São Tomé & Príncipe Dobra - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `ZWN` - ZWN + * `TVD` - TVD - * `ZRN` - Zairean New Zaire (1993–1998) + * `TJR` - Tajikistani Ruble - * `ZRZ` - Zairean Zaire (1971–1993) + * `TJS` - Tajikistani Somoni - * `ZMW` - Zambian Kwacha + * `TZS` - Tanzanian Shilling - * `ZMK` - Zambian Kwacha (1968–2012) + * `XTS` - Testing Currency Code - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `THB` - Thai Baht - * `ZWR` - Zimbabwean Dollar (2008) + * `XXX` - The codes assigned for transactions where no currency is + involved - * `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: openapi/openapi.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: openapi/openapi.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: openapi/openapi.yml - CategoryTypeEnum: - enum: - - CLASS - - DEPARTMENT - docs: |- - * `CLASS` - CLASS - * `DEPARTMENT` - DEPARTMENT - source: - openapi: openapi/openapi.yml - ClassificationEnum: - enum: - - ASSET - - EQUITY - - EXPENSE - - LIABILITY - - REVENUE - docs: |- - * `ASSET` - ASSET - * `EQUITY` - EQUITY - * `EXPENSE` - EXPENSE - * `LIABILITY` - LIABILITY - * `REVENUE` - REVENUE - source: - openapi: openapi/openapi.yml - CommonModelScopeApi: - properties: - common_models: - docs: The common models you want to update the scopes for - type: list - source: - openapi: openapi/openapi.yml - CommonModelScopesBodyRequest: - properties: - model_id: - type: string - validation: - minLength: 1 - enabled_actions: list - disabled_fields: list - source: - openapi: openapi/openapi.yml - CompanyInfo: - docs: >- - # The CompanyInfo Object + * `TPE` - Timorese Escudo - ### Description + * `TOP` - Tongan Paʻanga - 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. + * `TTD` - Trinidad & Tobago Dollar + * `TND` - Tunisian Dinar - ### Usage Example + * `TRY` - Turkish Lira - 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: - type: optional - docs: >- - The currency set in the company's accounting platform. + * `TRL` - Turkish Lira (1922–2005) + * `TMT` - Turkmenistani Manat - * `XUA` - ADB Unit of Account + * `TMM` - Turkmenistani Manat (1993–2009) - * `AFN` - Afghan Afghani + * `USD` - US Dollar - * `AFA` - Afghan Afghani (1927–2002) + * `USN` - US Dollar (Next day) - * `ALL` - Albanian Lek + * `USS` - US Dollar (Same day) - * `ALK` - Albanian Lek (1946–1965) + * `UGX` - Ugandan Shilling - * `DZD` - Algerian Dinar + * `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 @@ -6544,14 +6147,29 @@ types: * `ZWR` - Zimbabwean Dollar (2008) * `ZWL` - Zimbabwean Dollar (2009) - remote_created_at: + company: + type: optional + docs: '`Company` object for the given `BalanceSheet` object.' + date: type: optional - docs: When the third party's company was created. - urls: - type: optional>> - docs: The company's urls. - addresses: optional> - phone_numbers: 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: >- @@ -6568,374 +6186,4835 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml - ComponentTypeEnum: - enum: - - SALES - - PURCHASE - docs: |- - * `SALES` - SALES - * `PURCHASE` - PURCHASE - source: - openapi: openapi/openapi.yml - ContactAddressesItem: + openapi: accounting_v3.yml + BankFeedAccountCurrency: discriminated: false - union: - - type: string - validation: - format: uuid - - Address - source: - openapi: openapi/openapi.yml - inline: true - Contact: docs: >- - # The Contact Object + The currency code of the bank feed. - ### 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. + * `XUA` - ADB Unit of Account - * A `Contact` is a Vendor/Supplier if the `is_supplier` property is true. + * `AFN` - Afghan Afghani - * A `Contact` is a customer if the `is_customer` property is true. + * `AFA` - Afghan Afghani (1927–2002) + * `ALL` - Albanian Lek - ### Usage Example + * `ALK` - Albanian Lek (1946–1965) - 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 + * `DZD` - Algerian Dinar - * `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: openapi/openapi.yml - ContactRequestAddressesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Address - source: - openapi: openapi/openapi.yml - inline: true - ContactRequest: - docs: >- - # The Contact Object + * `ADP` - Andorran Peseta - ### Description + * `AOA` - Angolan Kwanza - 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. + * `AOK` - Angolan Kwanza (1977–1991) - * A `Contact` is a Vendor/Supplier if the `is_supplier` property is true. + * `AON` - Angolan New Kwanza (1990–2000) - * A `Contact` is a customer if the `is_customer` property is true. + * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `ARA` - Argentine Austral - ### Usage Example + * `ARS` - Argentine Peso - 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 + * `ARM` - Argentine Peso (1881–1970) - * `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: openapi/openapi.yml - ContactResponse: - properties: - model: Contact - warnings: list - errors: list - logs: optional> - source: - openapi: openapi/openapi.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' + * `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 @@ -7020,280 +11099,18779 @@ types: - 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 + * `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: openapi/openapi.yml - CreditNoteContact: + openapi: accounting_v3.yml + inline: true + ItemRequestRequestSalesTaxRate: discriminated: false - docs: The credit note's contact. + 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: - - type: string - validation: - format: uuid - - Contact + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - CreditNoteCompany: + JournalEntryCompany: discriminated: false - docs: The company the credit note belongs to. + docs: The company the journal entry belongs to. union: - type: string validation: format: uuid - CompanyInfo source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - CreditNoteTrackingCategoriesItem: + JournalEntryTrackingCategoriesItem: discriminated: false union: - type: string @@ -7301,1214 +29879,1409 @@ types: format: uuid - TrackingCategory source: - openapi: openapi/openapi.yml - inline: true - CreditNotePaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - CreditNoteAppliedPaymentsItem: + JournalEntryPostingStatus: discriminated: false + docs: |- + The journal's posting status. + + * `UNPOSTED` - UNPOSTED + * `POSTED` - POSTED union: - - type: string - validation: - format: uuid - - PaymentLineItem + - PostingStatusEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - CreditNoteAccountingPeriod: + JournalEntryAccountingPeriod: discriminated: false - docs: The accounting period that the CreditNote was generated in. + docs: The accounting period that the JournalEntry was generated in. union: - type: string validation: format: uuid - AccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - CreditNote: + JournalEntry: docs: >- - # The CreditNote Object + # 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 - ### Description + * `XBC` - European Unit of Account (XBC) - 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. + * `XBD` - European Unit of Account (XBD) + * `FKP` - Falkland Islands Pound - ### Usage Example + * `FJD` - Fijian Dollar - 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. + * `FIM` - Finnish Markka - * `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. + * `FRF` - French Franc + * `XFO` - French Gold Franc - * `XUA` - ADB Unit of Account + * `XFU` - French UIC-Franc - * `AFN` - Afghan Afghani + * `GMD` - Gambian Dalasi - * `AFA` - Afghan Afghani (1927–2002) + * `GEK` - Georgian Kupon Larit - * `ALL` - Albanian Lek + * `GEL` - Georgian Lari - * `ALK` - Albanian Lek (1946–1965) + * `DEM` - German Mark - * `DZD` - Algerian Dinar + * `GHS` - Ghanaian Cedi - * `ADP` - Andorran Peseta + * `GHC` - Ghanaian Cedi (1979–2007) - * `AOA` - Angolan Kwanza + * `GIP` - Gibraltar Pound - * `AOK` - Angolan Kwanza (1977–1991) + * `XAU` - Gold - * `AON` - Angolan New Kwanza (1990–2000) + * `GRD` - Greek Drachma - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `GTQ` - Guatemalan Quetzal - * `ARA` - Argentine Austral + * `GWP` - Guinea-Bissau Peso - * `ARS` - Argentine Peso + * `GNF` - Guinean Franc - * `ARM` - Argentine Peso (1881–1970) + * `GNS` - Guinean Syli - * `ARP` - Argentine Peso (1983–1985) + * `GYD` - Guyanaese Dollar - * `ARL` - Argentine Peso Ley (1970–1983) + * `HTG` - Haitian Gourde - * `AMD` - Armenian Dram + * `HNL` - Honduran Lempira - * `AWG` - Aruban Florin + * `HKD` - Hong Kong Dollar - * `AUD` - Australian Dollar + * `HUF` - Hungarian Forint - * `ATS` - Austrian Schilling + * `IMP` - IMP - * `AZN` - Azerbaijani Manat + * `ISK` - Icelandic Króna - * `AZM` - Azerbaijani Manat (1993–2006) + * `ISJ` - Icelandic Króna (1918–1981) - * `BSD` - Bahamian Dollar + * `INR` - Indian Rupee - * `BHD` - Bahraini Dinar + * `IDR` - Indonesian Rupiah - * `BDT` - Bangladeshi Taka + * `IRR` - Iranian Rial - * `BBD` - Barbadian Dollar + * `IQD` - Iraqi Dinar - * `BYN` - Belarusian Ruble + * `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. - * `BYB` - Belarusian Ruble (1994–1999) + * `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. - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc + * `XUA` - ADB Unit of Account - * `BEC` - Belgian Franc (convertible) + * `AFN` - Afghan Afghani - * `BEL` - Belgian Franc (financial) + * `AFA` - Afghan Afghani (1927–2002) - * `BZD` - Belize Dollar + * `ALL` - Albanian Lek - * `BMD` - Bermudan Dollar + * `ALK` - Albanian Lek (1946–1965) - * `BTN` - Bhutanese Ngultrum + * `DZD` - Algerian Dinar - * `BOB` - Bolivian Boliviano + * `ADP` - Andorran Peseta - * `BOL` - Bolivian Boliviano (1863–1963) + * `AOA` - Angolan Kwanza - * `BOV` - Bolivian Mvdol + * `AOK` - Angolan Kwanza (1977–1991) - * `BOP` - Bolivian Peso + * `AON` - Angolan New Kwanza (1990–2000) - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `ARA` - Argentine Austral - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `ARS` - Argentine Peso - * `BWP` - Botswanan Pula + * `ARM` - Argentine Peso (1881–1970) - * `BRC` - Brazilian Cruzado (1986–1989) + * `ARP` - Argentine Peso (1983–1985) - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `ARL` - Argentine Peso Ley (1970–1983) - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `AMD` - Armenian Dram - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `AWG` - Aruban Florin - * `BRN` - Brazilian New Cruzado (1989–1990) + * `AUD` - Australian Dollar - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `ATS` - Austrian Schilling - * `BRL` - Brazilian Real + * `AZN` - Azerbaijani Manat - * `GBP` - British Pound + * `AZM` - Azerbaijani Manat (1993–2006) - * `BND` - Brunei Dollar + * `BSD` - Bahamian Dollar - * `BGL` - Bulgarian Hard Lev + * `BHD` - Bahraini Dinar - * `BGN` - Bulgarian Lev + * `BDT` - Bangladeshi Taka - * `BGO` - Bulgarian Lev (1879–1952) + * `BBD` - Barbadian Dollar - * `BGM` - Bulgarian Socialist Lev + * `BYN` - Belarusian Ruble - * `BUK` - Burmese Kyat + * `BYB` - Belarusian Ruble (1994–1999) - * `BIF` - Burundian Franc + * `BYR` - Belarusian Ruble (2000–2016) - * `XPF` - CFP Franc + * `BEF` - Belgian Franc - * `KHR` - Cambodian Riel + * `BEC` - Belgian Franc (convertible) - * `CAD` - Canadian Dollar + * `BEL` - Belgian Franc (financial) - * `CVE` - Cape Verdean Escudo + * `BZD` - Belize Dollar - * `KYD` - Cayman Islands Dollar + * `BMD` - Bermudan Dollar - * `XAF` - Central African CFA Franc + * `BTN` - Bhutanese Ngultrum - * `CLE` - Chilean Escudo + * `BOB` - Bolivian Boliviano - * `CLP` - Chilean Peso + * `BOL` - Bolivian Boliviano (1863–1963) - * `CLF` - Chilean Unit of Account (UF) + * `BOV` - Bolivian Mvdol - * `CNX` - Chinese People’s Bank Dollar + * `BOP` - Bolivian Peso - * `CNY` - Chinese Yuan + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `CNH` - Chinese Yuan (offshore) + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `COP` - Colombian Peso + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `COU` - Colombian Real Value Unit + * `BWP` - Botswanan Pula - * `KMF` - Comorian Franc + * `BRC` - Brazilian Cruzado (1986–1989) - * `CDF` - Congolese Franc + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `CRC` - Costa Rican Colón + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `HRD` - Croatian Dinar + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `HRK` - Croatian Kuna + * `BRN` - Brazilian New Cruzado (1989–1990) - * `CUC` - Cuban Convertible Peso + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `CUP` - Cuban Peso + * `BRL` - Brazilian Real - * `CYP` - Cypriot Pound + * `GBP` - British Pound - * `CZK` - Czech Koruna + * `BND` - Brunei Dollar - * `CSK` - Czechoslovak Hard Koruna + * `BGL` - Bulgarian Hard Lev - * `DKK` - Danish Krone + * `BGN` - Bulgarian Lev - * `DJF` - Djiboutian Franc + * `BGO` - Bulgarian Lev (1879–1952) - * `DOP` - Dominican Peso + * `BGM` - Bulgarian Socialist Lev - * `NLG` - Dutch Guilder + * `BUK` - Burmese Kyat - * `XCD` - East Caribbean Dollar + * `BIF` - Burundian Franc - * `DDM` - East German Mark + * `XPF` - CFP Franc - * `ECS` - Ecuadorian Sucre + * `KHR` - Cambodian Riel - * `ECV` - Ecuadorian Unit of Constant Value + * `CAD` - Canadian Dollar - * `EGP` - Egyptian Pound + * `CVE` - Cape Verdean Escudo - * `GQE` - Equatorial Guinean Ekwele + * `KYD` - Cayman Islands Dollar - * `ERN` - Eritrean Nakfa + * `XAF` - Central African CFA Franc - * `EEK` - Estonian Kroon + * `CLE` - Chilean Escudo - * `ETB` - Ethiopian Birr + * `CLP` - Chilean Peso - * `EUR` - Euro + * `CLF` - Chilean Unit of Account (UF) - * `XBA` - European Composite Unit + * `CNX` - Chinese People’s Bank Dollar - * `XEU` - European Currency Unit + * `CNY` - Chinese Yuan - * `XBB` - European Monetary Unit + * `CNH` - Chinese Yuan (offshore) - * `XBC` - European Unit of Account (XBC) + * `COP` - Colombian Peso - * `XBD` - European Unit of Account (XBD) + * `COU` - Colombian Real Value Unit - * `FKP` - Falkland Islands Pound + * `KMF` - Comorian Franc - * `FJD` - Fijian Dollar + * `CDF` - Congolese Franc - * `FIM` - Finnish Markka + * `CRC` - Costa Rican Colón - * `FRF` - French Franc + * `HRD` - Croatian Dinar - * `XFO` - French Gold Franc + * `HRK` - Croatian Kuna - * `XFU` - French UIC-Franc + * `CUC` - Cuban Convertible Peso - * `GMD` - Gambian Dalasi + * `CUP` - Cuban Peso - * `GEK` - Georgian Kupon Larit + * `CYP` - Cypriot Pound - * `GEL` - Georgian Lari + * `CZK` - Czech Koruna - * `DEM` - German Mark + * `CSK` - Czechoslovak Hard Koruna - * `GHS` - Ghanaian Cedi + * `DKK` - Danish Krone - * `GHC` - Ghanaian Cedi (1979–2007) + * `DJF` - Djiboutian Franc - * `GIP` - Gibraltar Pound + * `DOP` - Dominican Peso - * `XAU` - Gold + * `NLG` - Dutch Guilder - * `GRD` - Greek Drachma + * `XCD` - East Caribbean Dollar - * `GTQ` - Guatemalan Quetzal + * `DDM` - East German Mark - * `GWP` - Guinea-Bissau Peso + * `ECS` - Ecuadorian Sucre - * `GNF` - Guinean Franc + * `ECV` - Ecuadorian Unit of Constant Value - * `GNS` - Guinean Syli + * `EGP` - Egyptian Pound - * `GYD` - Guyanaese Dollar + * `GQE` - Equatorial Guinean Ekwele - * `HTG` - Haitian Gourde + * `ERN` - Eritrean Nakfa - * `HNL` - Honduran Lempira + * `EEK` - Estonian Kroon - * `HKD` - Hong Kong Dollar + * `ETB` - Ethiopian Birr - * `HUF` - Hungarian Forint + * `EUR` - Euro - * `IMP` - IMP + * `XBA` - European Composite Unit - * `ISK` - Icelandic Króna + * `XEU` - European Currency Unit - * `ISJ` - Icelandic Króna (1918–1981) + * `XBB` - European Monetary Unit - * `INR` - Indian Rupee + * `XBC` - European Unit of Account (XBC) - * `IDR` - Indonesian Rupiah + * `XBD` - European Unit of Account (XBD) - * `IRR` - Iranian Rial + * `FKP` - Falkland Islands Pound - * `IQD` - Iraqi Dinar + * `FJD` - Fijian Dollar - * `IEP` - Irish Pound + * `FIM` - Finnish Markka - * `ILS` - Israeli New Shekel + * `FRF` - French Franc - * `ILP` - Israeli Pound + * `XFO` - French Gold Franc - * `ILR` - Israeli Shekel (1980–1985) + * `XFU` - French UIC-Franc - * `ITL` - Italian Lira + * `GMD` - Gambian Dalasi - * `JMD` - Jamaican Dollar + * `GEK` - Georgian Kupon Larit - * `JPY` - Japanese Yen + * `GEL` - Georgian Lari - * `JOD` - Jordanian Dinar + * `DEM` - German Mark - * `KZT` - Kazakhstani Tenge + * `GHS` - Ghanaian Cedi - * `KES` - Kenyan Shilling + * `GHC` - Ghanaian Cedi (1979–2007) - * `KWD` - Kuwaiti Dinar + * `GIP` - Gibraltar Pound - * `KGS` - Kyrgystani Som + * `XAU` - Gold - * `LAK` - Laotian Kip + * `GRD` - Greek Drachma - * `LVL` - Latvian Lats + * `GTQ` - Guatemalan Quetzal - * `LVR` - Latvian Ruble + * `GWP` - Guinea-Bissau Peso - * `LBP` - Lebanese Pound + * `GNF` - Guinean Franc - * `LSL` - Lesotho Loti + * `GNS` - Guinean Syli - * `LRD` - Liberian Dollar + * `GYD` - Guyanaese Dollar - * `LYD` - Libyan Dinar + * `HTG` - Haitian Gourde - * `LTL` - Lithuanian Litas + * `HNL` - Honduran Lempira - * `LTT` - Lithuanian Talonas + * `HKD` - Hong Kong Dollar - * `LUL` - Luxembourg Financial Franc + * `HUF` - Hungarian Forint - * `LUC` - Luxembourgian Convertible Franc + * `IMP` - IMP - * `LUF` - Luxembourgian Franc + * `ISK` - Icelandic Króna - * `MOP` - Macanese Pataca + * `ISJ` - Icelandic Króna (1918–1981) - * `MKD` - Macedonian Denar + * `INR` - Indian Rupee - * `MKN` - Macedonian Denar (1992–1993) + * `IDR` - Indonesian Rupiah - * `MGA` - Malagasy Ariary + * `IRR` - Iranian Rial - * `MGF` - Malagasy Franc + * `IQD` - Iraqi Dinar - * `MWK` - Malawian Kwacha + * `IEP` - Irish Pound - * `MYR` - Malaysian Ringgit + * `ILS` - Israeli New Shekel - * `MVR` - Maldivian Rufiyaa + * `ILP` - Israeli Pound - * `MVP` - Maldivian Rupee (1947–1981) + * `ILR` - Israeli Shekel (1980–1985) - * `MLF` - Malian Franc + * `ITL` - Italian Lira - * `MTL` - Maltese Lira + * `JMD` - Jamaican Dollar - * `MTP` - Maltese Pound + * `JPY` - Japanese Yen - * `MRU` - Mauritanian Ouguiya + * `JOD` - Jordanian Dinar - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `KZT` - Kazakhstani Tenge - * `MUR` - Mauritian Rupee + * `KES` - Kenyan Shilling - * `MXV` - Mexican Investment Unit + * `KWD` - Kuwaiti Dinar - * `MXN` - Mexican Peso + * `KGS` - Kyrgystani Som - * `MXP` - Mexican Silver Peso (1861–1992) + * `LAK` - Laotian Kip - * `MDC` - Moldovan Cupon + * `LVL` - Latvian Lats - * `MDL` - Moldovan Leu + * `LVR` - Latvian Ruble - * `MCF` - Monegasque Franc + * `LBP` - Lebanese Pound - * `MNT` - Mongolian Tugrik + * `LSL` - Lesotho Loti - * `MAD` - Moroccan Dirham + * `LRD` - Liberian Dollar - * `MAF` - Moroccan Franc + * `LYD` - Libyan Dinar - * `MZE` - Mozambican Escudo + * `LTL` - Lithuanian Litas - * `MZN` - Mozambican Metical + * `LTT` - Lithuanian Talonas - * `MZM` - Mozambican Metical (1980–2006) + * `LUL` - Luxembourg Financial Franc - * `MMK` - Myanmar Kyat + * `LUC` - Luxembourgian Convertible Franc - * `NAD` - Namibian Dollar + * `LUF` - Luxembourgian Franc - * `NPR` - Nepalese Rupee + * `MOP` - Macanese Pataca - * `ANG` - Netherlands Antillean Guilder + * `MKD` - Macedonian Denar - * `TWD` - New Taiwan Dollar + * `MKN` - Macedonian Denar (1992–1993) - * `NZD` - New Zealand Dollar + * `MGA` - Malagasy Ariary - * `NIO` - Nicaraguan Córdoba + * `MGF` - Malagasy Franc - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `MWK` - Malawian Kwacha - * `NGN` - Nigerian Naira + * `MYR` - Malaysian Ringgit - * `KPW` - North Korean Won + * `MVR` - Maldivian Rufiyaa - * `NOK` - Norwegian Krone + * `MVP` - Maldivian Rupee (1947–1981) - * `OMR` - Omani Rial + * `MLF` - Malian Franc - * `PKR` - Pakistani Rupee + * `MTL` - Maltese Lira - * `XPD` - Palladium + * `MTP` - Maltese Pound - * `PAB` - Panamanian Balboa + * `MRU` - Mauritanian Ouguiya - * `PGK` - Papua New Guinean Kina + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `PYG` - Paraguayan Guarani + * `MUR` - Mauritian Rupee - * `PEI` - Peruvian Inti + * `MXV` - Mexican Investment Unit - * `PEN` - Peruvian Sol + * `MXN` - Mexican Peso - * `PES` - Peruvian Sol (1863–1965) + * `MXP` - Mexican Silver Peso (1861–1992) - * `PHP` - Philippine Peso + * `MDC` - Moldovan Cupon - * `XPT` - Platinum + * `MDL` - Moldovan Leu - * `PLN` - Polish Zloty + * `MCF` - Monegasque Franc - * `PLZ` - Polish Zloty (1950–1995) + * `MNT` - Mongolian Tugrik - * `PTE` - Portuguese Escudo + * `MAD` - Moroccan Dirham - * `GWE` - Portuguese Guinea Escudo + * `MAF` - Moroccan Franc - * `QAR` - Qatari Rial + * `MZE` - Mozambican Escudo - * `XRE` - RINET Funds + * `MZN` - Mozambican Metical - * `RHD` - Rhodesian Dollar + * `MZM` - Mozambican Metical (1980–2006) - * `RON` - Romanian Leu + * `MMK` - Myanmar Kyat - * `ROL` - Romanian Leu (1952–2006) + * `NAD` - Namibian Dollar - * `RUB` - Russian Ruble + * `NPR` - Nepalese Rupee - * `RUR` - Russian Ruble (1991–1998) + * `ANG` - Netherlands Antillean Guilder - * `RWF` - Rwandan Franc + * `TWD` - New Taiwan Dollar - * `SVC` - Salvadoran Colón + * `NZD` - New Zealand Dollar - * `WST` - Samoan Tala + * `NIO` - Nicaraguan Córdoba - * `SAR` - Saudi Riyal + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `RSD` - Serbian Dinar + * `NGN` - Nigerian Naira - * `CSD` - Serbian Dinar (2002–2006) + * `KPW` - North Korean Won - * `SCR` - Seychellois Rupee + * `NOK` - Norwegian Krone - * `SLL` - Sierra Leonean Leone + * `OMR` - Omani Rial - * `XAG` - Silver + * `PKR` - Pakistani Rupee - * `SGD` - Singapore Dollar + * `XPD` - Palladium - * `SKK` - Slovak Koruna + * `PAB` - Panamanian Balboa - * `SIT` - Slovenian Tolar + * `PGK` - Papua New Guinean Kina - * `SBD` - Solomon Islands Dollar + * `PYG` - Paraguayan Guarani - * `SOS` - Somali Shilling + * `PEI` - Peruvian Inti - * `ZAR` - South African Rand + * `PEN` - Peruvian Sol - * `ZAL` - South African Rand (financial) + * `PES` - Peruvian Sol (1863–1965) - * `KRH` - South Korean Hwan (1953–1962) + * `PHP` - Philippine Peso - * `KRW` - South Korean Won + * `XPT` - Platinum - * `KRO` - South Korean Won (1945–1953) + * `PLN` - Polish Zloty - * `SSP` - South Sudanese Pound + * `PLZ` - Polish Zloty (1950–1995) - * `SUR` - Soviet Rouble + * `PTE` - Portuguese Escudo - * `ESP` - Spanish Peseta + * `GWE` - Portuguese Guinea Escudo - * `ESA` - Spanish Peseta (A account) + * `QAR` - Qatari Rial - * `ESB` - Spanish Peseta (convertible account) + * `XRE` - RINET Funds - * `XDR` - Special Drawing Rights + * `RHD` - Rhodesian Dollar - * `LKR` - Sri Lankan Rupee + * `RON` - Romanian Leu - * `SHP` - St. Helena Pound + * `ROL` - Romanian Leu (1952–2006) - * `XSU` - Sucre + * `RUB` - Russian Ruble - * `SDD` - Sudanese Dinar (1992–2007) + * `RUR` - Russian Ruble (1991–1998) - * `SDG` - Sudanese Pound + * `RWF` - Rwandan Franc - * `SDP` - Sudanese Pound (1957–1998) + * `SVC` - Salvadoran Colón - * `SRD` - Surinamese Dollar + * `WST` - Samoan Tala - * `SRG` - Surinamese Guilder + * `SAR` - Saudi Riyal - * `SZL` - Swazi Lilangeni + * `RSD` - Serbian Dinar - * `SEK` - Swedish Krona + * `CSD` - Serbian Dinar (2002–2006) - * `CHF` - Swiss Franc + * `SCR` - Seychellois Rupee - * `SYP` - Syrian Pound + * `SLL` - Sierra Leonean Leone - * `STN` - São Tomé & Príncipe Dobra + * `XAG` - Silver - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `SGD` - Singapore Dollar - * `TVD` - TVD + * `SKK` - Slovak Koruna - * `TJR` - Tajikistani Ruble + * `SIT` - Slovenian Tolar - * `TJS` - Tajikistani Somoni + * `SBD` - Solomon Islands Dollar - * `TZS` - Tanzanian Shilling + * `SOS` - Somali Shilling - * `XTS` - Testing Currency Code + * `ZAR` - South African Rand - * `THB` - Thai Baht + * `ZAL` - South African Rand (financial) - * `XXX` - The codes assigned for transactions where no currency is - involved + * `KRH` - South Korean Hwan (1953–1962) - * `TPE` - Timorese Escudo + * `KRW` - South Korean Won - * `TOP` - Tongan Paʻanga + * `KRO` - South Korean Won (1945–1953) - * `TTD` - Trinidad & Tobago Dollar + * `SSP` - South Sudanese Pound - * `TND` - Tunisian Dinar + * `SUR` - Soviet Rouble - * `TRY` - Turkish Lira + * `ESP` - Spanish Peseta - * `TRL` - Turkish Lira (1922–2005) + * `ESA` - Spanish Peseta (A account) - * `TMT` - Turkmenistani Manat + * `ESB` - Spanish Peseta (convertible account) - * `TMM` - Turkmenistani Manat (1993–2009) + * `XDR` - Special Drawing Rights - * `USD` - US Dollar + * `LKR` - Sri Lankan Rupee - * `USN` - US Dollar (Next day) + * `SHP` - St. Helena Pound - * `USS` - US Dollar (Same day) + * `XSU` - Sucre - * `UGX` - Ugandan Shilling + * `SDD` - Sudanese Dinar (1992–2007) - * `UGS` - Ugandan Shilling (1966–1987) + * `SDG` - Sudanese Pound - * `UAH` - Ukrainian Hryvnia + * `SDP` - Sudanese Pound (1957–1998) - * `UAK` - Ukrainian Karbovanets + * `SRD` - Surinamese Dollar - * `AED` - United Arab Emirates Dirham + * `SRG` - Surinamese Guilder - * `UYW` - Uruguayan Nominal Wage Index Unit + * `SZL` - Swazi Lilangeni - * `UYU` - Uruguayan Peso + * `SEK` - Swedish Krona - * `UYP` - Uruguayan Peso (1975–1993) + * `CHF` - Swiss Franc - * `UYI` - Uruguayan Peso (Indexed Units) + * `SYP` - Syrian Pound - * `UZS` - Uzbekistani Som + * `STN` - São Tomé & Príncipe Dobra - * `VUV` - Vanuatu Vatu + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `VES` - Venezuelan Bolívar + * `TVD` - TVD - * `VEB` - Venezuelan Bolívar (1871–2008) + * `TJR` - Tajikistani Ruble - * `VEF` - Venezuelan Bolívar (2008–2018) + * `TJS` - Tajikistani Somoni - * `VND` - Vietnamese Dong + * `TZS` - Tanzanian Shilling - * `VNN` - Vietnamese Dong (1978–1985) + * `XTS` - Testing Currency Code - * `CHE` - WIR Euro + * `THB` - Thai Baht - * `CHW` - WIR Franc + * `XXX` - The codes assigned for transactions where no currency is + involved - * `XOF` - West African CFA Franc + * `TPE` - Timorese Escudo - * `YDD` - Yemeni Dinar + * `TOP` - Tongan Paʻanga - * `YER` - Yemeni Rial + * `TTD` - Trinidad & Tobago Dollar - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `TND` - Tunisian Dinar - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `TRY` - Turkish Lira - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `TRL` - Turkish Lira (1922–2005) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `TMT` - Turkmenistani Manat - * `ZWN` - ZWN + * `TMM` - Turkmenistani Manat (1993–2009) - * `ZRN` - Zairean New Zaire (1993–1998) + * `USD` - US Dollar - * `ZRZ` - Zairean Zaire (1971–1993) + * `USN` - US Dollar (Next day) - * `ZMW` - Zambian Kwacha + * `USS` - US Dollar (Same day) - * `ZMK` - Zambian Kwacha (1968–2012) + * `UGX` - Ugandan Shilling - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `UGS` - Ugandan Shilling (1966–1987) - * `ZWR` - Zimbabwean Dollar (2008) + * `UAH` - Ukrainian Hryvnia - * `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: openapi/openapi.yml - CreditNoteApplyLineForCreditNoteInvoice: - discriminated: false - union: - - type: string - validation: - format: uuid - - Invoice - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteApplyLineForCreditNote: - docs: >- - # The CreditNoteApplyLine Object + * `UAK` - Ukrainian Karbovanets - ### Description + * `AED` - United Arab Emirates Dirham - The `CreditNoteApplyLine` is attached to the CreditNote model. + * `UYW` - Uruguayan Nominal Wage Index Unit + * `UYU` - Uruguayan Peso - ### Usage Example + * `UYP` - Uruguayan Peso (1975–1993) - 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: openapi/openapi.yml - CreditNoteApplyLineForCreditNoteRequestInvoice: - discriminated: false - union: - - type: string - validation: - format: uuid - - Invoice - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteApplyLineForCreditNoteRequest: - docs: >- - # The CreditNoteApplyLine Object + * `UYI` - Uruguayan Peso (Indexed Units) - ### Description + * `UZS` - Uzbekistani Som - The `CreditNoteApplyLine` is attached to the CreditNote model. + * `VUV` - Vanuatu Vatu + * `VES` - Venezuelan Bolívar - ### Usage Example + * `VEB` - Venezuelan Bolívar (1871–2008) - 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: openapi/openapi.yml - CreditNoteApplyLineForInvoiceCreditNote: - discriminated: false - union: - - type: string - validation: - format: uuid - - CreditNote - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteApplyLineForInvoice: - docs: >- - # The CreditNoteApplyLine Object + * `VEF` - Venezuelan Bolívar (2008–2018) - ### Description + * `VND` - Vietnamese Dong - The `CreditNoteApplyLine` is attached to the CreditNote model. + * `VNN` - Vietnamese Dong (1978–1985) + * `CHE` - WIR Euro - ### Usage Example + * `CHW` - WIR Franc - 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: openapi/openapi.yml - CreditNoteLineItemItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteLineItemCompany: - discriminated: false - docs: The company the credit note belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteLineItemContact: - discriminated: false - docs: The credit note's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteLineItemProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteLineItem: - docs: >- - # The CreditNoteLineItem Object + * `XOF` - West African CFA Franc - ### Description + * `YDD` - Yemeni Dinar - The `CreditNoteLineItem` object is used to represent a credit note's line - items. + * `YER` - Yemeni Rial + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - ### Usage Example + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - 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: openapi/openapi.yml - CreditNoteLineItemRequestItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteLineItemRequestCompany: - discriminated: false - docs: The company the credit note belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteLineItemRequestContact: - discriminated: false - docs: The credit note's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteLineItemRequestProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteLineItemRequest: - docs: >- - # The CreditNoteLineItem Object + * `YUM` - Yugoslavian New Dinar (1994–2002) - ### Description + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - The `CreditNoteLineItem` object is used to represent a credit note's line - items. + * `ZWN` - ZWN + * `ZRN` - Zairean New Zaire (1993–1998) - ### Usage Example + * `ZRZ` - Zairean Zaire (1971–1993) - 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: openapi/openapi.yml - CreditNoteRequestContact: - discriminated: false - docs: The credit note's contact. + * `ZMW` - Zambian Kwacha + + * `ZMK` - Zambian Kwacha (1968–2012) + + * `ZWD` - Zimbabwean Dollar (1980–2008) + + * `ZWR` - Zimbabwean Dollar (2008) + + * `ZWL` - Zimbabwean Dollar (2009) union: - - type: string - validation: - format: uuid - - Contact + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - CreditNoteRequestCompany: + JournalEntryRequestCompany: discriminated: false - docs: The company the credit note belongs to. + docs: The company the journal entry belongs to. union: - type: string validation: format: uuid - CompanyInfo source: - openapi: openapi/openapi.yml - inline: true - CreditNoteRequestLineItemsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - CreditNoteLineItemRequest - source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - CreditNoteRequestTrackingCategoriesItem: + JournalEntryRequestTrackingCategoriesItem: discriminated: false union: - type: string @@ -8516,102 +31289,50 @@ types: format: uuid - TrackingCategory source: - openapi: openapi/openapi.yml - inline: true - CreditNoteRequestPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: openapi/openapi.yml - inline: true - CreditNoteRequestAppliedPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItem - source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - CreditNoteRequestAccountingPeriod: + JournalEntryRequestPostingStatus: discriminated: false - docs: The accounting period that the CreditNote was generated in. + docs: |- + The journal's posting status. + + * `UNPOSTED` - UNPOSTED + * `POSTED` - POSTED union: - - type: string - validation: - format: uuid - - AccountingPeriod + - PostingStatusEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - CreditNoteRequest: + JournalEntryRequest: docs: >- - # The CreditNote Object + # The JournalEntry 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. + 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 `LIST CreditNotes` endpoint and view a company's credit - notes. + Fetch from the `GET JournalEntry` endpoint and view a company's journey + entry. 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: + docs: The journal entry's transaction date. + payments: + type: optional>> + docs: Array of `Payment` object IDs. + memo: 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>> + docs: The journal entry's private note. currency: - type: optional + type: optional docs: >- - The credit note's currency. + The journal's currency. * `XUA` - ADB Unit of Account @@ -9112,555 +31833,177 @@ types: * `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: openapi/openapi.yml - CreditNoteResponse: - properties: - model: CreditNote - warnings: list - errors: list - logs: optional> - source: - openapi: openapi/openapi.yml - CreditNoteStatusEnum: - enum: - - SUBMITTED - - AUTHORIZED - - PAID - docs: |- - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `PAID` - PAID - source: - openapi: openapi/openapi.yml - CreditOrDebitEnum: - enum: - - CREDIT - - DEBIT - docs: |- - * `CREDIT` - CREDIT - * `DEBIT` - DEBIT - source: - openapi: openapi/openapi.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: openapi/openapi.yml - DebugModeLog: - properties: - log_id: string - dashboard_view: string - log_summary: DebugModelLogSummary - source: - openapi: openapi/openapi.yml - DebugModelLogSummary: - properties: - url: string - method: string - status_code: integer - source: - openapi: openapi/openapi.yml - EmployeeCompany: - discriminated: false - docs: The subsidiary that the employee belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.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: Status895Enum - 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: openapi/openapi.yml - EnabledActionsEnum: - enum: - - READ - - WRITE - docs: |- - * `READ` - READ - * `WRITE` - WRITE - source: - openapi: openapi/openapi.yml - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - docs: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - source: - openapi: openapi/openapi.yml - ErrorValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: openapi/openapi.yml - EventTypeEnum: - enum: - - CREATED_REMOTE_PRODUCTION_API_KEY - - DELETED_REMOTE_PRODUCTION_API_KEY - - CREATED_TEST_API_KEY - - DELETED_TEST_API_KEY - - REGENERATED_PRODUCTION_API_KEY - - REGENERATED_WEBHOOK_SIGNATURE - - INVITED_USER - - TWO_FACTOR_AUTH_ENABLED - - TWO_FACTOR_AUTH_DISABLED - - DELETED_LINKED_ACCOUNT - - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - - CREATED_DESTINATION - - DELETED_DESTINATION - - CHANGED_DESTINATION - - CHANGED_SCOPES - - CHANGED_PERSONAL_INFORMATION - - CHANGED_ORGANIZATION_SETTINGS - - ENABLED_INTEGRATION - - DISABLED_INTEGRATION - - ENABLED_CATEGORY - - DISABLED_CATEGORY - - CHANGED_PASSWORD - - RESET_PASSWORD - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - - FORCED_LINKED_ACCOUNT_RESYNC - - MUTED_ISSUE - - GENERATED_MAGIC_LINK - - ENABLED_MERGE_WEBHOOK - - DISABLED_MERGE_WEBHOOK - - MERGE_WEBHOOK_TARGET_CHANGED - - END_USER_CREDENTIALS_ACCESSED - docs: >- - * `CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY - - * `DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY + * `SZL` - Swazi Lilangeni - * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY + * `SEK` - Swedish Krona - * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY + * `CHF` - Swiss Franc - * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY + * `SYP` - Syrian Pound - * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE + * `STN` - São Tomé & Príncipe Dobra - * `INVITED_USER` - INVITED_USER + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED + * `TVD` - TVD - * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED + * `TJR` - Tajikistani Ruble - * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT + * `TJS` - Tajikistani Somoni - * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT + * `TZS` - Tanzanian Shilling - * `CREATED_DESTINATION` - CREATED_DESTINATION + * `XTS` - Testing Currency Code - * `DELETED_DESTINATION` - DELETED_DESTINATION + * `THB` - Thai Baht - * `CHANGED_DESTINATION` - CHANGED_DESTINATION + * `XXX` - The codes assigned for transactions where no currency is + involved - * `CHANGED_SCOPES` - CHANGED_SCOPES + * `TPE` - Timorese Escudo - * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION + * `TOP` - Tongan Paʻanga - * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS + * `TTD` - Trinidad & Tobago Dollar - * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION + * `TND` - Tunisian Dinar - * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION + * `TRY` - Turkish Lira - * `ENABLED_CATEGORY` - ENABLED_CATEGORY + * `TRL` - Turkish Lira (1922–2005) - * `DISABLED_CATEGORY` - DISABLED_CATEGORY + * `TMT` - Turkmenistani Manat - * `CHANGED_PASSWORD` - CHANGED_PASSWORD + * `TMM` - Turkmenistani Manat (1993–2009) - * `RESET_PASSWORD` - RESET_PASSWORD + * `USD` - US Dollar - * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `USN` - US Dollar (Next day) - * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `USS` - US Dollar (Same day) - * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `UGX` - Ugandan Shilling - * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `UGS` - Ugandan Shilling (1966–1987) - * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING + * `UAH` - Ukrainian Hryvnia - * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING + * `UAK` - Ukrainian Karbovanets - * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + * `AED` - United Arab Emirates Dirham - * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + * `UYW` - Uruguayan Nominal Wage Index Unit - * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING + * `UYU` - Uruguayan Peso - * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING + * `UYP` - Uruguayan Peso (1975–1993) - * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `UYI` - Uruguayan Peso (Indexed Units) - * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `UZS` - Uzbekistani Som - * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `VUV` - Vanuatu Vatu - * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC + * `VES` - Venezuelan Bolívar - * `MUTED_ISSUE` - MUTED_ISSUE + * `VEB` - Venezuelan Bolívar (1871–2008) - * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + * `VEF` - Venezuelan Bolívar (2008–2018) - * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + * `VND` - Vietnamese Dong - * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + * `VNN` - Vietnamese Dong (1978–1985) - * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED + * `CHE` - WIR Euro - * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED - source: - openapi: openapi/openapi.yml - ExpenseAccount: - discriminated: false - docs: The expense's payment account. - union: - - type: string + * `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: - format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - ExpenseContact: - discriminated: false - docs: The expense's contact. - union: - - type: string + 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: - format: uuid - - Contact + 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: openapi/openapi.yml - inline: true - ExpenseCompany: - discriminated: false - docs: The company the expense belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo + openapi: accounting_v3.yml + JournalEntryResponse: + properties: + model: JournalEntry + warnings: list + errors: list + logs: optional> source: - openapi: openapi/openapi.yml - inline: true - ExpenseEmployee: + openapi: accounting_v3.yml + JournalLineAccount: discriminated: false - docs: The employee this overall transaction relates to. union: - type: string validation: format: uuid - - Employee + - Account source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ExpenseTrackingCategoriesItem: + JournalLineTrackingCategory: discriminated: false union: - type: string @@ -9668,805 +32011,643 @@ types: format: uuid - TrackingCategory source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ExpenseAccountingPeriod: + JournalLineTrackingCategoriesItem: discriminated: false - docs: The accounting period that the Expense was generated in. union: - type: string validation: format: uuid - - AccountingPeriod + - TrackingCategory source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - Expense: + JournalLineCurrency: + discriminated: false 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. + The journal line item's currency. - * `XUA` - ADB Unit of Account + * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani + * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) + * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek + * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) + * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar + * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta + * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza + * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) + * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) + * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral + * `ARA` - Argentine Austral - * `ARS` - Argentine Peso + * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) + * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) + * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) + * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram + * `AMD` - Armenian Dram - * `AWG` - Aruban Florin + * `AWG` - Aruban Florin - * `AUD` - Australian Dollar + * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling + * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat + * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) + * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar + * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar + * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka + * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar + * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble + * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) + * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) + * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc + * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) + * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) + * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar + * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar + * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum + * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano + * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) + * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol + * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso + * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula + * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) + * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real + * `BRL` - Brazilian Real - * `GBP` - British Pound + * `GBP` - British Pound - * `BND` - Brunei Dollar + * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev + * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev + * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) + * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev + * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat + * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc + * `BIF` - Burundian Franc - * `XPF` - CFP Franc + * `XPF` - CFP Franc - * `KHR` - Cambodian Riel + * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar + * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo + * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar + * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc + * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo + * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso + * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) + * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar + * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan + * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) + * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso + * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit + * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc + * `KMF` - Comorian Franc - * `CDF` - Congolese Franc + * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón + * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar + * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna + * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso + * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso + * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound + * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna + * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna + * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone + * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc + * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso + * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder + * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar + * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark + * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre + * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value + * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound + * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele + * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa + * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon + * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr + * `ETB` - Ethiopian Birr - * `EUR` - Euro + * `EUR` - Euro - * `XBA` - European Composite Unit + * `XBA` - European Composite Unit - * `XEU` - European Currency Unit + * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit + * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) + * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) + * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound + * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar + * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka + * `FIM` - Finnish Markka - * `FRF` - French Franc + * `FRF` - French Franc - * `XFO` - French Gold Franc + * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc + * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi + * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit + * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari + * `GEL` - Georgian Lari - * `DEM` - German Mark + * `DEM` - German Mark - * `GHS` - Ghanaian Cedi + * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) + * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound + * `GIP` - Gibraltar Pound - * `XAU` - Gold + * `XAU` - Gold - * `GRD` - Greek Drachma + * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal + * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso + * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc + * `GNF` - Guinean Franc - * `GNS` - Guinean Syli + * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar + * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde + * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira + * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar + * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint + * `HUF` - Hungarian Forint - * `IMP` - IMP + * `IMP` - IMP - * `ISK` - Icelandic Króna + * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) + * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee + * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah + * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial + * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar + * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound + * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel + * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound + * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) + * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira + * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar + * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen + * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar + * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge + * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling + * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar + * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som + * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip + * `LAK` - Laotian Kip - * `LVL` - Latvian Lats + * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble + * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound + * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti + * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar + * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar + * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas + * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas + * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc + * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc + * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc + * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca + * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar + * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) + * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary + * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc + * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha + * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit + * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa + * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) + * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc + * `MLF` - Malian Franc - * `MTL` - Maltese Lira + * `MTL` - Maltese Lira - * `MTP` - Maltese Pound + * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya + * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee + * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit + * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso + * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) + * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon + * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu + * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc + * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik + * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham + * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc + * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo + * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical + * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) + * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat + * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar + * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee + * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder + * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar + * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar + * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba + * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira + * `NGN` - Nigerian Naira - * `KPW` - North Korean Won + * `KPW` - North Korean Won - * `NOK` - Norwegian Krone + * `NOK` - Norwegian Krone - * `OMR` - Omani Rial + * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee + * `PKR` - Pakistani Rupee - * `XPD` - Palladium + * `XPD` - Palladium - * `PAB` - Panamanian Balboa + * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina + * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani + * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti + * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol + * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) + * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso + * `PHP` - Philippine Peso - * `XPT` - Platinum + * `XPT` - Platinum - * `PLN` - Polish Zloty + * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) + * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo + * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo + * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial + * `QAR` - Qatari Rial - * `XRE` - RINET Funds + * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar + * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu + * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) + * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble + * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) + * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc + * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón + * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala + * `WST` - Samoan Tala - * `SAR` - Saudi Riyal + * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar + * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) + * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee + * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone + * `SLL` - Sierra Leonean Leone - * `XAG` - Silver + * `XAG` - Silver - * `SGD` - Singapore Dollar + * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna + * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar + * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar + * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling + * `SOS` - Somali Shilling - * `ZAR` - South African Rand + * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) + * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) + * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won + * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) + * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound + * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble + * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta + * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) + * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) + * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights + * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee + * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound + * `SHP` - St. Helena Pound - * `XSU` - Sucre + * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) + * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound + * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) + * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar + * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder + * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni + * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona + * `SEK` - Swedish Krona - * `CHF` - Swiss Franc + * `CHF` - Swiss Franc - * `SYP` - Syrian Pound + * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra + * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD + * `TVD` - TVD - * `TJR` - Tajikistani Ruble + * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni + * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling + * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code + * `XTS` - Testing Currency Code - * `THB` - Thai Baht + * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is - involved + * `XXX` - The codes assigned for transactions where no currency is + involved - * `TPE` - Timorese Escudo + * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga + * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar + * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar + * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira + * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) + * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat + * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) + * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar + * `USD` - US Dollar - * `USN` - US Dollar (Next day) + * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) + * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling + * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) + * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia + * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets + * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham + * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit + * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso + * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) + * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) + * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som + * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu + * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar + * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) + * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) + * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong + * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) + * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro + * `CHE` - WIR Euro - * `CHW` - WIR Franc + * `CHW` - WIR Franc - * `XOF` - West African CFA Franc + * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar + * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial + * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN + * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) + * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) + * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha + * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) + * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (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: openapi/openapi.yml - ExpenseLineItem: - discriminated: false - docs: The line's item. - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: openapi/openapi.yml - inline: true - ExpenseLineTrackingCategory: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.yml - inline: true - ExpenseLineTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.yml - inline: true - ExpenseLineEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: openapi/openapi.yml - inline: true - ExpenseLineAccount: - discriminated: false - docs: The expense's payment account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - ExpenseLineContact: - discriminated: false - docs: The expense's contact. + * `ZWL` - Zimbabwean Dollar (2009) union: - - type: string - validation: - format: uuid - - Contact + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ExpenseLineProject: + JournalLineProject: discriminated: false union: - type: string @@ -10474,16 +32655,22 @@ types: format: uuid - Project source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ExpenseLine: - docs: |- - # The ExpenseLine Object + JournalLine: + docs: >- + # The JournalLine Object + ### Description - The `ExpenseLine` object is used to represent an expense's line items. + + The `JournalLine` object is used to represent a journal entry's line + items. + ### Usage Example - Fetch from the `GET Expense` endpoint and view the expense's line items. + + Fetch from the `GET JournalEntry` endpoint and view the journal entry's + line items. properties: id: type: optional @@ -10501,30 +32688,20 @@ types: type: optional docs: The datetime that this object was modified by Merge. access: read-only - item: - type: optional - docs: The line's item. + account: optional net_amount: type: optional - docs: The line's net amount. + docs: The value of the line item including taxes and other fees. tracking_category: - type: optional + 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. + type: optional>> + docs: The journal line item's associated tracking categories. currency: - type: optional + type: optional docs: >- - The expense line item's currency. + The journal line item's currency. * `XUA` - ADB Unit of Account @@ -11139,26 +33316,33 @@ types: * `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: + company: type: optional - docs: The description of the item that was purchased by the company. - exchange_rate: + docs: The company the journal entry belongs to. + validation: + format: uuid + employee: type: optional - docs: The expense line item's exchange rate. validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ + 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: >- @@ -11168,20 +33352,22 @@ types: [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). access: read-only + remote_fields: + type: optional> + access: read-only source: - openapi: openapi/openapi.yml - ExpenseLineRequestItem: + openapi: accounting_v3.yml + JournalLineRequestAccount: discriminated: false - docs: The line's item. union: - type: string validation: format: uuid - - Item + - Account source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ExpenseLineRequestTrackingCategory: + JournalLineRequestTrackingCategory: discriminated: false union: - type: string @@ -11189,9 +33375,9 @@ types: format: uuid - TrackingCategory source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ExpenseLineRequestTrackingCategoriesItem: + JournalLineRequestTrackingCategoriesItem: discriminated: false union: - type: string @@ -11199,841 +33385,674 @@ types: format: uuid - TrackingCategory source: - openapi: openapi/openapi.yml - inline: true - ExpenseLineRequestEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: openapi/openapi.yml - inline: true - ExpenseLineRequestAccount: - discriminated: false - docs: The expense's payment account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - ExpenseLineRequestContact: - discriminated: false - docs: The expense's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ExpenseLineRequestProject: + JournalLineRequestCurrency: discriminated: false - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.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) + docs: >- + The journal line item's currency. - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka + * `XUA` - ADB Unit of Account - * `BBD` - Barbadian Dollar + * `AFN` - Afghan Afghani - * `BYN` - Belarusian Ruble + * `AFA` - Afghan Afghani (1927–2002) - * `BYB` - Belarusian Ruble (1994–1999) + * `ALL` - Albanian Lek - * `BYR` - Belarusian Ruble (2000–2016) + * `ALK` - Albanian Lek (1946–1965) - * `BEF` - Belgian Franc + * `DZD` - Algerian Dinar - * `BEC` - Belgian Franc (convertible) + * `ADP` - Andorran Peseta - * `BEL` - Belgian Franc (financial) + * `AOA` - Angolan Kwanza - * `BZD` - Belize Dollar + * `AOK` - Angolan Kwanza (1977–1991) - * `BMD` - Bermudan Dollar + * `AON` - Angolan New Kwanza (1990–2000) - * `BTN` - Bhutanese Ngultrum + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `BOB` - Bolivian Boliviano + * `ARA` - Argentine Austral - * `BOL` - Bolivian Boliviano (1863–1963) + * `ARS` - Argentine Peso - * `BOV` - Bolivian Mvdol + * `ARM` - Argentine Peso (1881–1970) - * `BOP` - Bolivian Peso + * `ARP` - Argentine Peso (1983–1985) - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `ARL` - Argentine Peso Ley (1970–1983) - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `AMD` - Armenian Dram - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `AWG` - Aruban Florin - * `BWP` - Botswanan Pula + * `AUD` - Australian Dollar - * `BRC` - Brazilian Cruzado (1986–1989) + * `ATS` - Austrian Schilling - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `AZN` - Azerbaijani Manat - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `AZM` - Azerbaijani Manat (1993–2006) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BSD` - Bahamian Dollar - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BHD` - Bahraini Dinar - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BDT` - Bangladeshi Taka - * `BRL` - Brazilian Real + * `BBD` - Barbadian Dollar - * `GBP` - British Pound + * `BYN` - Belarusian Ruble - * `BND` - Brunei Dollar + * `BYB` - Belarusian Ruble (1994–1999) - * `BGL` - Bulgarian Hard Lev + * `BYR` - Belarusian Ruble (2000–2016) - * `BGN` - Bulgarian Lev + * `BEF` - Belgian Franc - * `BGO` - Bulgarian Lev (1879–1952) + * `BEC` - Belgian Franc (convertible) - * `BGM` - Bulgarian Socialist Lev + * `BEL` - Belgian Franc (financial) - * `BUK` - Burmese Kyat + * `BZD` - Belize Dollar - * `BIF` - Burundian Franc + * `BMD` - Bermudan Dollar - * `XPF` - CFP Franc + * `BTN` - Bhutanese Ngultrum - * `KHR` - Cambodian Riel + * `BOB` - Bolivian Boliviano - * `CAD` - Canadian Dollar + * `BOL` - Bolivian Boliviano (1863–1963) - * `CVE` - Cape Verdean Escudo + * `BOV` - Bolivian Mvdol - * `KYD` - Cayman Islands Dollar + * `BOP` - Bolivian Peso - * `XAF` - Central African CFA Franc + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `CLE` - Chilean Escudo + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `CLP` - Chilean Peso + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `CLF` - Chilean Unit of Account (UF) + * `BWP` - Botswanan Pula - * `CNX` - Chinese People’s Bank Dollar + * `BRC` - Brazilian Cruzado (1986–1989) - * `CNY` - Chinese Yuan + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `CNH` - Chinese Yuan (offshore) + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `COP` - Colombian Peso + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `COU` - Colombian Real Value Unit + * `BRN` - Brazilian New Cruzado (1989–1990) - * `KMF` - Comorian Franc + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `CDF` - Congolese Franc + * `BRL` - Brazilian Real - * `CRC` - Costa Rican Colón + * `GBP` - British Pound - * `HRD` - Croatian Dinar + * `BND` - Brunei Dollar - * `HRK` - Croatian Kuna + * `BGL` - Bulgarian Hard Lev - * `CUC` - Cuban Convertible Peso + * `BGN` - Bulgarian Lev - * `CUP` - Cuban Peso + * `BGO` - Bulgarian Lev (1879–1952) - * `CYP` - Cypriot Pound + * `BGM` - Bulgarian Socialist Lev - * `CZK` - Czech Koruna + * `BUK` - Burmese Kyat - * `CSK` - Czechoslovak Hard Koruna + * `BIF` - Burundian Franc - * `DKK` - Danish Krone + * `XPF` - CFP Franc - * `DJF` - Djiboutian Franc + * `KHR` - Cambodian Riel - * `DOP` - Dominican Peso + * `CAD` - Canadian Dollar - * `NLG` - Dutch Guilder + * `CVE` - Cape Verdean Escudo - * `XCD` - East Caribbean Dollar + * `KYD` - Cayman Islands Dollar - * `DDM` - East German Mark + * `XAF` - Central African CFA Franc - * `ECS` - Ecuadorian Sucre + * `CLE` - Chilean Escudo - * `ECV` - Ecuadorian Unit of Constant Value + * `CLP` - Chilean Peso - * `EGP` - Egyptian Pound + * `CLF` - Chilean Unit of Account (UF) - * `GQE` - Equatorial Guinean Ekwele + * `CNX` - Chinese People’s Bank Dollar - * `ERN` - Eritrean Nakfa + * `CNY` - Chinese Yuan - * `EEK` - Estonian Kroon + * `CNH` - Chinese Yuan (offshore) - * `ETB` - Ethiopian Birr + * `COP` - Colombian Peso - * `EUR` - Euro + * `COU` - Colombian Real Value Unit - * `XBA` - European Composite Unit + * `KMF` - Comorian Franc - * `XEU` - European Currency Unit + * `CDF` - Congolese Franc - * `XBB` - European Monetary Unit + * `CRC` - Costa Rican Colón - * `XBC` - European Unit of Account (XBC) + * `HRD` - Croatian Dinar - * `XBD` - European Unit of Account (XBD) + * `HRK` - Croatian Kuna - * `FKP` - Falkland Islands Pound + * `CUC` - Cuban Convertible Peso - * `FJD` - Fijian Dollar + * `CUP` - Cuban Peso - * `FIM` - Finnish Markka + * `CYP` - Cypriot Pound - * `FRF` - French Franc + * `CZK` - Czech Koruna - * `XFO` - French Gold Franc + * `CSK` - Czechoslovak Hard Koruna - * `XFU` - French UIC-Franc + * `DKK` - Danish Krone - * `GMD` - Gambian Dalasi + * `DJF` - Djiboutian Franc - * `GEK` - Georgian Kupon Larit + * `DOP` - Dominican Peso - * `GEL` - Georgian Lari + * `NLG` - Dutch Guilder - * `DEM` - German Mark + * `XCD` - East Caribbean Dollar - * `GHS` - Ghanaian Cedi + * `DDM` - East German Mark - * `GHC` - Ghanaian Cedi (1979–2007) + * `ECS` - Ecuadorian Sucre - * `GIP` - Gibraltar Pound + * `ECV` - Ecuadorian Unit of Constant Value - * `XAU` - Gold + * `EGP` - Egyptian Pound - * `GRD` - Greek Drachma + * `GQE` - Equatorial Guinean Ekwele - * `GTQ` - Guatemalan Quetzal + * `ERN` - Eritrean Nakfa - * `GWP` - Guinea-Bissau Peso + * `EEK` - Estonian Kroon - * `GNF` - Guinean Franc + * `ETB` - Ethiopian Birr - * `GNS` - Guinean Syli + * `EUR` - Euro - * `GYD` - Guyanaese Dollar + * `XBA` - European Composite Unit - * `HTG` - Haitian Gourde + * `XEU` - European Currency Unit - * `HNL` - Honduran Lempira + * `XBB` - European Monetary Unit - * `HKD` - Hong Kong Dollar + * `XBC` - European Unit of Account (XBC) - * `HUF` - Hungarian Forint + * `XBD` - European Unit of Account (XBD) - * `IMP` - IMP + * `FKP` - Falkland Islands Pound - * `ISK` - Icelandic Króna + * `FJD` - Fijian Dollar - * `ISJ` - Icelandic Króna (1918–1981) + * `FIM` - Finnish Markka - * `INR` - Indian Rupee + * `FRF` - French Franc - * `IDR` - Indonesian Rupiah + * `XFO` - French Gold Franc - * `IRR` - Iranian Rial + * `XFU` - French UIC-Franc - * `IQD` - Iraqi Dinar + * `GMD` - Gambian Dalasi - * `IEP` - Irish Pound + * `GEK` - Georgian Kupon Larit - * `ILS` - Israeli New Shekel + * `GEL` - Georgian Lari - * `ILP` - Israeli Pound + * `DEM` - German Mark - * `ILR` - Israeli Shekel (1980–1985) + * `GHS` - Ghanaian Cedi - * `ITL` - Italian Lira + * `GHC` - Ghanaian Cedi (1979–2007) - * `JMD` - Jamaican Dollar + * `GIP` - Gibraltar Pound - * `JPY` - Japanese Yen + * `XAU` - Gold - * `JOD` - Jordanian Dinar + * `GRD` - Greek Drachma - * `KZT` - Kazakhstani Tenge + * `GTQ` - Guatemalan Quetzal - * `KES` - Kenyan Shilling + * `GWP` - Guinea-Bissau Peso - * `KWD` - Kuwaiti Dinar + * `GNF` - Guinean Franc - * `KGS` - Kyrgystani Som + * `GNS` - Guinean Syli - * `LAK` - Laotian Kip + * `GYD` - Guyanaese Dollar - * `LVL` - Latvian Lats + * `HTG` - Haitian Gourde - * `LVR` - Latvian Ruble + * `HNL` - Honduran Lempira - * `LBP` - Lebanese Pound + * `HKD` - Hong Kong Dollar - * `LSL` - Lesotho Loti + * `HUF` - Hungarian Forint - * `LRD` - Liberian Dollar + * `IMP` - IMP - * `LYD` - Libyan Dinar + * `ISK` - Icelandic Króna - * `LTL` - Lithuanian Litas + * `ISJ` - Icelandic Króna (1918–1981) - * `LTT` - Lithuanian Talonas + * `INR` - Indian Rupee - * `LUL` - Luxembourg Financial Franc + * `IDR` - Indonesian Rupiah - * `LUC` - Luxembourgian Convertible Franc + * `IRR` - Iranian Rial - * `LUF` - Luxembourgian Franc + * `IQD` - Iraqi Dinar - * `MOP` - Macanese Pataca + * `IEP` - Irish Pound - * `MKD` - Macedonian Denar + * `ILS` - Israeli New Shekel - * `MKN` - Macedonian Denar (1992–1993) + * `ILP` - Israeli Pound - * `MGA` - Malagasy Ariary + * `ILR` - Israeli Shekel (1980–1985) - * `MGF` - Malagasy Franc + * `ITL` - Italian Lira - * `MWK` - Malawian Kwacha + * `JMD` - Jamaican Dollar - * `MYR` - Malaysian Ringgit + * `JPY` - Japanese Yen - * `MVR` - Maldivian Rufiyaa + * `JOD` - Jordanian Dinar - * `MVP` - Maldivian Rupee (1947–1981) + * `KZT` - Kazakhstani Tenge - * `MLF` - Malian Franc + * `KES` - Kenyan Shilling - * `MTL` - Maltese Lira + * `KWD` - Kuwaiti Dinar - * `MTP` - Maltese Pound + * `KGS` - Kyrgystani Som - * `MRU` - Mauritanian Ouguiya + * `LAK` - Laotian Kip - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `LVL` - Latvian Lats - * `MUR` - Mauritian Rupee + * `LVR` - Latvian Ruble - * `MXV` - Mexican Investment Unit + * `LBP` - Lebanese Pound - * `MXN` - Mexican Peso + * `LSL` - Lesotho Loti - * `MXP` - Mexican Silver Peso (1861–1992) + * `LRD` - Liberian Dollar - * `MDC` - Moldovan Cupon + * `LYD` - Libyan Dinar - * `MDL` - Moldovan Leu + * `LTL` - Lithuanian Litas - * `MCF` - Monegasque Franc + * `LTT` - Lithuanian Talonas - * `MNT` - Mongolian Tugrik + * `LUL` - Luxembourg Financial Franc - * `MAD` - Moroccan Dirham + * `LUC` - Luxembourgian Convertible Franc - * `MAF` - Moroccan Franc + * `LUF` - Luxembourgian Franc - * `MZE` - Mozambican Escudo + * `MOP` - Macanese Pataca - * `MZN` - Mozambican Metical + * `MKD` - Macedonian Denar - * `MZM` - Mozambican Metical (1980–2006) + * `MKN` - Macedonian Denar (1992–1993) - * `MMK` - Myanmar Kyat + * `MGA` - Malagasy Ariary - * `NAD` - Namibian Dollar + * `MGF` - Malagasy Franc - * `NPR` - Nepalese Rupee + * `MWK` - Malawian Kwacha - * `ANG` - Netherlands Antillean Guilder + * `MYR` - Malaysian Ringgit - * `TWD` - New Taiwan Dollar + * `MVR` - Maldivian Rufiyaa - * `NZD` - New Zealand Dollar + * `MVP` - Maldivian Rupee (1947–1981) - * `NIO` - Nicaraguan Córdoba + * `MLF` - Malian Franc - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `MTL` - Maltese Lira - * `NGN` - Nigerian Naira + * `MTP` - Maltese Pound - * `KPW` - North Korean Won + * `MRU` - Mauritanian Ouguiya - * `NOK` - Norwegian Krone + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `OMR` - Omani Rial + * `MUR` - Mauritian Rupee - * `PKR` - Pakistani Rupee + * `MXV` - Mexican Investment Unit - * `XPD` - Palladium + * `MXN` - Mexican Peso - * `PAB` - Panamanian Balboa + * `MXP` - Mexican Silver Peso (1861–1992) - * `PGK` - Papua New Guinean Kina + * `MDC` - Moldovan Cupon - * `PYG` - Paraguayan Guarani + * `MDL` - Moldovan Leu - * `PEI` - Peruvian Inti + * `MCF` - Monegasque Franc - * `PEN` - Peruvian Sol + * `MNT` - Mongolian Tugrik - * `PES` - Peruvian Sol (1863–1965) + * `MAD` - Moroccan Dirham - * `PHP` - Philippine Peso + * `MAF` - Moroccan Franc - * `XPT` - Platinum + * `MZE` - Mozambican Escudo - * `PLN` - Polish Zloty + * `MZN` - Mozambican Metical - * `PLZ` - Polish Zloty (1950–1995) + * `MZM` - Mozambican Metical (1980–2006) - * `PTE` - Portuguese Escudo + * `MMK` - Myanmar Kyat - * `GWE` - Portuguese Guinea Escudo + * `NAD` - Namibian Dollar - * `QAR` - Qatari Rial + * `NPR` - Nepalese Rupee - * `XRE` - RINET Funds + * `ANG` - Netherlands Antillean Guilder - * `RHD` - Rhodesian Dollar + * `TWD` - New Taiwan Dollar - * `RON` - Romanian Leu + * `NZD` - New Zealand Dollar - * `ROL` - Romanian Leu (1952–2006) + * `NIO` - Nicaraguan Córdoba - * `RUB` - Russian Ruble + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `RUR` - Russian Ruble (1991–1998) + * `NGN` - Nigerian Naira - * `RWF` - Rwandan Franc + * `KPW` - North Korean Won - * `SVC` - Salvadoran Colón + * `NOK` - Norwegian Krone - * `WST` - Samoan Tala + * `OMR` - Omani Rial - * `SAR` - Saudi Riyal + * `PKR` - Pakistani Rupee - * `RSD` - Serbian Dinar + * `XPD` - Palladium - * `CSD` - Serbian Dinar (2002–2006) + * `PAB` - Panamanian Balboa - * `SCR` - Seychellois Rupee + * `PGK` - Papua New Guinean Kina - * `SLL` - Sierra Leonean Leone + * `PYG` - Paraguayan Guarani - * `XAG` - Silver + * `PEI` - Peruvian Inti - * `SGD` - Singapore Dollar + * `PEN` - Peruvian Sol - * `SKK` - Slovak Koruna + * `PES` - Peruvian Sol (1863–1965) - * `SIT` - Slovenian Tolar + * `PHP` - Philippine Peso - * `SBD` - Solomon Islands Dollar + * `XPT` - Platinum - * `SOS` - Somali Shilling + * `PLN` - Polish Zloty - * `ZAR` - South African Rand + * `PLZ` - Polish Zloty (1950–1995) - * `ZAL` - South African Rand (financial) + * `PTE` - Portuguese Escudo - * `KRH` - South Korean Hwan (1953–1962) + * `GWE` - Portuguese Guinea Escudo - * `KRW` - South Korean Won + * `QAR` - Qatari Rial - * `KRO` - South Korean Won (1945–1953) + * `XRE` - RINET Funds - * `SSP` - South Sudanese Pound + * `RHD` - Rhodesian Dollar - * `SUR` - Soviet Rouble + * `RON` - Romanian Leu - * `ESP` - Spanish Peseta + * `ROL` - Romanian Leu (1952–2006) - * `ESA` - Spanish Peseta (A account) + * `RUB` - Russian Ruble - * `ESB` - Spanish Peseta (convertible account) + * `RUR` - Russian Ruble (1991–1998) - * `XDR` - Special Drawing Rights + * `RWF` - Rwandan Franc - * `LKR` - Sri Lankan Rupee + * `SVC` - Salvadoran Colón - * `SHP` - St. Helena Pound + * `WST` - Samoan Tala - * `XSU` - Sucre + * `SAR` - Saudi Riyal - * `SDD` - Sudanese Dinar (1992–2007) + * `RSD` - Serbian Dinar - * `SDG` - Sudanese Pound + * `CSD` - Serbian Dinar (2002–2006) - * `SDP` - Sudanese Pound (1957–1998) + * `SCR` - Seychellois Rupee - * `SRD` - Surinamese Dollar + * `SLL` - Sierra Leonean Leone - * `SRG` - Surinamese Guilder + * `XAG` - Silver - * `SZL` - Swazi Lilangeni + * `SGD` - Singapore Dollar - * `SEK` - Swedish Krona + * `SKK` - Slovak Koruna - * `CHF` - Swiss Franc + * `SIT` - Slovenian Tolar - * `SYP` - Syrian Pound + * `SBD` - Solomon Islands Dollar - * `STN` - São Tomé & Príncipe Dobra + * `SOS` - Somali Shilling - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `ZAR` - South African Rand - * `TVD` - TVD + * `ZAL` - South African Rand (financial) - * `TJR` - Tajikistani Ruble + * `KRH` - South Korean Hwan (1953–1962) - * `TJS` - Tajikistani Somoni + * `KRW` - South Korean Won - * `TZS` - Tanzanian Shilling + * `KRO` - South Korean Won (1945–1953) - * `XTS` - Testing Currency Code + * `SSP` - South Sudanese Pound - * `THB` - Thai Baht + * `SUR` - Soviet Rouble - * `XXX` - The codes assigned for transactions where no currency is - involved + * `ESP` - Spanish Peseta - * `TPE` - Timorese Escudo + * `ESA` - Spanish Peseta (A account) - * `TOP` - Tongan Paʻanga + * `ESB` - Spanish Peseta (convertible account) - * `TTD` - Trinidad & Tobago Dollar + * `XDR` - Special Drawing Rights - * `TND` - Tunisian Dinar + * `LKR` - Sri Lankan Rupee - * `TRY` - Turkish Lira + * `SHP` - St. Helena Pound - * `TRL` - Turkish Lira (1922–2005) + * `XSU` - Sucre - * `TMT` - Turkmenistani Manat + * `SDD` - Sudanese Dinar (1992–2007) - * `TMM` - Turkmenistani Manat (1993–2009) + * `SDG` - Sudanese Pound - * `USD` - US Dollar + * `SDP` - Sudanese Pound (1957–1998) - * `USN` - US Dollar (Next day) + * `SRD` - Surinamese Dollar - * `USS` - US Dollar (Same day) + * `SRG` - Surinamese Guilder - * `UGX` - Ugandan Shilling + * `SZL` - Swazi Lilangeni - * `UGS` - Ugandan Shilling (1966–1987) + * `SEK` - Swedish Krona - * `UAH` - Ukrainian Hryvnia + * `CHF` - Swiss Franc - * `UAK` - Ukrainian Karbovanets + * `SYP` - Syrian Pound - * `AED` - United Arab Emirates Dirham + * `STN` - São Tomé & Príncipe Dobra - * `UYW` - Uruguayan Nominal Wage Index Unit + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `UYU` - Uruguayan Peso + * `TVD` - TVD - * `UYP` - Uruguayan Peso (1975–1993) + * `TJR` - Tajikistani Ruble - * `UYI` - Uruguayan Peso (Indexed Units) + * `TJS` - Tajikistani Somoni - * `UZS` - Uzbekistani Som + * `TZS` - Tanzanian Shilling - * `VUV` - Vanuatu Vatu + * `XTS` - Testing Currency Code - * `VES` - Venezuelan Bolívar + * `THB` - Thai Baht - * `VEB` - Venezuelan Bolívar (1871–2008) + * `XXX` - The codes assigned for transactions where no currency is + involved - * `VEF` - Venezuelan Bolívar (2008–2018) + * `TPE` - Timorese Escudo - * `VND` - Vietnamese Dong + * `TOP` - Tongan Paʻanga - * `VNN` - Vietnamese Dong (1978–1985) + * `TTD` - Trinidad & Tobago Dollar - * `CHE` - WIR Euro + * `TND` - Tunisian Dinar - * `CHW` - WIR Franc + * `TRY` - Turkish Lira - * `XOF` - West African CFA Franc + * `TRL` - Turkish Lira (1922–2005) - * `YDD` - Yemeni Dinar + * `TMT` - Turkmenistani Manat - * `YER` - Yemeni Rial + * `TMM` - Turkmenistani Manat (1993–2009) - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `USD` - US Dollar - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `USN` - US Dollar (Next day) - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `USS` - US Dollar (Same day) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `UGX` - Ugandan Shilling - * `ZWN` - ZWN + * `UGS` - Ugandan Shilling (1966–1987) - * `ZRN` - Zairean New Zaire (1993–1998) + * `UAH` - Ukrainian Hryvnia - * `ZRZ` - Zairean Zaire (1971–1993) + * `UAK` - Ukrainian Karbovanets - * `ZMW` - Zambian Kwacha + * `AED` - United Arab Emirates Dirham - * `ZMK` - Zambian Kwacha (1968–2012) + * `UYW` - Uruguayan Nominal Wage Index Unit - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `UYU` - Uruguayan Peso - * `ZWR` - Zimbabwean Dollar (2008) + * `UYP` - Uruguayan Peso (1975–1993) - * `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: openapi/openapi.yml - ExpenseRequestAccount: - discriminated: false - docs: The expense's payment account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - ExpenseRequestContact: - discriminated: false - docs: The expense's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.yml - inline: true - ExpenseRequestCompany: - discriminated: false - docs: The company the expense belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - ExpenseRequestEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: openapi/openapi.yml - inline: true - ExpenseRequestTrackingCategoriesItem: - discriminated: false + * `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: - - type: string - validation: - format: uuid - - TrackingCategory + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ExpenseRequestAccountingPeriod: + JournalLineRequestProject: discriminated: false - docs: The accounting period that the Expense was generated in. union: - type: string validation: format: uuid - - AccountingPeriod + - Project source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ExpenseRequest: + JournalLineRequest: docs: >- - # The Expense Object + # The JournalLine 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. + The `JournalLine` object is used to represent a journal entry's line + items. ### Usage Example - Fetch from the `GET Expense` endpoint and view a company's expense. + Fetch from the `GET JournalEntry` endpoint and view the journal entry's + line items. 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: + remote_id: + type: optional + docs: The third-party API ID of the matching object. + account: optional + net_amount: type: optional - docs: The expense's total tax amount. + 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 + type: optional docs: >- - The expense's currency. + The journal line item's currency. * `XUA` - ADB Unit of Account @@ -12648,30 +34667,33 @@ types: * `ZWR` - Zimbabwean Dollar (2008) * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: + company: type: optional - docs: The expense's exchange rate. + docs: The company the journal entry belongs to. 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. + format: uuid 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. + 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 @@ -12682,1064 +34704,1217 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml - ExpenseResponse: + 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: - model: Expense - warnings: list - errors: list - logs: optional> + link_token: string + integration_name: optional + magic_link_url: optional source: - openapi: openapi/openapi.yml - ExternalTargetFieldApi: + openapi: accounting_v3.yml + LinkedAccountStatus: properties: - name: - type: optional - access: read-only - description: - type: optional - access: read-only - is_mapped: - type: optional - access: read-only + linked_account_status: string + can_make_request: boolean source: - openapi: openapi/openapi.yml - ExternalTargetFieldApiResponse: + openapi: accounting_v3.yml + MetaResponse: 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> + request_schema: map + remote_field_classes: optional> + status: optional + has_conditional_params: boolean + has_required_linked_account_params: boolean source: - openapi: openapi/openapi.yml - FeedStatusEnum: + openapi: accounting_v3.yml + MethodEnum: enum: - - ACTIVE - - INACTIVE + - GET + - OPTIONS + - HEAD + - POST + - PUT + - PATCH + - DELETE docs: |- - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE + * `GET` - GET + * `OPTIONS` - OPTIONS + * `HEAD` - HEAD + * `POST` - POST + * `PUT` - PUT + * `PATCH` - PATCH + * `DELETE` - DELETE source: - openapi: openapi/openapi.yml - FieldFormatEnum: + openapi: accounting_v3.yml + MethodTypeEnum: enum: - - string - - number - - date - - datetime - - bool - - list + - CREDIT_CARD + - DEBIT_CARD + - ACH + - CASH + - CHECK docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list + * `CREDIT_CARD` - CREDIT_CARD + * `DEBIT_CARD` - DEBIT_CARD + * `ACH` - ACH + * `CASH` - CASH + * `CHECK` - CHECK source: - openapi: openapi/openapi.yml - FieldMappingApiInstanceTargetField: + 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: - name: string - description: string - is_organization_wide: boolean + model_name: string + available_operations: list + required_post_parameters: list + supported_fields: list source: - openapi: openapi/openapi.yml - inline: true - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: + openapi: accounting_v3.yml + ModelPermissionDeserializer: properties: - method: optional - url_path: optional - field_traversal_path: optional> + is_enabled: optional source: - openapi: openapi/openapi.yml - inline: true - FieldMappingApiInstanceRemoteField: + openapi: accounting_v3.yml + ModelPermissionDeserializerRequest: properties: - remote_key_name: optional - schema: optional> - remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + is_enabled: optional source: - openapi: openapi/openapi.yml - inline: true - FieldMappingApiInstance: + 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: - id: + 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: - 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 + 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: openapi/openapi.yml - FieldMappingApiInstanceResponse: + openapi: accounting_v3.yml + PaginatedRemoteFieldClassList: 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> + next: optional + previous: optional + results: optional> source: - openapi: openapi/openapi.yml - FieldMappingInstanceResponse: + openapi: accounting_v3.yml + PaginatedSyncStatusList: properties: - model: FieldMappingApiInstance - warnings: list - errors: list - logs: optional> + next: optional + previous: optional + results: optional> source: - openapi: openapi/openapi.yml - FieldPermissionDeserializer: + openapi: accounting_v3.yml + PaginatedTaxRateList: properties: - enabled_fields: optional> - disabled_fields: optional> + next: optional + previous: optional + results: optional> source: - openapi: openapi/openapi.yml - FieldPermissionDeserializerRequest: + openapi: accounting_v3.yml + PaginatedTrackingCategoryList: properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: openapi/openapi.yml - FieldTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list + next: optional + previous: optional + results: optional> source: - openapi: openapi/openapi.yml - GeneralLedgerTransactionAccountingPeriod: - discriminated: false - docs: The accounting period that the GeneralLedgerTransaction was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod + openapi: accounting_v3.yml + PaginatedTransactionList: + properties: + next: optional + previous: optional + results: optional> source: - openapi: openapi/openapi.yml - inline: true - GeneralLedgerTransactionCompany: - discriminated: false - docs: The company the GeneralLedgerTransaction belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo + openapi: accounting_v3.yml + PaginatedVendorCreditList: + properties: + next: optional + previous: optional + results: optional> source: - openapi: openapi/openapi.yml - inline: true - GeneralLedgerTransactionTrackingCategoriesItem: + openapi: accounting_v3.yml + PatchedItemRequestRequestStatus: discriminated: false + docs: |- + The item's status. + + * `ACTIVE` - ACTIVE + * `ARCHIVED` - ARCHIVED union: - - type: string - validation: - format: uuid - - TrackingCategory + - Status7D1Enum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - GeneralLedgerTransactionGeneralLedgerTransactionLinesItem: + PatchedItemRequestRequestType: discriminated: false + docs: |- + The item's type. + + * `INVENTORY` - INVENTORY + * `NON_INVENTORY` - NON_INVENTORY + * `SERVICE` - SERVICE + * `UNKNOWN` - UNKNOWN union: - - type: string - validation: - format: uuid - - GeneralLedgerTransactionLine + - Type2BbEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - GeneralLedgerTransaction: - docs: >- - # The GeneralLedgerTransaction Object - + PatchedItemRequestRequest: + docs: |- + # The Item 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. - + The `Item` object refers to the goods involved in a transaction. ### Usage Example - - Fetch from the `GET GeneralLedgerTransaction` endpoint and view a general - ledger transaction. + Fetch from the `LIST Items` endpoint and view a company's items. properties: - id: + 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 - 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: + sales_account: type: optional - docs: The third party remote ID of the underlying transaction. + docs: References the default account used to record a sale. 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. + format: uuid 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: openapi/openapi.yml - GeneralLedgerTransactionLineAccount: - discriminated: false - union: - - type: string + type: optional + docs: The company the item belongs to. validation: format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - GeneralLedgerTransactionLineCompany: - discriminated: false - docs: The company the GeneralLedgerTransaction belongs to. - union: - - type: string + purchase_tax_rate: + type: optional + docs: The default purchase tax rate for this item. validation: format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - GeneralLedgerTransactionLineEmployee: - discriminated: false - union: - - type: string + sales_tax_rate: + type: optional + docs: The default sales tax rate for this item. validation: format: uuid - - Employee + integration_params: + type: optional> + access: write-only + linked_account_params: + type: optional> + access: write-only source: - openapi: openapi/openapi.yml - inline: true - GeneralLedgerTransactionLineContact: + 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: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - GeneralLedgerTransactionLineProject: + PatchedPaymentRequestAccount: discriminated: false + docs: The supplier’s or customer’s account in which the payment is made. union: - type: string validation: format: uuid - - Project + - Account source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - GeneralLedgerTransactionLineTrackingCategoriesItem: + PatchedPaymentRequestPaymentMethod: discriminated: false + docs: The method which this payment was made by. union: - type: string validation: format: uuid - - TrackingCategory + - PaymentMethod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - GeneralLedgerTransactionLineItem: + PatchedPaymentRequestCurrency: discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: openapi/openapi.yml - inline: true - GeneralLedgerTransactionLine: docs: >- - # The GeneralLedgerTransactionLineSerializer Object + The payment's currency. - ### Description - The `GeneralLedgerTransactionLineSerializer` object represents general - ledger transaction line item. + * `XUA` - ADB Unit of Account + * `AFN` - Afghan Afghani - ### Usage Example Fetch from the `GET - GeneralLedgerTransactionLineSerializer` endpoint and view an + * `AFA` - Afghan Afghani (1927–2002) - `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 + * `ALL` - Albanian Lek + * `ALK` - Albanian Lek (1946–1965) - * `XUA` - ADB Unit of Account + * `DZD` - Algerian Dinar - * `AFN` - Afghan Afghani + * `ADP` - Andorran Peseta - * `AFA` - Afghan Afghani (1927–2002) + * `AOA` - Angolan Kwanza - * `ALL` - Albanian Lek + * `AOK` - Angolan Kwanza (1977–1991) - * `ALK` - Albanian Lek (1946–1965) + * `AON` - Angolan New Kwanza (1990–2000) - * `DZD` - Algerian Dinar + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ADP` - Andorran Peseta + * `ARA` - Argentine Austral - * `AOA` - Angolan Kwanza + * `ARS` - Argentine Peso - * `AOK` - Angolan Kwanza (1977–1991) + * `ARM` - Argentine Peso (1881–1970) - * `AON` - Angolan New Kwanza (1990–2000) + * `ARP` - Argentine Peso (1983–1985) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `ARL` - Argentine Peso Ley (1970–1983) - * `ARA` - Argentine Austral + * `AMD` - Armenian Dram - * `ARS` - Argentine Peso + * `AWG` - Aruban Florin - * `ARM` - Argentine Peso (1881–1970) + * `AUD` - Australian Dollar - * `ARP` - Argentine Peso (1983–1985) + * `ATS` - Austrian Schilling - * `ARL` - Argentine Peso Ley (1970–1983) + * `AZN` - Azerbaijani Manat - * `AMD` - Armenian Dram + * `AZM` - Azerbaijani Manat (1993–2006) - * `AWG` - Aruban Florin + * `BSD` - Bahamian Dollar - * `AUD` - Australian Dollar + * `BHD` - Bahraini Dinar - * `ATS` - Austrian Schilling + * `BDT` - Bangladeshi Taka - * `AZN` - Azerbaijani Manat + * `BBD` - Barbadian Dollar - * `AZM` - Azerbaijani Manat (1993–2006) + * `BYN` - Belarusian Ruble - * `BSD` - Bahamian Dollar + * `BYB` - Belarusian Ruble (1994–1999) - * `BHD` - Bahraini Dinar + * `BYR` - Belarusian Ruble (2000–2016) - * `BDT` - Bangladeshi Taka + * `BEF` - Belgian Franc - * `BBD` - Barbadian Dollar + * `BEC` - Belgian Franc (convertible) - * `BYN` - Belarusian Ruble + * `BEL` - Belgian Franc (financial) - * `BYB` - Belarusian Ruble (1994–1999) + * `BZD` - Belize Dollar - * `BYR` - Belarusian Ruble (2000–2016) + * `BMD` - Bermudan Dollar - * `BEF` - Belgian Franc + * `BTN` - Bhutanese Ngultrum - * `BEC` - Belgian Franc (convertible) + * `BOB` - Bolivian Boliviano - * `BEL` - Belgian Franc (financial) + * `BOL` - Bolivian Boliviano (1863–1963) - * `BZD` - Belize Dollar + * `BOV` - Bolivian Mvdol - * `BMD` - Bermudan Dollar + * `BOP` - Bolivian Peso - * `BTN` - Bhutanese Ngultrum + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BOB` - Bolivian Boliviano + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BOL` - Bolivian Boliviano (1863–1963) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BOV` - Bolivian Mvdol + * `BWP` - Botswanan Pula - * `BOP` - Bolivian Peso + * `BRC` - Brazilian Cruzado (1986–1989) - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BWP` - Botswanan Pula + * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRC` - Brazilian Cruzado (1986–1989) + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRL` - Brazilian Real - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `GBP` - British Pound - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BND` - Brunei Dollar - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BGL` - Bulgarian Hard Lev - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BGN` - Bulgarian Lev - * `BRL` - Brazilian Real + * `BGO` - Bulgarian Lev (1879–1952) - * `GBP` - British Pound + * `BGM` - Bulgarian Socialist Lev - * `BND` - Brunei Dollar + * `BUK` - Burmese Kyat - * `BGL` - Bulgarian Hard Lev + * `BIF` - Burundian Franc - * `BGN` - Bulgarian Lev + * `XPF` - CFP Franc - * `BGO` - Bulgarian Lev (1879–1952) + * `KHR` - Cambodian Riel - * `BGM` - Bulgarian Socialist Lev + * `CAD` - Canadian Dollar - * `BUK` - Burmese Kyat + * `CVE` - Cape Verdean Escudo - * `BIF` - Burundian Franc + * `KYD` - Cayman Islands Dollar - * `XPF` - CFP Franc + * `XAF` - Central African CFA Franc - * `KHR` - Cambodian Riel + * `CLE` - Chilean Escudo - * `CAD` - Canadian Dollar + * `CLP` - Chilean Peso - * `CVE` - Cape Verdean Escudo + * `CLF` - Chilean Unit of Account (UF) - * `KYD` - Cayman Islands Dollar + * `CNX` - Chinese People’s Bank Dollar - * `XAF` - Central African CFA Franc + * `CNY` - Chinese Yuan - * `CLE` - Chilean Escudo + * `CNH` - Chinese Yuan (offshore) - * `CLP` - Chilean Peso + * `COP` - Colombian Peso - * `CLF` - Chilean Unit of Account (UF) + * `COU` - Colombian Real Value Unit - * `CNX` - Chinese People’s Bank Dollar + * `KMF` - Comorian Franc - * `CNY` - Chinese Yuan + * `CDF` - Congolese Franc - * `CNH` - Chinese Yuan (offshore) + * `CRC` - Costa Rican Colón - * `COP` - Colombian Peso + * `HRD` - Croatian Dinar - * `COU` - Colombian Real Value Unit + * `HRK` - Croatian Kuna - * `KMF` - Comorian Franc + * `CUC` - Cuban Convertible Peso - * `CDF` - Congolese Franc + * `CUP` - Cuban Peso - * `CRC` - Costa Rican Colón + * `CYP` - Cypriot Pound - * `HRD` - Croatian Dinar + * `CZK` - Czech Koruna - * `HRK` - Croatian Kuna + * `CSK` - Czechoslovak Hard Koruna - * `CUC` - Cuban Convertible Peso + * `DKK` - Danish Krone - * `CUP` - Cuban Peso + * `DJF` - Djiboutian Franc - * `CYP` - Cypriot Pound + * `DOP` - Dominican Peso - * `CZK` - Czech Koruna + * `NLG` - Dutch Guilder - * `CSK` - Czechoslovak Hard Koruna + * `XCD` - East Caribbean Dollar - * `DKK` - Danish Krone + * `DDM` - East German Mark - * `DJF` - Djiboutian Franc + * `ECS` - Ecuadorian Sucre - * `DOP` - Dominican Peso + * `ECV` - Ecuadorian Unit of Constant Value - * `NLG` - Dutch Guilder + * `EGP` - Egyptian Pound + + * `GQE` - Equatorial Guinean Ekwele - * `XCD` - East Caribbean Dollar + * `ERN` - Eritrean Nakfa - * `DDM` - East German Mark + * `EEK` - Estonian Kroon - * `ECS` - Ecuadorian Sucre + * `ETB` - Ethiopian Birr - * `ECV` - Ecuadorian Unit of Constant Value + * `EUR` - Euro - * `EGP` - Egyptian Pound + * `XBA` - European Composite Unit - * `GQE` - Equatorial Guinean Ekwele + * `XEU` - European Currency Unit - * `ERN` - Eritrean Nakfa + * `XBB` - European Monetary Unit - * `EEK` - Estonian Kroon + * `XBC` - European Unit of Account (XBC) - * `ETB` - Ethiopian Birr + * `XBD` - European Unit of Account (XBD) - * `EUR` - Euro + * `FKP` - Falkland Islands Pound - * `XBA` - European Composite Unit + * `FJD` - Fijian Dollar - * `XEU` - European Currency Unit + * `FIM` - Finnish Markka - * `XBB` - European Monetary Unit + * `FRF` - French Franc - * `XBC` - European Unit of Account (XBC) + * `XFO` - French Gold Franc - * `XBD` - European Unit of Account (XBD) + * `XFU` - French UIC-Franc - * `FKP` - Falkland Islands Pound + * `GMD` - Gambian Dalasi - * `FJD` - Fijian Dollar + * `GEK` - Georgian Kupon Larit - * `FIM` - Finnish Markka + * `GEL` - Georgian Lari - * `FRF` - French Franc + * `DEM` - German Mark - * `XFO` - French Gold Franc + * `GHS` - Ghanaian Cedi - * `XFU` - French UIC-Franc + * `GHC` - Ghanaian Cedi (1979–2007) - * `GMD` - Gambian Dalasi + * `GIP` - Gibraltar Pound - * `GEK` - Georgian Kupon Larit + * `XAU` - Gold - * `GEL` - Georgian Lari + * `GRD` - Greek Drachma - * `DEM` - German Mark + * `GTQ` - Guatemalan Quetzal - * `GHS` - Ghanaian Cedi + * `GWP` - Guinea-Bissau Peso - * `GHC` - Ghanaian Cedi (1979–2007) + * `GNF` - Guinean Franc - * `GIP` - Gibraltar Pound + * `GNS` - Guinean Syli - * `XAU` - Gold + * `GYD` - Guyanaese Dollar - * `GRD` - Greek Drachma + * `HTG` - Haitian Gourde - * `GTQ` - Guatemalan Quetzal + * `HNL` - Honduran Lempira - * `GWP` - Guinea-Bissau Peso + * `HKD` - Hong Kong Dollar - * `GNF` - Guinean Franc + * `HUF` - Hungarian Forint - * `GNS` - Guinean Syli + * `IMP` - IMP - * `GYD` - Guyanaese Dollar + * `ISK` - Icelandic Króna - * `HTG` - Haitian Gourde + * `ISJ` - Icelandic Króna (1918–1981) - * `HNL` - Honduran Lempira + * `INR` - Indian Rupee - * `HKD` - Hong Kong Dollar + * `IDR` - Indonesian Rupiah - * `HUF` - Hungarian Forint + * `IRR` - Iranian Rial - * `IMP` - IMP + * `IQD` - Iraqi Dinar - * `ISK` - Icelandic Króna + * `IEP` - Irish Pound - * `ISJ` - Icelandic Króna (1918–1981) + * `ILS` - Israeli New Shekel - * `INR` - Indian Rupee + * `ILP` - Israeli Pound - * `IDR` - Indonesian Rupiah + * `ILR` - Israeli Shekel (1980–1985) - * `IRR` - Iranian Rial + * `ITL` - Italian Lira - * `IQD` - Iraqi Dinar + * `JMD` - Jamaican Dollar - * `IEP` - Irish Pound + * `JPY` - Japanese Yen - * `ILS` - Israeli New Shekel + * `JOD` - Jordanian Dinar - * `ILP` - Israeli Pound + * `KZT` - Kazakhstani Tenge - * `ILR` - Israeli Shekel (1980–1985) + * `KES` - Kenyan Shilling - * `ITL` - Italian Lira + * `KWD` - Kuwaiti Dinar - * `JMD` - Jamaican Dollar + * `KGS` - Kyrgystani Som - * `JPY` - Japanese Yen + * `LAK` - Laotian Kip - * `JOD` - Jordanian Dinar + * `LVL` - Latvian Lats - * `KZT` - Kazakhstani Tenge + * `LVR` - Latvian Ruble - * `KES` - Kenyan Shilling + * `LBP` - Lebanese Pound - * `KWD` - Kuwaiti Dinar + * `LSL` - Lesotho Loti - * `KGS` - Kyrgystani Som + * `LRD` - Liberian Dollar - * `LAK` - Laotian Kip + * `LYD` - Libyan Dinar - * `LVL` - Latvian Lats + * `LTL` - Lithuanian Litas - * `LVR` - Latvian Ruble + * `LTT` - Lithuanian Talonas - * `LBP` - Lebanese Pound + * `LUL` - Luxembourg Financial Franc - * `LSL` - Lesotho Loti + * `LUC` - Luxembourgian Convertible Franc - * `LRD` - Liberian Dollar + * `LUF` - Luxembourgian Franc - * `LYD` - Libyan Dinar + * `MOP` - Macanese Pataca - * `LTL` - Lithuanian Litas + * `MKD` - Macedonian Denar - * `LTT` - Lithuanian Talonas + * `MKN` - Macedonian Denar (1992–1993) - * `LUL` - Luxembourg Financial Franc + * `MGA` - Malagasy Ariary - * `LUC` - Luxembourgian Convertible Franc + * `MGF` - Malagasy Franc - * `LUF` - Luxembourgian Franc + * `MWK` - Malawian Kwacha - * `MOP` - Macanese Pataca + * `MYR` - Malaysian Ringgit - * `MKD` - Macedonian Denar + * `MVR` - Maldivian Rufiyaa - * `MKN` - Macedonian Denar (1992–1993) + * `MVP` - Maldivian Rupee (1947–1981) - * `MGA` - Malagasy Ariary + * `MLF` - Malian Franc - * `MGF` - Malagasy Franc + * `MTL` - Maltese Lira - * `MWK` - Malawian Kwacha + * `MTP` - Maltese Pound - * `MYR` - Malaysian Ringgit + * `MRU` - Mauritanian Ouguiya - * `MVR` - Maldivian Rufiyaa + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MVP` - Maldivian Rupee (1947–1981) + * `MUR` - Mauritian Rupee - * `MLF` - Malian Franc + * `MXV` - Mexican Investment Unit - * `MTL` - Maltese Lira + * `MXN` - Mexican Peso - * `MTP` - Maltese Pound + * `MXP` - Mexican Silver Peso (1861–1992) - * `MRU` - Mauritanian Ouguiya + * `MDC` - Moldovan Cupon - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MDL` - Moldovan Leu - * `MUR` - Mauritian Rupee + * `MCF` - Monegasque Franc - * `MXV` - Mexican Investment Unit + * `MNT` - Mongolian Tugrik - * `MXN` - Mexican Peso + * `MAD` - Moroccan Dirham - * `MXP` - Mexican Silver Peso (1861–1992) + * `MAF` - Moroccan Franc - * `MDC` - Moldovan Cupon + * `MZE` - Mozambican Escudo - * `MDL` - Moldovan Leu + * `MZN` - Mozambican Metical - * `MCF` - Monegasque Franc + * `MZM` - Mozambican Metical (1980–2006) - * `MNT` - Mongolian Tugrik + * `MMK` - Myanmar Kyat - * `MAD` - Moroccan Dirham + * `NAD` - Namibian Dollar - * `MAF` - Moroccan Franc + * `NPR` - Nepalese Rupee - * `MZE` - Mozambican Escudo + * `ANG` - Netherlands Antillean Guilder - * `MZN` - Mozambican Metical + * `TWD` - New Taiwan Dollar - * `MZM` - Mozambican Metical (1980–2006) + * `NZD` - New Zealand Dollar - * `MMK` - Myanmar Kyat + * `NIO` - Nicaraguan Córdoba - * `NAD` - Namibian Dollar + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NPR` - Nepalese Rupee + * `NGN` - Nigerian Naira - * `ANG` - Netherlands Antillean Guilder + * `KPW` - North Korean Won - * `TWD` - New Taiwan Dollar + * `NOK` - Norwegian Krone - * `NZD` - New Zealand Dollar + * `OMR` - Omani Rial - * `NIO` - Nicaraguan Córdoba + * `PKR` - Pakistani Rupee - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `XPD` - Palladium - * `NGN` - Nigerian Naira + * `PAB` - Panamanian Balboa - * `KPW` - North Korean Won + * `PGK` - Papua New Guinean Kina - * `NOK` - Norwegian Krone + * `PYG` - Paraguayan Guarani - * `OMR` - Omani Rial + * `PEI` - Peruvian Inti - * `PKR` - Pakistani Rupee + * `PEN` - Peruvian Sol - * `XPD` - Palladium + * `PES` - Peruvian Sol (1863–1965) - * `PAB` - Panamanian Balboa + * `PHP` - Philippine Peso - * `PGK` - Papua New Guinean Kina + * `XPT` - Platinum - * `PYG` - Paraguayan Guarani + * `PLN` - Polish Zloty - * `PEI` - Peruvian Inti + * `PLZ` - Polish Zloty (1950–1995) - * `PEN` - Peruvian Sol + * `PTE` - Portuguese Escudo - * `PES` - Peruvian Sol (1863–1965) + * `GWE` - Portuguese Guinea Escudo - * `PHP` - Philippine Peso + * `QAR` - Qatari Rial - * `XPT` - Platinum + * `XRE` - RINET Funds - * `PLN` - Polish Zloty + * `RHD` - Rhodesian Dollar - * `PLZ` - Polish Zloty (1950–1995) + * `RON` - Romanian Leu - * `PTE` - Portuguese Escudo + * `ROL` - Romanian Leu (1952–2006) - * `GWE` - Portuguese Guinea Escudo + * `RUB` - Russian Ruble - * `QAR` - Qatari Rial + * `RUR` - Russian Ruble (1991–1998) - * `XRE` - RINET Funds + * `RWF` - Rwandan Franc - * `RHD` - Rhodesian Dollar + * `SVC` - Salvadoran Colón - * `RON` - Romanian Leu + * `WST` - Samoan Tala - * `ROL` - Romanian Leu (1952–2006) + * `SAR` - Saudi Riyal - * `RUB` - Russian Ruble + * `RSD` - Serbian Dinar - * `RUR` - Russian Ruble (1991–1998) + * `CSD` - Serbian Dinar (2002–2006) - * `RWF` - Rwandan Franc + * `SCR` - Seychellois Rupee - * `SVC` - Salvadoran Colón + * `SLL` - Sierra Leonean Leone - * `WST` - Samoan Tala + * `XAG` - Silver - * `SAR` - Saudi Riyal + * `SGD` - Singapore Dollar - * `RSD` - Serbian Dinar + * `SKK` - Slovak Koruna - * `CSD` - Serbian Dinar (2002–2006) + * `SIT` - Slovenian Tolar - * `SCR` - Seychellois Rupee + * `SBD` - Solomon Islands Dollar - * `SLL` - Sierra Leonean Leone + * `SOS` - Somali Shilling - * `XAG` - Silver + * `ZAR` - South African Rand - * `SGD` - Singapore Dollar + * `ZAL` - South African Rand (financial) - * `SKK` - Slovak Koruna + * `KRH` - South Korean Hwan (1953–1962) - * `SIT` - Slovenian Tolar + * `KRW` - South Korean Won - * `SBD` - Solomon Islands Dollar + * `KRO` - South Korean Won (1945–1953) - * `SOS` - Somali Shilling + * `SSP` - South Sudanese Pound - * `ZAR` - South African Rand + * `SUR` - Soviet Rouble - * `ZAL` - South African Rand (financial) + * `ESP` - Spanish Peseta - * `KRH` - South Korean Hwan (1953–1962) + * `ESA` - Spanish Peseta (A account) - * `KRW` - South Korean Won + * `ESB` - Spanish Peseta (convertible account) - * `KRO` - South Korean Won (1945–1953) + * `XDR` - Special Drawing Rights - * `SSP` - South Sudanese Pound + * `LKR` - Sri Lankan Rupee - * `SUR` - Soviet Rouble + * `SHP` - St. Helena Pound - * `ESP` - Spanish Peseta + * `XSU` - Sucre - * `ESA` - Spanish Peseta (A account) + * `SDD` - Sudanese Dinar (1992–2007) - * `ESB` - Spanish Peseta (convertible account) + * `SDG` - Sudanese Pound - * `XDR` - Special Drawing Rights + * `SDP` - Sudanese Pound (1957–1998) - * `LKR` - Sri Lankan Rupee + * `SRD` - Surinamese Dollar - * `SHP` - St. Helena Pound + * `SRG` - Surinamese Guilder - * `XSU` - Sucre + * `SZL` - Swazi Lilangeni - * `SDD` - Sudanese Dinar (1992–2007) + * `SEK` - Swedish Krona - * `SDG` - Sudanese Pound + * `CHF` - Swiss Franc - * `SDP` - Sudanese Pound (1957–1998) + * `SYP` - Syrian Pound - * `SRD` - Surinamese Dollar + * `STN` - São Tomé & Príncipe Dobra - * `SRG` - Surinamese Guilder + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `SZL` - Swazi Lilangeni + * `TVD` - TVD - * `SEK` - Swedish Krona + * `TJR` - Tajikistani Ruble - * `CHF` - Swiss Franc + * `TJS` - Tajikistani Somoni - * `SYP` - Syrian Pound + * `TZS` - Tanzanian Shilling - * `STN` - São Tomé & Príncipe Dobra + * `XTS` - Testing Currency Code - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `THB` - Thai Baht - * `TVD` - TVD + * `XXX` - The codes assigned for transactions where no currency is + involved - * `TJR` - Tajikistani Ruble + * `TPE` - Timorese Escudo - * `TJS` - Tajikistani Somoni + * `TOP` - Tongan Paʻanga - * `TZS` - Tanzanian Shilling + * `TTD` - Trinidad & Tobago Dollar - * `XTS` - Testing Currency Code + * `TND` - Tunisian Dinar - * `THB` - Thai Baht + * `TRY` - Turkish Lira - * `XXX` - The codes assigned for transactions where no currency is - involved + * `TRL` - Turkish Lira (1922–2005) - * `TPE` - Timorese Escudo + * `TMT` - Turkmenistani Manat - * `TOP` - Tongan Paʻanga + * `TMM` - Turkmenistani Manat (1993–2009) - * `TTD` - Trinidad & Tobago Dollar + * `USD` - US Dollar - * `TND` - Tunisian Dinar + * `USN` - US Dollar (Next day) - * `TRY` - Turkish Lira + * `USS` - US Dollar (Same day) - * `TRL` - Turkish Lira (1922–2005) + * `UGX` - Ugandan Shilling - * `TMT` - Turkmenistani Manat + * `UGS` - Ugandan Shilling (1966–1987) - * `TMM` - Turkmenistani Manat (1993–2009) + * `UAH` - Ukrainian Hryvnia - * `USD` - US Dollar + * `UAK` - Ukrainian Karbovanets - * `USN` - US Dollar (Next day) + * `AED` - United Arab Emirates Dirham - * `USS` - US Dollar (Same day) + * `UYW` - Uruguayan Nominal Wage Index Unit - * `UGX` - Ugandan Shilling + * `UYU` - Uruguayan Peso - * `UGS` - Ugandan Shilling (1966–1987) + * `UYP` - Uruguayan Peso (1975–1993) - * `UAH` - Ukrainian Hryvnia + * `UYI` - Uruguayan Peso (Indexed Units) - * `UAK` - Ukrainian Karbovanets + * `UZS` - Uzbekistani Som - * `AED` - United Arab Emirates Dirham + * `VUV` - Vanuatu Vatu - * `UYW` - Uruguayan Nominal Wage Index Unit + * `VES` - Venezuelan Bolívar - * `UYU` - Uruguayan Peso + * `VEB` - Venezuelan Bolívar (1871–2008) - * `UYP` - Uruguayan Peso (1975–1993) + * `VEF` - Venezuelan Bolívar (2008–2018) - * `UYI` - Uruguayan Peso (Indexed Units) + * `VND` - Vietnamese Dong - * `UZS` - Uzbekistani Som + * `VNN` - Vietnamese Dong (1978–1985) - * `VUV` - Vanuatu Vatu + * `CHE` - WIR Euro - * `VES` - Venezuelan Bolívar + * `CHW` - WIR Franc - * `VEB` - Venezuelan Bolívar (1871–2008) + * `XOF` - West African CFA Franc - * `VEF` - Venezuelan Bolívar (2008–2018) + * `YDD` - Yemeni Dinar - * `VND` - Vietnamese Dong + * `YER` - Yemeni Rial - * `VNN` - Vietnamese Dong (1978–1985) + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `CHE` - WIR Euro + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `CHW` - WIR Franc + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `XOF` - West African CFA Franc + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `YDD` - Yemeni Dinar + * `ZWN` - ZWN - * `YER` - Yemeni Rial + * `ZRN` - Zairean New Zaire (1993–1998) - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `ZRZ` - Zairean Zaire (1971–1993) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `ZMW` - Zambian Kwacha - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `ZMK` - Zambian Kwacha (1968–2012) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWN` - ZWN + * `ZWR` - Zimbabwean Dollar (2008) - * `ZRN` - Zairean New Zaire (1993–1998) + * `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. - * `ZRZ` - Zairean Zaire (1971–1993) + * `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 - * `ZMW` - Zambian Kwacha + ### Description - * `ZMK` - Zambian Kwacha (1968–2012) + The `Payment` object represents general payments made towards a specific + transaction. - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) + ### Usage Example - * `ZWL` - Zimbabwean Dollar (2009) - transaction_currency: - type: optional + 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 transaction currency that the transaction is made in. + The payment's currency. * `XUA` - ADB Unit of Account @@ -14356,811 +36531,724 @@ types: * `ZWL` - Zimbabwean Dollar (2009) exchange_rate: type: optional - docs: >- - The exchange rate between the base currency and the transaction - currency. + docs: The payment's exchange rate. 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 + company: + type: optional + docs: The company the payment belongs to. + total_amount: + type: optional docs: >- - Indicates whether or not this object has been deleted in the third - party platform. Full coverage deletion detection is 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: + 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: read-only + access: write-only + linked_account_params: + type: optional> + access: write-only + remote_fields: + type: optional> + access: write-only source: - openapi: openapi/openapi.yml - IncomeStatementCompany: + openapi: accounting_v3.yml + PaymentContact: discriminated: false - docs: The company the income statement belongs to. + docs: The supplier, or customer involved in the payment. union: - type: string validation: format: uuid - - CompanyInfo + - Contact source: - openapi: openapi/openapi.yml + 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 + PaymentAccount: + discriminated: false + docs: The supplier’s or customer’s account in which the payment is made. + union: + - type: string 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. + - 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 + * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani + * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) + * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek + * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) + * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar + * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta + * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza + * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) + * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) + * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral + * `ARA` - Argentine Austral - * `ARS` - Argentine Peso + * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) + * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) + * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) + * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram + * `AMD` - Armenian Dram - * `AWG` - Aruban Florin + * `AWG` - Aruban Florin - * `AUD` - Australian Dollar + * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling + * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat + * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) + * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar + * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar + * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka + * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar + * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble + * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) + * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) + * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc + * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) + * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) + * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar + * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar + * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum + * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano + * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) + * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol + * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso + * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula + * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) + * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real + * `BRL` - Brazilian Real - * `GBP` - British Pound + * `GBP` - British Pound - * `BND` - Brunei Dollar + * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev + * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev + * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) + * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev + * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat + * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc + * `BIF` - Burundian Franc - * `XPF` - CFP Franc + * `XPF` - CFP Franc - * `KHR` - Cambodian Riel + * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar + * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo + * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar + * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc + * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo + * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso + * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) + * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar + * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan + * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) + * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso + * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit + * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc + * `KMF` - Comorian Franc - * `CDF` - Congolese Franc + * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón + * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar + * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna + * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso + * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso + * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound + * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna + * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna + * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone + * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc + * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso + * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder + * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar + * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark + * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre + * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value + * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound + * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele + * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa + * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon + * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr + * `ETB` - Ethiopian Birr - * `EUR` - Euro + * `EUR` - Euro - * `XBA` - European Composite Unit + * `XBA` - European Composite Unit - * `XEU` - European Currency Unit + * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit + * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) + * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) + * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound + * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar + * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka + * `FIM` - Finnish Markka - * `FRF` - French Franc + * `FRF` - French Franc - * `XFO` - French Gold Franc + * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc + * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi + * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit + * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari + * `GEL` - Georgian Lari - * `DEM` - German Mark + * `DEM` - German Mark - * `GHS` - Ghanaian Cedi + * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) + * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound + * `GIP` - Gibraltar Pound - * `XAU` - Gold + * `XAU` - Gold - * `GRD` - Greek Drachma + * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal + * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso + * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc + * `GNF` - Guinean Franc - * `GNS` - Guinean Syli + * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar + * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde + * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira + * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar + * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint + * `HUF` - Hungarian Forint - * `IMP` - IMP + * `IMP` - IMP - * `ISK` - Icelandic Króna + * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) + * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee + * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah + * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial + * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar + * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound + * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel + * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound + * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) + * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira + * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar + * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen + * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar + * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge + * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling + * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar + * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som + * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip + * `LAK` - Laotian Kip - * `LVL` - Latvian Lats + * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble + * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound + * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti + * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar + * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar + * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas + * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas + * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc + * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc + * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc + * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca + * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar + * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) + * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary + * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc + * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha + * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit + * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa + * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) + * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc + * `MLF` - Malian Franc - * `MTL` - Maltese Lira + * `MTL` - Maltese Lira - * `MTP` - Maltese Pound + * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya + * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee + * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit + * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso + * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) + * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon + * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu + * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc + * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik + * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham + * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc + * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo + * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical + * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) + * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat + * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar + * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee + * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder + * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar + * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar + * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba + * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira + * `NGN` - Nigerian Naira - * `KPW` - North Korean Won + * `KPW` - North Korean Won - * `NOK` - Norwegian Krone + * `NOK` - Norwegian Krone - * `OMR` - Omani Rial + * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee + * `PKR` - Pakistani Rupee - * `XPD` - Palladium + * `XPD` - Palladium - * `PAB` - Panamanian Balboa + * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina + * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani + * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti + * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol + * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) + * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso + * `PHP` - Philippine Peso - * `XPT` - Platinum + * `XPT` - Platinum - * `PLN` - Polish Zloty + * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) + * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo + * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo + * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial + * `QAR` - Qatari Rial - * `XRE` - RINET Funds + * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar + * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu + * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) + * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble + * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) + * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc + * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón + * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala + * `WST` - Samoan Tala - * `SAR` - Saudi Riyal + * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar + * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) + * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee + * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone + * `SLL` - Sierra Leonean Leone - * `XAG` - Silver + * `XAG` - Silver - * `SGD` - Singapore Dollar + * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna + * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar + * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar + * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling + * `SOS` - Somali Shilling - * `ZAR` - South African Rand + * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) + * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) + * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won + * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) + * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound + * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble + * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta + * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) + * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) + * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights + * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee + * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound + * `SHP` - St. Helena Pound - * `XSU` - Sucre + * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) + * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound + * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) + * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar + * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder + * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni + * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona + * `SEK` - Swedish Krona - * `CHF` - Swiss Franc + * `CHF` - Swiss Franc - * `SYP` - Syrian Pound + * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra + * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD + * `TVD` - TVD - * `TJR` - Tajikistani Ruble + * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni + * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling + * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code + * `XTS` - Testing Currency Code - * `THB` - Thai Baht + * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is - involved + * `XXX` - The codes assigned for transactions where no currency is + involved - * `TPE` - Timorese Escudo + * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga + * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar + * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar + * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira + * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) + * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat + * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) + * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar + * `USD` - US Dollar - * `USN` - US Dollar (Next day) + * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) + * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling + * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) + * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia + * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets + * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham + * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit + * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso + * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) + * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) + * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som + * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu + * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar + * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) + * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) + * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong + * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) + * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro + * `CHE` - WIR Euro - * `CHW` - WIR Franc + * `CHW` - WIR Franc - * `XOF` - West African CFA Franc + * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar + * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial + * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN + * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) + * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) + * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha + * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) + * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (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: openapi/openapi.yml - IndividualCommonModelScopeDeserializer: - properties: - model_name: string - model_permissions: optional> - field_permissions: optional - source: - openapi: openapi/openapi.yml - IndividualCommonModelScopeDeserializerRequest: - properties: - model_name: - type: string - validation: - minLength: 1 - model_permissions: optional> - field_permissions: optional - source: - openapi: openapi/openapi.yml - InvoiceContact: - discriminated: false - docs: The invoice's contact. + * `ZWL` - Zimbabwean Dollar (2009) union: - - type: string - validation: - format: uuid - - Contact + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceCompany: + PaymentCompany: discriminated: false - docs: The company the invoice belongs to. + docs: The company the payment belongs to. union: - type: string validation: format: uuid - CompanyInfo source: - openapi: openapi/openapi.yml - inline: true - InvoiceEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoicePaymentTerm: + PaymentType: discriminated: false - docs: The payment term that applies to this transaction. + docs: |- + The type of the invoice. + + * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE + * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE union: - - type: string - validation: - format: uuid - - PaymentTerm + - PaymentTypeEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceTrackingCategoriesItem: + PaymentTrackingCategoriesItem: discriminated: false union: - type: string @@ -15168,40 +37256,20 @@ types: format: uuid - TrackingCategory source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceAccountingPeriod: + PaymentAccountingPeriod: discriminated: false - docs: The accounting period that the Invoice was generated in. + docs: The accounting period that the Payment was generated in. union: - type: string validation: format: uuid - AccountingPeriod source: - openapi: openapi/openapi.yml - inline: true - InvoicePurchaseOrdersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PurchaseOrder - source: - openapi: openapi/openapi.yml - inline: true - InvoicePaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceAppliedPaymentsItem: + PaymentAppliedToLinesItem: discriminated: false union: - type: string @@ -15209,46 +37277,21 @@ types: format: uuid - PaymentLineItem source: - openapi: openapi/openapi.yml - inline: true - InvoiceAppliedCreditNotesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - CreditNoteApplyLineForInvoice - source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceAppliedVendorCreditsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - VendorCreditApplyLineForInvoice - source: - openapi: openapi/openapi.yml - inline: true - Invoice: + Payment: docs: >- - # The Invoice Object + # The Payment 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`. + The `Payment` object represents general payments made towards a specific + transaction. ### Usage Example - Fetch from the `LIST Invoices` endpoint and view a company's invoices. + Fetch from the `GET Payment` endpoint and view an invoice's payment. properties: id: type: optional @@ -15266,45 +37309,22 @@ types: 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: + transaction_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. + 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 + type: optional docs: >- - The invoice's currency. + The payment's currency. * `XUA` - ADB Unit of Account @@ -15921,70 +37941,34 @@ types: * `ZWL` - Zimbabwean Dollar (2009) exchange_rate: type: optional - docs: The invoice's exchange rate. + docs: The payment'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: + company: + type: optional + docs: The company the payment belongs to. + total_amount: type: optional - docs: The total amount being paid before taxes. - status: - type: optional + docs: >- + The total amount of money being paid to the supplier, or customer, + after taxes. + type: + type: optional docs: |- - The status of the invoice. + The type 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. + * `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 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. + docs: When the third party's payment entry was updated. remote_was_deleted: type: optional docs: >- @@ -16004,92 +37988,143 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml - InvoiceLineItemEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string + 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 - - Employee - source: - openapi: openapi/openapi.yml - inline: true - InvoiceLineItemProject: - discriminated: false - union: - - type: string + 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: - format: uuid - - Project - source: - openapi: openapi/openapi.yml - inline: true - InvoiceLineItemContact: - discriminated: false - docs: The invoice's contact. - union: - - type: string + 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 - - Contact + 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: openapi/openapi.yml - inline: true - InvoiceLineItemItem: - discriminated: false - union: - - type: string + 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: - format: uuid - - Item - source: - openapi: openapi/openapi.yml - inline: true - InvoiceLineItemAccount: - discriminated: false - union: - - type: string + 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 - - Account - source: - openapi: openapi/openapi.yml - inline: true - InvoiceLineItemTrackingCategory: - discriminated: false - union: - - type: string + 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: - format: uuid - - TrackingCategory + 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: openapi/openapi.yml - inline: true - InvoiceLineItemTrackingCategoriesItem: + 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: - - type: string - validation: - format: uuid - - TrackingCategory + - MethodTypeEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceLineItem: + PaymentMethod: docs: >- - # The InvoiceLineItem Object + # The PaymentMethod Object ### Description - The `InvoiceLineItem` object represents an itemized record of goods and/or - services sold to a customer. + The `PaymentMethod` object defines how a payment against an invoice is + made. ### Usage Example - Fetch from the `GET Invoice` endpoint and view the invoice's line items. + Fetch from the `GET PaymentMethod` endpoint and view payment method + information. properties: id: type: optional @@ -16107,795 +38142,777 @@ types: 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. + 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 + * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani + * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) + * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek + * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) + * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar + * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta + * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza + * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) + * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) + * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral + * `ARA` - Argentine Austral - * `ARS` - Argentine Peso + * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) + * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) + * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) + * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram + * `AMD` - Armenian Dram - * `AWG` - Aruban Florin + * `AWG` - Aruban Florin - * `AUD` - Australian Dollar + * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling + * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat + * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) + * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar + * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar + * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka + * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar + * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble + * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) + * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) + * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc + * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) + * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) + * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar + * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar + * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum + * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano + * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) + * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol + * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso + * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula + * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) + * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real + * `BRL` - Brazilian Real - * `GBP` - British Pound + * `GBP` - British Pound - * `BND` - Brunei Dollar + * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev + * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev + * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) + * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev + * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat + * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc + * `BIF` - Burundian Franc - * `XPF` - CFP Franc + * `XPF` - CFP Franc - * `KHR` - Cambodian Riel + * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar + * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo + * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar + * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc + * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo + * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso + * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) + * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar + * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan + * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) + * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso + * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit + * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc + * `KMF` - Comorian Franc - * `CDF` - Congolese Franc + * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón + * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar + * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna + * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso + * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso + * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound + * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna + * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna + * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone + * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc + * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso + * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder + * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar + * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark + * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre + * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value + * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound + * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele + * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa + * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon + * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr + * `ETB` - Ethiopian Birr - * `EUR` - Euro + * `EUR` - Euro - * `XBA` - European Composite Unit + * `XBA` - European Composite Unit - * `XEU` - European Currency Unit + * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit + * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) + * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) + * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound + * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar + * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka + * `FIM` - Finnish Markka - * `FRF` - French Franc + * `FRF` - French Franc - * `XFO` - French Gold Franc + * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc + * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi + * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit + * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari + * `GEL` - Georgian Lari - * `DEM` - German Mark + * `DEM` - German Mark - * `GHS` - Ghanaian Cedi + * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) + * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound + * `GIP` - Gibraltar Pound - * `XAU` - Gold + * `XAU` - Gold - * `GRD` - Greek Drachma + * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal + * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso + * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc + * `GNF` - Guinean Franc - * `GNS` - Guinean Syli + * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar + * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde + * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira + * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar + * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint + * `HUF` - Hungarian Forint - * `IMP` - IMP + * `IMP` - IMP - * `ISK` - Icelandic Króna + * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) + * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee + * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah + * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial + * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar + * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound + * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel + * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound + * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) + * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira + * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar + * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen + * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar + * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge + * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling + * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar + * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som + * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip + * `LAK` - Laotian Kip - * `LVL` - Latvian Lats + * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble + * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound + * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti + * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar + * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar + * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas + * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas + * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc + * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc + * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc + * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca + * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar + * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) + * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary + * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc + * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha + * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit + * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa + * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) + * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc + * `MLF` - Malian Franc - * `MTL` - Maltese Lira + * `MTL` - Maltese Lira - * `MTP` - Maltese Pound + * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya + * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee + * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit + * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso + * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) + * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon + * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu + * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc + * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik + * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham + * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc + * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo + * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical + * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) + * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat + * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar + * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee + * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder + * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar + * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar + * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba + * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira + * `NGN` - Nigerian Naira - * `KPW` - North Korean Won + * `KPW` - North Korean Won - * `NOK` - Norwegian Krone + * `NOK` - Norwegian Krone - * `OMR` - Omani Rial + * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee + * `PKR` - Pakistani Rupee - * `XPD` - Palladium + * `XPD` - Palladium - * `PAB` - Panamanian Balboa + * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina + * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani + * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti + * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol + * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) + * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso + * `PHP` - Philippine Peso - * `XPT` - Platinum + * `XPT` - Platinum - * `PLN` - Polish Zloty + * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) + * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo + * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo + * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial + * `QAR` - Qatari Rial - * `XRE` - RINET Funds + * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar + * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu + * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) + * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble + * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) + * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc + * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón + * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala + * `WST` - Samoan Tala - * `SAR` - Saudi Riyal + * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar + * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) + * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee + * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone + * `SLL` - Sierra Leonean Leone - * `XAG` - Silver + * `XAG` - Silver - * `SGD` - Singapore Dollar + * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna + * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar + * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar + * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling + * `SOS` - Somali Shilling - * `ZAR` - South African Rand + * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) + * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) + * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won + * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) + * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound + * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble + * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta + * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) + * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) + * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights + * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee + * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound + * `SHP` - St. Helena Pound - * `XSU` - Sucre + * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) + * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound + * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) + * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar + * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder + * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni + * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona + * `SEK` - Swedish Krona - * `CHF` - Swiss Franc + * `CHF` - Swiss Franc - * `SYP` - Syrian Pound + * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra + * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD + * `TVD` - TVD - * `TJR` - Tajikistani Ruble + * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni + * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling + * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code + * `XTS` - Testing Currency Code - * `THB` - Thai Baht + * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is - involved + * `XXX` - The codes assigned for transactions where no currency is + involved - * `TPE` - Timorese Escudo + * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga + * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar + * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar + * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira + * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) + * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat + * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) + * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar + * `USD` - US Dollar - * `USN` - US Dollar (Next day) + * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) + * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling + * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) + * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia + * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets + * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham + * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit + * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso + * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) + * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) + * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som + * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu + * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar + * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) + * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) + * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong + * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) + * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro + * `CHE` - WIR Euro - * `CHW` - WIR Franc + * `CHW` - WIR Franc - * `XOF` - West African CFA Franc + * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar + * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial + * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN + * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) + * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) + * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha + * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) + * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (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: openapi/openapi.yml - InvoiceLineItemRequestEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: openapi/openapi.yml - inline: true - InvoiceLineItemRequestProject: - discriminated: false + * `ZWL` - Zimbabwean Dollar (2009) union: - - type: string - validation: - format: uuid - - Project + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceLineItemRequestContact: + PaymentRequestCompany: discriminated: false - docs: The invoice's contact. + docs: The company the payment belongs to. union: - type: string validation: format: uuid - - Contact + - CompanyInfo source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceLineItemRequestItem: + PaymentRequestType: discriminated: false + docs: |- + The type of the invoice. + + * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE + * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE union: - - type: string - validation: - format: uuid - - Item + - PaymentTypeEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceLineItemRequestAccount: + PaymentRequestTrackingCategoriesItem: discriminated: false union: - type: string validation: format: uuid - - Account + - TrackingCategory source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceLineItemRequestTrackingCategory: + PaymentRequestAccountingPeriod: discriminated: false + docs: The accounting period that the Payment was generated in. union: - type: string validation: format: uuid - - TrackingCategory + - AccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceLineItemRequestTrackingCategoriesItem: + PaymentRequestAppliedToLinesItem: discriminated: false union: - type: string validation: format: uuid - - TrackingCategory + - PaymentLineItemRequest source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceLineItemRequest: + PaymentRequest: docs: >- - # The InvoiceLineItem Object + # The Payment Object ### Description - The `InvoiceLineItem` object represents an itemized record of goods and/or - services sold to a customer. + The `Payment` object represents general payments made towards a specific + transaction. ### Usage Example - Fetch from the `GET Invoice` endpoint and view the invoice's line items. + Fetch from the `GET Payment` endpoint and view an invoice's payment. 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 + transaction_date: + type: optional + docs: The payment's transaction date. contact: - type: optional - docs: The invoice's 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 + type: optional docs: >- - The line item's currency. + The payment's currency. * `XUA` - ADB Unit of Account @@ -17512,27 +39529,31 @@ types: * `ZWL` - Zimbabwean Dollar (2009) exchange_rate: type: optional - docs: The line item's exchange rate. + docs: The payment'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 + 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 @@ -17543,1204 +39564,874 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml - InvoiceRequestContact: + openapi: accounting_v3.yml + PaymentResponse: + properties: + model: Payment + warnings: list + errors: list + logs: optional> + source: + openapi: accounting_v3.yml + PaymentTermCompany: discriminated: false - docs: The invoice's contact. + docs: The subsidiary that the payment term belongs to. union: - type: string validation: format: uuid - - Contact + - CompanyInfo source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceRequestEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string + 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 - - Employee + 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: openapi/openapi.yml - inline: true - InvoiceRequestCompany: + 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 company the invoice belongs to. + docs: The subsidiary that the project belongs to. union: - type: string validation: format: uuid - CompanyInfo source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceRequestPaymentTerm: + ProjectContact: discriminated: false - docs: The payment term that applies to this transaction. + docs: The supplier, or customer involved in the project. union: - type: string validation: format: uuid - - PaymentTerm + - Contact source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceRequestPaymentsItem: + 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 - - Payment + - Address source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceRequestTrackingCategoriesItem: + PurchaseOrderVendor: discriminated: false + docs: The party fulfilling the purchase order. union: - type: string validation: format: uuid - - TrackingCategory + - Contact source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceRequestPurchaseOrdersItem: + PurchaseOrderCompany: discriminated: false + docs: The company the purchase order belongs to. union: - type: string validation: format: uuid - - PurchaseOrder + - CompanyInfo source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - InvoiceRequest: + PurchaseOrderCurrency: + discriminated: false docs: >- - # The Invoice Object - - ### Description + The purchase order's currency. - 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 + * `XUA` - ADB Unit of Account - * `AOA` - Angolan Kwanza + * `AFN` - Afghan Afghani - * `AOK` - Angolan Kwanza (1977–1991) + * `AFA` - Afghan Afghani (1927–2002) - * `AON` - Angolan New Kwanza (1990–2000) + * `ALL` - Albanian Lek - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `ALK` - Albanian Lek (1946–1965) - * `ARA` - Argentine Austral + * `DZD` - Algerian Dinar - * `ARS` - Argentine Peso + * `ADP` - Andorran Peseta - * `ARM` - Argentine Peso (1881–1970) + * `AOA` - Angolan Kwanza - * `ARP` - Argentine Peso (1983–1985) + * `AOK` - Angolan Kwanza (1977–1991) - * `ARL` - Argentine Peso Ley (1970–1983) + * `AON` - Angolan New Kwanza (1990–2000) - * `AMD` - Armenian Dram + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `AWG` - Aruban Florin + * `ARA` - Argentine Austral - * `AUD` - Australian Dollar + * `ARS` - Argentine Peso - * `ATS` - Austrian Schilling + * `ARM` - Argentine Peso (1881–1970) - * `AZN` - Azerbaijani Manat + * `ARP` - Argentine Peso (1983–1985) - * `AZM` - Azerbaijani Manat (1993–2006) + * `ARL` - Argentine Peso Ley (1970–1983) - * `BSD` - Bahamian Dollar + * `AMD` - Armenian Dram - * `BHD` - Bahraini Dinar + * `AWG` - Aruban Florin - * `BDT` - Bangladeshi Taka + * `AUD` - Australian Dollar - * `BBD` - Barbadian Dollar + * `ATS` - Austrian Schilling - * `BYN` - Belarusian Ruble + * `AZN` - Azerbaijani Manat - * `BYB` - Belarusian Ruble (1994–1999) + * `AZM` - Azerbaijani Manat (1993–2006) - * `BYR` - Belarusian Ruble (2000–2016) + * `BSD` - Bahamian Dollar - * `BEF` - Belgian Franc + * `BHD` - Bahraini Dinar - * `BEC` - Belgian Franc (convertible) + * `BDT` - Bangladeshi Taka - * `BEL` - Belgian Franc (financial) + * `BBD` - Barbadian Dollar - * `BZD` - Belize Dollar + * `BYN` - Belarusian Ruble - * `BMD` - Bermudan Dollar + * `BYB` - Belarusian Ruble (1994–1999) - * `BTN` - Bhutanese Ngultrum + * `BYR` - Belarusian Ruble (2000–2016) - * `BOB` - Bolivian Boliviano + * `BEF` - Belgian Franc - * `BOL` - Bolivian Boliviano (1863–1963) + * `BEC` - Belgian Franc (convertible) - * `BOV` - Bolivian Mvdol + * `BEL` - Belgian Franc (financial) - * `BOP` - Bolivian Peso + * `BZD` - Belize Dollar - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BMD` - Bermudan Dollar - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BTN` - Bhutanese Ngultrum - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BOB` - Bolivian Boliviano - * `BWP` - Botswanan Pula + * `BOL` - Bolivian Boliviano (1863–1963) - * `BRC` - Brazilian Cruzado (1986–1989) + * `BOV` - Bolivian Mvdol - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BOP` - Bolivian Peso - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BWP` - Botswanan Pula - * `BRL` - Brazilian Real + * `BRC` - Brazilian Cruzado (1986–1989) - * `GBP` - British Pound + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BND` - Brunei Dollar + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BGL` - Bulgarian Hard Lev + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BGN` - Bulgarian Lev + * `BRN` - Brazilian New Cruzado (1989–1990) - * `BGO` - Bulgarian Lev (1879–1952) + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BGM` - Bulgarian Socialist Lev + * `BRL` - Brazilian Real - * `BUK` - Burmese Kyat + * `GBP` - British Pound - * `BIF` - Burundian Franc + * `BND` - Brunei Dollar - * `XPF` - CFP Franc + * `BGL` - Bulgarian Hard Lev - * `KHR` - Cambodian Riel + * `BGN` - Bulgarian Lev - * `CAD` - Canadian Dollar + * `BGO` - Bulgarian Lev (1879–1952) - * `CVE` - Cape Verdean Escudo + * `BGM` - Bulgarian Socialist Lev - * `KYD` - Cayman Islands Dollar + * `BUK` - Burmese Kyat - * `XAF` - Central African CFA Franc + * `BIF` - Burundian Franc - * `CLE` - Chilean Escudo + * `XPF` - CFP Franc - * `CLP` - Chilean Peso + * `KHR` - Cambodian Riel - * `CLF` - Chilean Unit of Account (UF) + * `CAD` - Canadian Dollar - * `CNX` - Chinese People’s Bank Dollar + * `CVE` - Cape Verdean Escudo - * `CNY` - Chinese Yuan + * `KYD` - Cayman Islands Dollar - * `CNH` - Chinese Yuan (offshore) + * `XAF` - Central African CFA Franc - * `COP` - Colombian Peso + * `CLE` - Chilean Escudo - * `COU` - Colombian Real Value Unit + * `CLP` - Chilean Peso - * `KMF` - Comorian Franc + * `CLF` - Chilean Unit of Account (UF) - * `CDF` - Congolese Franc + * `CNX` - Chinese People’s Bank Dollar - * `CRC` - Costa Rican Colón + * `CNY` - Chinese Yuan - * `HRD` - Croatian Dinar + * `CNH` - Chinese Yuan (offshore) - * `HRK` - Croatian Kuna + * `COP` - Colombian Peso - * `CUC` - Cuban Convertible Peso + * `COU` - Colombian Real Value Unit - * `CUP` - Cuban Peso + * `KMF` - Comorian Franc - * `CYP` - Cypriot Pound + * `CDF` - Congolese Franc - * `CZK` - Czech Koruna + * `CRC` - Costa Rican Colón - * `CSK` - Czechoslovak Hard Koruna + * `HRD` - Croatian Dinar - * `DKK` - Danish Krone + * `HRK` - Croatian Kuna - * `DJF` - Djiboutian Franc + * `CUC` - Cuban Convertible Peso - * `DOP` - Dominican Peso + * `CUP` - Cuban Peso - * `NLG` - Dutch Guilder + * `CYP` - Cypriot Pound - * `XCD` - East Caribbean Dollar + * `CZK` - Czech Koruna - * `DDM` - East German Mark + * `CSK` - Czechoslovak Hard Koruna - * `ECS` - Ecuadorian Sucre + * `DKK` - Danish Krone - * `ECV` - Ecuadorian Unit of Constant Value + * `DJF` - Djiboutian Franc - * `EGP` - Egyptian Pound + * `DOP` - Dominican Peso - * `GQE` - Equatorial Guinean Ekwele + * `NLG` - Dutch Guilder - * `ERN` - Eritrean Nakfa + * `XCD` - East Caribbean Dollar - * `EEK` - Estonian Kroon + * `DDM` - East German Mark - * `ETB` - Ethiopian Birr + * `ECS` - Ecuadorian Sucre - * `EUR` - Euro + * `ECV` - Ecuadorian Unit of Constant Value - * `XBA` - European Composite Unit + * `EGP` - Egyptian Pound - * `XEU` - European Currency Unit + * `GQE` - Equatorial Guinean Ekwele - * `XBB` - European Monetary Unit + * `ERN` - Eritrean Nakfa - * `XBC` - European Unit of Account (XBC) + * `EEK` - Estonian Kroon - * `XBD` - European Unit of Account (XBD) + * `ETB` - Ethiopian Birr - * `FKP` - Falkland Islands Pound + * `EUR` - Euro - * `FJD` - Fijian Dollar + * `XBA` - European Composite Unit - * `FIM` - Finnish Markka + * `XEU` - European Currency Unit - * `FRF` - French Franc + * `XBB` - European Monetary Unit - * `XFO` - French Gold Franc + * `XBC` - European Unit of Account (XBC) - * `XFU` - French UIC-Franc + * `XBD` - European Unit of Account (XBD) - * `GMD` - Gambian Dalasi + * `FKP` - Falkland Islands Pound - * `GEK` - Georgian Kupon Larit + * `FJD` - Fijian Dollar - * `GEL` - Georgian Lari + * `FIM` - Finnish Markka - * `DEM` - German Mark + * `FRF` - French Franc - * `GHS` - Ghanaian Cedi + * `XFO` - French Gold Franc - * `GHC` - Ghanaian Cedi (1979–2007) + * `XFU` - French UIC-Franc - * `GIP` - Gibraltar Pound + * `GMD` - Gambian Dalasi - * `XAU` - Gold + * `GEK` - Georgian Kupon Larit - * `GRD` - Greek Drachma + * `GEL` - Georgian Lari - * `GTQ` - Guatemalan Quetzal + * `DEM` - German Mark - * `GWP` - Guinea-Bissau Peso + * `GHS` - Ghanaian Cedi - * `GNF` - Guinean Franc + * `GHC` - Ghanaian Cedi (1979–2007) - * `GNS` - Guinean Syli + * `GIP` - Gibraltar Pound - * `GYD` - Guyanaese Dollar + * `XAU` - Gold - * `HTG` - Haitian Gourde + * `GRD` - Greek Drachma - * `HNL` - Honduran Lempira + * `GTQ` - Guatemalan Quetzal - * `HKD` - Hong Kong Dollar + * `GWP` - Guinea-Bissau Peso - * `HUF` - Hungarian Forint + * `GNF` - Guinean Franc - * `IMP` - IMP + * `GNS` - Guinean Syli - * `ISK` - Icelandic Króna + * `GYD` - Guyanaese Dollar - * `ISJ` - Icelandic Króna (1918–1981) + * `HTG` - Haitian Gourde - * `INR` - Indian Rupee + * `HNL` - Honduran Lempira - * `IDR` - Indonesian Rupiah + * `HKD` - Hong Kong Dollar - * `IRR` - Iranian Rial + * `HUF` - Hungarian Forint - * `IQD` - Iraqi Dinar + * `IMP` - IMP - * `IEP` - Irish Pound + * `ISK` - Icelandic Króna - * `ILS` - Israeli New Shekel + * `ISJ` - Icelandic Króna (1918–1981) - * `ILP` - Israeli Pound + * `INR` - Indian Rupee - * `ILR` - Israeli Shekel (1980–1985) + * `IDR` - Indonesian Rupiah - * `ITL` - Italian Lira + * `IRR` - Iranian Rial - * `JMD` - Jamaican Dollar + * `IQD` - Iraqi Dinar - * `JPY` - Japanese Yen + * `IEP` - Irish Pound - * `JOD` - Jordanian Dinar + * `ILS` - Israeli New Shekel - * `KZT` - Kazakhstani Tenge + * `ILP` - Israeli Pound - * `KES` - Kenyan Shilling + * `ILR` - Israeli Shekel (1980–1985) - * `KWD` - Kuwaiti Dinar + * `ITL` - Italian Lira - * `KGS` - Kyrgystani Som + * `JMD` - Jamaican Dollar - * `LAK` - Laotian Kip + * `JPY` - Japanese Yen - * `LVL` - Latvian Lats + * `JOD` - Jordanian Dinar - * `LVR` - Latvian Ruble + * `KZT` - Kazakhstani Tenge - * `LBP` - Lebanese Pound + * `KES` - Kenyan Shilling - * `LSL` - Lesotho Loti + * `KWD` - Kuwaiti Dinar - * `LRD` - Liberian Dollar + * `KGS` - Kyrgystani Som - * `LYD` - Libyan Dinar + * `LAK` - Laotian Kip - * `LTL` - Lithuanian Litas + * `LVL` - Latvian Lats - * `LTT` - Lithuanian Talonas + * `LVR` - Latvian Ruble - * `LUL` - Luxembourg Financial Franc + * `LBP` - Lebanese Pound - * `LUC` - Luxembourgian Convertible Franc + * `LSL` - Lesotho Loti - * `LUF` - Luxembourgian Franc + * `LRD` - Liberian Dollar - * `MOP` - Macanese Pataca + * `LYD` - Libyan Dinar - * `MKD` - Macedonian Denar + * `LTL` - Lithuanian Litas - * `MKN` - Macedonian Denar (1992–1993) + * `LTT` - Lithuanian Talonas - * `MGA` - Malagasy Ariary + * `LUL` - Luxembourg Financial Franc - * `MGF` - Malagasy Franc + * `LUC` - Luxembourgian Convertible Franc - * `MWK` - Malawian Kwacha + * `LUF` - Luxembourgian Franc - * `MYR` - Malaysian Ringgit + * `MOP` - Macanese Pataca - * `MVR` - Maldivian Rufiyaa + * `MKD` - Macedonian Denar - * `MVP` - Maldivian Rupee (1947–1981) + * `MKN` - Macedonian Denar (1992–1993) - * `MLF` - Malian Franc + * `MGA` - Malagasy Ariary - * `MTL` - Maltese Lira + * `MGF` - Malagasy Franc - * `MTP` - Maltese Pound + * `MWK` - Malawian Kwacha - * `MRU` - Mauritanian Ouguiya + * `MYR` - Malaysian Ringgit - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MVR` - Maldivian Rufiyaa - * `MUR` - Mauritian Rupee + * `MVP` - Maldivian Rupee (1947–1981) - * `MXV` - Mexican Investment Unit + * `MLF` - Malian Franc - * `MXN` - Mexican Peso + * `MTL` - Maltese Lira - * `MXP` - Mexican Silver Peso (1861–1992) + * `MTP` - Maltese Pound - * `MDC` - Moldovan Cupon + * `MRU` - Mauritanian Ouguiya - * `MDL` - Moldovan Leu + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MCF` - Monegasque Franc + * `MUR` - Mauritian Rupee - * `MNT` - Mongolian Tugrik + * `MXV` - Mexican Investment Unit - * `MAD` - Moroccan Dirham + * `MXN` - Mexican Peso - * `MAF` - Moroccan Franc + * `MXP` - Mexican Silver Peso (1861–1992) - * `MZE` - Mozambican Escudo + * `MDC` - Moldovan Cupon - * `MZN` - Mozambican Metical + * `MDL` - Moldovan Leu - * `MZM` - Mozambican Metical (1980–2006) + * `MCF` - Monegasque Franc - * `MMK` - Myanmar Kyat + * `MNT` - Mongolian Tugrik - * `NAD` - Namibian Dollar + * `MAD` - Moroccan Dirham - * `NPR` - Nepalese Rupee + * `MAF` - Moroccan Franc - * `ANG` - Netherlands Antillean Guilder + * `MZE` - Mozambican Escudo - * `TWD` - New Taiwan Dollar + * `MZN` - Mozambican Metical - * `NZD` - New Zealand Dollar + * `MZM` - Mozambican Metical (1980–2006) - * `NIO` - Nicaraguan Córdoba + * `MMK` - Myanmar Kyat - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NAD` - Namibian Dollar - * `NGN` - Nigerian Naira + * `NPR` - Nepalese Rupee - * `KPW` - North Korean Won + * `ANG` - Netherlands Antillean Guilder - * `NOK` - Norwegian Krone + * `TWD` - New Taiwan Dollar - * `OMR` - Omani Rial + * `NZD` - New Zealand Dollar - * `PKR` - Pakistani Rupee + * `NIO` - Nicaraguan Córdoba - * `XPD` - Palladium + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `PAB` - Panamanian Balboa + * `NGN` - Nigerian Naira - * `PGK` - Papua New Guinean Kina + * `KPW` - North Korean Won - * `PYG` - Paraguayan Guarani + * `NOK` - Norwegian Krone - * `PEI` - Peruvian Inti + * `OMR` - Omani Rial - * `PEN` - Peruvian Sol + * `PKR` - Pakistani Rupee - * `PES` - Peruvian Sol (1863–1965) + * `XPD` - Palladium - * `PHP` - Philippine Peso + * `PAB` - Panamanian Balboa - * `XPT` - Platinum + * `PGK` - Papua New Guinean Kina - * `PLN` - Polish Zloty + * `PYG` - Paraguayan Guarani - * `PLZ` - Polish Zloty (1950–1995) + * `PEI` - Peruvian Inti - * `PTE` - Portuguese Escudo + * `PEN` - Peruvian Sol - * `GWE` - Portuguese Guinea Escudo + * `PES` - Peruvian Sol (1863–1965) - * `QAR` - Qatari Rial + * `PHP` - Philippine Peso - * `XRE` - RINET Funds + * `XPT` - Platinum - * `RHD` - Rhodesian Dollar + * `PLN` - Polish Zloty - * `RON` - Romanian Leu + * `PLZ` - Polish Zloty (1950–1995) - * `ROL` - Romanian Leu (1952–2006) + * `PTE` - Portuguese Escudo - * `RUB` - Russian Ruble + * `GWE` - Portuguese Guinea Escudo - * `RUR` - Russian Ruble (1991–1998) + * `QAR` - Qatari Rial - * `RWF` - Rwandan Franc + * `XRE` - RINET Funds - * `SVC` - Salvadoran Colón + * `RHD` - Rhodesian Dollar - * `WST` - Samoan Tala + * `RON` - Romanian Leu - * `SAR` - Saudi Riyal + * `ROL` - Romanian Leu (1952–2006) - * `RSD` - Serbian Dinar + * `RUB` - Russian Ruble - * `CSD` - Serbian Dinar (2002–2006) + * `RUR` - Russian Ruble (1991–1998) - * `SCR` - Seychellois Rupee + * `RWF` - Rwandan Franc - * `SLL` - Sierra Leonean Leone + * `SVC` - Salvadoran Colón - * `XAG` - Silver + * `WST` - Samoan Tala - * `SGD` - Singapore Dollar + * `SAR` - Saudi Riyal - * `SKK` - Slovak Koruna + * `RSD` - Serbian Dinar - * `SIT` - Slovenian Tolar + * `CSD` - Serbian Dinar (2002–2006) - * `SBD` - Solomon Islands Dollar + * `SCR` - Seychellois Rupee - * `SOS` - Somali Shilling + * `SLL` - Sierra Leonean Leone - * `ZAR` - South African Rand + * `XAG` - Silver - * `ZAL` - South African Rand (financial) + * `SGD` - Singapore Dollar - * `KRH` - South Korean Hwan (1953–1962) + * `SKK` - Slovak Koruna - * `KRW` - South Korean Won + * `SIT` - Slovenian Tolar - * `KRO` - South Korean Won (1945–1953) + * `SBD` - Solomon Islands Dollar - * `SSP` - South Sudanese Pound + * `SOS` - Somali Shilling - * `SUR` - Soviet Rouble + * `ZAR` - South African Rand - * `ESP` - Spanish Peseta + * `ZAL` - South African Rand (financial) - * `ESA` - Spanish Peseta (A account) + * `KRH` - South Korean Hwan (1953–1962) - * `ESB` - Spanish Peseta (convertible account) + * `KRW` - South Korean Won - * `XDR` - Special Drawing Rights + * `KRO` - South Korean Won (1945–1953) - * `LKR` - Sri Lankan Rupee + * `SSP` - South Sudanese Pound - * `SHP` - St. Helena Pound + * `SUR` - Soviet Rouble - * `XSU` - Sucre + * `ESP` - Spanish Peseta - * `SDD` - Sudanese Dinar (1992–2007) + * `ESA` - Spanish Peseta (A account) - * `SDG` - Sudanese Pound + * `ESB` - Spanish Peseta (convertible account) - * `SDP` - Sudanese Pound (1957–1998) + * `XDR` - Special Drawing Rights - * `SRD` - Surinamese Dollar + * `LKR` - Sri Lankan Rupee - * `SRG` - Surinamese Guilder + * `SHP` - St. Helena Pound - * `SZL` - Swazi Lilangeni + * `XSU` - Sucre - * `SEK` - Swedish Krona + * `SDD` - Sudanese Dinar (1992–2007) - * `CHF` - Swiss Franc + * `SDG` - Sudanese Pound - * `SYP` - Syrian Pound + * `SDP` - Sudanese Pound (1957–1998) - * `STN` - São Tomé & Príncipe Dobra + * `SRD` - Surinamese Dollar - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `SRG` - Surinamese Guilder - * `TVD` - TVD + * `SZL` - Swazi Lilangeni - * `TJR` - Tajikistani Ruble + * `SEK` - Swedish Krona - * `TJS` - Tajikistani Somoni + * `CHF` - Swiss Franc - * `TZS` - Tanzanian Shilling + * `SYP` - Syrian Pound - * `XTS` - Testing Currency Code + * `STN` - São Tomé & Príncipe Dobra - * `THB` - Thai Baht + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `XXX` - The codes assigned for transactions where no currency is - involved + * `TVD` - TVD - * `TPE` - Timorese Escudo + * `TJR` - Tajikistani Ruble - * `TOP` - Tongan Paʻanga + * `TJS` - Tajikistani Somoni - * `TTD` - Trinidad & Tobago Dollar + * `TZS` - Tanzanian Shilling - * `TND` - Tunisian Dinar + * `XTS` - Testing Currency Code - * `TRY` - Turkish Lira + * `THB` - Thai Baht - * `TRL` - Turkish Lira (1922–2005) + * `XXX` - The codes assigned for transactions where no currency is + involved - * `TMT` - Turkmenistani Manat + * `TPE` - Timorese Escudo - * `TMM` - Turkmenistani Manat (1993–2009) + * `TOP` - Tongan Paʻanga - * `USD` - US Dollar + * `TTD` - Trinidad & Tobago Dollar - * `USN` - US Dollar (Next day) + * `TND` - Tunisian Dinar - * `USS` - US Dollar (Same day) + * `TRY` - Turkish Lira - * `UGX` - Ugandan Shilling + * `TRL` - Turkish Lira (1922–2005) - * `UGS` - Ugandan Shilling (1966–1987) + * `TMT` - Turkmenistani Manat - * `UAH` - Ukrainian Hryvnia + * `TMM` - Turkmenistani Manat (1993–2009) - * `UAK` - Ukrainian Karbovanets + * `USD` - US Dollar - * `AED` - United Arab Emirates Dirham + * `USN` - US Dollar (Next day) - * `UYW` - Uruguayan Nominal Wage Index Unit + * `USS` - US Dollar (Same day) - * `UYU` - Uruguayan Peso + * `UGX` - Ugandan Shilling - * `UYP` - Uruguayan Peso (1975–1993) + * `UGS` - Ugandan Shilling (1966–1987) - * `UYI` - Uruguayan Peso (Indexed Units) + * `UAH` - Ukrainian Hryvnia - * `UZS` - Uzbekistani Som + * `UAK` - Ukrainian Karbovanets - * `VUV` - Vanuatu Vatu + * `AED` - United Arab Emirates Dirham - * `VES` - Venezuelan Bolívar + * `UYW` - Uruguayan Nominal Wage Index Unit - * `VEB` - Venezuelan Bolívar (1871–2008) + * `UYU` - Uruguayan Peso - * `VEF` - Venezuelan Bolívar (2008–2018) + * `UYP` - Uruguayan Peso (1975–1993) - * `VND` - Vietnamese Dong + * `UYI` - Uruguayan Peso (Indexed Units) - * `VNN` - Vietnamese Dong (1978–1985) + * `UZS` - Uzbekistani Som - * `CHE` - WIR Euro + * `VUV` - Vanuatu Vatu - * `CHW` - WIR Franc + * `VES` - Venezuelan Bolívar - * `XOF` - West African CFA Franc + * `VEB` - Venezuelan Bolívar (1871–2008) - * `YDD` - Yemeni Dinar + * `VEF` - Venezuelan Bolívar (2008–2018) - * `YER` - Yemeni Rial + * `VND` - Vietnamese Dong - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `VNN` - Vietnamese Dong (1978–1985) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `CHE` - WIR Euro - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `CHW` - WIR Franc - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `XOF` - West African CFA Franc - * `ZWN` - ZWN + * `YDD` - Yemeni Dinar - * `ZRN` - Zairean New Zaire (1993–1998) + * `YER` - Yemeni Rial - * `ZRZ` - Zairean Zaire (1971–1993) + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `ZMW` - Zambian Kwacha + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `ZMK` - Zambian Kwacha (1968–2012) + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWR` - Zimbabwean Dollar (2008) + * `ZWN` - ZWN - * `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: openapi/openapi.yml - InvoiceResponse: - properties: - model: Invoice - warnings: list - errors: list - logs: optional> - source: - openapi: openapi/openapi.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: openapi/openapi.yml - InvoiceTypeEnum: - enum: - - ACCOUNTS_RECEIVABLE - - ACCOUNTS_PAYABLE - docs: |- - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - source: - openapi: openapi/openapi.yml - Issue: - properties: - id: - type: optional - validation: - format: uuid - access: read-only - status: - type: optional - docs: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') + * `ZRN` - Zairean New Zaire (1993–1998) - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - error_description: string - end_user: - type: optional> - access: read-only - first_incident_time: optional - last_incident_time: optional - is_muted: - type: optional - access: read-only - error_details: - type: optional> - access: read-only - source: - openapi: openapi/openapi.yml - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - docs: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - source: - openapi: openapi/openapi.yml - 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: openapi/openapi.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: openapi/openapi.yml - inline: true - ItemCompany: - discriminated: false - docs: The company the item belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - ItemPurchaseTaxRate: - discriminated: false - docs: The default purchase tax rate for this item. - union: - - type: string - validation: - format: uuid - - TaxRate - source: - openapi: openapi/openapi.yml - inline: true - ItemSalesTaxRate: - discriminated: false - docs: The default sales tax rate for this item. - union: - - type: string - validation: - format: uuid - - TaxRate - source: - openapi: openapi/openapi.yml - inline: true - Item: - docs: |- - # The Item Object - ### Description - The `Item` object refers to the goods involved in a transaction. + * `ZRZ` - Zairean Zaire (1971–1993) - ### 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. + * `ZMW` - Zambian Kwacha - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - 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: openapi/openapi.yml - ItemFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - uuid - * `number` - url - * `date` - email - * `datetime` - phone - * `bool` - currency - * `list` - decimal - source: - openapi: openapi/openapi.yml - 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: openapi/openapi.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: openapi/openapi.yml - inline: true - ItemRequestRequestCompany: - discriminated: false - docs: The company the item belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - ItemRequestRequestPurchaseTaxRate: - discriminated: false - docs: The default purchase tax rate for this item. - union: - - type: string - validation: - format: uuid - - TaxRate - source: - openapi: openapi/openapi.yml - inline: true - ItemRequestRequestSalesTaxRate: - discriminated: false - docs: The default sales tax rate for this item. - union: - - type: string - validation: - format: uuid - - TaxRate - source: - openapi: openapi/openapi.yml - inline: true - ItemRequestRequest: - docs: |- - # The Item Object - ### Description - The `Item` object refers to the goods involved in a transaction. + * `ZMK` - Zambian Kwacha (1968–2012) - ### 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. + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - type: - type: optional - docs: |- - The item's type. + * `ZWR` - Zimbabwean Dollar (2008) - * `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: openapi/openapi.yml - ItemResponse: - properties: - model: Item - warnings: list - errors: list - logs: optional> - source: - openapi: openapi/openapi.yml - ItemSchema: - properties: - item_type: optional - item_format: optional - item_choices: optional> - source: - openapi: openapi/openapi.yml - ItemTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: openapi/openapi.yml - JournalEntryPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: openapi/openapi.yml - inline: true - JournalEntryAppliedPaymentsItem: - discriminated: false + * `ZWL` - Zimbabwean Dollar (2009) union: - - type: string - validation: - format: uuid - - PaymentLineItem + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - JournalEntryCompany: + PurchaseOrderPaymentTerm: discriminated: false - docs: The company the journal entry belongs to. + docs: The payment term that applies to this transaction. union: - type: string validation: format: uuid - - CompanyInfo + - PaymentTerm source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - JournalEntryTrackingCategoriesItem: + PurchaseOrderTrackingCategoriesItem: discriminated: false union: - type: string @@ -18748,43 +40439,41 @@ types: format: uuid - TrackingCategory source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - JournalEntryAccountingPeriod: + PurchaseOrderAccountingPeriod: discriminated: false - docs: The accounting period that the JournalEntry was generated in. + docs: The accounting period that the PurchaseOrder was generated in. union: - type: string validation: format: uuid - AccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - JournalEntry: + PurchaseOrder: docs: >- - # The JournalEntry Object + # The PurchaseOrder 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. + 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. - 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. + 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 `GET JournalEntry` endpoint and view a company's journey - entry. + Fetch from the `LIST PurchaseOrders` endpoint and view a company's + purchase orders. properties: id: type: optional @@ -18802,24 +40491,51 @@ types: type: optional docs: The datetime that this object was modified by Merge. access: read-only - transaction_date: + 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 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. + 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: The journal entry's private note. + 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 + type: optional docs: >- - The journal's currency. + The purchase order's currency. * `XUA` - ADB Unit of Account @@ -19436,26 +41152,30 @@ types: * `ZWL` - Zimbabwean Dollar (2009) exchange_rate: type: optional - docs: The journal entry's exchange rate. + docs: The purchase order's exchange rate. validation: pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the journal entry belongs to. + 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. - lines: - type: optional> - access: read-only - journal_number: - type: optional - docs: Reference number for identifying journal entries. - validation: - maxLength: 70 - tracking_categories: optional>> + 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: >- @@ -19465,22 +41185,6 @@ types: [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 @@ -19491,781 +41195,655 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml - JournalEntryRequestPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: openapi/openapi.yml - inline: true - JournalEntryRequestCompany: + openapi: accounting_v3.yml + PurchaseOrderLineItemItem: discriminated: false - docs: The company the journal entry belongs to. union: - type: string validation: format: uuid - - CompanyInfo + - Item source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - JournalEntryRequestTrackingCategoriesItem: + PurchaseOrderLineItemCurrency: discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.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. + The purchase order line item's currency. - ### 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 + * `XUA` - ADB Unit of Account - * `AFA` - Afghan Afghani (1927–2002) + * `AFN` - Afghan Afghani - * `ALL` - Albanian Lek + * `AFA` - Afghan Afghani (1927–2002) - * `ALK` - Albanian Lek (1946–1965) + * `ALL` - Albanian Lek - * `DZD` - Algerian Dinar + * `ALK` - Albanian Lek (1946–1965) - * `ADP` - Andorran Peseta + * `DZD` - Algerian Dinar - * `AOA` - Angolan Kwanza + * `ADP` - Andorran Peseta - * `AOK` - Angolan Kwanza (1977–1991) + * `AOA` - Angolan Kwanza - * `AON` - Angolan New Kwanza (1990–2000) + * `AOK` - Angolan Kwanza (1977–1991) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `AON` - Angolan New Kwanza (1990–2000) - * `ARA` - Argentine Austral + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARS` - Argentine Peso + * `ARA` - Argentine Austral - * `ARM` - Argentine Peso (1881–1970) + * `ARS` - Argentine Peso - * `ARP` - Argentine Peso (1983–1985) + * `ARM` - Argentine Peso (1881–1970) - * `ARL` - Argentine Peso Ley (1970–1983) + * `ARP` - Argentine Peso (1983–1985) - * `AMD` - Armenian Dram + * `ARL` - Argentine Peso Ley (1970–1983) - * `AWG` - Aruban Florin + * `AMD` - Armenian Dram - * `AUD` - Australian Dollar + * `AWG` - Aruban Florin - * `ATS` - Austrian Schilling + * `AUD` - Australian Dollar - * `AZN` - Azerbaijani Manat + * `ATS` - Austrian Schilling - * `AZM` - Azerbaijani Manat (1993–2006) + * `AZN` - Azerbaijani Manat - * `BSD` - Bahamian Dollar + * `AZM` - Azerbaijani Manat (1993–2006) - * `BHD` - Bahraini Dinar + * `BSD` - Bahamian Dollar - * `BDT` - Bangladeshi Taka + * `BHD` - Bahraini Dinar - * `BBD` - Barbadian Dollar + * `BDT` - Bangladeshi Taka - * `BYN` - Belarusian Ruble + * `BBD` - Barbadian Dollar - * `BYB` - Belarusian Ruble (1994–1999) + * `BYN` - Belarusian Ruble - * `BYR` - Belarusian Ruble (2000–2016) + * `BYB` - Belarusian Ruble (1994–1999) - * `BEF` - Belgian Franc + * `BYR` - Belarusian Ruble (2000–2016) - * `BEC` - Belgian Franc (convertible) + * `BEF` - Belgian Franc - * `BEL` - Belgian Franc (financial) + * `BEC` - Belgian Franc (convertible) - * `BZD` - Belize Dollar + * `BEL` - Belgian Franc (financial) - * `BMD` - Bermudan Dollar + * `BZD` - Belize Dollar - * `BTN` - Bhutanese Ngultrum + * `BMD` - Bermudan Dollar - * `BOB` - Bolivian Boliviano + * `BTN` - Bhutanese Ngultrum - * `BOL` - Bolivian Boliviano (1863–1963) + * `BOB` - Bolivian Boliviano - * `BOV` - Bolivian Mvdol + * `BOL` - Bolivian Boliviano (1863–1963) - * `BOP` - Bolivian Peso + * `BOV` - Bolivian Mvdol - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BOP` - Bolivian Peso - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BWP` - Botswanan Pula + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BRC` - Brazilian Cruzado (1986–1989) + * `BWP` - Botswanan Pula - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRC` - Brazilian Cruzado (1986–1989) - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRL` - Brazilian Real + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `GBP` - British Pound + * `BRL` - Brazilian Real - * `BND` - Brunei Dollar + * `GBP` - British Pound - * `BGL` - Bulgarian Hard Lev + * `BND` - Brunei Dollar - * `BGN` - Bulgarian Lev + * `BGL` - Bulgarian Hard Lev - * `BGO` - Bulgarian Lev (1879–1952) + * `BGN` - Bulgarian Lev - * `BGM` - Bulgarian Socialist Lev + * `BGO` - Bulgarian Lev (1879–1952) - * `BUK` - Burmese Kyat + * `BGM` - Bulgarian Socialist Lev - * `BIF` - Burundian Franc + * `BUK` - Burmese Kyat - * `XPF` - CFP Franc + * `BIF` - Burundian Franc - * `KHR` - Cambodian Riel + * `XPF` - CFP Franc - * `CAD` - Canadian Dollar + * `KHR` - Cambodian Riel - * `CVE` - Cape Verdean Escudo + * `CAD` - Canadian Dollar - * `KYD` - Cayman Islands Dollar + * `CVE` - Cape Verdean Escudo - * `XAF` - Central African CFA Franc + * `KYD` - Cayman Islands Dollar - * `CLE` - Chilean Escudo + * `XAF` - Central African CFA Franc - * `CLP` - Chilean Peso + * `CLE` - Chilean Escudo - * `CLF` - Chilean Unit of Account (UF) + * `CLP` - Chilean Peso - * `CNX` - Chinese People’s Bank Dollar + * `CLF` - Chilean Unit of Account (UF) - * `CNY` - Chinese Yuan + * `CNX` - Chinese People’s Bank Dollar - * `CNH` - Chinese Yuan (offshore) + * `CNY` - Chinese Yuan - * `COP` - Colombian Peso + * `CNH` - Chinese Yuan (offshore) - * `COU` - Colombian Real Value Unit + * `COP` - Colombian Peso - * `KMF` - Comorian Franc + * `COU` - Colombian Real Value Unit - * `CDF` - Congolese Franc + * `KMF` - Comorian Franc - * `CRC` - Costa Rican Colón + * `CDF` - Congolese Franc - * `HRD` - Croatian Dinar + * `CRC` - Costa Rican Colón - * `HRK` - Croatian Kuna + * `HRD` - Croatian Dinar - * `CUC` - Cuban Convertible Peso + * `HRK` - Croatian Kuna - * `CUP` - Cuban Peso + * `CUC` - Cuban Convertible Peso - * `CYP` - Cypriot Pound + * `CUP` - Cuban Peso - * `CZK` - Czech Koruna + * `CYP` - Cypriot Pound - * `CSK` - Czechoslovak Hard Koruna + * `CZK` - Czech Koruna - * `DKK` - Danish Krone + * `CSK` - Czechoslovak Hard Koruna - * `DJF` - Djiboutian Franc + * `DKK` - Danish Krone - * `DOP` - Dominican Peso + * `DJF` - Djiboutian Franc - * `NLG` - Dutch Guilder + * `DOP` - Dominican Peso - * `XCD` - East Caribbean Dollar + * `NLG` - Dutch Guilder - * `DDM` - East German Mark + * `XCD` - East Caribbean Dollar - * `ECS` - Ecuadorian Sucre + * `DDM` - East German Mark - * `ECV` - Ecuadorian Unit of Constant Value + * `ECS` - Ecuadorian Sucre - * `EGP` - Egyptian Pound + * `ECV` - Ecuadorian Unit of Constant Value - * `GQE` - Equatorial Guinean Ekwele + * `EGP` - Egyptian Pound - * `ERN` - Eritrean Nakfa + * `GQE` - Equatorial Guinean Ekwele - * `EEK` - Estonian Kroon + * `ERN` - Eritrean Nakfa - * `ETB` - Ethiopian Birr + * `EEK` - Estonian Kroon - * `EUR` - Euro + * `ETB` - Ethiopian Birr - * `XBA` - European Composite Unit + * `EUR` - Euro - * `XEU` - European Currency Unit + * `XBA` - European Composite Unit - * `XBB` - European Monetary Unit + * `XEU` - European Currency Unit - * `XBC` - European Unit of Account (XBC) + * `XBB` - European Monetary Unit - * `XBD` - European Unit of Account (XBD) + * `XBC` - European Unit of Account (XBC) - * `FKP` - Falkland Islands Pound + * `XBD` - European Unit of Account (XBD) - * `FJD` - Fijian Dollar + * `FKP` - Falkland Islands Pound - * `FIM` - Finnish Markka + * `FJD` - Fijian Dollar - * `FRF` - French Franc + * `FIM` - Finnish Markka - * `XFO` - French Gold Franc + * `FRF` - French Franc - * `XFU` - French UIC-Franc + * `XFO` - French Gold Franc - * `GMD` - Gambian Dalasi + * `XFU` - French UIC-Franc - * `GEK` - Georgian Kupon Larit + * `GMD` - Gambian Dalasi - * `GEL` - Georgian Lari + * `GEK` - Georgian Kupon Larit - * `DEM` - German Mark + * `GEL` - Georgian Lari - * `GHS` - Ghanaian Cedi + * `DEM` - German Mark - * `GHC` - Ghanaian Cedi (1979–2007) + * `GHS` - Ghanaian Cedi - * `GIP` - Gibraltar Pound + * `GHC` - Ghanaian Cedi (1979–2007) - * `XAU` - Gold + * `GIP` - Gibraltar Pound - * `GRD` - Greek Drachma + * `XAU` - Gold - * `GTQ` - Guatemalan Quetzal + * `GRD` - Greek Drachma - * `GWP` - Guinea-Bissau Peso + * `GTQ` - Guatemalan Quetzal - * `GNF` - Guinean Franc + * `GWP` - Guinea-Bissau Peso - * `GNS` - Guinean Syli + * `GNF` - Guinean Franc - * `GYD` - Guyanaese Dollar + * `GNS` - Guinean Syli - * `HTG` - Haitian Gourde + * `GYD` - Guyanaese Dollar - * `HNL` - Honduran Lempira + * `HTG` - Haitian Gourde - * `HKD` - Hong Kong Dollar + * `HNL` - Honduran Lempira - * `HUF` - Hungarian Forint + * `HKD` - Hong Kong Dollar - * `IMP` - IMP + * `HUF` - Hungarian Forint - * `ISK` - Icelandic Króna + * `IMP` - IMP - * `ISJ` - Icelandic Króna (1918–1981) + * `ISK` - Icelandic Króna - * `INR` - Indian Rupee + * `ISJ` - Icelandic Króna (1918–1981) - * `IDR` - Indonesian Rupiah + * `INR` - Indian Rupee - * `IRR` - Iranian Rial + * `IDR` - Indonesian Rupiah - * `IQD` - Iraqi Dinar + * `IRR` - Iranian Rial - * `IEP` - Irish Pound + * `IQD` - Iraqi Dinar - * `ILS` - Israeli New Shekel + * `IEP` - Irish Pound - * `ILP` - Israeli Pound + * `ILS` - Israeli New Shekel - * `ILR` - Israeli Shekel (1980–1985) + * `ILP` - Israeli Pound - * `ITL` - Italian Lira + * `ILR` - Israeli Shekel (1980–1985) - * `JMD` - Jamaican Dollar + * `ITL` - Italian Lira - * `JPY` - Japanese Yen + * `JMD` - Jamaican Dollar - * `JOD` - Jordanian Dinar + * `JPY` - Japanese Yen - * `KZT` - Kazakhstani Tenge + * `JOD` - Jordanian Dinar - * `KES` - Kenyan Shilling + * `KZT` - Kazakhstani Tenge - * `KWD` - Kuwaiti Dinar + * `KES` - Kenyan Shilling - * `KGS` - Kyrgystani Som + * `KWD` - Kuwaiti Dinar - * `LAK` - Laotian Kip + * `KGS` - Kyrgystani Som - * `LVL` - Latvian Lats + * `LAK` - Laotian Kip - * `LVR` - Latvian Ruble + * `LVL` - Latvian Lats - * `LBP` - Lebanese Pound + * `LVR` - Latvian Ruble - * `LSL` - Lesotho Loti + * `LBP` - Lebanese Pound - * `LRD` - Liberian Dollar + * `LSL` - Lesotho Loti - * `LYD` - Libyan Dinar + * `LRD` - Liberian Dollar - * `LTL` - Lithuanian Litas + * `LYD` - Libyan Dinar - * `LTT` - Lithuanian Talonas + * `LTL` - Lithuanian Litas - * `LUL` - Luxembourg Financial Franc + * `LTT` - Lithuanian Talonas - * `LUC` - Luxembourgian Convertible Franc + * `LUL` - Luxembourg Financial Franc - * `LUF` - Luxembourgian Franc + * `LUC` - Luxembourgian Convertible Franc - * `MOP` - Macanese Pataca + * `LUF` - Luxembourgian Franc - * `MKD` - Macedonian Denar + * `MOP` - Macanese Pataca - * `MKN` - Macedonian Denar (1992–1993) + * `MKD` - Macedonian Denar - * `MGA` - Malagasy Ariary + * `MKN` - Macedonian Denar (1992–1993) - * `MGF` - Malagasy Franc + * `MGA` - Malagasy Ariary - * `MWK` - Malawian Kwacha + * `MGF` - Malagasy Franc - * `MYR` - Malaysian Ringgit + * `MWK` - Malawian Kwacha - * `MVR` - Maldivian Rufiyaa + * `MYR` - Malaysian Ringgit - * `MVP` - Maldivian Rupee (1947–1981) + * `MVR` - Maldivian Rufiyaa - * `MLF` - Malian Franc + * `MVP` - Maldivian Rupee (1947–1981) - * `MTL` - Maltese Lira + * `MLF` - Malian Franc - * `MTP` - Maltese Pound + * `MTL` - Maltese Lira - * `MRU` - Mauritanian Ouguiya + * `MTP` - Maltese Pound - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MRU` - Mauritanian Ouguiya - * `MUR` - Mauritian Rupee + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MXV` - Mexican Investment Unit + * `MUR` - Mauritian Rupee - * `MXN` - Mexican Peso + * `MXV` - Mexican Investment Unit - * `MXP` - Mexican Silver Peso (1861–1992) + * `MXN` - Mexican Peso - * `MDC` - Moldovan Cupon + * `MXP` - Mexican Silver Peso (1861–1992) - * `MDL` - Moldovan Leu + * `MDC` - Moldovan Cupon - * `MCF` - Monegasque Franc + * `MDL` - Moldovan Leu - * `MNT` - Mongolian Tugrik + * `MCF` - Monegasque Franc - * `MAD` - Moroccan Dirham + * `MNT` - Mongolian Tugrik - * `MAF` - Moroccan Franc + * `MAD` - Moroccan Dirham - * `MZE` - Mozambican Escudo + * `MAF` - Moroccan Franc - * `MZN` - Mozambican Metical + * `MZE` - Mozambican Escudo - * `MZM` - Mozambican Metical (1980–2006) + * `MZN` - Mozambican Metical - * `MMK` - Myanmar Kyat + * `MZM` - Mozambican Metical (1980–2006) - * `NAD` - Namibian Dollar + * `MMK` - Myanmar Kyat - * `NPR` - Nepalese Rupee + * `NAD` - Namibian Dollar - * `ANG` - Netherlands Antillean Guilder + * `NPR` - Nepalese Rupee - * `TWD` - New Taiwan Dollar + * `ANG` - Netherlands Antillean Guilder - * `NZD` - New Zealand Dollar + * `TWD` - New Taiwan Dollar - * `NIO` - Nicaraguan Córdoba + * `NZD` - New Zealand Dollar - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NIO` - Nicaraguan Córdoba - * `NGN` - Nigerian Naira + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `KPW` - North Korean Won + * `NGN` - Nigerian Naira - * `NOK` - Norwegian Krone + * `KPW` - North Korean Won - * `OMR` - Omani Rial + * `NOK` - Norwegian Krone - * `PKR` - Pakistani Rupee + * `OMR` - Omani Rial - * `XPD` - Palladium + * `PKR` - Pakistani Rupee - * `PAB` - Panamanian Balboa + * `XPD` - Palladium - * `PGK` - Papua New Guinean Kina + * `PAB` - Panamanian Balboa - * `PYG` - Paraguayan Guarani + * `PGK` - Papua New Guinean Kina - * `PEI` - Peruvian Inti + * `PYG` - Paraguayan Guarani - * `PEN` - Peruvian Sol + * `PEI` - Peruvian Inti - * `PES` - Peruvian Sol (1863–1965) + * `PEN` - Peruvian Sol - * `PHP` - Philippine Peso + * `PES` - Peruvian Sol (1863–1965) - * `XPT` - Platinum + * `PHP` - Philippine Peso - * `PLN` - Polish Zloty + * `XPT` - Platinum - * `PLZ` - Polish Zloty (1950–1995) + * `PLN` - Polish Zloty - * `PTE` - Portuguese Escudo + * `PLZ` - Polish Zloty (1950–1995) - * `GWE` - Portuguese Guinea Escudo + * `PTE` - Portuguese Escudo - * `QAR` - Qatari Rial + * `GWE` - Portuguese Guinea Escudo - * `XRE` - RINET Funds + * `QAR` - Qatari Rial - * `RHD` - Rhodesian Dollar + * `XRE` - RINET Funds - * `RON` - Romanian Leu + * `RHD` - Rhodesian Dollar - * `ROL` - Romanian Leu (1952–2006) + * `RON` - Romanian Leu - * `RUB` - Russian Ruble + * `ROL` - Romanian Leu (1952–2006) - * `RUR` - Russian Ruble (1991–1998) + * `RUB` - Russian Ruble - * `RWF` - Rwandan Franc + * `RUR` - Russian Ruble (1991–1998) - * `SVC` - Salvadoran Colón + * `RWF` - Rwandan Franc - * `WST` - Samoan Tala + * `SVC` - Salvadoran Colón - * `SAR` - Saudi Riyal + * `WST` - Samoan Tala - * `RSD` - Serbian Dinar + * `SAR` - Saudi Riyal - * `CSD` - Serbian Dinar (2002–2006) + * `RSD` - Serbian Dinar - * `SCR` - Seychellois Rupee + * `CSD` - Serbian Dinar (2002–2006) - * `SLL` - Sierra Leonean Leone + * `SCR` - Seychellois Rupee - * `XAG` - Silver + * `SLL` - Sierra Leonean Leone - * `SGD` - Singapore Dollar + * `XAG` - Silver - * `SKK` - Slovak Koruna + * `SGD` - Singapore Dollar - * `SIT` - Slovenian Tolar + * `SKK` - Slovak Koruna - * `SBD` - Solomon Islands Dollar + * `SIT` - Slovenian Tolar - * `SOS` - Somali Shilling + * `SBD` - Solomon Islands Dollar - * `ZAR` - South African Rand + * `SOS` - Somali Shilling - * `ZAL` - South African Rand (financial) + * `ZAR` - South African Rand - * `KRH` - South Korean Hwan (1953–1962) + * `ZAL` - South African Rand (financial) - * `KRW` - South Korean Won + * `KRH` - South Korean Hwan (1953–1962) - * `KRO` - South Korean Won (1945–1953) + * `KRW` - South Korean Won - * `SSP` - South Sudanese Pound + * `KRO` - South Korean Won (1945–1953) - * `SUR` - Soviet Rouble + * `SSP` - South Sudanese Pound - * `ESP` - Spanish Peseta + * `SUR` - Soviet Rouble - * `ESA` - Spanish Peseta (A account) + * `ESP` - Spanish Peseta - * `ESB` - Spanish Peseta (convertible account) + * `ESA` - Spanish Peseta (A account) - * `XDR` - Special Drawing Rights + * `ESB` - Spanish Peseta (convertible account) - * `LKR` - Sri Lankan Rupee + * `XDR` - Special Drawing Rights - * `SHP` - St. Helena Pound + * `LKR` - Sri Lankan Rupee - * `XSU` - Sucre + * `SHP` - St. Helena Pound - * `SDD` - Sudanese Dinar (1992–2007) + * `XSU` - Sucre - * `SDG` - Sudanese Pound + * `SDD` - Sudanese Dinar (1992–2007) - * `SDP` - Sudanese Pound (1957–1998) + * `SDG` - Sudanese Pound - * `SRD` - Surinamese Dollar + * `SDP` - Sudanese Pound (1957–1998) - * `SRG` - Surinamese Guilder + * `SRD` - Surinamese Dollar - * `SZL` - Swazi Lilangeni + * `SRG` - Surinamese Guilder - * `SEK` - Swedish Krona + * `SZL` - Swazi Lilangeni - * `CHF` - Swiss Franc + * `SEK` - Swedish Krona - * `SYP` - Syrian Pound + * `CHF` - Swiss Franc - * `STN` - São Tomé & Príncipe Dobra + * `SYP` - Syrian Pound - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `STN` - São Tomé & Príncipe Dobra - * `TVD` - TVD + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TJR` - Tajikistani Ruble + * `TVD` - TVD - * `TJS` - Tajikistani Somoni + * `TJR` - Tajikistani Ruble - * `TZS` - Tanzanian Shilling + * `TJS` - Tajikistani Somoni - * `XTS` - Testing Currency Code + * `TZS` - Tanzanian Shilling - * `THB` - Thai Baht + * `XTS` - Testing Currency Code - * `XXX` - The codes assigned for transactions where no currency is - involved + * `THB` - Thai Baht - * `TPE` - Timorese Escudo + * `XXX` - The codes assigned for transactions where no currency is + involved - * `TOP` - Tongan Paʻanga + * `TPE` - Timorese Escudo - * `TTD` - Trinidad & Tobago Dollar + * `TOP` - Tongan Paʻanga - * `TND` - Tunisian Dinar + * `TTD` - Trinidad & Tobago Dollar - * `TRY` - Turkish Lira + * `TND` - Tunisian Dinar - * `TRL` - Turkish Lira (1922–2005) + * `TRY` - Turkish Lira - * `TMT` - Turkmenistani Manat + * `TRL` - Turkish Lira (1922–2005) - * `TMM` - Turkmenistani Manat (1993–2009) + * `TMT` - Turkmenistani Manat - * `USD` - US Dollar + * `TMM` - Turkmenistani Manat (1993–2009) - * `USN` - US Dollar (Next day) + * `USD` - US Dollar - * `USS` - US Dollar (Same day) + * `USN` - US Dollar (Next day) - * `UGX` - Ugandan Shilling + * `USS` - US Dollar (Same day) - * `UGS` - Ugandan Shilling (1966–1987) + * `UGX` - Ugandan Shilling - * `UAH` - Ukrainian Hryvnia + * `UGS` - Ugandan Shilling (1966–1987) - * `UAK` - Ukrainian Karbovanets + * `UAH` - Ukrainian Hryvnia - * `AED` - United Arab Emirates Dirham + * `UAK` - Ukrainian Karbovanets - * `UYW` - Uruguayan Nominal Wage Index Unit + * `AED` - United Arab Emirates Dirham - * `UYU` - Uruguayan Peso + * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYP` - Uruguayan Peso (1975–1993) + * `UYU` - Uruguayan Peso - * `UYI` - Uruguayan Peso (Indexed Units) + * `UYP` - Uruguayan Peso (1975–1993) - * `UZS` - Uzbekistani Som + * `UYI` - Uruguayan Peso (Indexed Units) - * `VUV` - Vanuatu Vatu + * `UZS` - Uzbekistani Som - * `VES` - Venezuelan Bolívar + * `VUV` - Vanuatu Vatu - * `VEB` - Venezuelan Bolívar (1871–2008) + * `VES` - Venezuelan Bolívar - * `VEF` - Venezuelan Bolívar (2008–2018) + * `VEB` - Venezuelan Bolívar (1871–2008) - * `VND` - Vietnamese Dong + * `VEF` - Venezuelan Bolívar (2008–2018) - * `VNN` - Vietnamese Dong (1978–1985) + * `VND` - Vietnamese Dong - * `CHE` - WIR Euro + * `VNN` - Vietnamese Dong (1978–1985) - * `CHW` - WIR Franc + * `CHE` - WIR Euro - * `XOF` - West African CFA Franc + * `CHW` - WIR Franc - * `YDD` - Yemeni Dinar + * `XOF` - West African CFA Franc - * `YER` - Yemeni Rial + * `YDD` - Yemeni Dinar - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `YER` - Yemeni Rial - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `ZWN` - ZWN + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZRN` - Zairean New Zaire (1993–1998) + * `ZWN` - ZWN - * `ZRZ` - Zairean Zaire (1971–1993) + * `ZRN` - Zairean New Zaire (1993–1998) - * `ZMW` - Zambian Kwacha + * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMK` - Zambian Kwacha (1968–2012) + * `ZMW` - Zambian Kwacha - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWR` - Zimbabwean Dollar (2008) + * `ZWD` - Zimbabwean Dollar (1980–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. + * `ZWR` - Zimbabwean Dollar (2008) - * `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: openapi/openapi.yml - JournalEntryResponse: - properties: - model: JournalEntry - warnings: list - errors: list - logs: optional> - source: - openapi: openapi/openapi.yml - JournalLineAccount: - discriminated: false - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - JournalLineTrackingCategory: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.yml - inline: true - JournalLineTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.yml - inline: true - JournalLineProject: - discriminated: false + * `ZWL` - Zimbabwean Dollar (2009) union: - - type: string - validation: - format: uuid - - Project + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - JournalLine: + PurchaseOrderLineItem: docs: >- - # The JournalLine Object + # The PurchaseOrderLineItem Object ### Description - The `JournalLine` object is used to represent a journal entry's line - items. + The `PurchaseOrderLineItem` object is used to represent a purchase order's + line item. ### Usage Example - Fetch from the `GET JournalEntry` endpoint and view the journal entry's - line items. + Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase + orders. properties: id: type: optional @@ -20283,20 +41861,44 @@ types: type: optional docs: The datetime that this object was modified by Merge. access: read-only - account: optional - net_amount: + description: + type: optional + docs: A description of the good being purchased. + unit_price: type: optional - docs: The value of the line item including taxes and other fees. + 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 + type: optional + docs: The purchase order line item's associated tracking category. + validation: + format: uuid availability: deprecated tracking_categories: - type: optional>> - docs: The journal line item's associated 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 + type: optional docs: >- - The journal line item's currency. + The purchase order line item's currency. * `XUA` - ADB Unit of Account @@ -20911,33 +42513,21 @@ types: * `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. + 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: >- @@ -20951,1276 +42541,697 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml - JournalLineRequestAccount: - discriminated: false - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - JournalLineRequestTrackingCategory: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.yml - inline: true - JournalLineRequestTrackingCategoriesItem: + openapi: accounting_v3.yml + PurchaseOrderLineItemRequestItem: discriminated: false union: - type: string validation: format: uuid - - TrackingCategory + - Item source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - JournalLineRequestProject: + PurchaseOrderLineItemRequestCurrency: discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: openapi/openapi.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) + The purchase order line item's currency. - * `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 + * `XUA` - ADB Unit of Account - * `BND` - Brunei Dollar + * `AFN` - Afghan Afghani - * `BGL` - Bulgarian Hard Lev + * `AFA` - Afghan Afghani (1927–2002) - * `BGN` - Bulgarian Lev + * `ALL` - Albanian Lek - * `BGO` - Bulgarian Lev (1879–1952) + * `ALK` - Albanian Lek (1946–1965) - * `BGM` - Bulgarian Socialist Lev + * `DZD` - Algerian Dinar - * `BUK` - Burmese Kyat + * `ADP` - Andorran Peseta - * `BIF` - Burundian Franc + * `AOA` - Angolan Kwanza - * `XPF` - CFP Franc + * `AOK` - Angolan Kwanza (1977–1991) - * `KHR` - Cambodian Riel + * `AON` - Angolan New Kwanza (1990–2000) - * `CAD` - Canadian Dollar + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `CVE` - Cape Verdean Escudo + * `ARA` - Argentine Austral - * `KYD` - Cayman Islands Dollar + * `ARS` - Argentine Peso - * `XAF` - Central African CFA Franc + * `ARM` - Argentine Peso (1881–1970) - * `CLE` - Chilean Escudo + * `ARP` - Argentine Peso (1983–1985) - * `CLP` - Chilean Peso + * `ARL` - Argentine Peso Ley (1970–1983) - * `CLF` - Chilean Unit of Account (UF) + * `AMD` - Armenian Dram - * `CNX` - Chinese People’s Bank Dollar + * `AWG` - Aruban Florin - * `CNY` - Chinese Yuan + * `AUD` - Australian Dollar - * `CNH` - Chinese Yuan (offshore) + * `ATS` - Austrian Schilling - * `COP` - Colombian Peso + * `AZN` - Azerbaijani Manat - * `COU` - Colombian Real Value Unit + * `AZM` - Azerbaijani Manat (1993–2006) - * `KMF` - Comorian Franc + * `BSD` - Bahamian Dollar - * `CDF` - Congolese Franc + * `BHD` - Bahraini Dinar - * `CRC` - Costa Rican Colón + * `BDT` - Bangladeshi Taka - * `HRD` - Croatian Dinar + * `BBD` - Barbadian Dollar - * `HRK` - Croatian Kuna + * `BYN` - Belarusian Ruble - * `CUC` - Cuban Convertible Peso + * `BYB` - Belarusian Ruble (1994–1999) - * `CUP` - Cuban Peso + * `BYR` - Belarusian Ruble (2000–2016) - * `CYP` - Cypriot Pound + * `BEF` - Belgian Franc - * `CZK` - Czech Koruna + * `BEC` - Belgian Franc (convertible) - * `CSK` - Czechoslovak Hard Koruna + * `BEL` - Belgian Franc (financial) - * `DKK` - Danish Krone + * `BZD` - Belize Dollar - * `DJF` - Djiboutian Franc + * `BMD` - Bermudan Dollar - * `DOP` - Dominican Peso + * `BTN` - Bhutanese Ngultrum - * `NLG` - Dutch Guilder + * `BOB` - Bolivian Boliviano - * `XCD` - East Caribbean Dollar + * `BOL` - Bolivian Boliviano (1863–1963) - * `DDM` - East German Mark + * `BOV` - Bolivian Mvdol - * `ECS` - Ecuadorian Sucre + * `BOP` - Bolivian Peso - * `ECV` - Ecuadorian Unit of Constant Value + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `EGP` - Egyptian Pound + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `GQE` - Equatorial Guinean Ekwele + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `ERN` - Eritrean Nakfa + * `BWP` - Botswanan Pula - * `EEK` - Estonian Kroon + * `BRC` - Brazilian Cruzado (1986–1989) - * `ETB` - Ethiopian Birr + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `EUR` - Euro + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `XBA` - European Composite Unit + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `XEU` - European Currency Unit + * `BRN` - Brazilian New Cruzado (1989–1990) - * `XBB` - European Monetary Unit + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `XBC` - European Unit of Account (XBC) + * `BRL` - Brazilian Real - * `XBD` - European Unit of Account (XBD) + * `GBP` - British Pound - * `FKP` - Falkland Islands Pound + * `BND` - Brunei Dollar - * `FJD` - Fijian Dollar + * `BGL` - Bulgarian Hard Lev - * `FIM` - Finnish Markka + * `BGN` - Bulgarian Lev - * `FRF` - French Franc + * `BGO` - Bulgarian Lev (1879–1952) - * `XFO` - French Gold Franc + * `BGM` - Bulgarian Socialist Lev - * `XFU` - French UIC-Franc + * `BUK` - Burmese Kyat - * `GMD` - Gambian Dalasi + * `BIF` - Burundian Franc - * `GEK` - Georgian Kupon Larit + * `XPF` - CFP Franc - * `GEL` - Georgian Lari + * `KHR` - Cambodian Riel - * `DEM` - German Mark + * `CAD` - Canadian Dollar - * `GHS` - Ghanaian Cedi + * `CVE` - Cape Verdean Escudo - * `GHC` - Ghanaian Cedi (1979–2007) + * `KYD` - Cayman Islands Dollar - * `GIP` - Gibraltar Pound + * `XAF` - Central African CFA Franc - * `XAU` - Gold + * `CLE` - Chilean Escudo - * `GRD` - Greek Drachma + * `CLP` - Chilean Peso - * `GTQ` - Guatemalan Quetzal + * `CLF` - Chilean Unit of Account (UF) - * `GWP` - Guinea-Bissau Peso + * `CNX` - Chinese People’s Bank Dollar - * `GNF` - Guinean Franc + * `CNY` - Chinese Yuan - * `GNS` - Guinean Syli + * `CNH` - Chinese Yuan (offshore) - * `GYD` - Guyanaese Dollar + * `COP` - Colombian Peso - * `HTG` - Haitian Gourde + * `COU` - Colombian Real Value Unit - * `HNL` - Honduran Lempira + * `KMF` - Comorian Franc - * `HKD` - Hong Kong Dollar + * `CDF` - Congolese Franc - * `HUF` - Hungarian Forint + * `CRC` - Costa Rican Colón - * `IMP` - IMP + * `HRD` - Croatian Dinar - * `ISK` - Icelandic Króna + * `HRK` - Croatian Kuna - * `ISJ` - Icelandic Króna (1918–1981) + * `CUC` - Cuban Convertible Peso - * `INR` - Indian Rupee + * `CUP` - Cuban Peso - * `IDR` - Indonesian Rupiah + * `CYP` - Cypriot Pound - * `IRR` - Iranian Rial + * `CZK` - Czech Koruna - * `IQD` - Iraqi Dinar + * `CSK` - Czechoslovak Hard Koruna - * `IEP` - Irish Pound + * `DKK` - Danish Krone - * `ILS` - Israeli New Shekel + * `DJF` - Djiboutian Franc - * `ILP` - Israeli Pound + * `DOP` - Dominican Peso - * `ILR` - Israeli Shekel (1980–1985) + * `NLG` - Dutch Guilder - * `ITL` - Italian Lira + * `XCD` - East Caribbean Dollar - * `JMD` - Jamaican Dollar + * `DDM` - East German Mark - * `JPY` - Japanese Yen + * `ECS` - Ecuadorian Sucre - * `JOD` - Jordanian Dinar + * `ECV` - Ecuadorian Unit of Constant Value - * `KZT` - Kazakhstani Tenge + * `EGP` - Egyptian Pound - * `KES` - Kenyan Shilling + * `GQE` - Equatorial Guinean Ekwele - * `KWD` - Kuwaiti Dinar + * `ERN` - Eritrean Nakfa - * `KGS` - Kyrgystani Som + * `EEK` - Estonian Kroon - * `LAK` - Laotian Kip + * `ETB` - Ethiopian Birr - * `LVL` - Latvian Lats + * `EUR` - Euro - * `LVR` - Latvian Ruble + * `XBA` - European Composite Unit - * `LBP` - Lebanese Pound + * `XEU` - European Currency Unit - * `LSL` - Lesotho Loti + * `XBB` - European Monetary Unit - * `LRD` - Liberian Dollar + * `XBC` - European Unit of Account (XBC) - * `LYD` - Libyan Dinar + * `XBD` - European Unit of Account (XBD) - * `LTL` - Lithuanian Litas + * `FKP` - Falkland Islands Pound - * `LTT` - Lithuanian Talonas + * `FJD` - Fijian Dollar - * `LUL` - Luxembourg Financial Franc + * `FIM` - Finnish Markka - * `LUC` - Luxembourgian Convertible Franc + * `FRF` - French Franc - * `LUF` - Luxembourgian Franc + * `XFO` - French Gold Franc - * `MOP` - Macanese Pataca + * `XFU` - French UIC-Franc - * `MKD` - Macedonian Denar + * `GMD` - Gambian Dalasi - * `MKN` - Macedonian Denar (1992–1993) + * `GEK` - Georgian Kupon Larit - * `MGA` - Malagasy Ariary + * `GEL` - Georgian Lari - * `MGF` - Malagasy Franc + * `DEM` - German Mark - * `MWK` - Malawian Kwacha + * `GHS` - Ghanaian Cedi - * `MYR` - Malaysian Ringgit + * `GHC` - Ghanaian Cedi (1979–2007) - * `MVR` - Maldivian Rufiyaa + * `GIP` - Gibraltar Pound - * `MVP` - Maldivian Rupee (1947–1981) + * `XAU` - Gold - * `MLF` - Malian Franc + * `GRD` - Greek Drachma - * `MTL` - Maltese Lira + * `GTQ` - Guatemalan Quetzal - * `MTP` - Maltese Pound + * `GWP` - Guinea-Bissau Peso - * `MRU` - Mauritanian Ouguiya + * `GNF` - Guinean Franc - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `GNS` - Guinean Syli - * `MUR` - Mauritian Rupee + * `GYD` - Guyanaese Dollar - * `MXV` - Mexican Investment Unit + * `HTG` - Haitian Gourde - * `MXN` - Mexican Peso + * `HNL` - Honduran Lempira - * `MXP` - Mexican Silver Peso (1861–1992) + * `HKD` - Hong Kong Dollar - * `MDC` - Moldovan Cupon + * `HUF` - Hungarian Forint - * `MDL` - Moldovan Leu + * `IMP` - IMP - * `MCF` - Monegasque Franc + * `ISK` - Icelandic Króna - * `MNT` - Mongolian Tugrik + * `ISJ` - Icelandic Króna (1918–1981) - * `MAD` - Moroccan Dirham + * `INR` - Indian Rupee - * `MAF` - Moroccan Franc + * `IDR` - Indonesian Rupiah - * `MZE` - Mozambican Escudo + * `IRR` - Iranian Rial - * `MZN` - Mozambican Metical + * `IQD` - Iraqi Dinar - * `MZM` - Mozambican Metical (1980–2006) + * `IEP` - Irish Pound - * `MMK` - Myanmar Kyat + * `ILS` - Israeli New Shekel - * `NAD` - Namibian Dollar + * `ILP` - Israeli Pound - * `NPR` - Nepalese Rupee + * `ILR` - Israeli Shekel (1980–1985) - * `ANG` - Netherlands Antillean Guilder + * `ITL` - Italian Lira - * `TWD` - New Taiwan Dollar + * `JMD` - Jamaican Dollar - * `NZD` - New Zealand Dollar + * `JPY` - Japanese Yen - * `NIO` - Nicaraguan Córdoba + * `JOD` - Jordanian Dinar - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `KZT` - Kazakhstani Tenge - * `NGN` - Nigerian Naira + * `KES` - Kenyan Shilling - * `KPW` - North Korean Won + * `KWD` - Kuwaiti Dinar - * `NOK` - Norwegian Krone + * `KGS` - Kyrgystani Som - * `OMR` - Omani Rial + * `LAK` - Laotian Kip - * `PKR` - Pakistani Rupee + * `LVL` - Latvian Lats - * `XPD` - Palladium + * `LVR` - Latvian Ruble - * `PAB` - Panamanian Balboa + * `LBP` - Lebanese Pound - * `PGK` - Papua New Guinean Kina + * `LSL` - Lesotho Loti - * `PYG` - Paraguayan Guarani + * `LRD` - Liberian Dollar - * `PEI` - Peruvian Inti + * `LYD` - Libyan Dinar - * `PEN` - Peruvian Sol + * `LTL` - Lithuanian Litas - * `PES` - Peruvian Sol (1863–1965) + * `LTT` - Lithuanian Talonas - * `PHP` - Philippine Peso + * `LUL` - Luxembourg Financial Franc - * `XPT` - Platinum + * `LUC` - Luxembourgian Convertible Franc - * `PLN` - Polish Zloty + * `LUF` - Luxembourgian Franc - * `PLZ` - Polish Zloty (1950–1995) + * `MOP` - Macanese Pataca - * `PTE` - Portuguese Escudo + * `MKD` - Macedonian Denar - * `GWE` - Portuguese Guinea Escudo + * `MKN` - Macedonian Denar (1992–1993) - * `QAR` - Qatari Rial + * `MGA` - Malagasy Ariary - * `XRE` - RINET Funds + * `MGF` - Malagasy Franc - * `RHD` - Rhodesian Dollar + * `MWK` - Malawian Kwacha - * `RON` - Romanian Leu + * `MYR` - Malaysian Ringgit - * `ROL` - Romanian Leu (1952–2006) + * `MVR` - Maldivian Rufiyaa - * `RUB` - Russian Ruble + * `MVP` - Maldivian Rupee (1947–1981) - * `RUR` - Russian Ruble (1991–1998) + * `MLF` - Malian Franc - * `RWF` - Rwandan Franc + * `MTL` - Maltese Lira - * `SVC` - Salvadoran Colón + * `MTP` - Maltese Pound - * `WST` - Samoan Tala + * `MRU` - Mauritanian Ouguiya - * `SAR` - Saudi Riyal + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `RSD` - Serbian Dinar + * `MUR` - Mauritian Rupee - * `CSD` - Serbian Dinar (2002–2006) + * `MXV` - Mexican Investment Unit - * `SCR` - Seychellois Rupee + * `MXN` - Mexican Peso - * `SLL` - Sierra Leonean Leone + * `MXP` - Mexican Silver Peso (1861–1992) - * `XAG` - Silver + * `MDC` - Moldovan Cupon - * `SGD` - Singapore Dollar + * `MDL` - Moldovan Leu - * `SKK` - Slovak Koruna + * `MCF` - Monegasque Franc - * `SIT` - Slovenian Tolar + * `MNT` - Mongolian Tugrik - * `SBD` - Solomon Islands Dollar + * `MAD` - Moroccan Dirham - * `SOS` - Somali Shilling + * `MAF` - Moroccan Franc - * `ZAR` - South African Rand + * `MZE` - Mozambican Escudo - * `ZAL` - South African Rand (financial) + * `MZN` - Mozambican Metical - * `KRH` - South Korean Hwan (1953–1962) + * `MZM` - Mozambican Metical (1980–2006) - * `KRW` - South Korean Won + * `MMK` - Myanmar Kyat - * `KRO` - South Korean Won (1945–1953) + * `NAD` - Namibian Dollar - * `SSP` - South Sudanese Pound + * `NPR` - Nepalese Rupee - * `SUR` - Soviet Rouble + * `ANG` - Netherlands Antillean Guilder - * `ESP` - Spanish Peseta + * `TWD` - New Taiwan Dollar - * `ESA` - Spanish Peseta (A account) + * `NZD` - New Zealand Dollar - * `ESB` - Spanish Peseta (convertible account) + * `NIO` - Nicaraguan Córdoba - * `XDR` - Special Drawing Rights + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `LKR` - Sri Lankan Rupee + * `NGN` - Nigerian Naira - * `SHP` - St. Helena Pound + * `KPW` - North Korean Won - * `XSU` - Sucre + * `NOK` - Norwegian Krone - * `SDD` - Sudanese Dinar (1992–2007) + * `OMR` - Omani Rial - * `SDG` - Sudanese Pound + * `PKR` - Pakistani Rupee - * `SDP` - Sudanese Pound (1957–1998) + * `XPD` - Palladium - * `SRD` - Surinamese Dollar + * `PAB` - Panamanian Balboa - * `SRG` - Surinamese Guilder + * `PGK` - Papua New Guinean Kina - * `SZL` - Swazi Lilangeni + * `PYG` - Paraguayan Guarani - * `SEK` - Swedish Krona + * `PEI` - Peruvian Inti - * `CHF` - Swiss Franc + * `PEN` - Peruvian Sol - * `SYP` - Syrian Pound + * `PES` - Peruvian Sol (1863–1965) - * `STN` - São Tomé & Príncipe Dobra + * `PHP` - Philippine Peso - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `XPT` - Platinum - * `TVD` - TVD + * `PLN` - Polish Zloty - * `TJR` - Tajikistani Ruble + * `PLZ` - Polish Zloty (1950–1995) - * `TJS` - Tajikistani Somoni + * `PTE` - Portuguese Escudo - * `TZS` - Tanzanian Shilling + * `GWE` - Portuguese Guinea Escudo - * `XTS` - Testing Currency Code + * `QAR` - Qatari Rial - * `THB` - Thai Baht + * `XRE` - RINET Funds - * `XXX` - The codes assigned for transactions where no currency is - involved + * `RHD` - Rhodesian Dollar - * `TPE` - Timorese Escudo + * `RON` - Romanian Leu - * `TOP` - Tongan Paʻanga + * `ROL` - Romanian Leu (1952–2006) - * `TTD` - Trinidad & Tobago Dollar + * `RUB` - Russian Ruble - * `TND` - Tunisian Dinar + * `RUR` - Russian Ruble (1991–1998) - * `TRY` - Turkish Lira + * `RWF` - Rwandan Franc - * `TRL` - Turkish Lira (1922–2005) + * `SVC` - Salvadoran Colón - * `TMT` - Turkmenistani Manat + * `WST` - Samoan Tala - * `TMM` - Turkmenistani Manat (1993–2009) + * `SAR` - Saudi Riyal - * `USD` - US Dollar + * `RSD` - Serbian Dinar - * `USN` - US Dollar (Next day) + * `CSD` - Serbian Dinar (2002–2006) - * `USS` - US Dollar (Same day) + * `SCR` - Seychellois Rupee - * `UGX` - Ugandan Shilling + * `SLL` - Sierra Leonean Leone - * `UGS` - Ugandan Shilling (1966–1987) + * `XAG` - Silver - * `UAH` - Ukrainian Hryvnia + * `SGD` - Singapore Dollar - * `UAK` - Ukrainian Karbovanets + * `SKK` - Slovak Koruna - * `AED` - United Arab Emirates Dirham + * `SIT` - Slovenian Tolar - * `UYW` - Uruguayan Nominal Wage Index Unit + * `SBD` - Solomon Islands Dollar - * `UYU` - Uruguayan Peso + * `SOS` - Somali Shilling - * `UYP` - Uruguayan Peso (1975–1993) + * `ZAR` - South African Rand - * `UYI` - Uruguayan Peso (Indexed Units) + * `ZAL` - South African Rand (financial) - * `UZS` - Uzbekistani Som + * `KRH` - South Korean Hwan (1953–1962) - * `VUV` - Vanuatu Vatu + * `KRW` - South Korean Won - * `VES` - Venezuelan Bolívar + * `KRO` - South Korean Won (1945–1953) - * `VEB` - Venezuelan Bolívar (1871–2008) + * `SSP` - South Sudanese Pound - * `VEF` - Venezuelan Bolívar (2008–2018) + * `SUR` - Soviet Rouble - * `VND` - Vietnamese Dong + * `ESP` - Spanish Peseta - * `VNN` - Vietnamese Dong (1978–1985) + * `ESA` - Spanish Peseta (A account) - * `CHE` - WIR Euro + * `ESB` - Spanish Peseta (convertible account) - * `CHW` - WIR Franc + * `XDR` - Special Drawing Rights - * `XOF` - West African CFA Franc + * `LKR` - Sri Lankan Rupee - * `YDD` - Yemeni Dinar + * `SHP` - St. Helena Pound - * `YER` - Yemeni Rial + * `XSU` - Sucre - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `SDD` - Sudanese Dinar (1992–2007) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `SDG` - Sudanese Pound - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `SDP` - Sudanese Pound (1957–1998) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `SRD` - Surinamese Dollar - * `ZWN` - ZWN + * `SRG` - Surinamese Guilder - * `ZRN` - Zairean New Zaire (1993–1998) + * `SZL` - Swazi Lilangeni - * `ZRZ` - Zairean Zaire (1971–1993) + * `SEK` - Swedish Krona - * `ZMW` - Zambian Kwacha + * `CHF` - Swiss Franc - * `ZMK` - Zambian Kwacha (1968–2012) + * `SYP` - Syrian Pound - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `STN` - São Tomé & Príncipe Dobra - * `ZWR` - Zimbabwean Dollar (2008) + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `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: openapi/openapi.yml - LanguageEnum: - enum: - - en - - de - docs: |- - * `en` - en - * `de` - de - source: - openapi: openapi/openapi.yml - LastSyncResultEnum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - docs: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - source: - openapi: openapi/openapi.yml - LinkToken: - properties: - link_token: string - integration_name: optional - magic_link_url: optional - source: - openapi: openapi/openapi.yml - LinkedAccountStatus: - properties: - linked_account_status: string - can_make_request: boolean - source: - openapi: openapi/openapi.yml - MetaResponse: - properties: - request_schema: map - remote_field_classes: optional> - status: optional - has_conditional_params: boolean - has_required_linked_account_params: boolean - source: - openapi: openapi/openapi.yml - MethodEnum: - enum: - - GET - - OPTIONS - - HEAD - - POST - - PUT - - PATCH - - DELETE - docs: |- - * `GET` - GET - * `OPTIONS` - OPTIONS - * `HEAD` - HEAD - * `POST` - POST - * `PUT` - PUT - * `PATCH` - PATCH - * `DELETE` - DELETE - source: - openapi: openapi/openapi.yml - 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: openapi/openapi.yml - ModelOperation: - docs: >- - # The ModelOperation Object + * `TVD` - TVD - ### Description + * `TJR` - Tajikistani Ruble - The `ModelOperation` object is used to represent the operations that are - currently supported for a given model. + * `TJS` - Tajikistani Somoni + * `TZS` - Tanzanian Shilling - ### Usage Example + * `XTS` - Testing Currency Code - View what operations are supported for the `Candidate` endpoint. - properties: - model_name: string - available_operations: list - required_post_parameters: list - supported_fields: list - source: - openapi: openapi/openapi.yml - ModelPermissionDeserializer: - properties: - is_enabled: optional - source: - openapi: openapi/openapi.yml - ModelPermissionDeserializerRequest: - properties: - is_enabled: optional - source: - openapi: openapi/openapi.yml - MultipartFormFieldRequest: - docs: >- - # The MultipartFormField Object + * `THB` - Thai Baht - ### Description + * `XXX` - The codes assigned for transactions where no currency is + involved - The `MultipartFormField` object is used to represent fields in an HTTP - request using `multipart/form-data`. + * `TPE` - Timorese Escudo + * `TOP` - Tongan Paʻanga - ### Usage Example + * `TTD` - Trinidad & Tobago Dollar - 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. + * `TND` - Tunisian Dinar - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - file_name: - type: optional - docs: The file name of the form field, if the field is for a file. - validation: - minLength: 1 - content_type: - type: optional - docs: The MIME type of the file, if the field is for a file. - validation: - minLength: 1 - source: - openapi: openapi/openapi.yml - PaginatedAccountDetailsAndActionsList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedAccountList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedAccountingAttachmentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedAccountingPeriodList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedAuditLogEventList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedBalanceSheetList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedBankFeedAccountList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedBankFeedTransactionList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedCashFlowStatementList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedCompanyInfoList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedContactList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedCreditNoteList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedEmployeeList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedExpenseList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedGeneralLedgerTransactionList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedIncomeStatementList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedInvoiceList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedIssueList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedItemList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedJournalEntryList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedPaymentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedPaymentMethodList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedPaymentTermList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedProjectList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedPurchaseOrderList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedRemoteFieldClassList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedSyncStatusList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedTaxRateList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedTrackingCategoryList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedTransactionList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: openapi/openapi.yml - PaginatedVendorCreditList: - properties: - next: optional - previous: optional - results: optional> + * `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: openapi/openapi.yml - PatchedItemRequestRequest: - docs: |- - # The Item Object + openapi: accounting_v3.yml + inline: true + PurchaseOrderLineItemRequest: + docs: >- + # The PurchaseOrderLineItem Object + ### Description - The `Item` object refers to the goods involved in a transaction. + + The `PurchaseOrderLineItem` object is used to represent a purchase order's + line item. + ### Usage Example - Fetch from the `LIST Items` endpoint and view a company's items. + + Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase + orders. properties: - name: + remote_id: 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 + 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 item's unit price. - purchase_price: + docs: The line item's unit price. + quantity: 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: + docs: The line item's quantity. + item: optional + account: type: optional - docs: References the default account used to record a sale. + docs: The purchase order line item's account. validation: format: uuid - company: + tracking_category: type: optional - docs: The company the item belongs to. + docs: The purchase order line item's associated tracking category. validation: format: uuid - purchase_tax_rate: + availability: deprecated + tracking_categories: + type: optional>> + docs: The purchase order line item's associated tracking categories. + tax_amount: type: optional - docs: The default purchase tax rate for this item. + docs: The purchase order line item's tax amount. validation: - format: uuid - sales_tax_rate: + pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ + total_line_amount: 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: openapi/openapi.yml - PatchedPaymentRequestContact: - discriminated: false - docs: The supplier, or customer involved in the payment. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.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: openapi/openapi.yml - inline: true - PatchedPaymentRequestPaymentMethod: - discriminated: false - docs: The method which this payment was made by. - union: - - type: string - validation: - format: uuid - - PaymentMethod - source: - openapi: openapi/openapi.yml - inline: true - PatchedPaymentRequestCompany: - discriminated: false - docs: The company the payment belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - PatchedPaymentRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.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: openapi/openapi.yml - inline: true - PatchedPaymentRequestAppliedToLinesItem: - discriminated: false - union: - - type: string + docs: The purchase order line item's total amount. validation: - format: uuid - - PaymentLineItemRequest - source: - openapi: openapi/openapi.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. + pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ currency: - type: optional + type: optional docs: >- - The payment's currency. + The purchase order line item's currency. * `XUA` - ADB Unit of Account @@ -22835,33 +43846,21 @@ types: * `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 payment's exchange rate. + docs: The purchase order line item'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. + type: optional + docs: The company the purchase order line item belongs to. + validation: + format: uuid integration_params: type: optional> access: write-only @@ -22872,1003 +43871,692 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml - PaymentContact: + openapi: accounting_v3.yml + PurchaseOrderRequestStatus: discriminated: false - docs: The supplier, or customer involved in the payment. + docs: |- + The purchase order's status. + + * `DRAFT` - DRAFT + * `SUBMITTED` - SUBMITTED + * `AUTHORIZED` - AUTHORIZED + * `BILLED` - BILLED + * `DELETED` - DELETED union: - - type: string - validation: - format: uuid - - Contact + - PurchaseOrderStatusEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PaymentAccount: + PurchaseOrderRequestDeliveryAddress: discriminated: false - docs: The supplier’s or customer’s account in which the payment is made. + docs: The purchase order's delivery address. union: - type: string validation: format: uuid - - Account + - Address source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PaymentPaymentMethod: + PurchaseOrderRequestVendor: discriminated: false - docs: The method which this payment was made by. + docs: The party fulfilling the purchase order. union: - type: string validation: format: uuid - - PaymentMethod + - Contact source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PaymentCompany: + PurchaseOrderRequestCompany: discriminated: false - docs: The company the payment belongs to. + docs: The company the purchase order belongs to. union: - type: string validation: format: uuid - CompanyInfo source: - openapi: openapi/openapi.yml - inline: true - PaymentTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PaymentAccountingPeriod: + PurchaseOrderRequestPaymentTerm: discriminated: false - docs: The accounting period that the Payment was generated in. + docs: The payment term that applies to this transaction. union: - type: string validation: format: uuid - - AccountingPeriod + - PaymentTerm source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PaymentAppliedToLinesItem: + PurchaseOrderRequestCurrency: discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItem - source: - openapi: openapi/openapi.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 + The purchase order's currency. - * `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 + * `XUA` - ADB Unit of Account - * `ATS` - Austrian Schilling + * `AFN` - Afghan Afghani - * `AZN` - Azerbaijani Manat + * `AFA` - Afghan Afghani (1927–2002) - * `AZM` - Azerbaijani Manat (1993–2006) + * `ALL` - Albanian Lek - * `BSD` - Bahamian Dollar + * `ALK` - Albanian Lek (1946–1965) - * `BHD` - Bahraini Dinar + * `DZD` - Algerian Dinar - * `BDT` - Bangladeshi Taka + * `ADP` - Andorran Peseta - * `BBD` - Barbadian Dollar + * `AOA` - Angolan Kwanza - * `BYN` - Belarusian Ruble + * `AOK` - Angolan Kwanza (1977–1991) - * `BYB` - Belarusian Ruble (1994–1999) + * `AON` - Angolan New Kwanza (1990–2000) - * `BYR` - Belarusian Ruble (2000–2016) + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `BEF` - Belgian Franc + * `ARA` - Argentine Austral - * `BEC` - Belgian Franc (convertible) + * `ARS` - Argentine Peso - * `BEL` - Belgian Franc (financial) + * `ARM` - Argentine Peso (1881–1970) - * `BZD` - Belize Dollar + * `ARP` - Argentine Peso (1983–1985) - * `BMD` - Bermudan Dollar + * `ARL` - Argentine Peso Ley (1970–1983) - * `BTN` - Bhutanese Ngultrum + * `AMD` - Armenian Dram - * `BOB` - Bolivian Boliviano + * `AWG` - Aruban Florin - * `BOL` - Bolivian Boliviano (1863–1963) + * `AUD` - Australian Dollar - * `BOV` - Bolivian Mvdol + * `ATS` - Austrian Schilling - * `BOP` - Bolivian Peso + * `AZN` - Azerbaijani Manat - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `AZM` - Azerbaijani Manat (1993–2006) - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BSD` - Bahamian Dollar - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BHD` - Bahraini Dinar - * `BWP` - Botswanan Pula + * `BDT` - Bangladeshi Taka - * `BRC` - Brazilian Cruzado (1986–1989) + * `BBD` - Barbadian Dollar - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BYN` - Belarusian Ruble - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BYB` - Belarusian Ruble (1994–1999) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BYR` - Belarusian Ruble (2000–2016) - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BEF` - Belgian Franc - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BEC` - Belgian Franc (convertible) - * `BRL` - Brazilian Real + * `BEL` - Belgian Franc (financial) - * `GBP` - British Pound + * `BZD` - Belize Dollar - * `BND` - Brunei Dollar + * `BMD` - Bermudan Dollar - * `BGL` - Bulgarian Hard Lev + * `BTN` - Bhutanese Ngultrum - * `BGN` - Bulgarian Lev + * `BOB` - Bolivian Boliviano - * `BGO` - Bulgarian Lev (1879–1952) + * `BOL` - Bolivian Boliviano (1863–1963) - * `BGM` - Bulgarian Socialist Lev + * `BOV` - Bolivian Mvdol - * `BUK` - Burmese Kyat + * `BOP` - Bolivian Peso - * `BIF` - Burundian Franc + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `XPF` - CFP Franc + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `KHR` - Cambodian Riel + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `CAD` - Canadian Dollar + * `BWP` - Botswanan Pula - * `CVE` - Cape Verdean Escudo + * `BRC` - Brazilian Cruzado (1986–1989) - * `KYD` - Cayman Islands Dollar + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `XAF` - Central African CFA Franc + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `CLE` - Chilean Escudo + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `CLP` - Chilean Peso + * `BRN` - Brazilian New Cruzado (1989–1990) - * `CLF` - Chilean Unit of Account (UF) + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `CNX` - Chinese People’s Bank Dollar + * `BRL` - Brazilian Real - * `CNY` - Chinese Yuan + * `GBP` - British Pound - * `CNH` - Chinese Yuan (offshore) + * `BND` - Brunei Dollar - * `COP` - Colombian Peso + * `BGL` - Bulgarian Hard Lev - * `COU` - Colombian Real Value Unit + * `BGN` - Bulgarian Lev - * `KMF` - Comorian Franc + * `BGO` - Bulgarian Lev (1879–1952) - * `CDF` - Congolese Franc + * `BGM` - Bulgarian Socialist Lev - * `CRC` - Costa Rican Colón + * `BUK` - Burmese Kyat - * `HRD` - Croatian Dinar + * `BIF` - Burundian Franc - * `HRK` - Croatian Kuna + * `XPF` - CFP Franc - * `CUC` - Cuban Convertible Peso + * `KHR` - Cambodian Riel - * `CUP` - Cuban Peso + * `CAD` - Canadian Dollar - * `CYP` - Cypriot Pound + * `CVE` - Cape Verdean Escudo - * `CZK` - Czech Koruna + * `KYD` - Cayman Islands Dollar - * `CSK` - Czechoslovak Hard Koruna + * `XAF` - Central African CFA Franc - * `DKK` - Danish Krone + * `CLE` - Chilean Escudo - * `DJF` - Djiboutian Franc + * `CLP` - Chilean Peso - * `DOP` - Dominican Peso + * `CLF` - Chilean Unit of Account (UF) - * `NLG` - Dutch Guilder + * `CNX` - Chinese People’s Bank Dollar - * `XCD` - East Caribbean Dollar + * `CNY` - Chinese Yuan - * `DDM` - East German Mark + * `CNH` - Chinese Yuan (offshore) - * `ECS` - Ecuadorian Sucre + * `COP` - Colombian Peso - * `ECV` - Ecuadorian Unit of Constant Value + * `COU` - Colombian Real Value Unit - * `EGP` - Egyptian Pound + * `KMF` - Comorian Franc - * `GQE` - Equatorial Guinean Ekwele + * `CDF` - Congolese Franc - * `ERN` - Eritrean Nakfa + * `CRC` - Costa Rican Colón - * `EEK` - Estonian Kroon + * `HRD` - Croatian Dinar - * `ETB` - Ethiopian Birr + * `HRK` - Croatian Kuna - * `EUR` - Euro + * `CUC` - Cuban Convertible Peso - * `XBA` - European Composite Unit + * `CUP` - Cuban Peso - * `XEU` - European Currency Unit + * `CYP` - Cypriot Pound - * `XBB` - European Monetary Unit + * `CZK` - Czech Koruna - * `XBC` - European Unit of Account (XBC) + * `CSK` - Czechoslovak Hard Koruna - * `XBD` - European Unit of Account (XBD) + * `DKK` - Danish Krone - * `FKP` - Falkland Islands Pound + * `DJF` - Djiboutian Franc - * `FJD` - Fijian Dollar + * `DOP` - Dominican Peso - * `FIM` - Finnish Markka + * `NLG` - Dutch Guilder - * `FRF` - French Franc + * `XCD` - East Caribbean Dollar - * `XFO` - French Gold Franc + * `DDM` - East German Mark - * `XFU` - French UIC-Franc + * `ECS` - Ecuadorian Sucre - * `GMD` - Gambian Dalasi + * `ECV` - Ecuadorian Unit of Constant Value - * `GEK` - Georgian Kupon Larit + * `EGP` - Egyptian Pound - * `GEL` - Georgian Lari + * `GQE` - Equatorial Guinean Ekwele - * `DEM` - German Mark + * `ERN` - Eritrean Nakfa - * `GHS` - Ghanaian Cedi + * `EEK` - Estonian Kroon - * `GHC` - Ghanaian Cedi (1979–2007) + * `ETB` - Ethiopian Birr - * `GIP` - Gibraltar Pound + * `EUR` - Euro - * `XAU` - Gold + * `XBA` - European Composite Unit - * `GRD` - Greek Drachma + * `XEU` - European Currency Unit - * `GTQ` - Guatemalan Quetzal + * `XBB` - European Monetary Unit - * `GWP` - Guinea-Bissau Peso + * `XBC` - European Unit of Account (XBC) - * `GNF` - Guinean Franc + * `XBD` - European Unit of Account (XBD) - * `GNS` - Guinean Syli + * `FKP` - Falkland Islands Pound - * `GYD` - Guyanaese Dollar + * `FJD` - Fijian Dollar - * `HTG` - Haitian Gourde + * `FIM` - Finnish Markka - * `HNL` - Honduran Lempira + * `FRF` - French Franc - * `HKD` - Hong Kong Dollar + * `XFO` - French Gold Franc - * `HUF` - Hungarian Forint + * `XFU` - French UIC-Franc - * `IMP` - IMP + * `GMD` - Gambian Dalasi - * `ISK` - Icelandic Króna + * `GEK` - Georgian Kupon Larit - * `ISJ` - Icelandic Króna (1918–1981) + * `GEL` - Georgian Lari - * `INR` - Indian Rupee + * `DEM` - German Mark - * `IDR` - Indonesian Rupiah + * `GHS` - Ghanaian Cedi - * `IRR` - Iranian Rial + * `GHC` - Ghanaian Cedi (1979–2007) - * `IQD` - Iraqi Dinar + * `GIP` - Gibraltar Pound - * `IEP` - Irish Pound + * `XAU` - Gold - * `ILS` - Israeli New Shekel + * `GRD` - Greek Drachma - * `ILP` - Israeli Pound + * `GTQ` - Guatemalan Quetzal - * `ILR` - Israeli Shekel (1980–1985) + * `GWP` - Guinea-Bissau Peso - * `ITL` - Italian Lira + * `GNF` - Guinean Franc - * `JMD` - Jamaican Dollar + * `GNS` - Guinean Syli - * `JPY` - Japanese Yen + * `GYD` - Guyanaese Dollar - * `JOD` - Jordanian Dinar + * `HTG` - Haitian Gourde - * `KZT` - Kazakhstani Tenge + * `HNL` - Honduran Lempira - * `KES` - Kenyan Shilling + * `HKD` - Hong Kong Dollar - * `KWD` - Kuwaiti Dinar + * `HUF` - Hungarian Forint - * `KGS` - Kyrgystani Som + * `IMP` - IMP - * `LAK` - Laotian Kip + * `ISK` - Icelandic Króna - * `LVL` - Latvian Lats + * `ISJ` - Icelandic Króna (1918–1981) - * `LVR` - Latvian Ruble + * `INR` - Indian Rupee - * `LBP` - Lebanese Pound + * `IDR` - Indonesian Rupiah - * `LSL` - Lesotho Loti + * `IRR` - Iranian Rial - * `LRD` - Liberian Dollar + * `IQD` - Iraqi Dinar - * `LYD` - Libyan Dinar + * `IEP` - Irish Pound - * `LTL` - Lithuanian Litas + * `ILS` - Israeli New Shekel - * `LTT` - Lithuanian Talonas + * `ILP` - Israeli Pound - * `LUL` - Luxembourg Financial Franc + * `ILR` - Israeli Shekel (1980–1985) - * `LUC` - Luxembourgian Convertible Franc + * `ITL` - Italian Lira - * `LUF` - Luxembourgian Franc + * `JMD` - Jamaican Dollar - * `MOP` - Macanese Pataca + * `JPY` - Japanese Yen - * `MKD` - Macedonian Denar + * `JOD` - Jordanian Dinar - * `MKN` - Macedonian Denar (1992–1993) + * `KZT` - Kazakhstani Tenge - * `MGA` - Malagasy Ariary + * `KES` - Kenyan Shilling - * `MGF` - Malagasy Franc + * `KWD` - Kuwaiti Dinar - * `MWK` - Malawian Kwacha + * `KGS` - Kyrgystani Som - * `MYR` - Malaysian Ringgit + * `LAK` - Laotian Kip - * `MVR` - Maldivian Rufiyaa + * `LVL` - Latvian Lats - * `MVP` - Maldivian Rupee (1947–1981) + * `LVR` - Latvian Ruble - * `MLF` - Malian Franc + * `LBP` - Lebanese Pound - * `MTL` - Maltese Lira + * `LSL` - Lesotho Loti - * `MTP` - Maltese Pound + * `LRD` - Liberian Dollar - * `MRU` - Mauritanian Ouguiya + * `LYD` - Libyan Dinar - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `LTL` - Lithuanian Litas - * `MUR` - Mauritian Rupee + * `LTT` - Lithuanian Talonas - * `MXV` - Mexican Investment Unit + * `LUL` - Luxembourg Financial Franc - * `MXN` - Mexican Peso + * `LUC` - Luxembourgian Convertible Franc - * `MXP` - Mexican Silver Peso (1861–1992) + * `LUF` - Luxembourgian Franc - * `MDC` - Moldovan Cupon + * `MOP` - Macanese Pataca - * `MDL` - Moldovan Leu + * `MKD` - Macedonian Denar - * `MCF` - Monegasque Franc + * `MKN` - Macedonian Denar (1992–1993) - * `MNT` - Mongolian Tugrik + * `MGA` - Malagasy Ariary - * `MAD` - Moroccan Dirham + * `MGF` - Malagasy Franc - * `MAF` - Moroccan Franc + * `MWK` - Malawian Kwacha - * `MZE` - Mozambican Escudo + * `MYR` - Malaysian Ringgit - * `MZN` - Mozambican Metical + * `MVR` - Maldivian Rufiyaa - * `MZM` - Mozambican Metical (1980–2006) + * `MVP` - Maldivian Rupee (1947–1981) - * `MMK` - Myanmar Kyat + * `MLF` - Malian Franc - * `NAD` - Namibian Dollar + * `MTL` - Maltese Lira - * `NPR` - Nepalese Rupee + * `MTP` - Maltese Pound - * `ANG` - Netherlands Antillean Guilder + * `MRU` - Mauritanian Ouguiya - * `TWD` - New Taiwan Dollar + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `NZD` - New Zealand Dollar + * `MUR` - Mauritian Rupee - * `NIO` - Nicaraguan Córdoba + * `MXV` - Mexican Investment Unit - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `MXN` - Mexican Peso - * `NGN` - Nigerian Naira + * `MXP` - Mexican Silver Peso (1861–1992) - * `KPW` - North Korean Won + * `MDC` - Moldovan Cupon - * `NOK` - Norwegian Krone + * `MDL` - Moldovan Leu - * `OMR` - Omani Rial + * `MCF` - Monegasque Franc - * `PKR` - Pakistani Rupee + * `MNT` - Mongolian Tugrik - * `XPD` - Palladium + * `MAD` - Moroccan Dirham - * `PAB` - Panamanian Balboa + * `MAF` - Moroccan Franc - * `PGK` - Papua New Guinean Kina + * `MZE` - Mozambican Escudo - * `PYG` - Paraguayan Guarani + * `MZN` - Mozambican Metical - * `PEI` - Peruvian Inti + * `MZM` - Mozambican Metical (1980–2006) - * `PEN` - Peruvian Sol + * `MMK` - Myanmar Kyat - * `PES` - Peruvian Sol (1863–1965) + * `NAD` - Namibian Dollar - * `PHP` - Philippine Peso + * `NPR` - Nepalese Rupee - * `XPT` - Platinum + * `ANG` - Netherlands Antillean Guilder - * `PLN` - Polish Zloty + * `TWD` - New Taiwan Dollar - * `PLZ` - Polish Zloty (1950–1995) + * `NZD` - New Zealand Dollar - * `PTE` - Portuguese Escudo + * `NIO` - Nicaraguan Córdoba - * `GWE` - Portuguese Guinea Escudo + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `QAR` - Qatari Rial + * `NGN` - Nigerian Naira - * `XRE` - RINET Funds + * `KPW` - North Korean Won - * `RHD` - Rhodesian Dollar + * `NOK` - Norwegian Krone - * `RON` - Romanian Leu + * `OMR` - Omani Rial - * `ROL` - Romanian Leu (1952–2006) + * `PKR` - Pakistani Rupee - * `RUB` - Russian Ruble + * `XPD` - Palladium - * `RUR` - Russian Ruble (1991–1998) + * `PAB` - Panamanian Balboa - * `RWF` - Rwandan Franc + * `PGK` - Papua New Guinean Kina - * `SVC` - Salvadoran Colón + * `PYG` - Paraguayan Guarani - * `WST` - Samoan Tala + * `PEI` - Peruvian Inti - * `SAR` - Saudi Riyal + * `PEN` - Peruvian Sol - * `RSD` - Serbian Dinar + * `PES` - Peruvian Sol (1863–1965) - * `CSD` - Serbian Dinar (2002–2006) + * `PHP` - Philippine Peso - * `SCR` - Seychellois Rupee + * `XPT` - Platinum - * `SLL` - Sierra Leonean Leone + * `PLN` - Polish Zloty - * `XAG` - Silver + * `PLZ` - Polish Zloty (1950–1995) - * `SGD` - Singapore Dollar + * `PTE` - Portuguese Escudo - * `SKK` - Slovak Koruna + * `GWE` - Portuguese Guinea Escudo - * `SIT` - Slovenian Tolar + * `QAR` - Qatari Rial - * `SBD` - Solomon Islands Dollar + * `XRE` - RINET Funds - * `SOS` - Somali Shilling + * `RHD` - Rhodesian Dollar - * `ZAR` - South African Rand + * `RON` - Romanian Leu - * `ZAL` - South African Rand (financial) + * `ROL` - Romanian Leu (1952–2006) - * `KRH` - South Korean Hwan (1953–1962) + * `RUB` - Russian Ruble - * `KRW` - South Korean Won + * `RUR` - Russian Ruble (1991–1998) - * `KRO` - South Korean Won (1945–1953) + * `RWF` - Rwandan Franc - * `SSP` - South Sudanese Pound + * `SVC` - Salvadoran Colón - * `SUR` - Soviet Rouble + * `WST` - Samoan Tala - * `ESP` - Spanish Peseta + * `SAR` - Saudi Riyal - * `ESA` - Spanish Peseta (A account) + * `RSD` - Serbian Dinar - * `ESB` - Spanish Peseta (convertible account) + * `CSD` - Serbian Dinar (2002–2006) - * `XDR` - Special Drawing Rights + * `SCR` - Seychellois Rupee - * `LKR` - Sri Lankan Rupee + * `SLL` - Sierra Leonean Leone - * `SHP` - St. Helena Pound + * `XAG` - Silver - * `XSU` - Sucre + * `SGD` - Singapore Dollar - * `SDD` - Sudanese Dinar (1992–2007) + * `SKK` - Slovak Koruna - * `SDG` - Sudanese Pound + * `SIT` - Slovenian Tolar - * `SDP` - Sudanese Pound (1957–1998) + * `SBD` - Solomon Islands Dollar - * `SRD` - Surinamese Dollar + * `SOS` - Somali Shilling - * `SRG` - Surinamese Guilder + * `ZAR` - South African Rand - * `SZL` - Swazi Lilangeni + * `ZAL` - South African Rand (financial) - * `SEK` - Swedish Krona + * `KRH` - South Korean Hwan (1953–1962) - * `CHF` - Swiss Franc + * `KRW` - South Korean Won - * `SYP` - Syrian Pound + * `KRO` - South Korean Won (1945–1953) - * `STN` - São Tomé & Príncipe Dobra + * `SSP` - South Sudanese Pound - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `SUR` - Soviet Rouble - * `TVD` - TVD + * `ESP` - Spanish Peseta - * `TJR` - Tajikistani Ruble + * `ESA` - Spanish Peseta (A account) - * `TJS` - Tajikistani Somoni + * `ESB` - Spanish Peseta (convertible account) - * `TZS` - Tanzanian Shilling + * `XDR` - Special Drawing Rights - * `XTS` - Testing Currency Code + * `LKR` - Sri Lankan Rupee - * `THB` - Thai Baht + * `SHP` - St. Helena Pound - * `XXX` - The codes assigned for transactions where no currency is - involved + * `XSU` - Sucre - * `TPE` - Timorese Escudo + * `SDD` - Sudanese Dinar (1992–2007) - * `TOP` - Tongan Paʻanga + * `SDG` - Sudanese Pound - * `TTD` - Trinidad & Tobago Dollar + * `SDP` - Sudanese Pound (1957–1998) - * `TND` - Tunisian Dinar + * `SRD` - Surinamese Dollar - * `TRY` - Turkish Lira + * `SRG` - Surinamese Guilder - * `TRL` - Turkish Lira (1922–2005) + * `SZL` - Swazi Lilangeni - * `TMT` - Turkmenistani Manat + * `SEK` - Swedish Krona - * `TMM` - Turkmenistani Manat (1993–2009) + * `CHF` - Swiss Franc - * `USD` - US Dollar + * `SYP` - Syrian Pound - * `USN` - US Dollar (Next day) + * `STN` - São Tomé & Príncipe Dobra - * `USS` - US Dollar (Same day) + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `UGX` - Ugandan Shilling + * `TVD` - TVD - * `UGS` - Ugandan Shilling (1966–1987) + * `TJR` - Tajikistani Ruble - * `UAH` - Ukrainian Hryvnia + * `TJS` - Tajikistani Somoni - * `UAK` - Ukrainian Karbovanets + * `TZS` - Tanzanian Shilling - * `AED` - United Arab Emirates Dirham + * `XTS` - Testing Currency Code - * `UYW` - Uruguayan Nominal Wage Index Unit + * `THB` - Thai Baht - * `UYU` - Uruguayan Peso + * `XXX` - The codes assigned for transactions where no currency is + involved - * `UYP` - Uruguayan Peso (1975–1993) + * `TPE` - Timorese Escudo - * `UYI` - Uruguayan Peso (Indexed Units) + * `TOP` - Tongan Paʻanga - * `UZS` - Uzbekistani Som + * `TTD` - Trinidad & Tobago Dollar - * `VUV` - Vanuatu Vatu + * `TND` - Tunisian Dinar - * `VES` - Venezuelan Bolívar + * `TRY` - Turkish Lira - * `VEB` - Venezuelan Bolívar (1871–2008) + * `TRL` - Turkish Lira (1922–2005) - * `VEF` - Venezuelan Bolívar (2008–2018) + * `TMT` - Turkmenistani Manat - * `VND` - Vietnamese Dong + * `TMM` - Turkmenistani Manat (1993–2009) - * `VNN` - Vietnamese Dong (1978–1985) + * `USD` - US Dollar - * `CHE` - WIR Euro + * `USN` - US Dollar (Next day) - * `CHW` - WIR Franc + * `USS` - US Dollar (Same day) - * `XOF` - West African CFA Franc + * `UGX` - Ugandan Shilling - * `YDD` - Yemeni Dinar + * `UGS` - Ugandan Shilling (1966–1987) - * `YER` - Yemeni Rial + * `UAH` - Ukrainian Hryvnia - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `UAK` - Ukrainian Karbovanets - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `AED` - United Arab Emirates Dirham - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `UYW` - Uruguayan Nominal Wage Index Unit - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `UYU` - Uruguayan Peso - * `ZWN` - ZWN + * `UYP` - Uruguayan Peso (1975–1993) - * `ZRN` - Zairean New Zaire (1993–1998) + * `UYI` - Uruguayan Peso (Indexed Units) - * `ZRZ` - Zairean Zaire (1971–1993) + * `UZS` - Uzbekistani Som - * `ZMW` - Zambian Kwacha + * `VUV` - Vanuatu Vatu - * `ZMK` - Zambian Kwacha (1968–2012) + * `VES` - Venezuelan Bolívar - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `VEB` - Venezuelan Bolívar (1871–2008) - * `ZWR` - Zimbabwean Dollar (2008) + * `VEF` - Venezuelan Bolívar (2008–2018) - * `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. + * `VND` - Vietnamese Dong - * `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: openapi/openapi.yml - PaymentLineItem: - docs: >- - # The PaymentLineItem Object + * `VNN` - Vietnamese Dong (1978–1985) - ### Description + * `CHE` - WIR Euro - The `PaymentLineItem` object is an applied-to-line on a `Payment` that can - either be a `Invoice`, `CreditNote`, or `JournalEntry`. + * `CHW` - WIR Franc + * `XOF` - West African CFA Franc - ### Usage Example + * `YDD` - Yemeni Dinar - `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: openapi/openapi.yml - PaymentLineItemRequest: - docs: >- - # The PaymentLineItem Object + * `YER` - Yemeni Rial - ### Description + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - The `PaymentLineItem` object is an applied-to-line on a `Payment` that can - either be a `Invoice`, `CreditNote`, or `JournalEntry`. + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUM` - Yugoslavian New Dinar (1994–2002) - ### Usage Example + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - `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: openapi/openapi.yml - PaymentMethod: - docs: >- - # The PaymentMethod Object + * `ZWN` - ZWN - ### Description + * `ZRN` - Zairean New Zaire (1993–1998) - The `PaymentMethod` object defines how a payment against an invoice is - made. + * `ZRZ` - Zairean Zaire (1971–1993) + * `ZMW` - Zambian Kwacha - ### Usage Example + * `ZMK` - Zambian Kwacha (1968–2012) - 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: MethodTypeEnum - docs: |- - The type of the payment method. + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `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: openapi/openapi.yml - PaymentRequestContact: - discriminated: false - docs: The supplier, or customer involved in the payment. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.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: openapi/openapi.yml - inline: true - PaymentRequestPaymentMethod: - discriminated: false - docs: The method which this payment was made by. - union: - - type: string - validation: - format: uuid - - PaymentMethod - source: - openapi: openapi/openapi.yml - inline: true - PaymentRequestCompany: - discriminated: false - docs: The company the payment belongs to. + * `ZWR` - Zimbabwean Dollar (2008) + + * `ZWL` - Zimbabwean Dollar (2009) union: - - type: string - validation: - format: uuid - - CompanyInfo + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PaymentRequestTrackingCategoriesItem: + PurchaseOrderRequestTrackingCategoriesItem: discriminated: false union: - type: string @@ -23876,59 +44564,66 @@ types: format: uuid - TrackingCategory source: - openapi: openapi/openapi.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: openapi/openapi.yml - inline: true - PaymentRequestAppliedToLinesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItemRequest - source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PaymentRequest: + PurchaseOrderRequest: docs: >- - # The Payment Object + # The PurchaseOrder Object ### Description - The `Payment` object represents general payments made towards a specific - transaction. + The `PurchaseOrder` object is a record of request for a product or service + between a buyer and seller. ### Usage Example - Fetch from the `GET Payment` endpoint and view an invoice's payment. + Fetch from the `LIST PurchaseOrders` endpoint and view a company's + purchase orders. properties: - transaction_date: + 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 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. + 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 + type: optional docs: >- - The payment's currency. + The purchase order's currency. * `XUA` - ADB Unit of Account @@ -24543,33 +45238,18 @@ types: * `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 payment's exchange rate. + docs: The purchase order'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. + tracking_categories: optional>> + line_items: optional> integration_params: type: optional> access: write-only @@ -24580,43 +45260,396 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml - PaymentResponse: + openapi: accounting_v3.yml + PurchaseOrderResponse: properties: - model: Payment + model: PurchaseOrder warnings: list errors: list logs: optional> source: - openapi: openapi/openapi.yml - PaymentTermCompany: + 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 - docs: The subsidiary that the payment term belongs to. union: - type: string validation: format: uuid - - CompanyInfo + - RemoteFieldClass source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PaymentTerm: + 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 PaymentTerm Object + # The TaxRate 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. + The `TaxComponent` object is used to represent any sub-taxes that make up + the `TaxRate`. ### Usage Example - Fetch from the `GET PaymentTerm` endpoint and view payment term - information. + Fetch from the `LIST TaxRates` endpoint and view tax components relevant + to a tax rate. properties: id: type: optional @@ -24635,95 +45668,91 @@ types: 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. + type: optional + docs: The tax rate’s name. validation: - min: -2147483648 - max: 2147483647 - discount_days: - type: optional - docs: The number of days the invoice must be paid before discounts expire. + maxLength: 100 + rate: + type: optional + docs: The tax component’s rate. 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> + 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: openapi/openapi.yml - PaymentTypeEnum: - enum: - - ACCOUNTS_PAYABLE - - ACCOUNTS_RECEIVABLE - docs: |- - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - source: - openapi: openapi/openapi.yml - PostingStatusEnum: - enum: - - UNPOSTED - - POSTED - docs: |- - * `UNPOSTED` - UNPOSTED - * `POSTED` - POSTED - source: - openapi: openapi/openapi.yml - ProjectCompany: + openapi: accounting_v3.yml + TaxRateCompany: discriminated: false - docs: The subsidiary that the project belongs to. + 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: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - ProjectContact: + 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 - docs: The supplier, or customer involved in the project. union: - type: string validation: format: uuid - - Contact + - TaxComponent source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - Project: + TaxRate: docs: >- - # The Project Object + # The TaxRate 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. + The `TaxRate` object is used to represent a tax rate. ### Usage Example - Fetch from the `GET Project` endpoint and view project information. + Fetch from the `LIST TaxRates` endpoint and view tax rates relevant to a + company. properties: id: type: optional @@ -24741,20 +45770,61 @@ types: 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: string - docs: The project’s name + type: optional + docs: The tax rate’s name. validation: - maxLength: 255 - is_active: + 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: '`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. + docs: >- + Indicates whether or not this object has been deleted in the third + party platform. Full coverage deletion detection is 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 @@ -24762,94 +45832,60 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml - PurchaseOrderDeliveryAddress: + openapi: accounting_v3.yml + TrackingCategoryStatus: discriminated: false - docs: The purchase order's delivery address. + docs: |- + The tracking category's status. + + * `ACTIVE` - ACTIVE + * `ARCHIVED` - ARCHIVED union: - - type: string - validation: - format: uuid - - Address + - Status7D1Enum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PurchaseOrderVendor: + TrackingCategoryCategoryType: discriminated: false - docs: The party fulfilling the purchase order. + docs: |- + The tracking category’s type. + + * `CLASS` - CLASS + * `DEPARTMENT` - DEPARTMENT union: - - type: string - validation: - format: uuid - - Contact + - CategoryTypeEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PurchaseOrderCompany: + TrackingCategoryCompany: discriminated: false - docs: The company the purchase order belongs to. + docs: The company the GeneralLedgerTransaction belongs to. union: - type: string validation: format: uuid - CompanyInfo source: - openapi: openapi/openapi.yml - inline: true - PurchaseOrderPaymentTerm: - discriminated: false - docs: The payment term that applies to this transaction. - union: - - type: string - validation: - format: uuid - - PaymentTerm - source: - openapi: openapi/openapi.yml - inline: true - PurchaseOrderTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.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: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PurchaseOrder: + TrackingCategory: docs: >- - # The PurchaseOrder Object + # The TrackingCategory 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). + 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 `LIST PurchaseOrders` endpoint and view a company's - purchase orders. + Fetch from the `GET TrackingCategory` endpoint and view a company's + tracking category. properties: id: type: optional @@ -24867,735 +45903,741 @@ types: 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 + type: optional docs: |- - The purchase order's status. + The tracking category'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: + * `ACTIVE` - ACTIVE + * `ARCHIVED` - ARCHIVED + category_type: + type: optional + docs: |- + The tracking category’s type. + + * `CLASS` - CLASS + * `DEPARTMENT` - DEPARTMENT + parent_category: 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 + type: optional + docs: The company the GeneralLedgerTransaction belongs to. + remote_was_deleted: + type: optional docs: >- - The purchase order's currency. + Indicates whether or not this object has been deleted in the third + party platform. Full coverage deletion detection is 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 + * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani + * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) + * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek + * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) + * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar + * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta + * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza + * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) + * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) + * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral + * `ARA` - Argentine Austral - * `ARS` - Argentine Peso + * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) + * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) + * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) + * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram + * `AMD` - Armenian Dram - * `AWG` - Aruban Florin + * `AWG` - Aruban Florin - * `AUD` - Australian Dollar + * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling + * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat + * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) + * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar + * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar + * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka + * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar + * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble + * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) + * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) + * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc + * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) + * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) + * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar + * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar + * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum + * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano + * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) + * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol + * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso + * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula + * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) + * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real + * `BRL` - Brazilian Real - * `GBP` - British Pound + * `GBP` - British Pound - * `BND` - Brunei Dollar + * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev + * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev + * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) + * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev + * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat + * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc + * `BIF` - Burundian Franc - * `XPF` - CFP Franc + * `XPF` - CFP Franc - * `KHR` - Cambodian Riel + * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar + * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo + * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar + * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc + * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo + * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso + * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) + * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar + * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan + * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) + * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso + * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit + * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc + * `KMF` - Comorian Franc - * `CDF` - Congolese Franc + * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón + * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar + * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna + * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso + * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso + * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound + * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna + * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna + * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone + * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc + * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso + * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder + * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar + * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark + * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre + * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value + * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound + * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele + * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa + * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon + * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr + * `ETB` - Ethiopian Birr - * `EUR` - Euro + * `EUR` - Euro - * `XBA` - European Composite Unit + * `XBA` - European Composite Unit - * `XEU` - European Currency Unit + * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit + * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) + * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) + * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound + * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar + * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka + * `FIM` - Finnish Markka - * `FRF` - French Franc + * `FRF` - French Franc - * `XFO` - French Gold Franc + * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc + * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi + * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit + * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari + * `GEL` - Georgian Lari - * `DEM` - German Mark + * `DEM` - German Mark - * `GHS` - Ghanaian Cedi + * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) + * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound + * `GIP` - Gibraltar Pound - * `XAU` - Gold + * `XAU` - Gold - * `GRD` - Greek Drachma + * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal + * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso + * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc + * `GNF` - Guinean Franc - * `GNS` - Guinean Syli + * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar + * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde + * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira + * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar + * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint + * `HUF` - Hungarian Forint - * `IMP` - IMP + * `IMP` - IMP - * `ISK` - Icelandic Króna + * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) + * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee + * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah + * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial + * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar + * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound + * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel + * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound + * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) + * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira + * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar + * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen + * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar + * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge + * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling + * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar + * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som + * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip + * `LAK` - Laotian Kip - * `LVL` - Latvian Lats + * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble + * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound + * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti + * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar + * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar + * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas + * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas + * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc + * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc + * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc + * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca + * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar + * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) + * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary + * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc + * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha + * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit + * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa + * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) + * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc + * `MLF` - Malian Franc - * `MTL` - Maltese Lira + * `MTL` - Maltese Lira - * `MTP` - Maltese Pound + * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya + * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee + * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit + * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso + * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) + * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon + * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu + * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc + * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik + * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham + * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc + * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo + * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical + * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) + * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat + * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar + * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee + * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder + * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar + * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar + * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba + * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira + * `NGN` - Nigerian Naira - * `KPW` - North Korean Won + * `KPW` - North Korean Won - * `NOK` - Norwegian Krone + * `NOK` - Norwegian Krone - * `OMR` - Omani Rial + * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee + * `PKR` - Pakistani Rupee - * `XPD` - Palladium + * `XPD` - Palladium - * `PAB` - Panamanian Balboa + * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina + * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani + * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti + * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol + * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) + * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso + * `PHP` - Philippine Peso - * `XPT` - Platinum + * `XPT` - Platinum - * `PLN` - Polish Zloty + * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) + * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo + * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo + * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial + * `QAR` - Qatari Rial - * `XRE` - RINET Funds + * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar + * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu + * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) + * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble + * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) + * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc + * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón + * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala + * `WST` - Samoan Tala - * `SAR` - Saudi Riyal + * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar + * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) + * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee + * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone + * `SLL` - Sierra Leonean Leone - * `XAG` - Silver + * `XAG` - Silver - * `SGD` - Singapore Dollar + * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna + * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar + * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar + * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling + * `SOS` - Somali Shilling - * `ZAR` - South African Rand + * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) + * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) + * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won + * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) + * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound + * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble + * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta + * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) + * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) + * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights + * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee + * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound + * `SHP` - St. Helena Pound - * `XSU` - Sucre + * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) + * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound + * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) + * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar + * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder + * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni + * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona + * `SEK` - Swedish Krona - * `CHF` - Swiss Franc + * `CHF` - Swiss Franc - * `SYP` - Syrian Pound + * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra + * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD + * `TVD` - TVD - * `TJR` - Tajikistani Ruble + * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni + * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling + * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code + * `XTS` - Testing Currency Code - * `THB` - Thai Baht + * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is - involved + * `XXX` - The codes assigned for transactions where no currency is + involved - * `TPE` - Timorese Escudo + * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga + * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar + * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar + * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira + * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) + * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat + * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) + * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar + * `USD` - US Dollar - * `USN` - US Dollar (Next day) + * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) + * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling + * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) + * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia + * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets + * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham + * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit + * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso + * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) + * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) + * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som + * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu + * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar + * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) + * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) + * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong + * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) + * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro + * `CHE` - WIR Euro - * `CHW` - WIR Franc + * `CHW` - WIR Franc - * `XOF` - West African CFA Franc + * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar + * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial + * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN + * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) + * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) + * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha + * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) + * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) + * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The purchase order's exchange rate. + * `ZWL` - Zimbabwean Dollar (2009) + union: + - TransactionCurrencyEnum + - string + source: + openapi: accounting_v3.yml + inline: true + TransactionTrackingCategoriesItem: + discriminated: false + union: + - type: string 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 + format: uuid + - TrackingCategory source: - openapi: openapi/openapi.yml - PurchaseOrderLineItemItem: + 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 - - Item + - AccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - PurchaseOrderLineItem: + Transaction: docs: >- - # The PurchaseOrderLineItem Object + # 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: - ### Description + * __Credit Notes__ - The `PurchaseOrderLineItem` object is used to represent a purchase order's - line item. + * __Expenses__ + + * __Invoices__ + + * __Journal Entries__ + + * __Payments__ + + * __Purchase Orders__ + + * __Vendor Credits__ ### Usage Example - Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase - orders. + Fetch from the `GET Transaction` endpoint and view a company's + transactions. properties: id: type: optional @@ -25613,44 +46655,37 @@ types: 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: + transaction_type: 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: + docs: >- + The type of transaction, which can by any transaction object not + already included in Merge’s common model. + number: type: optional - docs: The purchase order line item's tax amount. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - total_line_amount: + 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 purchase order line item's total amount. + docs: The total amount being paid after taxes. validation: pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ currency: - type: optional + type: optional docs: >- - The purchase order line item's currency. + The transaction's currency. * `XUA` - ADB Unit of Account @@ -26265,21 +47300,20 @@ types: * `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. + docs: The transaction's exchange rate. validation: pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ company: type: optional - docs: The company the purchase order line item belongs to. + 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: >- @@ -26289,2145 +47323,1588 @@ types: [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). access: read-only - remote_fields: - type: optional> + 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: openapi/openapi.yml - PurchaseOrderLineItemRequestItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: openapi/openapi.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) + 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 - * `BGM` - Bulgarian Socialist Lev + * `AFN` - Afghan Afghani - * `BUK` - Burmese Kyat + * `AFA` - Afghan Afghani (1927–2002) - * `BIF` - Burundian Franc + * `ALL` - Albanian Lek - * `XPF` - CFP Franc + * `ALK` - Albanian Lek (1946–1965) - * `KHR` - Cambodian Riel + * `DZD` - Algerian Dinar - * `CAD` - Canadian Dollar + * `ADP` - Andorran Peseta - * `CVE` - Cape Verdean Escudo + * `AOA` - Angolan Kwanza - * `KYD` - Cayman Islands Dollar + * `AOK` - Angolan Kwanza (1977–1991) - * `XAF` - Central African CFA Franc + * `AON` - Angolan New Kwanza (1990–2000) - * `CLE` - Chilean Escudo + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `CLP` - Chilean Peso + * `ARA` - Argentine Austral - * `CLF` - Chilean Unit of Account (UF) + * `ARS` - Argentine Peso - * `CNX` - Chinese People’s Bank Dollar + * `ARM` - Argentine Peso (1881–1970) - * `CNY` - Chinese Yuan + * `ARP` - Argentine Peso (1983–1985) - * `CNH` - Chinese Yuan (offshore) + * `ARL` - Argentine Peso Ley (1970–1983) - * `COP` - Colombian Peso + * `AMD` - Armenian Dram - * `COU` - Colombian Real Value Unit + * `AWG` - Aruban Florin - * `KMF` - Comorian Franc + * `AUD` - Australian Dollar - * `CDF` - Congolese Franc + * `ATS` - Austrian Schilling - * `CRC` - Costa Rican Colón + * `AZN` - Azerbaijani Manat - * `HRD` - Croatian Dinar + * `AZM` - Azerbaijani Manat (1993–2006) - * `HRK` - Croatian Kuna + * `BSD` - Bahamian Dollar - * `CUC` - Cuban Convertible Peso + * `BHD` - Bahraini Dinar - * `CUP` - Cuban Peso + * `BDT` - Bangladeshi Taka - * `CYP` - Cypriot Pound + * `BBD` - Barbadian Dollar - * `CZK` - Czech Koruna + * `BYN` - Belarusian Ruble - * `CSK` - Czechoslovak Hard Koruna + * `BYB` - Belarusian Ruble (1994–1999) - * `DKK` - Danish Krone + * `BYR` - Belarusian Ruble (2000–2016) - * `DJF` - Djiboutian Franc + * `BEF` - Belgian Franc - * `DOP` - Dominican Peso + * `BEC` - Belgian Franc (convertible) - * `NLG` - Dutch Guilder + * `BEL` - Belgian Franc (financial) - * `XCD` - East Caribbean Dollar + * `BZD` - Belize Dollar - * `DDM` - East German Mark + * `BMD` - Bermudan Dollar - * `ECS` - Ecuadorian Sucre + * `BTN` - Bhutanese Ngultrum - * `ECV` - Ecuadorian Unit of Constant Value + * `BOB` - Bolivian Boliviano - * `EGP` - Egyptian Pound + * `BOL` - Bolivian Boliviano (1863–1963) - * `GQE` - Equatorial Guinean Ekwele + * `BOV` - Bolivian Mvdol - * `ERN` - Eritrean Nakfa + * `BOP` - Bolivian Peso - * `EEK` - Estonian Kroon + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `ETB` - Ethiopian Birr + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `EUR` - Euro + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `XBA` - European Composite Unit + * `BWP` - Botswanan Pula - * `XEU` - European Currency Unit + * `BRC` - Brazilian Cruzado (1986–1989) - * `XBB` - European Monetary Unit + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `XBC` - European Unit of Account (XBC) + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `XBD` - European Unit of Account (XBD) + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `FKP` - Falkland Islands Pound + * `BRN` - Brazilian New Cruzado (1989–1990) - * `FJD` - Fijian Dollar + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `FIM` - Finnish Markka + * `BRL` - Brazilian Real - * `FRF` - French Franc + * `GBP` - British Pound - * `XFO` - French Gold Franc + * `BND` - Brunei Dollar - * `XFU` - French UIC-Franc + * `BGL` - Bulgarian Hard Lev - * `GMD` - Gambian Dalasi + * `BGN` - Bulgarian Lev - * `GEK` - Georgian Kupon Larit + * `BGO` - Bulgarian Lev (1879–1952) - * `GEL` - Georgian Lari + * `BGM` - Bulgarian Socialist Lev - * `DEM` - German Mark + * `BUK` - Burmese Kyat - * `GHS` - Ghanaian Cedi + * `BIF` - Burundian Franc - * `GHC` - Ghanaian Cedi (1979–2007) + * `XPF` - CFP Franc - * `GIP` - Gibraltar Pound + * `KHR` - Cambodian Riel - * `XAU` - Gold + * `CAD` - Canadian Dollar - * `GRD` - Greek Drachma + * `CVE` - Cape Verdean Escudo - * `GTQ` - Guatemalan Quetzal + * `KYD` - Cayman Islands Dollar - * `GWP` - Guinea-Bissau Peso + * `XAF` - Central African CFA Franc - * `GNF` - Guinean Franc + * `CLE` - Chilean Escudo - * `GNS` - Guinean Syli + * `CLP` - Chilean Peso - * `GYD` - Guyanaese Dollar + * `CLF` - Chilean Unit of Account (UF) - * `HTG` - Haitian Gourde + * `CNX` - Chinese People’s Bank Dollar - * `HNL` - Honduran Lempira + * `CNY` - Chinese Yuan - * `HKD` - Hong Kong Dollar + * `CNH` - Chinese Yuan (offshore) - * `HUF` - Hungarian Forint + * `COP` - Colombian Peso - * `IMP` - IMP + * `COU` - Colombian Real Value Unit - * `ISK` - Icelandic Króna + * `KMF` - Comorian Franc - * `ISJ` - Icelandic Króna (1918–1981) + * `CDF` - Congolese Franc - * `INR` - Indian Rupee + * `CRC` - Costa Rican Colón - * `IDR` - Indonesian Rupiah + * `HRD` - Croatian Dinar - * `IRR` - Iranian Rial + * `HRK` - Croatian Kuna - * `IQD` - Iraqi Dinar + * `CUC` - Cuban Convertible Peso - * `IEP` - Irish Pound + * `CUP` - Cuban Peso - * `ILS` - Israeli New Shekel + * `CYP` - Cypriot Pound - * `ILP` - Israeli Pound + * `CZK` - Czech Koruna - * `ILR` - Israeli Shekel (1980–1985) + * `CSK` - Czechoslovak Hard Koruna - * `ITL` - Italian Lira + * `DKK` - Danish Krone - * `JMD` - Jamaican Dollar + * `DJF` - Djiboutian Franc - * `JPY` - Japanese Yen + * `DOP` - Dominican Peso - * `JOD` - Jordanian Dinar + * `NLG` - Dutch Guilder - * `KZT` - Kazakhstani Tenge + * `XCD` - East Caribbean Dollar - * `KES` - Kenyan Shilling + * `DDM` - East German Mark - * `KWD` - Kuwaiti Dinar + * `ECS` - Ecuadorian Sucre - * `KGS` - Kyrgystani Som + * `ECV` - Ecuadorian Unit of Constant Value - * `LAK` - Laotian Kip + * `EGP` - Egyptian Pound - * `LVL` - Latvian Lats + * `GQE` - Equatorial Guinean Ekwele - * `LVR` - Latvian Ruble + * `ERN` - Eritrean Nakfa - * `LBP` - Lebanese Pound + * `EEK` - Estonian Kroon - * `LSL` - Lesotho Loti + * `ETB` - Ethiopian Birr - * `LRD` - Liberian Dollar + * `EUR` - Euro - * `LYD` - Libyan Dinar + * `XBA` - European Composite Unit - * `LTL` - Lithuanian Litas + * `XEU` - European Currency Unit - * `LTT` - Lithuanian Talonas + * `XBB` - European Monetary Unit - * `LUL` - Luxembourg Financial Franc + * `XBC` - European Unit of Account (XBC) - * `LUC` - Luxembourgian Convertible Franc + * `XBD` - European Unit of Account (XBD) - * `LUF` - Luxembourgian Franc + * `FKP` - Falkland Islands Pound - * `MOP` - Macanese Pataca + * `FJD` - Fijian Dollar - * `MKD` - Macedonian Denar + * `FIM` - Finnish Markka - * `MKN` - Macedonian Denar (1992–1993) + * `FRF` - French Franc - * `MGA` - Malagasy Ariary + * `XFO` - French Gold Franc - * `MGF` - Malagasy Franc + * `XFU` - French UIC-Franc - * `MWK` - Malawian Kwacha + * `GMD` - Gambian Dalasi - * `MYR` - Malaysian Ringgit + * `GEK` - Georgian Kupon Larit - * `MVR` - Maldivian Rufiyaa + * `GEL` - Georgian Lari - * `MVP` - Maldivian Rupee (1947–1981) + * `DEM` - German Mark - * `MLF` - Malian Franc + * `GHS` - Ghanaian Cedi - * `MTL` - Maltese Lira + * `GHC` - Ghanaian Cedi (1979–2007) - * `MTP` - Maltese Pound + * `GIP` - Gibraltar Pound - * `MRU` - Mauritanian Ouguiya + * `XAU` - Gold - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `GRD` - Greek Drachma - * `MUR` - Mauritian Rupee + * `GTQ` - Guatemalan Quetzal - * `MXV` - Mexican Investment Unit + * `GWP` - Guinea-Bissau Peso - * `MXN` - Mexican Peso + * `GNF` - Guinean Franc - * `MXP` - Mexican Silver Peso (1861–1992) + * `GNS` - Guinean Syli - * `MDC` - Moldovan Cupon + * `GYD` - Guyanaese Dollar - * `MDL` - Moldovan Leu + * `HTG` - Haitian Gourde - * `MCF` - Monegasque Franc + * `HNL` - Honduran Lempira - * `MNT` - Mongolian Tugrik + * `HKD` - Hong Kong Dollar - * `MAD` - Moroccan Dirham + * `HUF` - Hungarian Forint - * `MAF` - Moroccan Franc + * `IMP` - IMP - * `MZE` - Mozambican Escudo + * `ISK` - Icelandic Króna - * `MZN` - Mozambican Metical + * `ISJ` - Icelandic Króna (1918–1981) - * `MZM` - Mozambican Metical (1980–2006) + * `INR` - Indian Rupee - * `MMK` - Myanmar Kyat + * `IDR` - Indonesian Rupiah - * `NAD` - Namibian Dollar + * `IRR` - Iranian Rial - * `NPR` - Nepalese Rupee + * `IQD` - Iraqi Dinar - * `ANG` - Netherlands Antillean Guilder + * `IEP` - Irish Pound - * `TWD` - New Taiwan Dollar + * `ILS` - Israeli New Shekel - * `NZD` - New Zealand Dollar + * `ILP` - Israeli Pound - * `NIO` - Nicaraguan Córdoba + * `ILR` - Israeli Shekel (1980–1985) - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `ITL` - Italian Lira - * `NGN` - Nigerian Naira + * `JMD` - Jamaican Dollar - * `KPW` - North Korean Won + * `JPY` - Japanese Yen - * `NOK` - Norwegian Krone + * `JOD` - Jordanian Dinar - * `OMR` - Omani Rial + * `KZT` - Kazakhstani Tenge - * `PKR` - Pakistani Rupee + * `KES` - Kenyan Shilling - * `XPD` - Palladium + * `KWD` - Kuwaiti Dinar - * `PAB` - Panamanian Balboa + * `KGS` - Kyrgystani Som - * `PGK` - Papua New Guinean Kina + * `LAK` - Laotian Kip - * `PYG` - Paraguayan Guarani + * `LVL` - Latvian Lats - * `PEI` - Peruvian Inti + * `LVR` - Latvian Ruble - * `PEN` - Peruvian Sol + * `LBP` - Lebanese Pound - * `PES` - Peruvian Sol (1863–1965) + * `LSL` - Lesotho Loti - * `PHP` - Philippine Peso + * `LRD` - Liberian Dollar - * `XPT` - Platinum + * `LYD` - Libyan Dinar - * `PLN` - Polish Zloty + * `LTL` - Lithuanian Litas - * `PLZ` - Polish Zloty (1950–1995) + * `LTT` - Lithuanian Talonas - * `PTE` - Portuguese Escudo + * `LUL` - Luxembourg Financial Franc - * `GWE` - Portuguese Guinea Escudo + * `LUC` - Luxembourgian Convertible Franc - * `QAR` - Qatari Rial + * `LUF` - Luxembourgian Franc - * `XRE` - RINET Funds + * `MOP` - Macanese Pataca - * `RHD` - Rhodesian Dollar + * `MKD` - Macedonian Denar - * `RON` - Romanian Leu + * `MKN` - Macedonian Denar (1992–1993) - * `ROL` - Romanian Leu (1952–2006) + * `MGA` - Malagasy Ariary - * `RUB` - Russian Ruble + * `MGF` - Malagasy Franc - * `RUR` - Russian Ruble (1991–1998) + * `MWK` - Malawian Kwacha - * `RWF` - Rwandan Franc + * `MYR` - Malaysian Ringgit - * `SVC` - Salvadoran Colón + * `MVR` - Maldivian Rufiyaa - * `WST` - Samoan Tala + * `MVP` - Maldivian Rupee (1947–1981) - * `SAR` - Saudi Riyal + * `MLF` - Malian Franc - * `RSD` - Serbian Dinar + * `MTL` - Maltese Lira - * `CSD` - Serbian Dinar (2002–2006) + * `MTP` - Maltese Pound - * `SCR` - Seychellois Rupee + * `MRU` - Mauritanian Ouguiya - * `SLL` - Sierra Leonean Leone + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `XAG` - Silver + * `MUR` - Mauritian Rupee - * `SGD` - Singapore Dollar + * `MXV` - Mexican Investment Unit - * `SKK` - Slovak Koruna + * `MXN` - Mexican Peso - * `SIT` - Slovenian Tolar + * `MXP` - Mexican Silver Peso (1861–1992) - * `SBD` - Solomon Islands Dollar + * `MDC` - Moldovan Cupon - * `SOS` - Somali Shilling + * `MDL` - Moldovan Leu - * `ZAR` - South African Rand + * `MCF` - Monegasque Franc - * `ZAL` - South African Rand (financial) + * `MNT` - Mongolian Tugrik - * `KRH` - South Korean Hwan (1953–1962) + * `MAD` - Moroccan Dirham - * `KRW` - South Korean Won + * `MAF` - Moroccan Franc - * `KRO` - South Korean Won (1945–1953) + * `MZE` - Mozambican Escudo - * `SSP` - South Sudanese Pound + * `MZN` - Mozambican Metical - * `SUR` - Soviet Rouble + * `MZM` - Mozambican Metical (1980–2006) - * `ESP` - Spanish Peseta + * `MMK` - Myanmar Kyat - * `ESA` - Spanish Peseta (A account) + * `NAD` - Namibian Dollar - * `ESB` - Spanish Peseta (convertible account) + * `NPR` - Nepalese Rupee - * `XDR` - Special Drawing Rights + * `ANG` - Netherlands Antillean Guilder - * `LKR` - Sri Lankan Rupee + * `TWD` - New Taiwan Dollar - * `SHP` - St. Helena Pound + * `NZD` - New Zealand Dollar - * `XSU` - Sucre + * `NIO` - Nicaraguan Córdoba - * `SDD` - Sudanese Dinar (1992–2007) + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `SDG` - Sudanese Pound + * `NGN` - Nigerian Naira - * `SDP` - Sudanese Pound (1957–1998) + * `KPW` - North Korean Won - * `SRD` - Surinamese Dollar + * `NOK` - Norwegian Krone - * `SRG` - Surinamese Guilder + * `OMR` - Omani Rial - * `SZL` - Swazi Lilangeni + * `PKR` - Pakistani Rupee - * `SEK` - Swedish Krona + * `XPD` - Palladium - * `CHF` - Swiss Franc + * `PAB` - Panamanian Balboa - * `SYP` - Syrian Pound + * `PGK` - Papua New Guinean Kina - * `STN` - São Tomé & Príncipe Dobra + * `PYG` - Paraguayan Guarani - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `PEI` - Peruvian Inti - * `TVD` - TVD + * `PEN` - Peruvian Sol - * `TJR` - Tajikistani Ruble + * `PES` - Peruvian Sol (1863–1965) - * `TJS` - Tajikistani Somoni + * `PHP` - Philippine Peso - * `TZS` - Tanzanian Shilling + * `XPT` - Platinum - * `XTS` - Testing Currency Code + * `PLN` - Polish Zloty - * `THB` - Thai Baht + * `PLZ` - Polish Zloty (1950–1995) - * `XXX` - The codes assigned for transactions where no currency is - involved + * `PTE` - Portuguese Escudo - * `TPE` - Timorese Escudo + * `GWE` - Portuguese Guinea Escudo - * `TOP` - Tongan Paʻanga + * `QAR` - Qatari Rial - * `TTD` - Trinidad & Tobago Dollar + * `XRE` - RINET Funds - * `TND` - Tunisian Dinar + * `RHD` - Rhodesian Dollar - * `TRY` - Turkish Lira + * `RON` - Romanian Leu - * `TRL` - Turkish Lira (1922–2005) + * `ROL` - Romanian Leu (1952–2006) - * `TMT` - Turkmenistani Manat + * `RUB` - Russian Ruble - * `TMM` - Turkmenistani Manat (1993–2009) + * `RUR` - Russian Ruble (1991–1998) - * `USD` - US Dollar + * `RWF` - Rwandan Franc - * `USN` - US Dollar (Next day) + * `SVC` - Salvadoran Colón - * `USS` - US Dollar (Same day) + * `WST` - Samoan Tala - * `UGX` - Ugandan Shilling + * `SAR` - Saudi Riyal - * `UGS` - Ugandan Shilling (1966–1987) + * `RSD` - Serbian Dinar - * `UAH` - Ukrainian Hryvnia + * `CSD` - Serbian Dinar (2002–2006) - * `UAK` - Ukrainian Karbovanets + * `SCR` - Seychellois Rupee - * `AED` - United Arab Emirates Dirham + * `SLL` - Sierra Leonean Leone - * `UYW` - Uruguayan Nominal Wage Index Unit + * `XAG` - Silver - * `UYU` - Uruguayan Peso + * `SGD` - Singapore Dollar - * `UYP` - Uruguayan Peso (1975–1993) + * `SKK` - Slovak Koruna - * `UYI` - Uruguayan Peso (Indexed Units) + * `SIT` - Slovenian Tolar - * `UZS` - Uzbekistani Som + * `SBD` - Solomon Islands Dollar - * `VUV` - Vanuatu Vatu + * `SOS` - Somali Shilling - * `VES` - Venezuelan Bolívar + * `ZAR` - South African Rand - * `VEB` - Venezuelan Bolívar (1871–2008) + * `ZAL` - South African Rand (financial) - * `VEF` - Venezuelan Bolívar (2008–2018) + * `KRH` - South Korean Hwan (1953–1962) - * `VND` - Vietnamese Dong + * `KRW` - South Korean Won - * `VNN` - Vietnamese Dong (1978–1985) + * `KRO` - South Korean Won (1945–1953) - * `CHE` - WIR Euro + * `SSP` - South Sudanese Pound - * `CHW` - WIR Franc + * `SUR` - Soviet Rouble - * `XOF` - West African CFA Franc + * `ESP` - Spanish Peseta - * `YDD` - Yemeni Dinar + * `ESA` - Spanish Peseta (A account) - * `YER` - Yemeni Rial + * `ESB` - Spanish Peseta (convertible account) - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `XDR` - Special Drawing Rights - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `LKR` - Sri Lankan Rupee - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `SHP` - St. Helena Pound - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `XSU` - Sucre - * `ZWN` - ZWN + * `SDD` - Sudanese Dinar (1992–2007) - * `ZRN` - Zairean New Zaire (1993–1998) + * `SDG` - Sudanese Pound - * `ZRZ` - Zairean Zaire (1971–1993) + * `SDP` - Sudanese Pound (1957–1998) - * `ZMW` - Zambian Kwacha + * `SRD` - Surinamese Dollar - * `ZMK` - Zambian Kwacha (1968–2012) + * `SRG` - Surinamese Guilder - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `SZL` - Swazi Lilangeni - * `ZWR` - Zimbabwean Dollar (2008) + * `SEK` - Swedish Krona - * `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: openapi/openapi.yml - PurchaseOrderRequestDeliveryAddress: - discriminated: false - docs: The purchase order's delivery address. - union: - - type: string - validation: - format: uuid - - Address - source: - openapi: openapi/openapi.yml - inline: true - PurchaseOrderRequestVendor: - discriminated: false - docs: The party fulfilling the purchase order. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.yml - inline: true - PurchaseOrderRequestCompany: - discriminated: false - docs: The company the purchase order belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - PurchaseOrderRequestPaymentTerm: - discriminated: false - docs: The payment term that applies to this transaction. - union: - - type: string - validation: - format: uuid - - PaymentTerm - source: - openapi: openapi/openapi.yml - inline: true - PurchaseOrderRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.yml - inline: true - PurchaseOrderRequest: - docs: >- - # The PurchaseOrder Object + * `CHF` - Swiss Franc - ### Description + * `SYP` - Syrian Pound - The `PurchaseOrder` object is a record of request for a product or service - between a buyer and seller. + * `STN` - São Tomé & Príncipe Dobra + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - ### Usage Example + * `TVD` - TVD - Fetch from the `LIST PurchaseOrders` endpoint and view a company's - purchase orders. - properties: - status: - type: optional - docs: |- - The purchase order's status. + * `TJR` - Tajikistani Ruble - * `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. + * `TJS` - Tajikistani Somoni + * `TZS` - Tanzanian Shilling - * `XUA` - ADB Unit of Account + * `XTS` - Testing Currency Code - * `AFN` - Afghan Afghani + * `THB` - Thai Baht - * `AFA` - Afghan Afghani (1927–2002) + * `XXX` - The codes assigned for transactions where no currency is + involved - * `ALL` - Albanian Lek + * `TPE` - Timorese Escudo - * `ALK` - Albanian Lek (1946–1965) + * `TOP` - Tongan Paʻanga - * `DZD` - Algerian Dinar + * `TTD` - Trinidad & Tobago Dollar - * `ADP` - Andorran Peseta + * `TND` - Tunisian Dinar - * `AOA` - Angolan Kwanza + * `TRY` - Turkish Lira - * `AOK` - Angolan Kwanza (1977–1991) + * `TRL` - Turkish Lira (1922–2005) - * `AON` - Angolan New Kwanza (1990–2000) + * `TMT` - Turkmenistani Manat - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `TMM` - Turkmenistani Manat (1993–2009) - * `ARA` - Argentine Austral + * `USD` - US Dollar - * `ARS` - Argentine Peso + * `USN` - US Dollar (Next day) - * `ARM` - Argentine Peso (1881–1970) + * `USS` - US Dollar (Same day) - * `ARP` - Argentine Peso (1983–1985) + * `UGX` - Ugandan Shilling - * `ARL` - Argentine Peso Ley (1970–1983) + * `UGS` - Ugandan Shilling (1966–1987) - * `AMD` - Armenian Dram + * `UAH` - Ukrainian Hryvnia - * `AWG` - Aruban Florin + * `UAK` - Ukrainian Karbovanets - * `AUD` - Australian Dollar + * `AED` - United Arab Emirates Dirham - * `ATS` - Austrian Schilling + * `UYW` - Uruguayan Nominal Wage Index Unit - * `AZN` - Azerbaijani Manat + * `UYU` - Uruguayan Peso - * `AZM` - Azerbaijani Manat (1993–2006) + * `UYP` - Uruguayan Peso (1975–1993) - * `BSD` - Bahamian Dollar + * `UYI` - Uruguayan Peso (Indexed Units) - * `BHD` - Bahraini Dinar + * `UZS` - Uzbekistani Som - * `BDT` - Bangladeshi Taka + * `VUV` - Vanuatu Vatu - * `BBD` - Barbadian Dollar + * `VES` - Venezuelan Bolívar - * `BYN` - Belarusian Ruble + * `VEB` - Venezuelan Bolívar (1871–2008) - * `BYB` - Belarusian Ruble (1994–1999) + * `VEF` - Venezuelan Bolívar (2008–2018) - * `BYR` - Belarusian Ruble (2000–2016) + * `VND` - Vietnamese Dong - * `BEF` - Belgian Franc + * `VNN` - Vietnamese Dong (1978–1985) - * `BEC` - Belgian Franc (convertible) + * `CHE` - WIR Euro - * `BEL` - Belgian Franc (financial) + * `CHW` - WIR Franc - * `BZD` - Belize Dollar + * `XOF` - West African CFA Franc - * `BMD` - Bermudan Dollar + * `YDD` - Yemeni Dinar - * `BTN` - Bhutanese Ngultrum + * `YER` - Yemeni Rial - * `BOB` - Bolivian Boliviano + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `BOL` - Bolivian Boliviano (1863–1963) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `BOV` - Bolivian Mvdol + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `BOP` - Bolivian Peso + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `ZWN` - ZWN - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `ZRN` - Zairean New Zaire (1993–1998) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `ZRZ` - Zairean Zaire (1971–1993) - * `BWP` - Botswanan Pula + * `ZMW` - Zambian Kwacha - * `BRC` - Brazilian Cruzado (1986–1989) + * `ZMK` - Zambian Kwacha (1968–2012) - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `ZWR` - Zimbabwean Dollar (2008) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `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. - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `XUA` - ADB Unit of Account - * `BRL` - Brazilian Real + * `AFN` - Afghan Afghani - * `GBP` - British Pound + * `AFA` - Afghan Afghani (1927–2002) - * `BND` - Brunei Dollar + * `ALL` - Albanian Lek - * `BGL` - Bulgarian Hard Lev + * `ALK` - Albanian Lek (1946–1965) - * `BGN` - Bulgarian Lev + * `DZD` - Algerian Dinar - * `BGO` - Bulgarian Lev (1879–1952) + * `ADP` - Andorran Peseta - * `BGM` - Bulgarian Socialist Lev + * `AOA` - Angolan Kwanza - * `BUK` - Burmese Kyat + * `AOK` - Angolan Kwanza (1977–1991) - * `BIF` - Burundian Franc + * `AON` - Angolan New Kwanza (1990–2000) - * `XPF` - CFP Franc + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `KHR` - Cambodian Riel + * `ARA` - Argentine Austral - * `CAD` - Canadian Dollar + * `ARS` - Argentine Peso - * `CVE` - Cape Verdean Escudo + * `ARM` - Argentine Peso (1881–1970) - * `KYD` - Cayman Islands Dollar + * `ARP` - Argentine Peso (1983–1985) - * `XAF` - Central African CFA Franc + * `ARL` - Argentine Peso Ley (1970–1983) - * `CLE` - Chilean Escudo + * `AMD` - Armenian Dram - * `CLP` - Chilean Peso + * `AWG` - Aruban Florin - * `CLF` - Chilean Unit of Account (UF) + * `AUD` - Australian Dollar - * `CNX` - Chinese People’s Bank Dollar + * `ATS` - Austrian Schilling - * `CNY` - Chinese Yuan + * `AZN` - Azerbaijani Manat - * `CNH` - Chinese Yuan (offshore) + * `AZM` - Azerbaijani Manat (1993–2006) - * `COP` - Colombian Peso + * `BSD` - Bahamian Dollar - * `COU` - Colombian Real Value Unit + * `BHD` - Bahraini Dinar - * `KMF` - Comorian Franc + * `BDT` - Bangladeshi Taka - * `CDF` - Congolese Franc + * `BBD` - Barbadian Dollar - * `CRC` - Costa Rican Colón + * `BYN` - Belarusian Ruble - * `HRD` - Croatian Dinar + * `BYB` - Belarusian Ruble (1994–1999) - * `HRK` - Croatian Kuna + * `BYR` - Belarusian Ruble (2000–2016) - * `CUC` - Cuban Convertible Peso + * `BEF` - Belgian Franc - * `CUP` - Cuban Peso + * `BEC` - Belgian Franc (convertible) - * `CYP` - Cypriot Pound + * `BEL` - Belgian Franc (financial) - * `CZK` - Czech Koruna + * `BZD` - Belize Dollar - * `CSK` - Czechoslovak Hard Koruna + * `BMD` - Bermudan Dollar - * `DKK` - Danish Krone + * `BTN` - Bhutanese Ngultrum - * `DJF` - Djiboutian Franc + * `BOB` - Bolivian Boliviano - * `DOP` - Dominican Peso + * `BOL` - Bolivian Boliviano (1863–1963) - * `NLG` - Dutch Guilder + * `BOV` - Bolivian Mvdol - * `XCD` - East Caribbean Dollar + * `BOP` - Bolivian Peso - * `DDM` - East German Mark + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `ECS` - Ecuadorian Sucre + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `ECV` - Ecuadorian Unit of Constant Value + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `EGP` - Egyptian Pound + * `BWP` - Botswanan Pula - * `GQE` - Equatorial Guinean Ekwele + * `BRC` - Brazilian Cruzado (1986–1989) - * `ERN` - Eritrean Nakfa + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `EEK` - Estonian Kroon + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `ETB` - Ethiopian Birr + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `EUR` - Euro + * `BRN` - Brazilian New Cruzado (1989–1990) - * `XBA` - European Composite Unit + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `XEU` - European Currency Unit + * `BRL` - Brazilian Real - * `XBB` - European Monetary Unit + * `GBP` - British Pound - * `XBC` - European Unit of Account (XBC) + * `BND` - Brunei Dollar - * `XBD` - European Unit of Account (XBD) + * `BGL` - Bulgarian Hard Lev - * `FKP` - Falkland Islands Pound + * `BGN` - Bulgarian Lev - * `FJD` - Fijian Dollar + * `BGO` - Bulgarian Lev (1879–1952) - * `FIM` - Finnish Markka + * `BGM` - Bulgarian Socialist Lev - * `FRF` - French Franc + * `BUK` - Burmese Kyat - * `XFO` - French Gold Franc + * `BIF` - Burundian Franc - * `XFU` - French UIC-Franc + * `XPF` - CFP Franc - * `GMD` - Gambian Dalasi + * `KHR` - Cambodian Riel - * `GEK` - Georgian Kupon Larit + * `CAD` - Canadian Dollar - * `GEL` - Georgian Lari + * `CVE` - Cape Verdean Escudo - * `DEM` - German Mark + * `KYD` - Cayman Islands Dollar - * `GHS` - Ghanaian Cedi + * `XAF` - Central African CFA Franc - * `GHC` - Ghanaian Cedi (1979–2007) + * `CLE` - Chilean Escudo - * `GIP` - Gibraltar Pound + * `CLP` - Chilean Peso - * `XAU` - Gold + * `CLF` - Chilean Unit of Account (UF) - * `GRD` - Greek Drachma + * `CNX` - Chinese People’s Bank Dollar - * `GTQ` - Guatemalan Quetzal + * `CNY` - Chinese Yuan - * `GWP` - Guinea-Bissau Peso + * `CNH` - Chinese Yuan (offshore) - * `GNF` - Guinean Franc + * `COP` - Colombian Peso - * `GNS` - Guinean Syli + * `COU` - Colombian Real Value Unit - * `GYD` - Guyanaese Dollar + * `KMF` - Comorian Franc - * `HTG` - Haitian Gourde + * `CDF` - Congolese Franc - * `HNL` - Honduran Lempira + * `CRC` - Costa Rican Colón - * `HKD` - Hong Kong Dollar + * `HRD` - Croatian Dinar - * `HUF` - Hungarian Forint + * `HRK` - Croatian Kuna - * `IMP` - IMP + * `CUC` - Cuban Convertible Peso - * `ISK` - Icelandic Króna + * `CUP` - Cuban Peso - * `ISJ` - Icelandic Króna (1918–1981) + * `CYP` - Cypriot Pound - * `INR` - Indian Rupee + * `CZK` - Czech Koruna - * `IDR` - Indonesian Rupiah + * `CSK` - Czechoslovak Hard Koruna - * `IRR` - Iranian Rial + * `DKK` - Danish Krone - * `IQD` - Iraqi Dinar + * `DJF` - Djiboutian Franc - * `IEP` - Irish Pound + * `DOP` - Dominican Peso - * `ILS` - Israeli New Shekel + * `NLG` - Dutch Guilder - * `ILP` - Israeli Pound + * `XCD` - East Caribbean Dollar - * `ILR` - Israeli Shekel (1980–1985) + * `DDM` - East German Mark - * `ITL` - Italian Lira + * `ECS` - Ecuadorian Sucre - * `JMD` - Jamaican Dollar + * `ECV` - Ecuadorian Unit of Constant Value - * `JPY` - Japanese Yen + * `EGP` - Egyptian Pound - * `JOD` - Jordanian Dinar + * `GQE` - Equatorial Guinean Ekwele - * `KZT` - Kazakhstani Tenge + * `ERN` - Eritrean Nakfa - * `KES` - Kenyan Shilling + * `EEK` - Estonian Kroon - * `KWD` - Kuwaiti Dinar + * `ETB` - Ethiopian Birr - * `KGS` - Kyrgystani Som + * `EUR` - Euro - * `LAK` - Laotian Kip + * `XBA` - European Composite Unit - * `LVL` - Latvian Lats + * `XEU` - European Currency Unit - * `LVR` - Latvian Ruble + * `XBB` - European Monetary Unit - * `LBP` - Lebanese Pound + * `XBC` - European Unit of Account (XBC) - * `LSL` - Lesotho Loti + * `XBD` - European Unit of Account (XBD) - * `LRD` - Liberian Dollar + * `FKP` - Falkland Islands Pound - * `LYD` - Libyan Dinar + * `FJD` - Fijian Dollar - * `LTL` - Lithuanian Litas + * `FIM` - Finnish Markka - * `LTT` - Lithuanian Talonas + * `FRF` - French Franc - * `LUL` - Luxembourg Financial Franc + * `XFO` - French Gold Franc - * `LUC` - Luxembourgian Convertible Franc + * `XFU` - French UIC-Franc - * `LUF` - Luxembourgian Franc + * `GMD` - Gambian Dalasi - * `MOP` - Macanese Pataca + * `GEK` - Georgian Kupon Larit - * `MKD` - Macedonian Denar + * `GEL` - Georgian Lari - * `MKN` - Macedonian Denar (1992–1993) + * `DEM` - German Mark - * `MGA` - Malagasy Ariary + * `GHS` - Ghanaian Cedi - * `MGF` - Malagasy Franc + * `GHC` - Ghanaian Cedi (1979–2007) - * `MWK` - Malawian Kwacha + * `GIP` - Gibraltar Pound - * `MYR` - Malaysian Ringgit + * `XAU` - Gold - * `MVR` - Maldivian Rufiyaa + * `GRD` - Greek Drachma - * `MVP` - Maldivian Rupee (1947–1981) + * `GTQ` - Guatemalan Quetzal - * `MLF` - Malian Franc + * `GWP` - Guinea-Bissau Peso - * `MTL` - Maltese Lira + * `GNF` - Guinean Franc - * `MTP` - Maltese Pound + * `GNS` - Guinean Syli - * `MRU` - Mauritanian Ouguiya + * `GYD` - Guyanaese Dollar - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `HTG` - Haitian Gourde - * `MUR` - Mauritian Rupee + * `HNL` - Honduran Lempira - * `MXV` - Mexican Investment Unit + * `HKD` - Hong Kong Dollar - * `MXN` - Mexican Peso + * `HUF` - Hungarian Forint - * `MXP` - Mexican Silver Peso (1861–1992) + * `IMP` - IMP - * `MDC` - Moldovan Cupon + * `ISK` - Icelandic Króna - * `MDL` - Moldovan Leu + * `ISJ` - Icelandic Króna (1918–1981) - * `MCF` - Monegasque Franc + * `INR` - Indian Rupee - * `MNT` - Mongolian Tugrik + * `IDR` - Indonesian Rupiah - * `MAD` - Moroccan Dirham + * `IRR` - Iranian Rial - * `MAF` - Moroccan Franc + * `IQD` - Iraqi Dinar - * `MZE` - Mozambican Escudo + * `IEP` - Irish Pound - * `MZN` - Mozambican Metical + * `ILS` - Israeli New Shekel - * `MZM` - Mozambican Metical (1980–2006) + * `ILP` - Israeli Pound - * `MMK` - Myanmar Kyat + * `ILR` - Israeli Shekel (1980–1985) - * `NAD` - Namibian Dollar + * `ITL` - Italian Lira - * `NPR` - Nepalese Rupee + * `JMD` - Jamaican Dollar - * `ANG` - Netherlands Antillean Guilder + * `JPY` - Japanese Yen - * `TWD` - New Taiwan Dollar + * `JOD` - Jordanian Dinar - * `NZD` - New Zealand Dollar + * `KZT` - Kazakhstani Tenge - * `NIO` - Nicaraguan Córdoba + * `KES` - Kenyan Shilling - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `KWD` - Kuwaiti Dinar - * `NGN` - Nigerian Naira + * `KGS` - Kyrgystani Som - * `KPW` - North Korean Won + * `LAK` - Laotian Kip - * `NOK` - Norwegian Krone + * `LVL` - Latvian Lats - * `OMR` - Omani Rial + * `LVR` - Latvian Ruble - * `PKR` - Pakistani Rupee + * `LBP` - Lebanese Pound - * `XPD` - Palladium + * `LSL` - Lesotho Loti - * `PAB` - Panamanian Balboa + * `LRD` - Liberian Dollar - * `PGK` - Papua New Guinean Kina + * `LYD` - Libyan Dinar - * `PYG` - Paraguayan Guarani + * `LTL` - Lithuanian Litas - * `PEI` - Peruvian Inti + * `LTT` - Lithuanian Talonas - * `PEN` - Peruvian Sol + * `LUL` - Luxembourg Financial Franc - * `PES` - Peruvian Sol (1863–1965) + * `LUC` - Luxembourgian Convertible Franc - * `PHP` - Philippine Peso + * `LUF` - Luxembourgian Franc - * `XPT` - Platinum + * `MOP` - Macanese Pataca - * `PLN` - Polish Zloty + * `MKD` - Macedonian Denar - * `PLZ` - Polish Zloty (1950–1995) + * `MKN` - Macedonian Denar (1992–1993) - * `PTE` - Portuguese Escudo + * `MGA` - Malagasy Ariary - * `GWE` - Portuguese Guinea Escudo + * `MGF` - Malagasy Franc - * `QAR` - Qatari Rial + * `MWK` - Malawian Kwacha - * `XRE` - RINET Funds + * `MYR` - Malaysian Ringgit - * `RHD` - Rhodesian Dollar + * `MVR` - Maldivian Rufiyaa - * `RON` - Romanian Leu + * `MVP` - Maldivian Rupee (1947–1981) - * `ROL` - Romanian Leu (1952–2006) + * `MLF` - Malian Franc - * `RUB` - Russian Ruble + * `MTL` - Maltese Lira - * `RUR` - Russian Ruble (1991–1998) + * `MTP` - Maltese Pound - * `RWF` - Rwandan Franc + * `MRU` - Mauritanian Ouguiya - * `SVC` - Salvadoran Colón + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `WST` - Samoan Tala + * `MUR` - Mauritian Rupee - * `SAR` - Saudi Riyal + * `MXV` - Mexican Investment Unit - * `RSD` - Serbian Dinar + * `MXN` - Mexican Peso - * `CSD` - Serbian Dinar (2002–2006) + * `MXP` - Mexican Silver Peso (1861–1992) - * `SCR` - Seychellois Rupee + * `MDC` - Moldovan Cupon - * `SLL` - Sierra Leonean Leone + * `MDL` - Moldovan Leu - * `XAG` - Silver + * `MCF` - Monegasque Franc - * `SGD` - Singapore Dollar + * `MNT` - Mongolian Tugrik - * `SKK` - Slovak Koruna + * `MAD` - Moroccan Dirham - * `SIT` - Slovenian Tolar + * `MAF` - Moroccan Franc - * `SBD` - Solomon Islands Dollar + * `MZE` - Mozambican Escudo - * `SOS` - Somali Shilling + * `MZN` - Mozambican Metical - * `ZAR` - South African Rand + * `MZM` - Mozambican Metical (1980–2006) - * `ZAL` - South African Rand (financial) + * `MMK` - Myanmar Kyat - * `KRH` - South Korean Hwan (1953–1962) + * `NAD` - Namibian Dollar - * `KRW` - South Korean Won + * `NPR` - Nepalese Rupee - * `KRO` - South Korean Won (1945–1953) + * `ANG` - Netherlands Antillean Guilder - * `SSP` - South Sudanese Pound + * `TWD` - New Taiwan Dollar - * `SUR` - Soviet Rouble + * `NZD` - New Zealand Dollar - * `ESP` - Spanish Peseta + * `NIO` - Nicaraguan Córdoba - * `ESA` - Spanish Peseta (A account) + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `ESB` - Spanish Peseta (convertible account) + * `NGN` - Nigerian Naira - * `XDR` - Special Drawing Rights + * `KPW` - North Korean Won - * `LKR` - Sri Lankan Rupee + * `NOK` - Norwegian Krone - * `SHP` - St. Helena Pound + * `OMR` - Omani Rial - * `XSU` - Sucre + * `PKR` - Pakistani Rupee - * `SDD` - Sudanese Dinar (1992–2007) + * `XPD` - Palladium - * `SDG` - Sudanese Pound + * `PAB` - Panamanian Balboa - * `SDP` - Sudanese Pound (1957–1998) + * `PGK` - Papua New Guinean Kina - * `SRD` - Surinamese Dollar + * `PYG` - Paraguayan Guarani - * `SRG` - Surinamese Guilder + * `PEI` - Peruvian Inti - * `SZL` - Swazi Lilangeni + * `PEN` - Peruvian Sol - * `SEK` - Swedish Krona + * `PES` - Peruvian Sol (1863–1965) - * `CHF` - Swiss Franc + * `PHP` - Philippine Peso - * `SYP` - Syrian Pound + * `XPT` - Platinum - * `STN` - São Tomé & Príncipe Dobra + * `PLN` - Polish Zloty - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `PLZ` - Polish Zloty (1950–1995) - * `TVD` - TVD + * `PTE` - Portuguese Escudo - * `TJR` - Tajikistani Ruble + * `GWE` - Portuguese Guinea Escudo - * `TJS` - Tajikistani Somoni + * `QAR` - Qatari Rial - * `TZS` - Tanzanian Shilling + * `XRE` - RINET Funds - * `XTS` - Testing Currency Code + * `RHD` - Rhodesian Dollar - * `THB` - Thai Baht + * `RON` - Romanian Leu - * `XXX` - The codes assigned for transactions where no currency is - involved + * `ROL` - Romanian Leu (1952–2006) - * `TPE` - Timorese Escudo + * `RUB` - Russian Ruble - * `TOP` - Tongan Paʻanga + * `RUR` - Russian Ruble (1991–1998) - * `TTD` - Trinidad & Tobago Dollar + * `RWF` - Rwandan Franc - * `TND` - Tunisian Dinar + * `SVC` - Salvadoran Colón - * `TRY` - Turkish Lira + * `WST` - Samoan Tala - * `TRL` - Turkish Lira (1922–2005) + * `SAR` - Saudi Riyal - * `TMT` - Turkmenistani Manat + * `RSD` - Serbian Dinar - * `TMM` - Turkmenistani Manat (1993–2009) + * `CSD` - Serbian Dinar (2002–2006) - * `USD` - US Dollar + * `SCR` - Seychellois Rupee - * `USN` - US Dollar (Next day) + * `SLL` - Sierra Leonean Leone - * `USS` - US Dollar (Same day) + * `XAG` - Silver - * `UGX` - Ugandan Shilling + * `SGD` - Singapore Dollar - * `UGS` - Ugandan Shilling (1966–1987) + * `SKK` - Slovak Koruna - * `UAH` - Ukrainian Hryvnia + * `SIT` - Slovenian Tolar - * `UAK` - Ukrainian Karbovanets + * `SBD` - Solomon Islands Dollar - * `AED` - United Arab Emirates Dirham + * `SOS` - Somali Shilling - * `UYW` - Uruguayan Nominal Wage Index Unit + * `ZAR` - South African Rand - * `UYU` - Uruguayan Peso + * `ZAL` - South African Rand (financial) - * `UYP` - Uruguayan Peso (1975–1993) + * `KRH` - South Korean Hwan (1953–1962) - * `UYI` - Uruguayan Peso (Indexed Units) + * `KRW` - South Korean Won - * `UZS` - Uzbekistani Som + * `KRO` - South Korean Won (1945–1953) - * `VUV` - Vanuatu Vatu + * `SSP` - South Sudanese Pound - * `VES` - Venezuelan Bolívar + * `SUR` - Soviet Rouble - * `VEB` - Venezuelan Bolívar (1871–2008) + * `ESP` - Spanish Peseta - * `VEF` - Venezuelan Bolívar (2008–2018) + * `ESA` - Spanish Peseta (A account) - * `VND` - Vietnamese Dong + * `ESB` - Spanish Peseta (convertible account) - * `VNN` - Vietnamese Dong (1978–1985) + * `XDR` - Special Drawing Rights - * `CHE` - WIR Euro + * `LKR` - Sri Lankan Rupee - * `CHW` - WIR Franc + * `SHP` - St. Helena Pound - * `XOF` - West African CFA Franc + * `XSU` - Sucre - * `YDD` - Yemeni Dinar + * `SDD` - Sudanese Dinar (1992–2007) - * `YER` - Yemeni Rial + * `SDG` - Sudanese Pound - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `SDP` - Sudanese Pound (1957–1998) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `SRD` - Surinamese Dollar - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `SRG` - Surinamese Guilder - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `SZL` - Swazi Lilangeni - * `ZWN` - ZWN + * `SEK` - Swedish Krona - * `ZRN` - Zairean New Zaire (1993–1998) + * `CHF` - Swiss Franc - * `ZRZ` - Zairean Zaire (1971–1993) + * `SYP` - Syrian Pound - * `ZMW` - Zambian Kwacha + * `STN` - São Tomé & Príncipe Dobra - * `ZMK` - Zambian Kwacha (1968–2012) + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `TVD` - TVD - * `ZWR` - Zimbabwean Dollar (2008) + * `TJR` - Tajikistani Ruble - * `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: openapi/openapi.yml - PurchaseOrderResponse: - properties: - model: PurchaseOrder - warnings: list - errors: list - logs: optional> - source: - openapi: openapi/openapi.yml - PurchaseOrderStatusEnum: - enum: - - DRAFT - - SUBMITTED - - AUTHORIZED - - BILLED - - DELETED - docs: |- - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `BILLED` - BILLED - * `DELETED` - DELETED - source: - openapi: openapi/openapi.yml - RemoteData: - docs: >- - # The RemoteData Object + * `TJS` - Tajikistani Somoni - ### Description + * `TZS` - Tanzanian Shilling - The `RemoteData` object is used to represent the full data pulled from the - third-party API for an object. + * `XTS` - Testing Currency Code + * `THB` - Thai Baht - ### Usage Example + * `XXX` - The codes assigned for transactions where no currency is + involved - TODO - properties: - path: - type: string - docs: The third-party API path that is being called. - data: - type: optional - access: read-only - source: - openapi: openapi/openapi.yml - RemoteEndpointInfo: - properties: - method: string - url_path: string - field_traversal_path: list - source: - openapi: openapi/openapi.yml - RemoteFieldRemoteFieldClass: - discriminated: false - union: - - string - - RemoteFieldClass - source: - openapi: openapi/openapi.yml - inline: true - RemoteField: - properties: - remote_field_class: RemoteFieldRemoteFieldClass - value: optional - source: - openapi: openapi/openapi.yml - RemoteFieldApiCoverage: - discriminated: false - union: - - integer - - double - source: - openapi: openapi/openapi.yml - inline: true - RemoteFieldApi: - properties: - schema: map - remote_key_name: string - remote_endpoint_info: RemoteEndpointInfo - example_values: optional> - advanced_metadata: optional - coverage: - type: optional - access: read-only - source: - openapi: openapi/openapi.yml - RemoteFieldApiResponse: - properties: - 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: openapi/openapi.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: openapi/openapi.yml - RemoteFieldRequestRemoteFieldClass: - discriminated: false - union: - - type: string - validation: - format: uuid - - RemoteFieldClass - source: - openapi: openapi/openapi.yml - inline: true - RemoteFieldRequest: - properties: - remote_field_class: RemoteFieldRequestRemoteFieldClass - value: optional - source: - openapi: openapi/openapi.yml - RemoteKey: - docs: >- - # The RemoteKey Object + * `TPE` - Timorese Escudo - ### Description + * `TOP` - Tongan Paʻanga - The `RemoteKey` object is used to represent a request for a new remote - key. + * `TTD` - Trinidad & Tobago Dollar + * `TND` - Tunisian Dinar - ### Usage Example + * `TRY` - Turkish Lira - Post a `GenerateRemoteKey` to receive a new `RemoteKey`. - properties: - name: string - key: string - source: - openapi: openapi/openapi.yml - RemoteResponse: - docs: >- - # The RemoteResponse Object + * `TRL` - Turkish Lira (1922–2005) - ### Description + * `TMT` - Turkmenistani Manat - The `RemoteResponse` object is used to represent information returned from - a third-party endpoint. + * `TMM` - Turkmenistani Manat (1993–2009) + * `USD` - US Dollar - ### Usage Example + * `USN` - US Dollar (Next day) - View the `RemoteResponse` returned from your `DataPassthrough`. - properties: - method: string - path: string - status: integer - response: unknown - response_headers: optional> - response_type: optional - headers: optional> - source: - openapi: openapi/openapi.yml - ReportItem: - docs: >- - # The ReportItem Object + * `USS` - US Dollar (Same day) - ### Description + * `UGX` - Ugandan Shilling - The `ReportItem` object is used to represent a report item for a Balance - Sheet, Cash Flow Statement or Profit and Loss Report. + * `UGS` - Ugandan Shilling (1966–1987) + * `UAH` - Ukrainian Hryvnia - ### Usage Example + * `UAK` - Ukrainian Karbovanets - 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: openapi/openapi.yml - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - docs: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - source: - openapi: openapi/openapi.yml - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - docs: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - source: - openapi: openapi/openapi.yml - RoleEnum: - enum: - - ADMIN - - DEVELOPER - - MEMBER - - API - - SYSTEM - - MERGE_TEAM - docs: |- - * `ADMIN` - ADMIN - * `DEVELOPER` - DEVELOPER - * `MEMBER` - MEMBER - * `API` - API - * `SYSTEM` - SYSTEM - * `MERGE_TEAM` - MERGE_TEAM - source: - openapi: openapi/openapi.yml - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - docs: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - source: - openapi: openapi/openapi.yml - Status7D1Enum: - enum: - - ACTIVE - - ARCHIVED - docs: |- - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - source: - openapi: openapi/openapi.yml - Status895Enum: - enum: - - ACTIVE - - INACTIVE - docs: |- - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - source: - openapi: openapi/openapi.yml - StatusFd5Enum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - docs: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - source: - openapi: openapi/openapi.yml - SyncStatus: - docs: >- - # The SyncStatus Object + * `AED` - United Arab Emirates Dirham - ### Description + * `UYW` - Uruguayan Nominal Wage Index Unit - The `SyncStatus` object is used to represent the syncing state of an - account + * `UYU` - Uruguayan Peso + * `UYP` - Uruguayan Peso (1975–1993) - ### Usage Example + * `UYI` - Uruguayan Peso (Indexed Units) - 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: StatusFd5Enum - is_initial_sync: boolean - selective_sync_configurations_usage: optional - source: - openapi: openapi/openapi.yml - TaxComponent: - docs: >- - # The TaxRate Object + * `UZS` - Uzbekistani Som - ### Description + * `VUV` - Vanuatu Vatu - The `TaxComponent` object is used to represent any sub-taxes that make up - the `TaxRate`. + * `VES` - Venezuelan Bolívar + * `VEB` - Venezuelan Bolívar (1871–2008) - ### Usage Example + * `VEF` - Venezuelan Bolívar (2008–2018) - 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. + * `VND` - Vietnamese Dong + * `VNN` - Vietnamese Dong (1978–1985) - * `SALES` - SALES + * `CHE` - WIR Euro - * `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: openapi/openapi.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: openapi/openapi.yml - inline: true - TaxRateTaxComponentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TaxComponent - source: - openapi: openapi/openapi.yml - inline: true - TaxRate: - docs: >- - # The TaxRate Object + * `CHW` - WIR Franc - ### Description + * `XOF` - West African CFA Franc - The `TaxRate` object is used to represent a tax rate. + * `YDD` - Yemeni Dinar + * `YER` - Yemeni Rial - ### Usage Example + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - 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. + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `ACTIVE` - ACTIVE + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `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: openapi/openapi.yml - TrackingCategoryCompany: - discriminated: false - docs: The company the GeneralLedgerTransaction belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: openapi/openapi.yml - inline: true - TrackingCategory: - docs: >- - # The TrackingCategory Object + * `ZWN` - ZWN - ### Description + * `ZRN` - Zairean New Zaire (1993–1998) - 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. + * `ZRZ` - Zairean Zaire (1971–1993) + * `ZMW` - Zambian Kwacha - ### Usage Example + * `ZMK` - Zambian Kwacha (1968–2012) - 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. + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - category_type: - type: optional - docs: |- - The tracking category’s type. + * `ZWR` - Zimbabwean Dollar (2008) - * `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: openapi/openapi.yml - TransactionAccount: - discriminated: false - docs: The transaction's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - TransactionContact: - discriminated: false - docs: The contact to whom the transaction relates to. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.yml - inline: true - TransactionTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: openapi/openapi.yml - inline: true - TransactionAccountingPeriod: - discriminated: false - docs: The accounting period that the Transaction was generated in. + * `ZWL` - Zimbabwean Dollar (2009) union: - - type: string - validation: - format: uuid - - AccountingPeriod + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - Transaction: + TransactionLineItem: docs: >- - # The Transaction Object + # The TransactionLineItem 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__ + The `TransactionLineItem` object is used to represent a transaction's line + items. ### Usage Example - Fetch from the `GET Transaction` endpoint and view a company's - transactions. + Fetch from the `GET TransactionLineItem` endpoint and view the + transaction's line items. properties: id: type: optional @@ -28445,37 +48922,50 @@ types: type: optional docs: The datetime that this object was modified by Merge. access: read-only - transaction_type: + memo: type: optional docs: >- - The type of transaction, which can by any transaction object not - already included in Merge’s common model. - number: + An internal note used by the business to clarify purpose of the + transaction. + unit_price: type: optional - docs: The transaction's number used for identifying purposes. - transaction_date: - type: optional - docs: The date upon which the transaction occurred. + 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 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. + 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 + type: optional docs: >- - The transaction's currency. + The line item's currency. * `XUA` - ADB Unit of Account @@ -29092,18 +49582,14 @@ types: * `ZWL` - Zimbabwean Dollar (2009) exchange_rate: type: optional - docs: The transaction's exchange rate. + docs: The line item's exchange rate. validation: pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ company: type: optional - docs: The company the transaction belongs to. + docs: The company the line belongs to. validation: format: uuid - tracking_categories: optional>> - line_items: - type: optional> - access: read-only remote_was_deleted: type: optional docs: >- @@ -29113,326 +49599,62 @@ types: [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: openapi/openapi.yml - TransactionCurrencyEnum: + openapi: accounting_v3.yml + Type2BbEnum: 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 + - 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 @@ -30045,32 +50267,62 @@ types: * `ZWR` - Zimbabwean Dollar (2008) * `ZWL` - Zimbabwean Dollar (2009) + union: + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml - TransactionLineItemItem: + openapi: accounting_v3.yml + inline: true + VendorCreditCompany: discriminated: false + docs: The company the vendor credit belongs to. union: - type: string validation: format: uuid - - Item + - CompanyInfo source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - TransactionLineItem: + 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 TransactionLineItem Object + # The VendorCredit Object ### Description - The `TransactionLineItem` object is used to represent a transaction's line - items. + 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 TransactionLineItem` endpoint and view the - transaction's line items. + Fetch from the `GET VendorCredit` endpoint and view a company's vendor + credits. properties: id: type: optional @@ -30088,50 +50340,22 @@ types: 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: + number: type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid + 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 + type: optional docs: >- - The line item's currency. + The vendor credit's currency. * `XUA` - ADB Unit of Account @@ -30748,14 +50972,89 @@ types: * `ZWL` - Zimbabwean Dollar (2009) exchange_rate: type: optional - docs: The line item's exchange rate. + 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 line belongs to. + 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: >- @@ -30766,105 +51065,153 @@ types: more](https://docs.merge.dev/integrations/hris/supported-features/). access: read-only source: - openapi: openapi/openapi.yml - Type2BbEnum: - enum: - - INVENTORY - - NON_INVENTORY - - SERVICE - - UNKNOWN - docs: |- - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - source: - openapi: openapi/openapi.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 + openapi: accounting_v3.yml + VendorCreditApplyLineForVendorCreditInvoice: + discriminated: false + union: + - type: string + validation: + format: uuid + - Invoice source: - openapi: openapi/openapi.yml - ValidationProblemSource: + 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: - pointer: string + 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: openapi/openapi.yml - VendorCreditVendor: + openapi: accounting_v3.yml + VendorCreditApplyLineForVendorCreditRequestInvoice: discriminated: false - docs: The vendor that owes the gift or refund. union: - type: string validation: format: uuid - - Contact + - Invoice source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - VendorCreditCompany: + 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 company the vendor credit belongs to. + docs: The line's account. union: - type: string validation: format: uuid - - CompanyInfo + - Account source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - VendorCreditTrackingCategoriesItem: + VendorCreditLineProject: discriminated: false union: - type: string validation: format: uuid - - TrackingCategory + - Project source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - VendorCreditAccountingPeriod: + VendorCreditLineContact: discriminated: false - docs: The accounting period that the VendorCredit was generated in. union: - type: string validation: format: uuid - - AccountingPeriod + - Contact source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true - VendorCredit: + VendorCreditLine: docs: >- - # The VendorCredit Object + # The VendorCreditLine 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`. + The `VendorCreditLine` object is used to represent a vendor credit's line + items. ### Usage Example - Fetch from the `GET VendorCredit` endpoint and view a company's vendor - credits. + Fetch from the `GET VendorCredit` endpoint and view the vendor credit's + line items. properties: id: type: optional @@ -30882,1043 +51229,778 @@ types: 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: + net_amount: type: optional - docs: The vendor credit's total amount. - currency: - 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: >- - 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 + Indicates whether or not this object has been deleted in the third + party platform. Full coverage deletion detection is 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 - * `ATS` - Austrian Schilling + ### Description - * `AZN` - Azerbaijani Manat + The `VendorCreditLine` object is used to represent a vendor credit's line + items. - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar + ### Usage Example - * `BHD` - Bahraini Dinar + 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. - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar + * `XUA` - ADB Unit of Account - * `BYN` - Belarusian Ruble + * `AFN` - Afghan Afghani - * `BYB` - Belarusian Ruble (1994–1999) + * `AFA` - Afghan Afghani (1927–2002) - * `BYR` - Belarusian Ruble (2000–2016) + * `ALL` - Albanian Lek - * `BEF` - Belgian Franc + * `ALK` - Albanian Lek (1946–1965) - * `BEC` - Belgian Franc (convertible) + * `DZD` - Algerian Dinar - * `BEL` - Belgian Franc (financial) + * `ADP` - Andorran Peseta - * `BZD` - Belize Dollar + * `AOA` - Angolan Kwanza - * `BMD` - Bermudan Dollar + * `AOK` - Angolan Kwanza (1977–1991) - * `BTN` - Bhutanese Ngultrum + * `AON` - Angolan New Kwanza (1990–2000) - * `BOB` - Bolivian Boliviano + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `BOL` - Bolivian Boliviano (1863–1963) + * `ARA` - Argentine Austral - * `BOV` - Bolivian Mvdol + * `ARS` - Argentine Peso - * `BOP` - Bolivian Peso + * `ARM` - Argentine Peso (1881–1970) - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `ARP` - Argentine Peso (1983–1985) - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `ARL` - Argentine Peso Ley (1970–1983) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `AMD` - Armenian Dram - * `BWP` - Botswanan Pula + * `AWG` - Aruban Florin - * `BRC` - Brazilian Cruzado (1986–1989) + * `AUD` - Australian Dollar - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `ATS` - Austrian Schilling - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `AZN` - Azerbaijani Manat - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `AZM` - Azerbaijani Manat (1993–2006) - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BSD` - Bahamian Dollar - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BHD` - Bahraini Dinar - * `BRL` - Brazilian Real + * `BDT` - Bangladeshi Taka - * `GBP` - British Pound + * `BBD` - Barbadian Dollar - * `BND` - Brunei Dollar + * `BYN` - Belarusian Ruble - * `BGL` - Bulgarian Hard Lev + * `BYB` - Belarusian Ruble (1994–1999) - * `BGN` - Bulgarian Lev + * `BYR` - Belarusian Ruble (2000–2016) - * `BGO` - Bulgarian Lev (1879–1952) + * `BEF` - Belgian Franc - * `BGM` - Bulgarian Socialist Lev + * `BEC` - Belgian Franc (convertible) - * `BUK` - Burmese Kyat + * `BEL` - Belgian Franc (financial) - * `BIF` - Burundian Franc + * `BZD` - Belize Dollar - * `XPF` - CFP Franc + * `BMD` - Bermudan Dollar - * `KHR` - Cambodian Riel + * `BTN` - Bhutanese Ngultrum - * `CAD` - Canadian Dollar + * `BOB` - Bolivian Boliviano - * `CVE` - Cape Verdean Escudo + * `BOL` - Bolivian Boliviano (1863–1963) - * `KYD` - Cayman Islands Dollar + * `BOV` - Bolivian Mvdol - * `XAF` - Central African CFA Franc + * `BOP` - Bolivian Peso - * `CLE` - Chilean Escudo + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `CLP` - Chilean Peso + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `CLF` - Chilean Unit of Account (UF) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `CNX` - Chinese People’s Bank Dollar + * `BWP` - Botswanan Pula - * `CNY` - Chinese Yuan + * `BRC` - Brazilian Cruzado (1986–1989) - * `CNH` - Chinese Yuan (offshore) + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `COP` - Colombian Peso + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `COU` - Colombian Real Value Unit + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `KMF` - Comorian Franc + * `BRN` - Brazilian New Cruzado (1989–1990) - * `CDF` - Congolese Franc + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `CRC` - Costa Rican Colón + * `BRL` - Brazilian Real - * `HRD` - Croatian Dinar + * `GBP` - British Pound - * `HRK` - Croatian Kuna + * `BND` - Brunei Dollar - * `CUC` - Cuban Convertible Peso + * `BGL` - Bulgarian Hard Lev - * `CUP` - Cuban Peso + * `BGN` - Bulgarian Lev - * `CYP` - Cypriot Pound + * `BGO` - Bulgarian Lev (1879–1952) - * `CZK` - Czech Koruna + * `BGM` - Bulgarian Socialist Lev - * `CSK` - Czechoslovak Hard Koruna + * `BUK` - Burmese Kyat - * `DKK` - Danish Krone + * `BIF` - Burundian Franc - * `DJF` - Djiboutian Franc + * `XPF` - CFP Franc - * `DOP` - Dominican Peso + * `KHR` - Cambodian Riel - * `NLG` - Dutch Guilder + * `CAD` - Canadian Dollar - * `XCD` - East Caribbean Dollar + * `CVE` - Cape Verdean Escudo - * `DDM` - East German Mark + * `KYD` - Cayman Islands Dollar - * `ECS` - Ecuadorian Sucre + * `XAF` - Central African CFA Franc - * `ECV` - Ecuadorian Unit of Constant Value + * `CLE` - Chilean Escudo - * `EGP` - Egyptian Pound + * `CLP` - Chilean Peso - * `GQE` - Equatorial Guinean Ekwele + * `CLF` - Chilean Unit of Account (UF) - * `ERN` - Eritrean Nakfa + * `CNX` - Chinese People’s Bank Dollar - * `EEK` - Estonian Kroon + * `CNY` - Chinese Yuan - * `ETB` - Ethiopian Birr + * `CNH` - Chinese Yuan (offshore) - * `EUR` - Euro + * `COP` - Colombian Peso - * `XBA` - European Composite Unit + * `COU` - Colombian Real Value Unit - * `XEU` - European Currency Unit + * `KMF` - Comorian Franc - * `XBB` - European Monetary Unit + * `CDF` - Congolese Franc - * `XBC` - European Unit of Account (XBC) + * `CRC` - Costa Rican Colón - * `XBD` - European Unit of Account (XBD) + * `HRD` - Croatian Dinar - * `FKP` - Falkland Islands Pound + * `HRK` - Croatian Kuna - * `FJD` - Fijian Dollar + * `CUC` - Cuban Convertible Peso - * `FIM` - Finnish Markka + * `CUP` - Cuban Peso - * `FRF` - French Franc + * `CYP` - Cypriot Pound - * `XFO` - French Gold Franc + * `CZK` - Czech Koruna - * `XFU` - French UIC-Franc + * `CSK` - Czechoslovak Hard Koruna - * `GMD` - Gambian Dalasi + * `DKK` - Danish Krone - * `GEK` - Georgian Kupon Larit + * `DJF` - Djiboutian Franc - * `GEL` - Georgian Lari + * `DOP` - Dominican Peso - * `DEM` - German Mark + * `NLG` - Dutch Guilder - * `GHS` - Ghanaian Cedi + * `XCD` - East Caribbean Dollar - * `GHC` - Ghanaian Cedi (1979–2007) + * `DDM` - East German Mark - * `GIP` - Gibraltar Pound + * `ECS` - Ecuadorian Sucre - * `XAU` - Gold + * `ECV` - Ecuadorian Unit of Constant Value - * `GRD` - Greek Drachma + * `EGP` - Egyptian Pound - * `GTQ` - Guatemalan Quetzal + * `GQE` - Equatorial Guinean Ekwele - * `GWP` - Guinea-Bissau Peso + * `ERN` - Eritrean Nakfa - * `GNF` - Guinean Franc + * `EEK` - Estonian Kroon - * `GNS` - Guinean Syli + * `ETB` - Ethiopian Birr - * `GYD` - Guyanaese Dollar + * `EUR` - Euro - * `HTG` - Haitian Gourde + * `XBA` - European Composite Unit - * `HNL` - Honduran Lempira + * `XEU` - European Currency Unit - * `HKD` - Hong Kong Dollar + * `XBB` - European Monetary Unit - * `HUF` - Hungarian Forint + * `XBC` - European Unit of Account (XBC) - * `IMP` - IMP + * `XBD` - European Unit of Account (XBD) - * `ISK` - Icelandic Króna + * `FKP` - Falkland Islands Pound - * `ISJ` - Icelandic Króna (1918–1981) + * `FJD` - Fijian Dollar - * `INR` - Indian Rupee + * `FIM` - Finnish Markka - * `IDR` - Indonesian Rupiah + * `FRF` - French Franc - * `IRR` - Iranian Rial + * `XFO` - French Gold Franc - * `IQD` - Iraqi Dinar + * `XFU` - French UIC-Franc - * `IEP` - Irish Pound + * `GMD` - Gambian Dalasi - * `ILS` - Israeli New Shekel + * `GEK` - Georgian Kupon Larit - * `ILP` - Israeli Pound + * `GEL` - Georgian Lari - * `ILR` - Israeli Shekel (1980–1985) + * `DEM` - German Mark - * `ITL` - Italian Lira + * `GHS` - Ghanaian Cedi - * `JMD` - Jamaican Dollar + * `GHC` - Ghanaian Cedi (1979–2007) - * `JPY` - Japanese Yen + * `GIP` - Gibraltar Pound - * `JOD` - Jordanian Dinar + * `XAU` - Gold - * `KZT` - Kazakhstani Tenge + * `GRD` - Greek Drachma - * `KES` - Kenyan Shilling + * `GTQ` - Guatemalan Quetzal - * `KWD` - Kuwaiti Dinar + * `GWP` - Guinea-Bissau Peso - * `KGS` - Kyrgystani Som + * `GNF` - Guinean Franc - * `LAK` - Laotian Kip + * `GNS` - Guinean Syli - * `LVL` - Latvian Lats + * `GYD` - Guyanaese Dollar - * `LVR` - Latvian Ruble + * `HTG` - Haitian Gourde - * `LBP` - Lebanese Pound + * `HNL` - Honduran Lempira - * `LSL` - Lesotho Loti + * `HKD` - Hong Kong Dollar - * `LRD` - Liberian Dollar + * `HUF` - Hungarian Forint - * `LYD` - Libyan Dinar + * `IMP` - IMP - * `LTL` - Lithuanian Litas + * `ISK` - Icelandic Króna - * `LTT` - Lithuanian Talonas + * `ISJ` - Icelandic Króna (1918–1981) - * `LUL` - Luxembourg Financial Franc + * `INR` - Indian Rupee - * `LUC` - Luxembourgian Convertible Franc + * `IDR` - Indonesian Rupiah - * `LUF` - Luxembourgian Franc + * `IRR` - Iranian Rial - * `MOP` - Macanese Pataca + * `IQD` - Iraqi Dinar - * `MKD` - Macedonian Denar + * `IEP` - Irish Pound - * `MKN` - Macedonian Denar (1992–1993) + * `ILS` - Israeli New Shekel - * `MGA` - Malagasy Ariary + * `ILP` - Israeli Pound - * `MGF` - Malagasy Franc + * `ILR` - Israeli Shekel (1980–1985) - * `MWK` - Malawian Kwacha + * `ITL` - Italian Lira - * `MYR` - Malaysian Ringgit + * `JMD` - Jamaican Dollar - * `MVR` - Maldivian Rufiyaa + * `JPY` - Japanese Yen - * `MVP` - Maldivian Rupee (1947–1981) + * `JOD` - Jordanian Dinar - * `MLF` - Malian Franc + * `KZT` - Kazakhstani Tenge - * `MTL` - Maltese Lira + * `KES` - Kenyan Shilling - * `MTP` - Maltese Pound + * `KWD` - Kuwaiti Dinar - * `MRU` - Mauritanian Ouguiya + * `KGS` - Kyrgystani Som - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `LAK` - Laotian Kip - * `MUR` - Mauritian Rupee + * `LVL` - Latvian Lats - * `MXV` - Mexican Investment Unit + * `LVR` - Latvian Ruble - * `MXN` - Mexican Peso + * `LBP` - Lebanese Pound - * `MXP` - Mexican Silver Peso (1861–1992) + * `LSL` - Lesotho Loti - * `MDC` - Moldovan Cupon + * `LRD` - Liberian Dollar - * `MDL` - Moldovan Leu + * `LYD` - Libyan Dinar - * `MCF` - Monegasque Franc + * `LTL` - Lithuanian Litas - * `MNT` - Mongolian Tugrik + * `LTT` - Lithuanian Talonas - * `MAD` - Moroccan Dirham + * `LUL` - Luxembourg Financial Franc - * `MAF` - Moroccan Franc + * `LUC` - Luxembourgian Convertible Franc - * `MZE` - Mozambican Escudo + * `LUF` - Luxembourgian Franc - * `MZN` - Mozambican Metical + * `MOP` - Macanese Pataca - * `MZM` - Mozambican Metical (1980–2006) + * `MKD` - Macedonian Denar - * `MMK` - Myanmar Kyat + * `MKN` - Macedonian Denar (1992–1993) - * `NAD` - Namibian Dollar + * `MGA` - Malagasy Ariary - * `NPR` - Nepalese Rupee + * `MGF` - Malagasy Franc - * `ANG` - Netherlands Antillean Guilder + * `MWK` - Malawian Kwacha - * `TWD` - New Taiwan Dollar + * `MYR` - Malaysian Ringgit - * `NZD` - New Zealand Dollar + * `MVR` - Maldivian Rufiyaa - * `NIO` - Nicaraguan Córdoba + * `MVP` - Maldivian Rupee (1947–1981) - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `MLF` - Malian Franc - * `NGN` - Nigerian Naira + * `MTL` - Maltese Lira - * `KPW` - North Korean Won + * `MTP` - Maltese Pound - * `NOK` - Norwegian Krone + * `MRU` - Mauritanian Ouguiya - * `OMR` - Omani Rial + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `PKR` - Pakistani Rupee + * `MUR` - Mauritian Rupee - * `XPD` - Palladium + * `MXV` - Mexican Investment Unit - * `PAB` - Panamanian Balboa + * `MXN` - Mexican Peso - * `PGK` - Papua New Guinean Kina + * `MXP` - Mexican Silver Peso (1861–1992) - * `PYG` - Paraguayan Guarani + * `MDC` - Moldovan Cupon - * `PEI` - Peruvian Inti + * `MDL` - Moldovan Leu - * `PEN` - Peruvian Sol + * `MCF` - Monegasque Franc - * `PES` - Peruvian Sol (1863–1965) + * `MNT` - Mongolian Tugrik - * `PHP` - Philippine Peso + * `MAD` - Moroccan Dirham - * `XPT` - Platinum + * `MAF` - Moroccan Franc - * `PLN` - Polish Zloty + * `MZE` - Mozambican Escudo - * `PLZ` - Polish Zloty (1950–1995) + * `MZN` - Mozambican Metical - * `PTE` - Portuguese Escudo + * `MZM` - Mozambican Metical (1980–2006) - * `GWE` - Portuguese Guinea Escudo + * `MMK` - Myanmar Kyat - * `QAR` - Qatari Rial + * `NAD` - Namibian Dollar - * `XRE` - RINET Funds + * `NPR` - Nepalese Rupee - * `RHD` - Rhodesian Dollar + * `ANG` - Netherlands Antillean Guilder - * `RON` - Romanian Leu + * `TWD` - New Taiwan Dollar - * `ROL` - Romanian Leu (1952–2006) + * `NZD` - New Zealand Dollar - * `RUB` - Russian Ruble + * `NIO` - Nicaraguan Córdoba - * `RUR` - Russian Ruble (1991–1998) + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `RWF` - Rwandan Franc + * `NGN` - Nigerian Naira - * `SVC` - Salvadoran Colón + * `KPW` - North Korean Won - * `WST` - Samoan Tala + * `NOK` - Norwegian Krone - * `SAR` - Saudi Riyal + * `OMR` - Omani Rial - * `RSD` - Serbian Dinar + * `PKR` - Pakistani Rupee - * `CSD` - Serbian Dinar (2002–2006) + * `XPD` - Palladium - * `SCR` - Seychellois Rupee + * `PAB` - Panamanian Balboa - * `SLL` - Sierra Leonean Leone + * `PGK` - Papua New Guinean Kina - * `XAG` - Silver + * `PYG` - Paraguayan Guarani - * `SGD` - Singapore Dollar + * `PEI` - Peruvian Inti - * `SKK` - Slovak Koruna + * `PEN` - Peruvian Sol - * `SIT` - Slovenian Tolar + * `PES` - Peruvian Sol (1863–1965) - * `SBD` - Solomon Islands Dollar + * `PHP` - Philippine Peso - * `SOS` - Somali Shilling + * `XPT` - Platinum - * `ZAR` - South African Rand + * `PLN` - Polish Zloty - * `ZAL` - South African Rand (financial) + * `PLZ` - Polish Zloty (1950–1995) - * `KRH` - South Korean Hwan (1953–1962) + * `PTE` - Portuguese Escudo - * `KRW` - South Korean Won + * `GWE` - Portuguese Guinea Escudo - * `KRO` - South Korean Won (1945–1953) + * `QAR` - Qatari Rial - * `SSP` - South Sudanese Pound + * `XRE` - RINET Funds - * `SUR` - Soviet Rouble + * `RHD` - Rhodesian Dollar - * `ESP` - Spanish Peseta + * `RON` - Romanian Leu - * `ESA` - Spanish Peseta (A account) + * `ROL` - Romanian Leu (1952–2006) - * `ESB` - Spanish Peseta (convertible account) + * `RUB` - Russian Ruble - * `XDR` - Special Drawing Rights + * `RUR` - Russian Ruble (1991–1998) - * `LKR` - Sri Lankan Rupee + * `RWF` - Rwandan Franc - * `SHP` - St. Helena Pound + * `SVC` - Salvadoran Colón - * `XSU` - Sucre + * `WST` - Samoan Tala - * `SDD` - Sudanese Dinar (1992–2007) + * `SAR` - Saudi Riyal - * `SDG` - Sudanese Pound + * `RSD` - Serbian Dinar - * `SDP` - Sudanese Pound (1957–1998) + * `CSD` - Serbian Dinar (2002–2006) - * `SRD` - Surinamese Dollar + * `SCR` - Seychellois Rupee - * `SRG` - Surinamese Guilder + * `SLL` - Sierra Leonean Leone - * `SZL` - Swazi Lilangeni + * `XAG` - Silver - * `SEK` - Swedish Krona + * `SGD` - Singapore Dollar - * `CHF` - Swiss Franc + * `SKK` - Slovak Koruna - * `SYP` - Syrian Pound + * `SIT` - Slovenian Tolar - * `STN` - São Tomé & Príncipe Dobra + * `SBD` - Solomon Islands Dollar - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `SOS` - Somali Shilling - * `TVD` - TVD + * `ZAR` - South African Rand - * `TJR` - Tajikistani Ruble + * `ZAL` - South African Rand (financial) - * `TJS` - Tajikistani Somoni + * `KRH` - South Korean Hwan (1953–1962) - * `TZS` - Tanzanian Shilling + * `KRW` - South Korean Won - * `XTS` - Testing Currency Code + * `KRO` - South Korean Won (1945–1953) - * `THB` - Thai Baht + * `SSP` - South Sudanese Pound - * `XXX` - The codes assigned for transactions where no currency is - involved + * `SUR` - Soviet Rouble - * `TPE` - Timorese Escudo + * `ESP` - Spanish Peseta - * `TOP` - Tongan Paʻanga + * `ESA` - Spanish Peseta (A account) - * `TTD` - Trinidad & Tobago Dollar + * `ESB` - Spanish Peseta (convertible account) - * `TND` - Tunisian Dinar + * `XDR` - Special Drawing Rights - * `TRY` - Turkish Lira + * `LKR` - Sri Lankan Rupee - * `TRL` - Turkish Lira (1922–2005) + * `SHP` - St. Helena Pound - * `TMT` - Turkmenistani Manat + * `XSU` - Sucre - * `TMM` - Turkmenistani Manat (1993–2009) + * `SDD` - Sudanese Dinar (1992–2007) - * `USD` - US Dollar + * `SDG` - Sudanese Pound - * `USN` - US Dollar (Next day) + * `SDP` - Sudanese Pound (1957–1998) - * `USS` - US Dollar (Same day) + * `SRD` - Surinamese Dollar - * `UGX` - Ugandan Shilling + * `SRG` - Surinamese Guilder - * `UGS` - Ugandan Shilling (1966–1987) + * `SZL` - Swazi Lilangeni - * `UAH` - Ukrainian Hryvnia + * `SEK` - Swedish Krona - * `UAK` - Ukrainian Karbovanets + * `CHF` - Swiss Franc - * `AED` - United Arab Emirates Dirham + * `SYP` - Syrian Pound - * `UYW` - Uruguayan Nominal Wage Index Unit + * `STN` - São Tomé & Príncipe Dobra - * `UYU` - Uruguayan Peso + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `UYP` - Uruguayan Peso (1975–1993) + * `TVD` - TVD - * `UYI` - Uruguayan Peso (Indexed Units) + * `TJR` - Tajikistani Ruble - * `UZS` - Uzbekistani Som + * `TJS` - Tajikistani Somoni - * `VUV` - Vanuatu Vatu + * `TZS` - Tanzanian Shilling - * `VES` - Venezuelan Bolívar + * `XTS` - Testing Currency Code - * `VEB` - Venezuelan Bolívar (1871–2008) + * `THB` - Thai Baht - * `VEF` - Venezuelan Bolívar (2008–2018) + * `XXX` - The codes assigned for transactions where no currency is + involved - * `VND` - Vietnamese Dong + * `TPE` - Timorese Escudo - * `VNN` - Vietnamese Dong (1978–1985) + * `TOP` - Tongan Paʻanga - * `CHE` - WIR Euro + * `TTD` - Trinidad & Tobago Dollar - * `CHW` - WIR Franc + * `TND` - Tunisian Dinar - * `XOF` - West African CFA Franc + * `TRY` - Turkish Lira - * `YDD` - Yemeni Dinar + * `TRL` - Turkish Lira (1922–2005) - * `YER` - Yemeni Rial + * `TMT` - Turkmenistani Manat - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `TMM` - Turkmenistani Manat (1993–2009) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `USD` - US Dollar - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `USN` - US Dollar (Next day) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `USS` - US Dollar (Same day) - * `ZWN` - ZWN + * `UGX` - Ugandan Shilling - * `ZRN` - Zairean New Zaire (1993–1998) + * `UGS` - Ugandan Shilling (1966–1987) - * `ZRZ` - Zairean Zaire (1971–1993) + * `UAH` - Ukrainian Hryvnia - * `ZMW` - Zambian Kwacha + * `UAK` - Ukrainian Karbovanets - * `ZMK` - Zambian Kwacha (1968–2012) + * `AED` - United Arab Emirates Dirham - * `ZWD` - Zimbabwean Dollar (1980–2008) + * `UYW` - Uruguayan Nominal Wage Index Unit - * `ZWR` - Zimbabwean Dollar (2008) + * `UYU` - Uruguayan Peso - * `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: openapi/openapi.yml - VendorCreditApplyLineForInvoiceVendorCredit: - discriminated: false - union: - - type: string - validation: - format: uuid - - VendorCredit - source: - openapi: openapi/openapi.yml - inline: true - VendorCreditApplyLineForInvoice: - docs: >- - # The VendorCreditApplyLine Object + * `UYP` - Uruguayan Peso (1975–1993) - ### Description + * `UYI` - Uruguayan Peso (Indexed Units) - The `VendorCreditApplyLine` object is used to represent a applied vendor - credit. + * `UZS` - Uzbekistani Som + * `VUV` - Vanuatu Vatu - ### Usage Example + * `VES` - Venezuelan Bolívar - 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: openapi/openapi.yml - VendorCreditApplyLineForVendorCreditInvoice: - discriminated: false - union: - - type: string - validation: - format: uuid - - Invoice - source: - openapi: openapi/openapi.yml - inline: true - VendorCreditApplyLineForVendorCredit: - docs: >- - # The VendorCreditApplyLine Object + * `VEB` - Venezuelan Bolívar (1871–2008) - ### Description + * `VEF` - Venezuelan Bolívar (2008–2018) - The `VendorCreditApplyLine` object is used to represent a applied vendor - credit. + * `VND` - Vietnamese Dong + * `VNN` - Vietnamese Dong (1978–1985) - ### Usage Example + * `CHE` - WIR Euro - 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: openapi/openapi.yml - VendorCreditApplyLineForVendorCreditRequestInvoice: - discriminated: false - union: - - type: string - validation: - format: uuid - - Invoice - source: - openapi: openapi/openapi.yml - inline: true - VendorCreditApplyLineForVendorCreditRequest: - docs: >- - # The VendorCreditApplyLine Object + * `CHW` - WIR Franc - ### Description + * `XOF` - West African CFA Franc - The `VendorCreditApplyLine` object is used to represent a applied vendor - credit. + * `YDD` - Yemeni Dinar + * `YER` - Yemeni Rial - ### Usage Example + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - 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: openapi/openapi.yml - VendorCreditLineAccount: - discriminated: false - docs: The line's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - VendorCreditLineProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: openapi/openapi.yml - inline: true - VendorCreditLineContact: - discriminated: false - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.yml - inline: true - VendorCreditLine: - docs: >- - # The VendorCreditLine Object + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - ### Description + * `YUM` - Yugoslavian New Dinar (1994–2002) - The `VendorCreditLine` object is used to represent a vendor credit's line - items. + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `ZWN` - ZWN - ### Usage Example + * `ZRN` - Zairean New Zaire (1993–1998) - 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: openapi/openapi.yml - VendorCreditLineRequestAccount: - discriminated: false - docs: The line's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: openapi/openapi.yml - inline: true - VendorCreditLineRequestProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: openapi/openapi.yml - inline: true - VendorCreditLineRequestContact: - discriminated: false - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: openapi/openapi.yml - inline: true - VendorCreditLineRequest: - docs: >- - # The VendorCreditLine Object + * `ZRZ` - Zairean Zaire (1971–1993) - ### Description + * `ZMW` - Zambian Kwacha - The `VendorCreditLine` object is used to represent a vendor credit's line - items. + * `ZMK` - Zambian Kwacha (1968–2012) + * `ZWD` - Zimbabwean Dollar (1980–2008) - ### Usage Example + * `ZWR` - Zimbabwean Dollar (2008) - 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: openapi/openapi.yml - VendorCreditRequestVendor: - discriminated: false - docs: The vendor that owes the gift or refund. + * `ZWL` - Zimbabwean Dollar (2009) union: - - type: string - validation: - format: uuid - - Contact + - TransactionCurrencyEnum + - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true VendorCreditRequestCompany: discriminated: false @@ -31929,7 +52011,7 @@ types: format: uuid - CompanyInfo source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true VendorCreditRequestTrackingCategoriesItem: discriminated: false @@ -31939,7 +52021,7 @@ types: format: uuid - TrackingCategory source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true VendorCreditRequestAccountingPeriod: discriminated: false @@ -31950,7 +52032,7 @@ types: format: uuid - AccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml inline: true VendorCreditRequest: docs: >- @@ -31984,7 +52066,7 @@ types: type: optional docs: The vendor credit's total amount. currency: - type: optional + type: optional docs: >- The vendor credit's currency. @@ -32628,7 +52710,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml VendorCreditResponse: properties: model: VendorCredit @@ -32636,7 +52718,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml WarningValidationProblem: properties: source: optional @@ -32644,11 +52726,11 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml WebhookReceiver: properties: event: string is_active: boolean key: optional source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/accountDetails.yml b/.mock/definition/Accounting/accountDetails.yml similarity index 79% rename from .mock/definition/accounting/accountDetails.yml rename to .mock/definition/Accounting/accountDetails.yml index a9e9606..865ea05 100644 --- a/.mock/definition/accounting/accountDetails.yml +++ b/.mock/definition/Accounting/accountDetails.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /accounting/v1/account-details method: GET - auth: true + auth: + - tokenAuth: [] docs: Get details for a linked account. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.AccountDetails + type: accountingRoot.AccountDetails status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd @@ -33,4 +35,4 @@ service: account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/accountToken.yml b/.mock/definition/Accounting/accountToken.yml similarity index 82% rename from .mock/definition/accounting/accountToken.yml rename to .mock/definition/Accounting/accountToken.yml index e5fa047..5218fcc 100644 --- a/.mock/definition/accounting/accountToken.yml +++ b/.mock/definition/Accounting/accountToken.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,24 @@ service: retrieve: path: /accounting/v1/account-token/{public_token} method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Returns the account token for the end user with the provided public token. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: public_token: string response: docs: '' - type: root.AccountToken + type: accountingRoot.AccountToken status-code: 200 examples: - path-parameters: public_token: public_token + headers: + X-Account-Token: '[object Object]' response: body: account_token: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB @@ -41,4 +44,4 @@ service: key: value id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/accountingPeriods.yml b/.mock/definition/Accounting/accountingPeriods.yml similarity index 81% rename from .mock/definition/accounting/accountingPeriods.yml rename to .mock/definition/Accounting/accountingPeriods.yml index d6fc7c6..871b636 100644 --- a/.mock/definition/accounting/accountingPeriods.yml +++ b/.mock/definition/Accounting/accountingPeriods.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/accounting-periods method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `AccountingPeriod` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: AccountingPeriodsListRequest query-parameters: @@ -40,10 +45,17 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedAccountingPeriodList + type: accountingRoot.PaginatedAccountingPeriodList status-code: 200 examples: - - headers: {} + - 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 @@ -69,10 +81,11 @@ service: retrieve: path: /accounting/v1/accounting-periods/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `AccountingPeriod` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -90,12 +103,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.AccountingPeriod + type: accountingRoot.AccountingPeriod status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -116,4 +133,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/accounts.yml b/.mock/definition/Accounting/accounts.yml similarity index 87% rename from .mock/definition/accounting/accounts.yml rename to .mock/definition/Accounting/accounts.yml index c674609..f1fb20b 100644 --- a/.mock/definition/accounting/accounts.yml +++ b/.mock/definition/Accounting/accounts.yml @@ -1,4 +1,15 @@ types: + AccountsListRequestClassification: + enum: + - value: '' + name: EMPTY + - ASSET + - EQUITY + - EXPENSE + - LIABILITY + - REVENUE + source: + openapi: accounting_v3.yml AccountsListRequestRemoteFields: enum: - classification @@ -6,7 +17,7 @@ types: name: ClassificationStatus - status source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml AccountsListRequestShowEnumOrigins: enum: - classification @@ -14,7 +25,16 @@ types: name: ClassificationStatus - status source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml + AccountsListRequestStatus: + enum: + - value: '' + name: EMPTY + - ACTIVE + - INACTIVE + - PENDING + source: + openapi: accounting_v3.yml AccountsRetrieveRequestRemoteFields: enum: - classification @@ -22,7 +42,7 @@ types: name: ClassificationStatus - status source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml AccountsRetrieveRequestShowEnumOrigins: enum: - classification @@ -30,9 +50,9 @@ types: name: ClassificationStatus - status source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -40,10 +60,15 @@ service: list: path: /accounting/v1/accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Account` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: AccountsListRequest query-parameters: @@ -51,7 +76,7 @@ service: type: optional docs: If provided, will only return accounts with the passed in enum. classification: - type: optional + type: optional docs: If provided, will only return accounts with this classification. company_id: type: optional @@ -69,6 +94,7 @@ service: 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. @@ -120,14 +146,33 @@ service: enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) status: - type: optional + type: optional docs: If provided, will only return accounts with this status. response: docs: '' - type: root.PaginatedAccountList + type: accountingRoot.PaginatedAccountList status-code: 200 examples: - - headers: {} + - 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 @@ -161,10 +206,11 @@ service: create: path: /accounting/v1/accounts method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `Account` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: AccountEndpointRequest query-parameters: @@ -178,14 +224,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.AccountRequest + model: accountingRoot.AccountRequest content-type: application/json response: docs: '' - type: root.AccountResponse + type: accountingRoot.AccountResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -239,10 +289,11 @@ service: retrieve: path: /accounting/v1/accounts/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Account` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -250,6 +301,7 @@ service: 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. @@ -275,12 +327,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Account + type: accountingRoot.Account status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -311,16 +369,18 @@ service: metaPostRetrieve: path: /accounting/v1/accounts/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Account` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -493,4 +553,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/addresses.yml b/.mock/definition/Accounting/addresses.yml similarity index 81% rename from .mock/definition/accounting/addresses.yml rename to .mock/definition/Accounting/addresses.yml index 989f0df..c7dc06e 100644 --- a/.mock/definition/accounting/addresses.yml +++ b/.mock/definition/Accounting/addresses.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: retrieve: path: /accounting/v1/addresses/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Address` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -38,12 +39,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Address + type: accountingRoot.Address status-code: 200 examples: - path-parameters: id: id - headers: {} + 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' @@ -58,4 +65,4 @@ service: country: AF zip_code: '10027' source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/asyncPassthrough.yml b/.mock/definition/Accounting/asyncPassthrough.yml similarity index 75% rename from .mock/definition/accounting/asyncPassthrough.yml rename to .mock/definition/Accounting/asyncPassthrough.yml index da15baf..72b5844 100644 --- a/.mock/definition/accounting/asyncPassthrough.yml +++ b/.mock/definition/Accounting/asyncPassthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,23 @@ service: create: path: /accounting/v1/async-passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: >- Asynchronously pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: - body: root.DataPassthroughRequest + body: accountingRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.AsyncPassthroughReciept + type: accountingRoot.AsyncPassthroughReciept status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -31,10 +33,11 @@ service: retrieve: path: /accounting/v1/async-passthrough/{async_passthrough_receipt_id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Retrieves data from earlier async-passthrough POST request source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: async_passthrough_receipt_id: string response: @@ -44,7 +47,8 @@ service: examples: - path-parameters: async_passthrough_receipt_id: async_passthrough_receipt_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: method: GET @@ -59,12 +63,12 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml types: AsyncPassthroughRetrieveResponse: discriminated: false union: - - root.RemoteResponse + - accountingRoot.RemoteResponse - string source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/asyncTasks.yml b/.mock/definition/Accounting/asyncTasks.yml similarity index 92% rename from .mock/definition/accounting/asyncTasks.yml rename to .mock/definition/Accounting/asyncTasks.yml index 6365c3a..f4ca6af 100644 --- a/.mock/definition/accounting/asyncTasks.yml +++ b/.mock/definition/Accounting/asyncTasks.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,20 +7,22 @@ service: retrieve: path: /accounting/v1/async-tasks/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `AsyncPostTask` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string response: docs: '' - type: root.AsyncPostTask + type: accountingRoot.AsyncPostTask status-code: 200 examples: - path-parameters: id: id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: status: QUEUED @@ -78,4 +80,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/attachments.yml b/.mock/definition/Accounting/attachments.yml similarity index 90% rename from .mock/definition/accounting/attachments.yml rename to .mock/definition/Accounting/attachments.yml index cae3762..fd49f37 100644 --- a/.mock/definition/accounting/attachments.yml +++ b/.mock/definition/Accounting/attachments.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/attachments method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `AccountingAttachment` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: AttachmentsListRequest query-parameters: @@ -66,10 +71,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedAccountingAttachmentList + type: accountingRoot.PaginatedAccountingAttachmentList status-code: 200 examples: - - headers: {} + - 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 @@ -96,10 +114,11 @@ service: create: path: /accounting/v1/attachments method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `AccountingAttachment` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: AccountingAttachmentEndpointRequest query-parameters: @@ -113,14 +132,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.AccountingAttachmentRequest + model: accountingRoot.AccountingAttachmentRequest content-type: application/json response: docs: '' - type: root.AccountingAttachmentResponse + type: accountingRoot.AccountingAttachmentResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -167,10 +190,11 @@ service: retrieve: path: /accounting/v1/attachments/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `AccountingAttachment` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -188,12 +212,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.AccountingAttachment + type: accountingRoot.AccountingAttachment status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -217,16 +245,18 @@ service: metaPostRetrieve: path: /accounting/v1/attachments/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `AccountingAttachment` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -399,4 +429,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/auditTrail.yml b/.mock/definition/Accounting/auditTrail.yml similarity index 85% rename from .mock/definition/accounting/auditTrail.yml rename to .mock/definition/Accounting/auditTrail.yml index 6e1b867..f8feeb9 100644 --- a/.mock/definition/accounting/auditTrail.yml +++ b/.mock/definition/Accounting/auditTrail.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/audit-trail method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets a list of audit trail events. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: AuditTrailListRequest query-parameters: @@ -72,10 +77,19 @@ service: email. response: docs: '' - type: root.PaginatedAuditLogEventList + type: accountingRoot.PaginatedAuditLogEventList status-code: 200 examples: - - response: + - 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 @@ -91,4 +105,4 @@ service: from Read to Read+Write created_at: '2024-01-15T09:30:00Z' source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/availableActions.yml b/.mock/definition/Accounting/availableActions.yml similarity index 84% rename from .mock/definition/accounting/availableActions.yml rename to .mock/definition/Accounting/availableActions.yml index 35fca3f..8a30ab4 100644 --- a/.mock/definition/accounting/availableActions.yml +++ b/.mock/definition/Accounting/availableActions.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /accounting/v1/available-actions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of models and actions available for an account. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.AvailableActions + type: accountingRoot.AvailableActions status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: integration: @@ -47,4 +49,4 @@ service: - company - title source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/balanceSheets.yml b/.mock/definition/Accounting/balanceSheets.yml similarity index 88% rename from .mock/definition/accounting/balanceSheets.yml rename to .mock/definition/Accounting/balanceSheets.yml index dde810e..7f0352b 100644 --- a/.mock/definition/accounting/balanceSheets.yml +++ b/.mock/definition/Accounting/balanceSheets.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/balance-sheets method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `BalanceSheet` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: BalanceSheetsListRequest query-parameters: @@ -30,6 +35,7 @@ service: 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. @@ -69,10 +75,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedBalanceSheetList + type: accountingRoot.PaginatedBalanceSheetList status-code: 200 examples: - - headers: {} + - 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 @@ -138,10 +157,11 @@ service: retrieve: path: /accounting/v1/balance-sheets/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `BalanceSheet` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -149,6 +169,7 @@ service: 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. @@ -164,12 +185,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.BalanceSheet + type: accountingRoot.BalanceSheet status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -238,4 +263,4 @@ service: data: key: value source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/bankFeedAccounts.yml b/.mock/definition/Accounting/bankFeedAccounts.yml similarity index 91% rename from .mock/definition/accounting/bankFeedAccounts.yml rename to .mock/definition/Accounting/bankFeedAccounts.yml index 2e64d19..edf14a7 100644 --- a/.mock/definition/accounting/bankFeedAccounts.yml +++ b/.mock/definition/Accounting/bankFeedAccounts.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/bank-feed-accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `BankFeedAccount` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: BankFeedAccountsListRequest query-parameters: @@ -40,10 +45,17 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedBankFeedAccountList + type: accountingRoot.PaginatedBankFeedAccountList status-code: 200 examples: - - headers: {} + - 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 @@ -69,13 +81,16 @@ service: 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: true + auth: + - tokenAuth: [] docs: Creates a `BankFeedAccount` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: BankFeedAccountEndpointRequest query-parameters: @@ -89,14 +104,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.BankFeedAccountRequest + model: accountingRoot.BankFeedAccountRequest content-type: application/json response: docs: '' - type: root.BankFeedAccountResponse + type: accountingRoot.BankFeedAccountResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -147,10 +166,11 @@ service: retrieve: path: /accounting/v1/bank-feed-accounts/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `BankFeedAccount` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -168,12 +188,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.BankFeedAccount + type: accountingRoot.BankFeedAccount status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -201,16 +225,18 @@ service: metaPostRetrieve: path: /accounting/v1/bank-feed-accounts/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `BankFeedAccount` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -383,4 +409,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/bankFeedTransactions.yml b/.mock/definition/Accounting/bankFeedTransactions.yml similarity index 89% rename from .mock/definition/accounting/bankFeedTransactions.yml rename to .mock/definition/Accounting/bankFeedTransactions.yml index 682615d..8a23cac 100644 --- a/.mock/definition/accounting/bankFeedTransactions.yml +++ b/.mock/definition/Accounting/bankFeedTransactions.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/bank-feed-transactions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `BankFeedTransaction` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: BankFeedTransactionsListRequest query-parameters: @@ -27,6 +32,7 @@ service: 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. @@ -71,10 +77,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedBankFeedTransactionList + type: accountingRoot.PaginatedBankFeedTransactionList status-code: 200 examples: - - headers: {} + - 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 @@ -98,10 +117,11 @@ service: create: path: /accounting/v1/bank-feed-transactions method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `BankFeedTransaction` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: BankFeedTransactionEndpointRequest query-parameters: @@ -115,14 +135,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.BankFeedTransactionRequestRequest + model: accountingRoot.BankFeedTransactionRequestRequest content-type: application/json response: docs: '' - type: root.BankFeedTransactionResponse + type: accountingRoot.BankFeedTransactionResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -166,10 +190,11 @@ service: retrieve: path: /accounting/v1/bank-feed-transactions/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `BankFeedTransaction` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -177,6 +202,7 @@ service: 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. @@ -192,12 +218,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.BankFeedTransaction + type: accountingRoot.BankFeedTransaction status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -218,16 +248,18 @@ service: metaPostRetrieve: path: /accounting/v1/bank-feed-transactions/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `BankFeedTransaction` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -400,4 +432,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/cashFlowStatements.yml b/.mock/definition/Accounting/cashFlowStatements.yml similarity index 88% rename from .mock/definition/accounting/cashFlowStatements.yml rename to .mock/definition/Accounting/cashFlowStatements.yml index 179afb9..52afdc7 100644 --- a/.mock/definition/accounting/cashFlowStatements.yml +++ b/.mock/definition/Accounting/cashFlowStatements.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/cash-flow-statements method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `CashFlowStatement` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: CashFlowStatementsListRequest query-parameters: @@ -32,6 +37,7 @@ service: 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. @@ -71,10 +77,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedCashFlowStatementList + type: accountingRoot.PaginatedCashFlowStatementList status-code: 200 examples: - - headers: {} + - 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 @@ -139,10 +158,11 @@ service: retrieve: path: /accounting/v1/cash-flow-statements/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `CashFlowStatement` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -150,6 +170,7 @@ service: 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. @@ -165,12 +186,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.CashFlowStatement + type: accountingRoot.CashFlowStatement status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -238,4 +263,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/companyInfo.yml b/.mock/definition/Accounting/companyInfo.yml similarity index 80% rename from .mock/definition/accounting/companyInfo.yml rename to .mock/definition/Accounting/companyInfo.yml index 488a430..76a4eaf 100644 --- a/.mock/definition/accounting/companyInfo.yml +++ b/.mock/definition/Accounting/companyInfo.yml @@ -1,22 +1,18 @@ types: - CompanyInfoListRequestExpand: + CompanyInfoListRequestExpandItem: enum: - addresses - - value: addresses,phone_numbers - name: AddressesPhoneNumbers - phone_numbers source: - openapi: openapi/openapi.yml - CompanyInfoRetrieveRequestExpand: + openapi: accounting_v3.yml + CompanyInfoRetrieveRequestExpandItem: enum: - addresses - - value: addresses,phone_numbers - name: AddressesPhoneNumbers - phone_numbers source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -24,10 +20,15 @@ service: list: path: /accounting/v1/company-info method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `CompanyInfo` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: CompanyInfoListRequest query-parameters: @@ -43,7 +44,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -83,10 +85,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedCompanyInfoList + type: accountingRoot.PaginatedCompanyInfoList status-code: 200 examples: - - headers: {} + - 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 @@ -101,8 +115,11 @@ service: tax_number: 11-0011000 fiscal_year_end_month: 12 fiscal_year_end_day: 31 - currency: XUA + 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' @@ -128,17 +145,19 @@ service: retrieve: path: /accounting/v1/company-info/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `CompanyInfo` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: CompanyInfoRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -154,12 +173,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.CompanyInfo + type: accountingRoot.CompanyInfo status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -171,7 +194,8 @@ service: tax_number: 11-0011000 fiscal_year_end_month: 12 fiscal_year_end_day: 31 - currency: XUA + currency: + key: value remote_created_at: '2020-03-31T00:00:00Z' urls: - urls @@ -202,4 +226,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/contacts.yml b/.mock/definition/Accounting/contacts.yml similarity index 87% rename from .mock/definition/accounting/contacts.yml rename to .mock/definition/Accounting/contacts.yml index ba75cfb..dfa1813 100644 --- a/.mock/definition/accounting/contacts.yml +++ b/.mock/definition/Accounting/contacts.yml @@ -1,36 +1,28 @@ types: - ContactsListRequestExpand: + ContactsListRequestExpandItem: enum: - addresses - - value: addresses,company - name: AddressesCompany - - value: addresses,phone_numbers - name: AddressesPhoneNumbers - - value: addresses,phone_numbers,company - name: AddressesPhoneNumbersCompany - company - phone_numbers - - value: phone_numbers,company - name: PhoneNumbersCompany source: - openapi: openapi/openapi.yml - ContactsRetrieveRequestExpand: + openapi: accounting_v3.yml + ContactsListRequestStatus: + enum: + - value: '' + name: EMPTY + - ACTIVE + - ARCHIVED + source: + openapi: accounting_v3.yml + ContactsRetrieveRequestExpandItem: enum: - addresses - - value: addresses,company - name: AddressesCompany - - value: addresses,phone_numbers - name: AddressesPhoneNumbers - - value: addresses,phone_numbers,company - name: AddressesPhoneNumbersCompany - company - phone_numbers - - value: phone_numbers,company - name: PhoneNumbersCompany source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -38,10 +30,15 @@ service: list: path: /accounting/v1/contacts method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Contact` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ContactsListRequest query-parameters: @@ -63,7 +60,8 @@ service: type: optional docs: If provided, will only return Contacts that match this email. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -130,14 +128,35 @@ service: enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) status: - type: optional + type: optional docs: If provided, will only return Contacts that match this status. response: docs: '' - type: root.PaginatedContactList + type: accountingRoot.PaginatedContactList status-code: 200 examples: - - headers: {} + - 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 @@ -179,10 +198,11 @@ service: create: path: /accounting/v1/contacts method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Contact` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ContactEndpointRequest query-parameters: @@ -196,14 +216,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.ContactRequest + model: accountingRoot.ContactRequest content-type: application/json response: docs: '' - type: root.ContactResponse + type: accountingRoot.ContactResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -265,17 +289,19 @@ service: retrieve: path: /accounting/v1/contacts/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Contact` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: ContactsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -306,12 +332,19 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Contact + type: accountingRoot.Contact status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -352,16 +385,18 @@ service: metaPostRetrieve: path: /accounting/v1/contacts/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Contact` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -536,10 +571,15 @@ service: remoteFieldClassesList: path: /accounting/v1/contacts/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ContactsRemoteFieldClassesListRequest query-parameters: @@ -579,10 +619,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: accountingRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -599,4 +648,4 @@ service: field_choices: - field_choices source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/creditNotes.yml b/.mock/definition/Accounting/creditNotes.yml new file mode 100644 index 0000000..db88f86 --- /dev/null +++ b/.mock/definition/Accounting/creditNotes.yml @@ -0,0 +1,668 @@ +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 similarity index 54% rename from .mock/definition/accounting/deleteAccount.yml rename to .mock/definition/Accounting/deleteAccount.yml index 402b4e7..ac30455 100644 --- a/.mock/definition/accounting/deleteAccount.yml +++ b/.mock/definition/Accounting/deleteAccount.yml @@ -5,11 +5,13 @@ service: delete: path: /accounting/v1/delete-account method: POST - auth: true + auth: + - tokenAuth: [] docs: Delete a linked account. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/employees.yml b/.mock/definition/Accounting/employees.yml similarity index 83% rename from .mock/definition/accounting/employees.yml rename to .mock/definition/Accounting/employees.yml index 3ccf25f..15a0cdb 100644 --- a/.mock/definition/accounting/employees.yml +++ b/.mock/definition/Accounting/employees.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/employees method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Employee` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: EmployeesListRequest query-parameters: @@ -19,6 +24,7 @@ service: 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. @@ -45,10 +51,17 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedEmployeeList + type: accountingRoot.PaginatedEmployeeList status-code: 200 examples: - - headers: {} + - 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 @@ -78,10 +91,11 @@ service: retrieve: path: /accounting/v1/employees/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Employee` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -89,6 +103,7 @@ service: 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. @@ -104,12 +119,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Employee + type: accountingRoot.Employee status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -134,4 +153,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/expenses.yml b/.mock/definition/Accounting/expenses.yml similarity index 69% rename from .mock/definition/accounting/expenses.yml rename to .mock/definition/Accounting/expenses.yml index 98c48ed..c039baa 100644 --- a/.mock/definition/accounting/expenses.yml +++ b/.mock/definition/Accounting/expenses.yml @@ -1,254 +1,26 @@ types: - ExpensesListRequestExpand: + ExpensesListRequestExpandItem: enum: - account - - value: account,accounting_period - name: AccountAccountingPeriod - - value: account,company - name: AccountCompany - - value: account,company,accounting_period - name: AccountCompanyAccountingPeriod - - value: account,company,employee - name: AccountCompanyEmployee - - value: account,company,employee,accounting_period - name: AccountCompanyEmployeeAccountingPeriod - - value: account,contact - name: AccountContact - - value: account,contact,accounting_period - name: AccountContactAccountingPeriod - - value: account,contact,company - name: AccountContactCompany - - value: account,contact,company,accounting_period - name: AccountContactCompanyAccountingPeriod - - value: account,contact,company,employee - name: AccountContactCompanyEmployee - - value: account,contact,company,employee,accounting_period - name: AccountContactCompanyEmployeeAccountingPeriod - - value: account,contact,employee - name: AccountContactEmployee - - value: account,contact,employee,accounting_period - name: AccountContactEmployeeAccountingPeriod - - value: account,employee - name: AccountEmployee - - value: account,employee,accounting_period - name: AccountEmployeeAccountingPeriod - accounting_period - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - value: company,employee - name: CompanyEmployee - - value: company,employee,accounting_period - name: CompanyEmployeeAccountingPeriod - contact - - value: contact,accounting_period - name: ContactAccountingPeriod - - value: contact,company - name: ContactCompany - - value: contact,company,accounting_period - name: ContactCompanyAccountingPeriod - - value: contact,company,employee - name: ContactCompanyEmployee - - value: contact,company,employee,accounting_period - name: ContactCompanyEmployeeAccountingPeriod - - value: contact,employee - name: ContactEmployee - - value: contact,employee,accounting_period - name: ContactEmployeeAccountingPeriod - employee - - value: employee,accounting_period - name: EmployeeAccountingPeriod - tracking_categories - - value: tracking_categories,account - name: TrackingCategoriesAccount - - value: tracking_categories,account,accounting_period - name: TrackingCategoriesAccountAccountingPeriod - - value: tracking_categories,account,company - name: TrackingCategoriesAccountCompany - - value: tracking_categories,account,company,accounting_period - name: TrackingCategoriesAccountCompanyAccountingPeriod - - value: tracking_categories,account,company,employee - name: TrackingCategoriesAccountCompanyEmployee - - value: tracking_categories,account,company,employee,accounting_period - name: TrackingCategoriesAccountCompanyEmployeeAccountingPeriod - - value: tracking_categories,account,contact - name: TrackingCategoriesAccountContact - - value: tracking_categories,account,contact,accounting_period - name: TrackingCategoriesAccountContactAccountingPeriod - - value: tracking_categories,account,contact,company - name: TrackingCategoriesAccountContactCompany - - value: tracking_categories,account,contact,company,accounting_period - name: TrackingCategoriesAccountContactCompanyAccountingPeriod - - value: tracking_categories,account,contact,company,employee - name: TrackingCategoriesAccountContactCompanyEmployee - - value: tracking_categories,account,contact,company,employee,accounting_period - name: TrackingCategoriesAccountContactCompanyEmployeeAccountingPeriod - - value: tracking_categories,account,contact,employee - name: TrackingCategoriesAccountContactEmployee - - value: tracking_categories,account,contact,employee,accounting_period - name: TrackingCategoriesAccountContactEmployeeAccountingPeriod - - value: tracking_categories,account,employee - name: TrackingCategoriesAccountEmployee - - value: tracking_categories,account,employee,accounting_period - name: TrackingCategoriesAccountEmployeeAccountingPeriod - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,company,employee - name: TrackingCategoriesCompanyEmployee - - value: tracking_categories,company,employee,accounting_period - name: TrackingCategoriesCompanyEmployeeAccountingPeriod - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod - - value: tracking_categories,contact,company - name: TrackingCategoriesContactCompany - - value: tracking_categories,contact,company,accounting_period - name: TrackingCategoriesContactCompanyAccountingPeriod - - value: tracking_categories,contact,company,employee - name: TrackingCategoriesContactCompanyEmployee - - value: tracking_categories,contact,company,employee,accounting_period - name: TrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: tracking_categories,contact,employee - name: TrackingCategoriesContactEmployee - - value: tracking_categories,contact,employee,accounting_period - name: TrackingCategoriesContactEmployeeAccountingPeriod - - value: tracking_categories,employee - name: TrackingCategoriesEmployee - - value: tracking_categories,employee,accounting_period - name: TrackingCategoriesEmployeeAccountingPeriod source: - openapi: openapi/openapi.yml - ExpensesRetrieveRequestExpand: + openapi: accounting_v3.yml + ExpensesRetrieveRequestExpandItem: enum: - account - - value: account,accounting_period - name: AccountAccountingPeriod - - value: account,company - name: AccountCompany - - value: account,company,accounting_period - name: AccountCompanyAccountingPeriod - - value: account,company,employee - name: AccountCompanyEmployee - - value: account,company,employee,accounting_period - name: AccountCompanyEmployeeAccountingPeriod - - value: account,contact - name: AccountContact - - value: account,contact,accounting_period - name: AccountContactAccountingPeriod - - value: account,contact,company - name: AccountContactCompany - - value: account,contact,company,accounting_period - name: AccountContactCompanyAccountingPeriod - - value: account,contact,company,employee - name: AccountContactCompanyEmployee - - value: account,contact,company,employee,accounting_period - name: AccountContactCompanyEmployeeAccountingPeriod - - value: account,contact,employee - name: AccountContactEmployee - - value: account,contact,employee,accounting_period - name: AccountContactEmployeeAccountingPeriod - - value: account,employee - name: AccountEmployee - - value: account,employee,accounting_period - name: AccountEmployeeAccountingPeriod - accounting_period - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - value: company,employee - name: CompanyEmployee - - value: company,employee,accounting_period - name: CompanyEmployeeAccountingPeriod - contact - - value: contact,accounting_period - name: ContactAccountingPeriod - - value: contact,company - name: ContactCompany - - value: contact,company,accounting_period - name: ContactCompanyAccountingPeriod - - value: contact,company,employee - name: ContactCompanyEmployee - - value: contact,company,employee,accounting_period - name: ContactCompanyEmployeeAccountingPeriod - - value: contact,employee - name: ContactEmployee - - value: contact,employee,accounting_period - name: ContactEmployeeAccountingPeriod - employee - - value: employee,accounting_period - name: EmployeeAccountingPeriod - tracking_categories - - value: tracking_categories,account - name: TrackingCategoriesAccount - - value: tracking_categories,account,accounting_period - name: TrackingCategoriesAccountAccountingPeriod - - value: tracking_categories,account,company - name: TrackingCategoriesAccountCompany - - value: tracking_categories,account,company,accounting_period - name: TrackingCategoriesAccountCompanyAccountingPeriod - - value: tracking_categories,account,company,employee - name: TrackingCategoriesAccountCompanyEmployee - - value: tracking_categories,account,company,employee,accounting_period - name: TrackingCategoriesAccountCompanyEmployeeAccountingPeriod - - value: tracking_categories,account,contact - name: TrackingCategoriesAccountContact - - value: tracking_categories,account,contact,accounting_period - name: TrackingCategoriesAccountContactAccountingPeriod - - value: tracking_categories,account,contact,company - name: TrackingCategoriesAccountContactCompany - - value: tracking_categories,account,contact,company,accounting_period - name: TrackingCategoriesAccountContactCompanyAccountingPeriod - - value: tracking_categories,account,contact,company,employee - name: TrackingCategoriesAccountContactCompanyEmployee - - value: tracking_categories,account,contact,company,employee,accounting_period - name: TrackingCategoriesAccountContactCompanyEmployeeAccountingPeriod - - value: tracking_categories,account,contact,employee - name: TrackingCategoriesAccountContactEmployee - - value: tracking_categories,account,contact,employee,accounting_period - name: TrackingCategoriesAccountContactEmployeeAccountingPeriod - - value: tracking_categories,account,employee - name: TrackingCategoriesAccountEmployee - - value: tracking_categories,account,employee,accounting_period - name: TrackingCategoriesAccountEmployeeAccountingPeriod - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,company,employee - name: TrackingCategoriesCompanyEmployee - - value: tracking_categories,company,employee,accounting_period - name: TrackingCategoriesCompanyEmployeeAccountingPeriod - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod - - value: tracking_categories,contact,company - name: TrackingCategoriesContactCompany - - value: tracking_categories,contact,company,accounting_period - name: TrackingCategoriesContactCompanyAccountingPeriod - - value: tracking_categories,contact,company,employee - name: TrackingCategoriesContactCompanyEmployee - - value: tracking_categories,contact,company,employee,accounting_period - name: TrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: tracking_categories,contact,employee - name: TrackingCategoriesContactEmployee - - value: tracking_categories,contact,employee,accounting_period - name: TrackingCategoriesContactEmployeeAccountingPeriod - - value: tracking_categories,employee - name: TrackingCategoriesEmployee - - value: tracking_categories,employee,accounting_period - name: TrackingCategoriesEmployeeAccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -256,10 +28,15 @@ service: list: path: /accounting/v1/expenses method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Expense` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ExpensesListRequest query-parameters: @@ -278,7 +55,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -331,10 +109,26 @@ service: datetime. response: docs: '' - type: root.PaginatedExpenseList + type: accountingRoot.PaginatedExpenseList status-code: 200 examples: - - headers: {} + - 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 @@ -409,10 +203,11 @@ service: create: path: /accounting/v1/expenses method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `Expense` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ExpenseEndpointRequest query-parameters: @@ -426,14 +221,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.ExpenseRequest + model: accountingRoot.ExpenseRequest content-type: application/json response: docs: '' - type: root.ExpenseResponse + type: accountingRoot.ExpenseResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -528,17 +327,19 @@ service: retrieve: path: /accounting/v1/expenses/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Expense` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: ExpensesRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -559,12 +360,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Expense + type: accountingRoot.Expense status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -591,7 +397,6 @@ service: modified_at: '2021-10-16T00:00:00Z' item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d net_amount: 25.54 - tracking_category: tracking_category tracking_categories: - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - 9b840d2-686a-465a-8a8e-7b028498f8e4 @@ -612,7 +417,6 @@ service: modified_at: '2021-10-16T00:00:00Z' item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d net_amount: 10 - tracking_category: tracking_category tracking_categories: - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - 9b840d2-686a-465a-8a8e-7b028498f8e4 @@ -649,10 +453,15 @@ service: linesRemoteFieldClassesList: path: /accounting/v1/expenses/lines/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ExpensesLinesRemoteFieldClassesListRequest query-parameters: @@ -692,10 +501,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: accountingRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -714,16 +532,18 @@ service: metaPostRetrieve: path: /accounting/v1/expenses/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Expense` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -898,10 +718,15 @@ service: remoteFieldClassesList: path: /accounting/v1/expenses/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ExpensesRemoteFieldClassesListRequest query-parameters: @@ -941,10 +766,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: accountingRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -961,4 +795,4 @@ service: field_choices: - field_choices source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/fieldMapping.yml b/.mock/definition/Accounting/fieldMapping.yml similarity index 96% rename from .mock/definition/accounting/fieldMapping.yml rename to .mock/definition/Accounting/fieldMapping.yml index 7f10618..e8c557c 100644 --- a/.mock/definition/accounting/fieldMapping.yml +++ b/.mock/definition/Accounting/fieldMapping.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,14 +7,15 @@ service: field_mappings_retrieve: path: /accounting/v1/field-mappings method: GET - auth: true + 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: openapi/openapi.yml + openapi: accounting_v3.yml request: name: FieldMappingsRetrieveRequest query-parameters: @@ -27,10 +28,13 @@ service: of the request since these fields require some calculations. response: docs: '' - type: root.FieldMappingApiInstanceResponse + type: accountingRoot.FieldMappingApiInstanceResponse status-code: 200 examples: - - headers: {} + - query-parameters: + exclude_remote_field_metadata: true + headers: + X-Account-Token: X-Account-Token response: body: Account: @@ -436,13 +440,14 @@ service: field_mappings_create: path: /accounting/v1/field-mappings method: POST - auth: true + 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: openapi/openapi.yml + openapi: accounting_v3.yml request: name: CreateFieldMappingRequest query-parameters: @@ -498,10 +503,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: accountingRoot.FieldMappingInstanceResponse status-code: 201 examples: - - headers: {} + - 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 @@ -551,24 +559,26 @@ service: field_mappings_destroy: path: /accounting/v1/field-mappings/{field_mapping_id} method: DELETE - auth: true + 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: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: field_mapping_id: string response: docs: '' - type: root.FieldMappingInstanceResponse + type: accountingRoot.FieldMappingInstanceResponse status-code: 204 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: model: @@ -610,13 +620,14 @@ service: field_mappings_partial_update: path: /accounting/v1/field-mappings/{field_mapping_id} method: PATCH - auth: true + 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: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: field_mapping_id: string request: @@ -645,12 +656,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: accountingRoot.FieldMappingInstanceResponse status-code: 200 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token request: {} response: body: @@ -693,7 +705,8 @@ service: remote_fields_retrieve: path: /accounting/v1/remote-fields method: GET - auth: true + 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 @@ -701,7 +714,7 @@ service: or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: RemoteFieldsRetrieveRequest query-parameters: @@ -718,10 +731,14 @@ service: data from your customers. response: docs: '' - type: root.RemoteFieldApiResponse + type: accountingRoot.RemoteFieldApiResponse status-code: 200 examples: - - headers: {} + - query-parameters: + common_models: common_models + include_example_values: include_example_values + headers: + X-Account-Token: X-Account-Token response: body: Account: @@ -1077,7 +1094,8 @@ service: target_fields_retrieve: path: /accounting/v1/target-fields method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields @@ -1085,13 +1103,14 @@ service: Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.ExternalTargetFieldApiResponse + type: accountingRoot.ExternalTargetFieldApiResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: Account: @@ -1195,4 +1214,4 @@ service: description: this is a example description of a target field is_mapped: is_mapped source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/forceResync.yml b/.mock/definition/Accounting/forceResync.yml similarity index 81% rename from .mock/definition/accounting/forceResync.yml rename to .mock/definition/Accounting/forceResync.yml index 8e7e969..b9631fd 100644 --- a/.mock/definition/accounting/forceResync.yml +++ b/.mock/definition/Accounting/forceResync.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: sync_status_resync_create: path: /accounting/v1/sync-status/resync method: POST - auth: true + 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 @@ -15,13 +16,14 @@ service: linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - model_name: Invoice @@ -34,4 +36,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/generalLedgerTransactions.yml b/.mock/definition/Accounting/generalLedgerTransactions.yml similarity index 74% rename from .mock/definition/accounting/generalLedgerTransactions.yml rename to .mock/definition/Accounting/generalLedgerTransactions.yml index 38fe729..12923c8 100644 --- a/.mock/definition/accounting/generalLedgerTransactions.yml +++ b/.mock/definition/Accounting/generalLedgerTransactions.yml @@ -1,68 +1,22 @@ types: - GeneralLedgerTransactionsListRequestExpand: + GeneralLedgerTransactionsListRequestExpandItem: enum: - accounting_period - company - - value: company,accounting_period - name: CompanyAccountingPeriod - general_ledger_transaction_lines - - value: general_ledger_transaction_lines,accounting_period - name: GeneralLedgerTransactionLinesAccountingPeriod - - value: general_ledger_transaction_lines,company - name: GeneralLedgerTransactionLinesCompany - - value: general_ledger_transaction_lines,company,accounting_period - name: GeneralLedgerTransactionLinesCompanyAccountingPeriod - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,general_ledger_transaction_lines - name: TrackingCategoriesGeneralLedgerTransactionLines - - value: tracking_categories,general_ledger_transaction_lines,accounting_period - name: TrackingCategoriesGeneralLedgerTransactionLinesAccountingPeriod - - value: tracking_categories,general_ledger_transaction_lines,company - name: TrackingCategoriesGeneralLedgerTransactionLinesCompany - - value: >- - tracking_categories,general_ledger_transaction_lines,company,accounting_period - name: TrackingCategoriesGeneralLedgerTransactionLinesCompanyAccountingPeriod source: - openapi: openapi/openapi.yml - GeneralLedgerTransactionsRetrieveRequestExpand: + openapi: accounting_v3.yml + GeneralLedgerTransactionsRetrieveRequestExpandItem: enum: - accounting_period - company - - value: company,accounting_period - name: CompanyAccountingPeriod - general_ledger_transaction_lines - - value: general_ledger_transaction_lines,accounting_period - name: GeneralLedgerTransactionLinesAccountingPeriod - - value: general_ledger_transaction_lines,company - name: GeneralLedgerTransactionLinesCompany - - value: general_ledger_transaction_lines,company,accounting_period - name: GeneralLedgerTransactionLinesCompanyAccountingPeriod - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,general_ledger_transaction_lines - name: TrackingCategoriesGeneralLedgerTransactionLines - - value: tracking_categories,general_ledger_transaction_lines,accounting_period - name: TrackingCategoriesGeneralLedgerTransactionLinesAccountingPeriod - - value: tracking_categories,general_ledger_transaction_lines,company - name: TrackingCategoriesGeneralLedgerTransactionLinesCompany - - value: >- - tracking_categories,general_ledger_transaction_lines,company,accounting_period - name: TrackingCategoriesGeneralLedgerTransactionLinesCompanyAccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -70,10 +24,15 @@ service: list: path: /accounting/v1/general-ledger-transactions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `GeneralLedgerTransaction` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: GeneralLedgerTransactionsListRequest query-parameters: @@ -94,7 +53,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -140,10 +100,25 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedGeneralLedgerTransactionList + type: accountingRoot.PaginatedGeneralLedgerTransactionList status-code: 200 examples: - - headers: {} + - 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 @@ -197,17 +172,19 @@ service: retrieve: path: /accounting/v1/general-ledger-transactions/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `GeneralLedgerTransaction` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: GeneralLedgerTransactionsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -223,12 +200,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.GeneralLedgerTransaction + type: accountingRoot.GeneralLedgerTransaction status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -286,4 +267,4 @@ service: data: key: value source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/generateKey.yml b/.mock/definition/Accounting/generateKey.yml similarity index 73% rename from .mock/definition/accounting/generateKey.yml rename to .mock/definition/Accounting/generateKey.yml index 4d79b8c..ba16dde 100644 --- a/.mock/definition/accounting/generateKey.yml +++ b/.mock/definition/Accounting/generateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /accounting/v1/generate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Create a remote key. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: GenerateRemoteKeyRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: accountingRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/incomeStatements.yml b/.mock/definition/Accounting/incomeStatements.yml similarity index 89% rename from .mock/definition/accounting/incomeStatements.yml rename to .mock/definition/Accounting/incomeStatements.yml index 92f62e7..0c2e79b 100644 --- a/.mock/definition/accounting/incomeStatements.yml +++ b/.mock/definition/Accounting/incomeStatements.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/income-statements method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `IncomeStatement` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: IncomeStatementsListRequest query-parameters: @@ -30,6 +35,7 @@ service: 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. @@ -69,10 +75,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedIncomeStatementList + type: accountingRoot.PaginatedIncomeStatementList status-code: 200 examples: - - headers: {} + - 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 @@ -152,10 +171,11 @@ service: retrieve: path: /accounting/v1/income-statements/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `IncomeStatement` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -163,6 +183,7 @@ service: 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. @@ -178,12 +199,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.IncomeStatement + type: accountingRoot.IncomeStatement status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -266,4 +291,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/invoices.yml b/.mock/definition/Accounting/invoices.yml new file mode 100644 index 0000000..304889f --- /dev/null +++ b/.mock/definition/Accounting/invoices.yml @@ -0,0 +1,1270 @@ +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 similarity index 75% rename from .mock/definition/accounting/issues.yml rename to .mock/definition/Accounting/issues.yml index 58c4f3b..01daddd 100644 --- a/.mock/definition/accounting/issues.yml +++ b/.mock/definition/Accounting/issues.yml @@ -4,9 +4,9 @@ types: - ONGOING - RESOLVED source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -14,10 +14,15 @@ service: list: path: /accounting/v1/issues method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets all issues for Organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: IssuesListRequest query-parameters: @@ -77,10 +82,27 @@ service: * `RESOLVED` - RESOLVED response: docs: '' - type: root.PaginatedIssueList + type: accountingRoot.PaginatedIssueList status-code: 200 examples: - - response: + - 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 @@ -99,19 +121,22 @@ service: retrieve: path: /accounting/v1/issues/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Get a specific issue. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string response: docs: '' - type: root.Issue + 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 @@ -126,4 +151,4 @@ service: - Missing employee permissions. - Missing time off permissions. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/items.yml b/.mock/definition/Accounting/items.yml similarity index 81% rename from .mock/definition/accounting/items.yml rename to .mock/definition/Accounting/items.yml index 7ee5dea..81d180f 100644 --- a/.mock/definition/accounting/items.yml +++ b/.mock/definition/Accounting/items.yml @@ -1,130 +1,24 @@ types: - ItemsListRequestExpand: + ItemsListRequestExpandItem: enum: - company - - value: company,purchase_tax_rate - name: CompanyPurchaseTaxRate - - value: company,sales_tax_rate - name: CompanySalesTaxRate - - value: company,sales_tax_rate,purchase_tax_rate - name: CompanySalesTaxRatePurchaseTaxRate - purchase_account - - value: purchase_account,company - name: PurchaseAccountCompany - - value: purchase_account,company,purchase_tax_rate - name: PurchaseAccountCompanyPurchaseTaxRate - - value: purchase_account,company,sales_tax_rate - name: PurchaseAccountCompanySalesTaxRate - - value: purchase_account,company,sales_tax_rate,purchase_tax_rate - name: PurchaseAccountCompanySalesTaxRatePurchaseTaxRate - - value: purchase_account,purchase_tax_rate - name: PurchaseAccountPurchaseTaxRate - - value: purchase_account,sales_account - name: PurchaseAccountSalesAccount - - value: purchase_account,sales_account,company - name: PurchaseAccountSalesAccountCompany - - value: purchase_account,sales_account,company,purchase_tax_rate - name: PurchaseAccountSalesAccountCompanyPurchaseTaxRate - - value: purchase_account,sales_account,company,sales_tax_rate - name: PurchaseAccountSalesAccountCompanySalesTaxRate - - value: >- - purchase_account,sales_account,company,sales_tax_rate,purchase_tax_rate - name: PurchaseAccountSalesAccountCompanySalesTaxRatePurchaseTaxRate - - value: purchase_account,sales_account,purchase_tax_rate - name: PurchaseAccountSalesAccountPurchaseTaxRate - - value: purchase_account,sales_account,sales_tax_rate - name: PurchaseAccountSalesAccountSalesTaxRate - - value: purchase_account,sales_account,sales_tax_rate,purchase_tax_rate - name: PurchaseAccountSalesAccountSalesTaxRatePurchaseTaxRate - - value: purchase_account,sales_tax_rate - name: PurchaseAccountSalesTaxRate - - value: purchase_account,sales_tax_rate,purchase_tax_rate - name: PurchaseAccountSalesTaxRatePurchaseTaxRate - purchase_tax_rate - sales_account - - value: sales_account,company - name: SalesAccountCompany - - value: sales_account,company,purchase_tax_rate - name: SalesAccountCompanyPurchaseTaxRate - - value: sales_account,company,sales_tax_rate - name: SalesAccountCompanySalesTaxRate - - value: sales_account,company,sales_tax_rate,purchase_tax_rate - name: SalesAccountCompanySalesTaxRatePurchaseTaxRate - - value: sales_account,purchase_tax_rate - name: SalesAccountPurchaseTaxRate - - value: sales_account,sales_tax_rate - name: SalesAccountSalesTaxRate - - value: sales_account,sales_tax_rate,purchase_tax_rate - name: SalesAccountSalesTaxRatePurchaseTaxRate - sales_tax_rate - - value: sales_tax_rate,purchase_tax_rate - name: SalesTaxRatePurchaseTaxRate source: - openapi: openapi/openapi.yml - ItemsRetrieveRequestExpand: + openapi: accounting_v3.yml + ItemsRetrieveRequestExpandItem: enum: - company - - value: company,purchase_tax_rate - name: CompanyPurchaseTaxRate - - value: company,sales_tax_rate - name: CompanySalesTaxRate - - value: company,sales_tax_rate,purchase_tax_rate - name: CompanySalesTaxRatePurchaseTaxRate - purchase_account - - value: purchase_account,company - name: PurchaseAccountCompany - - value: purchase_account,company,purchase_tax_rate - name: PurchaseAccountCompanyPurchaseTaxRate - - value: purchase_account,company,sales_tax_rate - name: PurchaseAccountCompanySalesTaxRate - - value: purchase_account,company,sales_tax_rate,purchase_tax_rate - name: PurchaseAccountCompanySalesTaxRatePurchaseTaxRate - - value: purchase_account,purchase_tax_rate - name: PurchaseAccountPurchaseTaxRate - - value: purchase_account,sales_account - name: PurchaseAccountSalesAccount - - value: purchase_account,sales_account,company - name: PurchaseAccountSalesAccountCompany - - value: purchase_account,sales_account,company,purchase_tax_rate - name: PurchaseAccountSalesAccountCompanyPurchaseTaxRate - - value: purchase_account,sales_account,company,sales_tax_rate - name: PurchaseAccountSalesAccountCompanySalesTaxRate - - value: >- - purchase_account,sales_account,company,sales_tax_rate,purchase_tax_rate - name: PurchaseAccountSalesAccountCompanySalesTaxRatePurchaseTaxRate - - value: purchase_account,sales_account,purchase_tax_rate - name: PurchaseAccountSalesAccountPurchaseTaxRate - - value: purchase_account,sales_account,sales_tax_rate - name: PurchaseAccountSalesAccountSalesTaxRate - - value: purchase_account,sales_account,sales_tax_rate,purchase_tax_rate - name: PurchaseAccountSalesAccountSalesTaxRatePurchaseTaxRate - - value: purchase_account,sales_tax_rate - name: PurchaseAccountSalesTaxRate - - value: purchase_account,sales_tax_rate,purchase_tax_rate - name: PurchaseAccountSalesTaxRatePurchaseTaxRate - purchase_tax_rate - sales_account - - value: sales_account,company - name: SalesAccountCompany - - value: sales_account,company,purchase_tax_rate - name: SalesAccountCompanyPurchaseTaxRate - - value: sales_account,company,sales_tax_rate - name: SalesAccountCompanySalesTaxRate - - value: sales_account,company,sales_tax_rate,purchase_tax_rate - name: SalesAccountCompanySalesTaxRatePurchaseTaxRate - - value: sales_account,purchase_tax_rate - name: SalesAccountPurchaseTaxRate - - value: sales_account,sales_tax_rate - name: SalesAccountSalesTaxRate - - value: sales_account,sales_tax_rate,purchase_tax_rate - name: SalesAccountSalesTaxRatePurchaseTaxRate - sales_tax_rate - - value: sales_tax_rate,purchase_tax_rate - name: SalesTaxRatePurchaseTaxRate source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -132,10 +26,15 @@ service: list: path: /accounting/v1/items method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Item` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ItemsListRequest query-parameters: @@ -154,7 +53,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -204,10 +104,25 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedItemList + type: accountingRoot.PaginatedItemList status-code: 200 examples: - - headers: {} + - 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 @@ -219,6 +134,7 @@ service: modified_at: '2021-10-16T00:00:00Z' name: Pickleball Paddle status: ACTIVE + type: INVENTORY unit_price: 10 purchase_price: 25 purchase_account: purchase_account @@ -240,10 +156,11 @@ service: create: path: /accounting/v1/items method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `Item` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ItemEndpointRequest query-parameters: @@ -257,14 +174,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.ItemRequestRequest + model: accountingRoot.ItemRequestRequest content-type: application/json response: docs: '' - type: root.ItemResponse + type: accountingRoot.ItemResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -276,6 +197,7 @@ service: modified_at: '2021-10-16T00:00:00Z' name: Pickleball Paddle status: ACTIVE + type: INVENTORY unit_price: 10 purchase_price: 25 purchase_account: purchase_account @@ -317,17 +239,19 @@ service: retrieve: path: /accounting/v1/items/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Item` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: ItemsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -353,12 +277,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Item + type: accountingRoot.Item status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -367,6 +297,7 @@ service: modified_at: '2021-10-16T00:00:00Z' name: Pickleball Paddle status: ACTIVE + type: INVENTORY unit_price: 10 purchase_price: 25 purchase_account: purchase_account @@ -388,10 +319,11 @@ service: partialUpdate: path: /accounting/v1/items/{id} method: PATCH - auth: true + auth: + - tokenAuth: [] docs: Updates an `Item` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -407,16 +339,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.PatchedItemRequestRequest + model: accountingRoot.PatchedItemRequestRequest content-type: application/json response: docs: '' - type: root.ItemResponse + type: accountingRoot.ItemResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -428,6 +364,7 @@ service: modified_at: '2021-10-16T00:00:00Z' name: Pickleball Paddle status: ACTIVE + type: INVENTORY unit_price: 10 purchase_price: 25 purchase_account: purchase_account @@ -469,20 +406,22 @@ service: metaPatchRetrieve: path: /accounting/v1/items/meta/patch/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Item` PATCHs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -657,16 +596,18 @@ service: metaPostRetrieve: path: /accounting/v1/items/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Item` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -839,4 +780,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/journalEntries.yml b/.mock/definition/Accounting/journalEntries.yml similarity index 67% rename from .mock/definition/accounting/journalEntries.yml rename to .mock/definition/Accounting/journalEntries.yml index feb7bad..de40010 100644 --- a/.mock/definition/accounting/journalEntries.yml +++ b/.mock/definition/Accounting/journalEntries.yml @@ -1,258 +1,26 @@ types: - JournalEntriesListRequestExpand: + JournalEntriesListRequestExpandItem: enum: - accounting_period - applied_payments - - value: applied_payments,accounting_period - name: AppliedPaymentsAccountingPeriod - - value: applied_payments,company - name: AppliedPaymentsCompany - - value: applied_payments,company,accounting_period - name: AppliedPaymentsCompanyAccountingPeriod - - value: applied_payments,tracking_categories - name: AppliedPaymentsTrackingCategories - - value: applied_payments,tracking_categories,accounting_period - name: AppliedPaymentsTrackingCategoriesAccountingPeriod - - value: applied_payments,tracking_categories,company - name: AppliedPaymentsTrackingCategoriesCompany - - value: applied_payments,tracking_categories,company,accounting_period - name: AppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - company - - value: company,accounting_period - name: CompanyAccountingPeriod - lines - - value: lines,accounting_period - name: LinesAccountingPeriod - - value: lines,applied_payments - name: LinesAppliedPayments - - value: lines,applied_payments,accounting_period - name: LinesAppliedPaymentsAccountingPeriod - - value: lines,applied_payments,company - name: LinesAppliedPaymentsCompany - - value: lines,applied_payments,company,accounting_period - name: LinesAppliedPaymentsCompanyAccountingPeriod - - value: lines,applied_payments,tracking_categories - name: LinesAppliedPaymentsTrackingCategories - - value: lines,applied_payments,tracking_categories,accounting_period - name: LinesAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: lines,applied_payments,tracking_categories,company - name: LinesAppliedPaymentsTrackingCategoriesCompany - - value: lines,applied_payments,tracking_categories,company,accounting_period - name: LinesAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: lines,company - name: LinesCompany - - value: lines,company,accounting_period - name: LinesCompanyAccountingPeriod - - value: lines,payments - name: LinesPayments - - value: lines,payments,accounting_period - name: LinesPaymentsAccountingPeriod - - value: lines,payments,applied_payments - name: LinesPaymentsAppliedPayments - - value: lines,payments,applied_payments,accounting_period - name: LinesPaymentsAppliedPaymentsAccountingPeriod - - value: lines,payments,applied_payments,company - name: LinesPaymentsAppliedPaymentsCompany - - value: lines,payments,applied_payments,company,accounting_period - name: LinesPaymentsAppliedPaymentsCompanyAccountingPeriod - - value: lines,payments,applied_payments,tracking_categories - name: LinesPaymentsAppliedPaymentsTrackingCategories - - value: lines,payments,applied_payments,tracking_categories,accounting_period - name: LinesPaymentsAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: lines,payments,applied_payments,tracking_categories,company - name: LinesPaymentsAppliedPaymentsTrackingCategoriesCompany - - value: >- - lines,payments,applied_payments,tracking_categories,company,accounting_period - name: LinesPaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: lines,payments,company - name: LinesPaymentsCompany - - value: lines,payments,company,accounting_period - name: LinesPaymentsCompanyAccountingPeriod - - value: lines,payments,tracking_categories - name: LinesPaymentsTrackingCategories - - value: lines,payments,tracking_categories,accounting_period - name: LinesPaymentsTrackingCategoriesAccountingPeriod - - value: lines,payments,tracking_categories,company - name: LinesPaymentsTrackingCategoriesCompany - - value: lines,payments,tracking_categories,company,accounting_period - name: LinesPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: lines,tracking_categories - name: LinesTrackingCategories - - value: lines,tracking_categories,accounting_period - name: LinesTrackingCategoriesAccountingPeriod - - value: lines,tracking_categories,company - name: LinesTrackingCategoriesCompany - - value: lines,tracking_categories,company,accounting_period - name: LinesTrackingCategoriesCompanyAccountingPeriod - payments - - value: payments,accounting_period - name: PaymentsAccountingPeriod - - value: payments,applied_payments - name: PaymentsAppliedPayments - - value: payments,applied_payments,accounting_period - name: PaymentsAppliedPaymentsAccountingPeriod - - value: payments,applied_payments,company - name: PaymentsAppliedPaymentsCompany - - value: payments,applied_payments,company,accounting_period - name: PaymentsAppliedPaymentsCompanyAccountingPeriod - - value: payments,applied_payments,tracking_categories - name: PaymentsAppliedPaymentsTrackingCategories - - value: payments,applied_payments,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: payments,applied_payments,tracking_categories,company - name: PaymentsAppliedPaymentsTrackingCategoriesCompany - - value: >- - payments,applied_payments,tracking_categories,company,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: payments,company - name: PaymentsCompany - - value: payments,company,accounting_period - name: PaymentsCompanyAccountingPeriod - - value: payments,tracking_categories - name: PaymentsTrackingCategories - - value: payments,tracking_categories,accounting_period - name: PaymentsTrackingCategoriesAccountingPeriod - - value: payments,tracking_categories,company - name: PaymentsTrackingCategoriesCompany - - value: payments,tracking_categories,company,accounting_period - name: PaymentsTrackingCategoriesCompanyAccountingPeriod - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod source: - openapi: openapi/openapi.yml - JournalEntriesRetrieveRequestExpand: + openapi: accounting_v3.yml + JournalEntriesRetrieveRequestExpandItem: enum: - accounting_period - applied_payments - - value: applied_payments,accounting_period - name: AppliedPaymentsAccountingPeriod - - value: applied_payments,company - name: AppliedPaymentsCompany - - value: applied_payments,company,accounting_period - name: AppliedPaymentsCompanyAccountingPeriod - - value: applied_payments,tracking_categories - name: AppliedPaymentsTrackingCategories - - value: applied_payments,tracking_categories,accounting_period - name: AppliedPaymentsTrackingCategoriesAccountingPeriod - - value: applied_payments,tracking_categories,company - name: AppliedPaymentsTrackingCategoriesCompany - - value: applied_payments,tracking_categories,company,accounting_period - name: AppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - company - - value: company,accounting_period - name: CompanyAccountingPeriod - lines - - value: lines,accounting_period - name: LinesAccountingPeriod - - value: lines,applied_payments - name: LinesAppliedPayments - - value: lines,applied_payments,accounting_period - name: LinesAppliedPaymentsAccountingPeriod - - value: lines,applied_payments,company - name: LinesAppliedPaymentsCompany - - value: lines,applied_payments,company,accounting_period - name: LinesAppliedPaymentsCompanyAccountingPeriod - - value: lines,applied_payments,tracking_categories - name: LinesAppliedPaymentsTrackingCategories - - value: lines,applied_payments,tracking_categories,accounting_period - name: LinesAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: lines,applied_payments,tracking_categories,company - name: LinesAppliedPaymentsTrackingCategoriesCompany - - value: lines,applied_payments,tracking_categories,company,accounting_period - name: LinesAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: lines,company - name: LinesCompany - - value: lines,company,accounting_period - name: LinesCompanyAccountingPeriod - - value: lines,payments - name: LinesPayments - - value: lines,payments,accounting_period - name: LinesPaymentsAccountingPeriod - - value: lines,payments,applied_payments - name: LinesPaymentsAppliedPayments - - value: lines,payments,applied_payments,accounting_period - name: LinesPaymentsAppliedPaymentsAccountingPeriod - - value: lines,payments,applied_payments,company - name: LinesPaymentsAppliedPaymentsCompany - - value: lines,payments,applied_payments,company,accounting_period - name: LinesPaymentsAppliedPaymentsCompanyAccountingPeriod - - value: lines,payments,applied_payments,tracking_categories - name: LinesPaymentsAppliedPaymentsTrackingCategories - - value: lines,payments,applied_payments,tracking_categories,accounting_period - name: LinesPaymentsAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: lines,payments,applied_payments,tracking_categories,company - name: LinesPaymentsAppliedPaymentsTrackingCategoriesCompany - - value: >- - lines,payments,applied_payments,tracking_categories,company,accounting_period - name: LinesPaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: lines,payments,company - name: LinesPaymentsCompany - - value: lines,payments,company,accounting_period - name: LinesPaymentsCompanyAccountingPeriod - - value: lines,payments,tracking_categories - name: LinesPaymentsTrackingCategories - - value: lines,payments,tracking_categories,accounting_period - name: LinesPaymentsTrackingCategoriesAccountingPeriod - - value: lines,payments,tracking_categories,company - name: LinesPaymentsTrackingCategoriesCompany - - value: lines,payments,tracking_categories,company,accounting_period - name: LinesPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: lines,tracking_categories - name: LinesTrackingCategories - - value: lines,tracking_categories,accounting_period - name: LinesTrackingCategoriesAccountingPeriod - - value: lines,tracking_categories,company - name: LinesTrackingCategoriesCompany - - value: lines,tracking_categories,company,accounting_period - name: LinesTrackingCategoriesCompanyAccountingPeriod - payments - - value: payments,accounting_period - name: PaymentsAccountingPeriod - - value: payments,applied_payments - name: PaymentsAppliedPayments - - value: payments,applied_payments,accounting_period - name: PaymentsAppliedPaymentsAccountingPeriod - - value: payments,applied_payments,company - name: PaymentsAppliedPaymentsCompany - - value: payments,applied_payments,company,accounting_period - name: PaymentsAppliedPaymentsCompanyAccountingPeriod - - value: payments,applied_payments,tracking_categories - name: PaymentsAppliedPaymentsTrackingCategories - - value: payments,applied_payments,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: payments,applied_payments,tracking_categories,company - name: PaymentsAppliedPaymentsTrackingCategoriesCompany - - value: >- - payments,applied_payments,tracking_categories,company,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: payments,company - name: PaymentsCompany - - value: payments,company,accounting_period - name: PaymentsCompanyAccountingPeriod - - value: payments,tracking_categories - name: PaymentsTrackingCategories - - value: payments,tracking_categories,accounting_period - name: PaymentsTrackingCategoriesAccountingPeriod - - value: payments,tracking_categories,company - name: PaymentsTrackingCategoriesCompany - - value: payments,tracking_categories,company,accounting_period - name: PaymentsTrackingCategoriesCompanyAccountingPeriod - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -260,10 +28,15 @@ service: list: path: /accounting/v1/journal-entries method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `JournalEntry` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: JournalEntriesListRequest query-parameters: @@ -282,7 +55,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -335,10 +109,26 @@ service: datetime. response: docs: '' - type: root.PaginatedJournalEntryList + type: accountingRoot.PaginatedJournalEntryList status-code: 200 examples: - - headers: {} + - 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 @@ -407,10 +197,11 @@ service: create: path: /accounting/v1/journal-entries method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `JournalEntry` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: JournalEntryEndpointRequest query-parameters: @@ -424,14 +215,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.JournalEntryRequest + model: accountingRoot.JournalEntryRequest content-type: application/json response: docs: '' - type: root.JournalEntryResponse + type: accountingRoot.JournalEntryResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -520,17 +315,19 @@ service: retrieve: path: /accounting/v1/journal-entries/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `JournalEntry` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: JournalEntriesRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -551,12 +348,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.JournalEntry + type: accountingRoot.JournalEntry status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -580,7 +382,6 @@ service: modified_at: '2021-10-16T00:00:00Z' account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 net_amount: 25.54 - tracking_category: tracking_category tracking_categories: - d25d609b-945f-4762-b55a-1c8fb220c43c - 9b840d2-686a-465a-8a8e-7b028498f8e4 @@ -602,7 +403,6 @@ service: modified_at: '2021-10-16T00:00:00Z' account: f963f34d-3d2f-4f77-b557-cf36bc7e6498 net_amount: 10 - tracking_category: tracking_category tracking_categories: - d25d609b-945f-4762-b55a-1c8fb220c43c - 9b840d2-686a-465a-8a8e-7b028498f8e4 @@ -644,10 +444,15 @@ service: linesRemoteFieldClassesList: path: /accounting/v1/journal-entries/lines/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: JournalEntriesLinesRemoteFieldClassesListRequest query-parameters: @@ -687,10 +492,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: accountingRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -709,16 +523,18 @@ service: metaPostRetrieve: path: /accounting/v1/journal-entries/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `JournalEntry` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -893,10 +709,15 @@ service: remoteFieldClassesList: path: /accounting/v1/journal-entries/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: JournalEntriesRemoteFieldClassesListRequest query-parameters: @@ -936,10 +757,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: accountingRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -956,4 +786,4 @@ service: field_choices: - field_choices source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/linkToken.yml b/.mock/definition/Accounting/linkToken.yml similarity index 84% rename from .mock/definition/accounting/linkToken.yml rename to .mock/definition/Accounting/linkToken.yml index 65ffc3c..4d3d29c 100644 --- a/.mock/definition/accounting/linkToken.yml +++ b/.mock/definition/Accounting/linkToken.yml @@ -1,5 +1,22 @@ imports: - root: __package__.yml + 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: '' @@ -7,10 +24,11 @@ service: create: path: /accounting/v1/link-token method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a link token to be used when linking a new end user. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: EndUserDetailsRequest body: @@ -41,7 +59,7 @@ service: maxLength: 100 categories: docs: The integration categories to show in Merge Link. - type: list + type: list integration: type: optional docs: >- @@ -76,7 +94,7 @@ service: https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. default: false common_models: - type: optional> + 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 @@ -86,14 +104,14 @@ service: category_common_model_scopes: type: >- optional>>> + 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 + type: optional docs: >- The following subset of IETF language tags can be used to configure localization. @@ -116,10 +134,12 @@ service: content-type: application/json response: docs: '' - type: root.LinkToken + type: accountingRoot.LinkToken status-code: 200 examples: - - request: + - 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' @@ -132,4 +152,4 @@ service: integration_name: Lever magic_link_url: https://link.merge.dev/asdfjkl12345jsndfgi2i83n source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/linkedAccounts.yml b/.mock/definition/Accounting/linkedAccounts.yml similarity index 82% rename from .mock/definition/accounting/linkedAccounts.yml rename to .mock/definition/Accounting/linkedAccounts.yml index aa8806e..b338291 100644 --- a/.mock/definition/accounting/linkedAccounts.yml +++ b/.mock/definition/Accounting/linkedAccounts.yml @@ -9,9 +9,9 @@ types: - mktg - ticketing source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -19,10 +19,15 @@ service: list: path: /accounting/v1/linked-accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: List linked accounts for your organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: LinkedAccountsListRequest query-parameters: @@ -104,10 +109,26 @@ service: `RELINK_NEEDED` response: docs: '' - type: root.PaginatedAccountDetailsAndActionsList + type: accountingRoot.PaginatedAccountDetailsAndActionsList status-code: 200 examples: - - response: + - 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 @@ -144,7 +165,5 @@ service: - title account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' - integration_specific_fields: - integration_specific_field: Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/passthrough.yml b/.mock/definition/Accounting/passthrough.yml similarity index 73% rename from .mock/definition/accounting/passthrough.yml rename to .mock/definition/Accounting/passthrough.yml index 25ab767..5815ec9 100644 --- a/.mock/definition/accounting/passthrough.yml +++ b/.mock/definition/Accounting/passthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,21 @@ service: create: path: /accounting/v1/passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: Pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: - body: root.DataPassthroughRequest + body: accountingRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.RemoteResponse + type: accountingRoot.RemoteResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -37,4 +39,4 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/paymentMethods.yml b/.mock/definition/Accounting/paymentMethods.yml similarity index 81% rename from .mock/definition/accounting/paymentMethods.yml rename to .mock/definition/Accounting/paymentMethods.yml index c53c952..8d1a368 100644 --- a/.mock/definition/accounting/paymentMethods.yml +++ b/.mock/definition/Accounting/paymentMethods.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/payment-methods method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `PaymentMethod` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: PaymentMethodsListRequest query-parameters: @@ -40,10 +45,17 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedPaymentMethodList + type: accountingRoot.PaginatedPaymentMethodList status-code: 200 examples: - - headers: {} + - 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 @@ -69,10 +81,11 @@ service: retrieve: path: /accounting/v1/payment-methods/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `PaymentMethod` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -90,12 +103,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.PaymentMethod + type: accountingRoot.PaymentMethod status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -116,4 +133,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/paymentTerms.yml b/.mock/definition/Accounting/paymentTerms.yml similarity index 82% rename from .mock/definition/accounting/paymentTerms.yml rename to .mock/definition/Accounting/paymentTerms.yml index 688ed9c..f1f3429 100644 --- a/.mock/definition/accounting/paymentTerms.yml +++ b/.mock/definition/Accounting/paymentTerms.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/payment-terms method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `PaymentTerm` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: PaymentTermsListRequest query-parameters: @@ -19,6 +24,7 @@ service: 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. @@ -45,10 +51,17 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedPaymentTermList + type: accountingRoot.PaginatedPaymentTermList status-code: 200 examples: - - headers: {} + - 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 @@ -76,10 +89,11 @@ service: retrieve: path: /accounting/v1/payment-terms/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `PaymentTerm` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -87,6 +101,7 @@ service: 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. @@ -102,12 +117,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.PaymentTerm + type: accountingRoot.PaymentTerm status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -130,4 +149,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/payments.yml b/.mock/definition/Accounting/payments.yml similarity index 54% rename from .mock/definition/accounting/payments.yml rename to .mock/definition/Accounting/payments.yml index 26c0f1b..2bd53ed 100644 --- a/.mock/definition/accounting/payments.yml +++ b/.mock/definition/Accounting/payments.yml @@ -1,538 +1,28 @@ types: - PaymentsListRequestExpand: + PaymentsListRequestExpandItem: enum: - account - - value: account,accounting_period - name: AccountAccountingPeriod - - value: account,accounting_period,payment_method - name: AccountAccountingPeriodPaymentMethod - - value: account,company - name: AccountCompany - - value: account,company,accounting_period - name: AccountCompanyAccountingPeriod - - value: account,company,accounting_period,payment_method - name: AccountCompanyAccountingPeriodPaymentMethod - - value: account,company,payment_method - name: AccountCompanyPaymentMethod - - value: account,payment_method - name: AccountPaymentMethod - accounting_period - - value: accounting_period,payment_method - name: AccountingPeriodPaymentMethod - applied_to_lines - - value: applied_to_lines,account - name: AppliedToLinesAccount - - value: applied_to_lines,account,accounting_period - name: AppliedToLinesAccountAccountingPeriod - - value: applied_to_lines,account,accounting_period,payment_method - name: AppliedToLinesAccountAccountingPeriodPaymentMethod - - value: applied_to_lines,account,company - name: AppliedToLinesAccountCompany - - value: applied_to_lines,account,company,accounting_period - name: AppliedToLinesAccountCompanyAccountingPeriod - - value: applied_to_lines,account,company,accounting_period,payment_method - name: AppliedToLinesAccountCompanyAccountingPeriodPaymentMethod - - value: applied_to_lines,account,company,payment_method - name: AppliedToLinesAccountCompanyPaymentMethod - - value: applied_to_lines,account,payment_method - name: AppliedToLinesAccountPaymentMethod - - value: applied_to_lines,accounting_period - name: AppliedToLinesAccountingPeriod - - value: applied_to_lines,accounting_period,payment_method - name: AppliedToLinesAccountingPeriodPaymentMethod - - value: applied_to_lines,company - name: AppliedToLinesCompany - - value: applied_to_lines,company,accounting_period - name: AppliedToLinesCompanyAccountingPeriod - - value: applied_to_lines,company,accounting_period,payment_method - name: AppliedToLinesCompanyAccountingPeriodPaymentMethod - - value: applied_to_lines,company,payment_method - name: AppliedToLinesCompanyPaymentMethod - - value: applied_to_lines,contact - name: AppliedToLinesContact - - value: applied_to_lines,contact,account - name: AppliedToLinesContactAccount - - value: applied_to_lines,contact,account,accounting_period - name: AppliedToLinesContactAccountAccountingPeriod - - value: applied_to_lines,contact,account,accounting_period,payment_method - name: AppliedToLinesContactAccountAccountingPeriodPaymentMethod - - value: applied_to_lines,contact,account,company - name: AppliedToLinesContactAccountCompany - - value: applied_to_lines,contact,account,company,accounting_period - name: AppliedToLinesContactAccountCompanyAccountingPeriod - - value: >- - applied_to_lines,contact,account,company,accounting_period,payment_method - name: AppliedToLinesContactAccountCompanyAccountingPeriodPaymentMethod - - value: applied_to_lines,contact,account,company,payment_method - name: AppliedToLinesContactAccountCompanyPaymentMethod - - value: applied_to_lines,contact,account,payment_method - name: AppliedToLinesContactAccountPaymentMethod - - value: applied_to_lines,contact,accounting_period - name: AppliedToLinesContactAccountingPeriod - - value: applied_to_lines,contact,accounting_period,payment_method - name: AppliedToLinesContactAccountingPeriodPaymentMethod - - value: applied_to_lines,contact,company - name: AppliedToLinesContactCompany - - value: applied_to_lines,contact,company,accounting_period - name: AppliedToLinesContactCompanyAccountingPeriod - - value: applied_to_lines,contact,company,accounting_period,payment_method - name: AppliedToLinesContactCompanyAccountingPeriodPaymentMethod - - value: applied_to_lines,contact,company,payment_method - name: AppliedToLinesContactCompanyPaymentMethod - - value: applied_to_lines,contact,payment_method - name: AppliedToLinesContactPaymentMethod - - value: applied_to_lines,payment_method - name: AppliedToLinesPaymentMethod - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - value: company,accounting_period,payment_method - name: CompanyAccountingPeriodPaymentMethod - - value: company,payment_method - name: CompanyPaymentMethod - contact - - value: contact,account - name: ContactAccount - - value: contact,account,accounting_period - name: ContactAccountAccountingPeriod - - value: contact,account,accounting_period,payment_method - name: ContactAccountAccountingPeriodPaymentMethod - - value: contact,account,company - name: ContactAccountCompany - - value: contact,account,company,accounting_period - name: ContactAccountCompanyAccountingPeriod - - value: contact,account,company,accounting_period,payment_method - name: ContactAccountCompanyAccountingPeriodPaymentMethod - - value: contact,account,company,payment_method - name: ContactAccountCompanyPaymentMethod - - value: contact,account,payment_method - name: ContactAccountPaymentMethod - - value: contact,accounting_period - name: ContactAccountingPeriod - - value: contact,accounting_period,payment_method - name: ContactAccountingPeriodPaymentMethod - - value: contact,company - name: ContactCompany - - value: contact,company,accounting_period - name: ContactCompanyAccountingPeriod - - value: contact,company,accounting_period,payment_method - name: ContactCompanyAccountingPeriodPaymentMethod - - value: contact,company,payment_method - name: ContactCompanyPaymentMethod - - value: contact,payment_method - name: ContactPaymentMethod - payment_method - tracking_categories - - value: tracking_categories,account - name: TrackingCategoriesAccount - - value: tracking_categories,account,accounting_period - name: TrackingCategoriesAccountAccountingPeriod - - value: tracking_categories,account,accounting_period,payment_method - name: TrackingCategoriesAccountAccountingPeriodPaymentMethod - - value: tracking_categories,account,company - name: TrackingCategoriesAccountCompany - - value: tracking_categories,account,company,accounting_period - name: TrackingCategoriesAccountCompanyAccountingPeriod - - value: tracking_categories,account,company,accounting_period,payment_method - name: TrackingCategoriesAccountCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,account,company,payment_method - name: TrackingCategoriesAccountCompanyPaymentMethod - - value: tracking_categories,account,payment_method - name: TrackingCategoriesAccountPaymentMethod - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,accounting_period,payment_method - name: TrackingCategoriesAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines - name: TrackingCategoriesAppliedToLines - - value: tracking_categories,applied_to_lines,account - name: TrackingCategoriesAppliedToLinesAccount - - value: tracking_categories,applied_to_lines,account,accounting_period - name: TrackingCategoriesAppliedToLinesAccountAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,account,accounting_period,payment_method - name: TrackingCategoriesAppliedToLinesAccountAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,account,company - name: TrackingCategoriesAppliedToLinesAccountCompany - - value: tracking_categories,applied_to_lines,account,company,accounting_period - name: TrackingCategoriesAppliedToLinesAccountCompanyAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,account,company,accounting_period,payment_method - name: >- - TrackingCategoriesAppliedToLinesAccountCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,account,company,payment_method - name: TrackingCategoriesAppliedToLinesAccountCompanyPaymentMethod - - value: tracking_categories,applied_to_lines,account,payment_method - name: TrackingCategoriesAppliedToLinesAccountPaymentMethod - - value: tracking_categories,applied_to_lines,accounting_period - name: TrackingCategoriesAppliedToLinesAccountingPeriod - - value: tracking_categories,applied_to_lines,accounting_period,payment_method - name: TrackingCategoriesAppliedToLinesAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,company - name: TrackingCategoriesAppliedToLinesCompany - - value: tracking_categories,applied_to_lines,company,accounting_period - name: TrackingCategoriesAppliedToLinesCompanyAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,company,accounting_period,payment_method - name: TrackingCategoriesAppliedToLinesCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,company,payment_method - name: TrackingCategoriesAppliedToLinesCompanyPaymentMethod - - value: tracking_categories,applied_to_lines,contact - name: TrackingCategoriesAppliedToLinesContact - - value: tracking_categories,applied_to_lines,contact,account - name: TrackingCategoriesAppliedToLinesContactAccount - - value: tracking_categories,applied_to_lines,contact,account,accounting_period - name: TrackingCategoriesAppliedToLinesContactAccountAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,contact,account,accounting_period,payment_method - name: >- - TrackingCategoriesAppliedToLinesContactAccountAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,contact,account,company - name: TrackingCategoriesAppliedToLinesContactAccountCompany - - value: >- - tracking_categories,applied_to_lines,contact,account,company,accounting_period - name: TrackingCategoriesAppliedToLinesContactAccountCompanyAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,contact,account,company,accounting_period,payment_method - name: >- - TrackingCategoriesAppliedToLinesContactAccountCompanyAccountingPeriodPaymentMethod - - value: >- - tracking_categories,applied_to_lines,contact,account,company,payment_method - name: TrackingCategoriesAppliedToLinesContactAccountCompanyPaymentMethod - - value: tracking_categories,applied_to_lines,contact,account,payment_method - name: TrackingCategoriesAppliedToLinesContactAccountPaymentMethod - - value: tracking_categories,applied_to_lines,contact,accounting_period - name: TrackingCategoriesAppliedToLinesContactAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,contact,accounting_period,payment_method - name: TrackingCategoriesAppliedToLinesContactAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,contact,company - name: TrackingCategoriesAppliedToLinesContactCompany - - value: tracking_categories,applied_to_lines,contact,company,accounting_period - name: TrackingCategoriesAppliedToLinesContactCompanyAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,contact,company,accounting_period,payment_method - name: >- - TrackingCategoriesAppliedToLinesContactCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,contact,company,payment_method - name: TrackingCategoriesAppliedToLinesContactCompanyPaymentMethod - - value: tracking_categories,applied_to_lines,contact,payment_method - name: TrackingCategoriesAppliedToLinesContactPaymentMethod - - value: tracking_categories,applied_to_lines,payment_method - name: TrackingCategoriesAppliedToLinesPaymentMethod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,company,accounting_period,payment_method - name: TrackingCategoriesCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,company,payment_method - name: TrackingCategoriesCompanyPaymentMethod - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,account - name: TrackingCategoriesContactAccount - - value: tracking_categories,contact,account,accounting_period - name: TrackingCategoriesContactAccountAccountingPeriod - - value: tracking_categories,contact,account,accounting_period,payment_method - name: TrackingCategoriesContactAccountAccountingPeriodPaymentMethod - - value: tracking_categories,contact,account,company - name: TrackingCategoriesContactAccountCompany - - value: tracking_categories,contact,account,company,accounting_period - name: TrackingCategoriesContactAccountCompanyAccountingPeriod - - value: >- - tracking_categories,contact,account,company,accounting_period,payment_method - name: TrackingCategoriesContactAccountCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,contact,account,company,payment_method - name: TrackingCategoriesContactAccountCompanyPaymentMethod - - value: tracking_categories,contact,account,payment_method - name: TrackingCategoriesContactAccountPaymentMethod - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod - - value: tracking_categories,contact,accounting_period,payment_method - name: TrackingCategoriesContactAccountingPeriodPaymentMethod - - value: tracking_categories,contact,company - name: TrackingCategoriesContactCompany - - value: tracking_categories,contact,company,accounting_period - name: TrackingCategoriesContactCompanyAccountingPeriod - - value: tracking_categories,contact,company,accounting_period,payment_method - name: TrackingCategoriesContactCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,contact,company,payment_method - name: TrackingCategoriesContactCompanyPaymentMethod - - value: tracking_categories,contact,payment_method - name: TrackingCategoriesContactPaymentMethod - - value: tracking_categories,payment_method - name: TrackingCategoriesPaymentMethod source: - openapi: openapi/openapi.yml - PaymentsRetrieveRequestExpand: + openapi: accounting_v3.yml + PaymentsRetrieveRequestExpandItem: enum: - account - - value: account,accounting_period - name: AccountAccountingPeriod - - value: account,accounting_period,payment_method - name: AccountAccountingPeriodPaymentMethod - - value: account,company - name: AccountCompany - - value: account,company,accounting_period - name: AccountCompanyAccountingPeriod - - value: account,company,accounting_period,payment_method - name: AccountCompanyAccountingPeriodPaymentMethod - - value: account,company,payment_method - name: AccountCompanyPaymentMethod - - value: account,payment_method - name: AccountPaymentMethod - accounting_period - - value: accounting_period,payment_method - name: AccountingPeriodPaymentMethod - applied_to_lines - - value: applied_to_lines,account - name: AppliedToLinesAccount - - value: applied_to_lines,account,accounting_period - name: AppliedToLinesAccountAccountingPeriod - - value: applied_to_lines,account,accounting_period,payment_method - name: AppliedToLinesAccountAccountingPeriodPaymentMethod - - value: applied_to_lines,account,company - name: AppliedToLinesAccountCompany - - value: applied_to_lines,account,company,accounting_period - name: AppliedToLinesAccountCompanyAccountingPeriod - - value: applied_to_lines,account,company,accounting_period,payment_method - name: AppliedToLinesAccountCompanyAccountingPeriodPaymentMethod - - value: applied_to_lines,account,company,payment_method - name: AppliedToLinesAccountCompanyPaymentMethod - - value: applied_to_lines,account,payment_method - name: AppliedToLinesAccountPaymentMethod - - value: applied_to_lines,accounting_period - name: AppliedToLinesAccountingPeriod - - value: applied_to_lines,accounting_period,payment_method - name: AppliedToLinesAccountingPeriodPaymentMethod - - value: applied_to_lines,company - name: AppliedToLinesCompany - - value: applied_to_lines,company,accounting_period - name: AppliedToLinesCompanyAccountingPeriod - - value: applied_to_lines,company,accounting_period,payment_method - name: AppliedToLinesCompanyAccountingPeriodPaymentMethod - - value: applied_to_lines,company,payment_method - name: AppliedToLinesCompanyPaymentMethod - - value: applied_to_lines,contact - name: AppliedToLinesContact - - value: applied_to_lines,contact,account - name: AppliedToLinesContactAccount - - value: applied_to_lines,contact,account,accounting_period - name: AppliedToLinesContactAccountAccountingPeriod - - value: applied_to_lines,contact,account,accounting_period,payment_method - name: AppliedToLinesContactAccountAccountingPeriodPaymentMethod - - value: applied_to_lines,contact,account,company - name: AppliedToLinesContactAccountCompany - - value: applied_to_lines,contact,account,company,accounting_period - name: AppliedToLinesContactAccountCompanyAccountingPeriod - - value: >- - applied_to_lines,contact,account,company,accounting_period,payment_method - name: AppliedToLinesContactAccountCompanyAccountingPeriodPaymentMethod - - value: applied_to_lines,contact,account,company,payment_method - name: AppliedToLinesContactAccountCompanyPaymentMethod - - value: applied_to_lines,contact,account,payment_method - name: AppliedToLinesContactAccountPaymentMethod - - value: applied_to_lines,contact,accounting_period - name: AppliedToLinesContactAccountingPeriod - - value: applied_to_lines,contact,accounting_period,payment_method - name: AppliedToLinesContactAccountingPeriodPaymentMethod - - value: applied_to_lines,contact,company - name: AppliedToLinesContactCompany - - value: applied_to_lines,contact,company,accounting_period - name: AppliedToLinesContactCompanyAccountingPeriod - - value: applied_to_lines,contact,company,accounting_period,payment_method - name: AppliedToLinesContactCompanyAccountingPeriodPaymentMethod - - value: applied_to_lines,contact,company,payment_method - name: AppliedToLinesContactCompanyPaymentMethod - - value: applied_to_lines,contact,payment_method - name: AppliedToLinesContactPaymentMethod - - value: applied_to_lines,payment_method - name: AppliedToLinesPaymentMethod - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - value: company,accounting_period,payment_method - name: CompanyAccountingPeriodPaymentMethod - - value: company,payment_method - name: CompanyPaymentMethod - contact - - value: contact,account - name: ContactAccount - - value: contact,account,accounting_period - name: ContactAccountAccountingPeriod - - value: contact,account,accounting_period,payment_method - name: ContactAccountAccountingPeriodPaymentMethod - - value: contact,account,company - name: ContactAccountCompany - - value: contact,account,company,accounting_period - name: ContactAccountCompanyAccountingPeriod - - value: contact,account,company,accounting_period,payment_method - name: ContactAccountCompanyAccountingPeriodPaymentMethod - - value: contact,account,company,payment_method - name: ContactAccountCompanyPaymentMethod - - value: contact,account,payment_method - name: ContactAccountPaymentMethod - - value: contact,accounting_period - name: ContactAccountingPeriod - - value: contact,accounting_period,payment_method - name: ContactAccountingPeriodPaymentMethod - - value: contact,company - name: ContactCompany - - value: contact,company,accounting_period - name: ContactCompanyAccountingPeriod - - value: contact,company,accounting_period,payment_method - name: ContactCompanyAccountingPeriodPaymentMethod - - value: contact,company,payment_method - name: ContactCompanyPaymentMethod - - value: contact,payment_method - name: ContactPaymentMethod - payment_method - tracking_categories - - value: tracking_categories,account - name: TrackingCategoriesAccount - - value: tracking_categories,account,accounting_period - name: TrackingCategoriesAccountAccountingPeriod - - value: tracking_categories,account,accounting_period,payment_method - name: TrackingCategoriesAccountAccountingPeriodPaymentMethod - - value: tracking_categories,account,company - name: TrackingCategoriesAccountCompany - - value: tracking_categories,account,company,accounting_period - name: TrackingCategoriesAccountCompanyAccountingPeriod - - value: tracking_categories,account,company,accounting_period,payment_method - name: TrackingCategoriesAccountCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,account,company,payment_method - name: TrackingCategoriesAccountCompanyPaymentMethod - - value: tracking_categories,account,payment_method - name: TrackingCategoriesAccountPaymentMethod - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,accounting_period,payment_method - name: TrackingCategoriesAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines - name: TrackingCategoriesAppliedToLines - - value: tracking_categories,applied_to_lines,account - name: TrackingCategoriesAppliedToLinesAccount - - value: tracking_categories,applied_to_lines,account,accounting_period - name: TrackingCategoriesAppliedToLinesAccountAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,account,accounting_period,payment_method - name: TrackingCategoriesAppliedToLinesAccountAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,account,company - name: TrackingCategoriesAppliedToLinesAccountCompany - - value: tracking_categories,applied_to_lines,account,company,accounting_period - name: TrackingCategoriesAppliedToLinesAccountCompanyAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,account,company,accounting_period,payment_method - name: >- - TrackingCategoriesAppliedToLinesAccountCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,account,company,payment_method - name: TrackingCategoriesAppliedToLinesAccountCompanyPaymentMethod - - value: tracking_categories,applied_to_lines,account,payment_method - name: TrackingCategoriesAppliedToLinesAccountPaymentMethod - - value: tracking_categories,applied_to_lines,accounting_period - name: TrackingCategoriesAppliedToLinesAccountingPeriod - - value: tracking_categories,applied_to_lines,accounting_period,payment_method - name: TrackingCategoriesAppliedToLinesAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,company - name: TrackingCategoriesAppliedToLinesCompany - - value: tracking_categories,applied_to_lines,company,accounting_period - name: TrackingCategoriesAppliedToLinesCompanyAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,company,accounting_period,payment_method - name: TrackingCategoriesAppliedToLinesCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,company,payment_method - name: TrackingCategoriesAppliedToLinesCompanyPaymentMethod - - value: tracking_categories,applied_to_lines,contact - name: TrackingCategoriesAppliedToLinesContact - - value: tracking_categories,applied_to_lines,contact,account - name: TrackingCategoriesAppliedToLinesContactAccount - - value: tracking_categories,applied_to_lines,contact,account,accounting_period - name: TrackingCategoriesAppliedToLinesContactAccountAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,contact,account,accounting_period,payment_method - name: >- - TrackingCategoriesAppliedToLinesContactAccountAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,contact,account,company - name: TrackingCategoriesAppliedToLinesContactAccountCompany - - value: >- - tracking_categories,applied_to_lines,contact,account,company,accounting_period - name: TrackingCategoriesAppliedToLinesContactAccountCompanyAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,contact,account,company,accounting_period,payment_method - name: >- - TrackingCategoriesAppliedToLinesContactAccountCompanyAccountingPeriodPaymentMethod - - value: >- - tracking_categories,applied_to_lines,contact,account,company,payment_method - name: TrackingCategoriesAppliedToLinesContactAccountCompanyPaymentMethod - - value: tracking_categories,applied_to_lines,contact,account,payment_method - name: TrackingCategoriesAppliedToLinesContactAccountPaymentMethod - - value: tracking_categories,applied_to_lines,contact,accounting_period - name: TrackingCategoriesAppliedToLinesContactAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,contact,accounting_period,payment_method - name: TrackingCategoriesAppliedToLinesContactAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,contact,company - name: TrackingCategoriesAppliedToLinesContactCompany - - value: tracking_categories,applied_to_lines,contact,company,accounting_period - name: TrackingCategoriesAppliedToLinesContactCompanyAccountingPeriod - - value: >- - tracking_categories,applied_to_lines,contact,company,accounting_period,payment_method - name: >- - TrackingCategoriesAppliedToLinesContactCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,applied_to_lines,contact,company,payment_method - name: TrackingCategoriesAppliedToLinesContactCompanyPaymentMethod - - value: tracking_categories,applied_to_lines,contact,payment_method - name: TrackingCategoriesAppliedToLinesContactPaymentMethod - - value: tracking_categories,applied_to_lines,payment_method - name: TrackingCategoriesAppliedToLinesPaymentMethod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,company,accounting_period,payment_method - name: TrackingCategoriesCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,company,payment_method - name: TrackingCategoriesCompanyPaymentMethod - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,account - name: TrackingCategoriesContactAccount - - value: tracking_categories,contact,account,accounting_period - name: TrackingCategoriesContactAccountAccountingPeriod - - value: tracking_categories,contact,account,accounting_period,payment_method - name: TrackingCategoriesContactAccountAccountingPeriodPaymentMethod - - value: tracking_categories,contact,account,company - name: TrackingCategoriesContactAccountCompany - - value: tracking_categories,contact,account,company,accounting_period - name: TrackingCategoriesContactAccountCompanyAccountingPeriod - - value: >- - tracking_categories,contact,account,company,accounting_period,payment_method - name: TrackingCategoriesContactAccountCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,contact,account,company,payment_method - name: TrackingCategoriesContactAccountCompanyPaymentMethod - - value: tracking_categories,contact,account,payment_method - name: TrackingCategoriesContactAccountPaymentMethod - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod - - value: tracking_categories,contact,accounting_period,payment_method - name: TrackingCategoriesContactAccountingPeriodPaymentMethod - - value: tracking_categories,contact,company - name: TrackingCategoriesContactCompany - - value: tracking_categories,contact,company,accounting_period - name: TrackingCategoriesContactCompanyAccountingPeriod - - value: tracking_categories,contact,company,accounting_period,payment_method - name: TrackingCategoriesContactCompanyAccountingPeriodPaymentMethod - - value: tracking_categories,contact,company,payment_method - name: TrackingCategoriesContactCompanyPaymentMethod - - value: tracking_categories,contact,payment_method - name: TrackingCategoriesContactPaymentMethod - - value: tracking_categories,payment_method - name: TrackingCategoriesPaymentMethod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -540,10 +30,15 @@ service: list: path: /accounting/v1/payments method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Payment` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: PaymentsListRequest query-parameters: @@ -568,7 +63,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -621,10 +117,28 @@ service: datetime. response: docs: '' - type: root.PaginatedPaymentList + type: accountingRoot.PaginatedPaymentList status-code: 200 examples: - - headers: {} + - 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 @@ -653,7 +167,7 @@ service: remote_id: '234' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa related_object_type: INVOICE @@ -661,7 +175,7 @@ service: remote_id: '235' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 related_object_type: CREDIT_NOTE @@ -681,10 +195,11 @@ service: create: path: /accounting/v1/payments method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Payment` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: PaymentEndpointRequest query-parameters: @@ -698,14 +213,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.PaymentRequest + model: accountingRoot.PaymentRequest content-type: application/json response: docs: '' - type: root.PaymentResponse + type: accountingRoot.PaymentResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -734,7 +253,7 @@ service: remote_id: '234' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa related_object_type: INVOICE @@ -742,7 +261,7 @@ service: remote_id: '235' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 related_object_type: CREDIT_NOTE @@ -782,17 +301,19 @@ service: retrieve: path: /accounting/v1/payments/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Payment` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: PaymentsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -813,12 +334,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Payment + type: accountingRoot.Payment status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -844,7 +370,7 @@ service: remote_id: '234' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa related_object_type: INVOICE @@ -852,7 +378,7 @@ service: remote_id: '235' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 related_object_type: CREDIT_NOTE @@ -874,10 +400,11 @@ service: partialUpdate: path: /accounting/v1/payments/{id} method: PATCH - auth: true + auth: + - tokenAuth: [] docs: Updates a `Payment` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -893,16 +420,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.PatchedPaymentRequest + model: accountingRoot.PatchedPaymentRequest content-type: application/json response: docs: '' - type: root.PaymentResponse + type: accountingRoot.PaymentResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -931,7 +462,7 @@ service: remote_id: '234' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa related_object_type: INVOICE @@ -939,7 +470,7 @@ service: remote_id: '235' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 related_object_type: CREDIT_NOTE @@ -979,10 +510,15 @@ service: lineItemsRemoteFieldClassesList: path: /accounting/v1/payments/line-items/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: PaymentsLineItemsRemoteFieldClassesListRequest query-parameters: @@ -1022,10 +558,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: accountingRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -1044,20 +589,22 @@ service: metaPatchRetrieve: path: /accounting/v1/payments/meta/patch/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Payment` PATCHs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -1232,16 +779,18 @@ service: metaPostRetrieve: path: /accounting/v1/payments/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Payment` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -1416,10 +965,15 @@ service: remoteFieldClassesList: path: /accounting/v1/payments/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: PaymentsRemoteFieldClassesListRequest query-parameters: @@ -1459,10 +1013,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: accountingRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -1479,4 +1042,4 @@ service: field_choices: - field_choices source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/phoneNumbers.yml b/.mock/definition/Accounting/phoneNumbers.yml similarity index 76% rename from .mock/definition/accounting/phoneNumbers.yml rename to .mock/definition/Accounting/phoneNumbers.yml index b673238..d5d8e3d 100644 --- a/.mock/definition/accounting/phoneNumbers.yml +++ b/.mock/definition/Accounting/phoneNumbers.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: retrieve: path: /accounting/v1/phone-numbers/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `AccountingPhoneNumber` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -28,12 +29,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.AccountingPhoneNumber + type: accountingRoot.AccountingPhoneNumber status-code: 200 examples: - path-parameters: id: id - headers: {} + 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' @@ -41,4 +46,4 @@ service: number: '+3198675309' type: Mobile source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/projects.yml b/.mock/definition/Accounting/projects.yml similarity index 80% rename from .mock/definition/accounting/projects.yml rename to .mock/definition/Accounting/projects.yml index 097c0ff..b4c587c 100644 --- a/.mock/definition/accounting/projects.yml +++ b/.mock/definition/Accounting/projects.yml @@ -1,22 +1,18 @@ types: - ProjectsListRequestExpand: + ProjectsListRequestExpandItem: enum: - company - - value: company,contact - name: CompanyContact - contact source: - openapi: openapi/openapi.yml - ProjectsRetrieveRequestExpand: + openapi: accounting_v3.yml + ProjectsRetrieveRequestExpandItem: enum: - company - - value: company,contact - name: CompanyContact - contact source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -24,10 +20,11 @@ service: list: path: /accounting/v1/projects method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Project` objects. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: ProjectsListRequest query-parameters: @@ -35,7 +32,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -62,10 +60,17 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedProjectList + type: accountingRoot.PaginatedProjectList status-code: 200 examples: - - headers: {} + - 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 @@ -91,17 +96,19 @@ service: retrieve: path: /accounting/v1/projects/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Project` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: ProjectsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -117,12 +124,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Project + type: accountingRoot.Project status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -143,4 +154,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/purchaseOrders.yml b/.mock/definition/Accounting/purchaseOrders.yml new file mode 100644 index 0000000..54247ab --- /dev/null +++ b/.mock/definition/Accounting/purchaseOrders.yml @@ -0,0 +1,839 @@ +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 similarity index 74% rename from .mock/definition/accounting/regenerateKey.yml rename to .mock/definition/Accounting/regenerateKey.yml index 39fe26f..3fabcb1 100644 --- a/.mock/definition/accounting/regenerateKey.yml +++ b/.mock/definition/Accounting/regenerateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /accounting/v1/regenerate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Exchange remote keys. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: RemoteKeyForRegenerationRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: accountingRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/scopes.yml b/.mock/definition/Accounting/scopes.yml similarity index 86% rename from .mock/definition/accounting/scopes.yml rename to .mock/definition/Accounting/scopes.yml index ab81c59..c0e2e75 100644 --- a/.mock/definition/accounting/scopes.yml +++ b/.mock/definition/Accounting/scopes.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,22 @@ service: default_scopes_retrieve: path: /accounting/v1/default-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: accountingRoot.CommonModelScopeApi status-code: 200 examples: - - response: + - headers: + X-Account-Token: '[object Object]' + response: body: common_models: - model_name: Employee @@ -48,19 +51,21 @@ service: linked_account_scopes_retrieve: path: /accounting/v1/linked-account-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: accountingRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: common_models: @@ -90,28 +95,31 @@ service: linked_account_scopes_create: path: /accounting/v1/linked-account-scopes method: POST - auth: true + 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: openapi/openapi.yml + openapi: accounting_v3.yml request: name: LinkedAccountCommonModelScopeDeserializerRequest body: properties: common_models: docs: The common models you want to update the scopes for - type: list + type: >- + list content-type: application/json response: docs: '' - type: root.CommonModelScopeApi + type: accountingRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: common_models: - model_name: Employee @@ -157,4 +165,4 @@ service: - manager - work_location source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/syncStatus.yml b/.mock/definition/Accounting/syncStatus.yml similarity index 80% rename from .mock/definition/accounting/syncStatus.yml rename to .mock/definition/Accounting/syncStatus.yml index 38dcf2c..bb6eaf2 100644 --- a/.mock/definition/accounting/syncStatus.yml +++ b/.mock/definition/Accounting/syncStatus.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: list: path: /accounting/v1/sync-status method: GET - auth: true + 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. @@ -20,8 +21,12 @@ service: `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: openapi/openapi.yml + openapi: accounting_v3.yml request: name: SyncStatusListRequest query-parameters: @@ -33,10 +38,14 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedSyncStatusList + type: accountingRoot.PaginatedSyncStatusList status-code: 200 examples: - - headers: {} + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + page_size: 1 + headers: + X-Account-Token: X-Account-Token response: body: next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw @@ -52,4 +61,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/taxRates.yml b/.mock/definition/Accounting/taxRates.yml similarity index 84% rename from .mock/definition/accounting/taxRates.yml rename to .mock/definition/Accounting/taxRates.yml index 3ff1519..e2fedf7 100644 --- a/.mock/definition/accounting/taxRates.yml +++ b/.mock/definition/Accounting/taxRates.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /accounting/v1/tax-rates method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `TaxRate` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: TaxRatesListRequest query-parameters: @@ -30,6 +35,7 @@ service: 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. @@ -72,10 +78,24 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedTaxRateList + type: accountingRoot.PaginatedTaxRateList status-code: 200 examples: - - headers: {} + - 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 @@ -115,10 +135,11 @@ service: retrieve: path: /accounting/v1/tax-rates/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `TaxRate` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -126,6 +147,7 @@ service: 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. @@ -141,12 +163,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.TaxRate + type: accountingRoot.TaxRate status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -182,4 +208,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/trackingCategories.yml b/.mock/definition/Accounting/trackingCategories.yml similarity index 77% rename from .mock/definition/accounting/trackingCategories.yml rename to .mock/definition/Accounting/trackingCategories.yml index 2e3f062..92b731f 100644 --- a/.mock/definition/accounting/trackingCategories.yml +++ b/.mock/definition/Accounting/trackingCategories.yml @@ -1,5 +1,22 @@ +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: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,15 +24,20 @@ service: list: path: /accounting/v1/tracking-categories method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `TrackingCategory` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: TrackingCategoriesListRequest query-parameters: category_type: - type: optional + type: optional docs: If provided, will only return tracking categories with this type. company_id: type: optional @@ -35,6 +57,7 @@ service: 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. @@ -86,16 +109,34 @@ service: enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) status: - type: optional + type: optional docs: >- If provided, will only return tracking categories with this status. response: docs: '' - type: root.PaginatedTrackingCategoryList + type: accountingRoot.PaginatedTrackingCategoryList status-code: 200 examples: - - headers: {} + - 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 @@ -119,10 +160,11 @@ service: retrieve: path: /accounting/v1/tracking-categories/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `TrackingCategory` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: @@ -130,6 +172,7 @@ service: 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. @@ -155,12 +198,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.TrackingCategory + type: accountingRoot.TrackingCategory status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -179,4 +228,4 @@ service: linked_account_defined_targets: custom_key: custom_value source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/transactions.yml b/.mock/definition/Accounting/transactions.yml similarity index 64% rename from .mock/definition/accounting/transactions.yml rename to .mock/definition/Accounting/transactions.yml index 94a999d..480f386 100644 --- a/.mock/definition/accounting/transactions.yml +++ b/.mock/definition/Accounting/transactions.yml @@ -1,128 +1,24 @@ types: - TransactionsListRequestExpand: + TransactionsListRequestExpandItem: enum: - account - - value: account,accounting_period - name: AccountAccountingPeriod - accounting_period - contact - - value: contact,account - name: ContactAccount - - value: contact,account,accounting_period - name: ContactAccountAccountingPeriod - - value: contact,accounting_period - name: ContactAccountingPeriod - line_items - - value: line_items,account - name: LineItemsAccount - - value: line_items,account,accounting_period - name: LineItemsAccountAccountingPeriod - - value: line_items,accounting_period - name: LineItemsAccountingPeriod - - value: line_items,contact - name: LineItemsContact - - value: line_items,contact,account - name: LineItemsContactAccount - - value: line_items,contact,account,accounting_period - name: LineItemsContactAccountAccountingPeriod - - value: line_items,contact,accounting_period - name: LineItemsContactAccountingPeriod - - value: line_items,tracking_categories - name: LineItemsTrackingCategories - - value: line_items,tracking_categories,account - name: LineItemsTrackingCategoriesAccount - - value: line_items,tracking_categories,account,accounting_period - name: LineItemsTrackingCategoriesAccountAccountingPeriod - - value: line_items,tracking_categories,accounting_period - name: LineItemsTrackingCategoriesAccountingPeriod - - value: line_items,tracking_categories,contact - name: LineItemsTrackingCategoriesContact - - value: line_items,tracking_categories,contact,account - name: LineItemsTrackingCategoriesContactAccount - - value: line_items,tracking_categories,contact,account,accounting_period - name: LineItemsTrackingCategoriesContactAccountAccountingPeriod - - value: line_items,tracking_categories,contact,accounting_period - name: LineItemsTrackingCategoriesContactAccountingPeriod - tracking_categories - - value: tracking_categories,account - name: TrackingCategoriesAccount - - value: tracking_categories,account,accounting_period - name: TrackingCategoriesAccountAccountingPeriod - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,account - name: TrackingCategoriesContactAccount - - value: tracking_categories,contact,account,accounting_period - name: TrackingCategoriesContactAccountAccountingPeriod - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod source: - openapi: openapi/openapi.yml - TransactionsRetrieveRequestExpand: + openapi: accounting_v3.yml + TransactionsRetrieveRequestExpandItem: enum: - account - - value: account,accounting_period - name: AccountAccountingPeriod - accounting_period - contact - - value: contact,account - name: ContactAccount - - value: contact,account,accounting_period - name: ContactAccountAccountingPeriod - - value: contact,accounting_period - name: ContactAccountingPeriod - line_items - - value: line_items,account - name: LineItemsAccount - - value: line_items,account,accounting_period - name: LineItemsAccountAccountingPeriod - - value: line_items,accounting_period - name: LineItemsAccountingPeriod - - value: line_items,contact - name: LineItemsContact - - value: line_items,contact,account - name: LineItemsContactAccount - - value: line_items,contact,account,accounting_period - name: LineItemsContactAccountAccountingPeriod - - value: line_items,contact,accounting_period - name: LineItemsContactAccountingPeriod - - value: line_items,tracking_categories - name: LineItemsTrackingCategories - - value: line_items,tracking_categories,account - name: LineItemsTrackingCategoriesAccount - - value: line_items,tracking_categories,account,accounting_period - name: LineItemsTrackingCategoriesAccountAccountingPeriod - - value: line_items,tracking_categories,accounting_period - name: LineItemsTrackingCategoriesAccountingPeriod - - value: line_items,tracking_categories,contact - name: LineItemsTrackingCategoriesContact - - value: line_items,tracking_categories,contact,account - name: LineItemsTrackingCategoriesContactAccount - - value: line_items,tracking_categories,contact,account,accounting_period - name: LineItemsTrackingCategoriesContactAccountAccountingPeriod - - value: line_items,tracking_categories,contact,accounting_period - name: LineItemsTrackingCategoriesContactAccountingPeriod - tracking_categories - - value: tracking_categories,account - name: TrackingCategoriesAccount - - value: tracking_categories,account,accounting_period - name: TrackingCategoriesAccountAccountingPeriod - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,account - name: TrackingCategoriesContactAccount - - value: tracking_categories,contact,account,accounting_period - name: TrackingCategoriesContactAccountAccountingPeriod - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -130,10 +26,15 @@ service: list: path: /accounting/v1/transactions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Transaction` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: TransactionsListRequest query-parameters: @@ -154,7 +55,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -202,10 +104,25 @@ service: datetime. response: docs: '' - type: root.PaginatedTransactionList + type: accountingRoot.PaginatedTransactionList status-code: 200 examples: - - headers: {} + - 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 @@ -277,17 +194,19 @@ service: retrieve: path: /accounting/v1/transactions/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Transaction` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: TransactionsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -303,12 +222,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Transaction + type: accountingRoot.Transaction status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -339,7 +262,6 @@ service: quantity: '10.0' item: 0958cbc6-6040-430a-848e-aafacbadf4ae account: 2b38c085-2620-4269-b5ec-75dd9095ed2c - tracking_category: tracking_category tracking_categories: - f1214c24-2702-4617-b74b-3ddecfc0d384 - 9b840d2-686a-465a-8a8e-7b028498f8e4 @@ -359,7 +281,6 @@ service: quantity: '10.0' item: 249c9faa-3045-4a31-953b-8f22d3613301 account: 3e442c5d-8f51-4103-b5c9-dcee39c30a08 - tracking_category: tracking_category tracking_categories: - f1214c24-2702-4617-b74b-3ddecfc0d384 - 9b840d2-686a-465a-8a8e-7b028498f8e4 @@ -382,4 +303,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/vendorCredits.yml b/.mock/definition/Accounting/vendorCredits.yml similarity index 80% rename from .mock/definition/accounting/vendorCredits.yml rename to .mock/definition/Accounting/vendorCredits.yml index 39b4141..1df3827 100644 --- a/.mock/definition/accounting/vendorCredits.yml +++ b/.mock/definition/Accounting/vendorCredits.yml @@ -1,128 +1,24 @@ types: - VendorCreditsListRequestExpand: + VendorCreditsListRequestExpandItem: enum: - accounting_period - company - - value: company,accounting_period - name: CompanyAccountingPeriod - lines - - value: lines,accounting_period - name: LinesAccountingPeriod - - value: lines,company - name: LinesCompany - - value: lines,company,accounting_period - name: LinesCompanyAccountingPeriod - - value: lines,tracking_categories - name: LinesTrackingCategories - - value: lines,tracking_categories,accounting_period - name: LinesTrackingCategoriesAccountingPeriod - - value: lines,tracking_categories,company - name: LinesTrackingCategoriesCompany - - value: lines,tracking_categories,company,accounting_period - name: LinesTrackingCategoriesCompanyAccountingPeriod - - value: lines,tracking_categories,vendor - name: LinesTrackingCategoriesVendor - - value: lines,tracking_categories,vendor,accounting_period - name: LinesTrackingCategoriesVendorAccountingPeriod - - value: lines,tracking_categories,vendor,company - name: LinesTrackingCategoriesVendorCompany - - value: lines,tracking_categories,vendor,company,accounting_period - name: LinesTrackingCategoriesVendorCompanyAccountingPeriod - - value: lines,vendor - name: LinesVendor - - value: lines,vendor,accounting_period - name: LinesVendorAccountingPeriod - - value: lines,vendor,company - name: LinesVendorCompany - - value: lines,vendor,company,accounting_period - name: LinesVendorCompanyAccountingPeriod - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,vendor - name: TrackingCategoriesVendor - - value: tracking_categories,vendor,accounting_period - name: TrackingCategoriesVendorAccountingPeriod - - value: tracking_categories,vendor,company - name: TrackingCategoriesVendorCompany - - value: tracking_categories,vendor,company,accounting_period - name: TrackingCategoriesVendorCompanyAccountingPeriod - vendor - - value: vendor,accounting_period - name: VendorAccountingPeriod - - value: vendor,company - name: VendorCompany - - value: vendor,company,accounting_period - name: VendorCompanyAccountingPeriod source: - openapi: openapi/openapi.yml - VendorCreditsRetrieveRequestExpand: + openapi: accounting_v3.yml + VendorCreditsRetrieveRequestExpandItem: enum: - accounting_period - company - - value: company,accounting_period - name: CompanyAccountingPeriod - lines - - value: lines,accounting_period - name: LinesAccountingPeriod - - value: lines,company - name: LinesCompany - - value: lines,company,accounting_period - name: LinesCompanyAccountingPeriod - - value: lines,tracking_categories - name: LinesTrackingCategories - - value: lines,tracking_categories,accounting_period - name: LinesTrackingCategoriesAccountingPeriod - - value: lines,tracking_categories,company - name: LinesTrackingCategoriesCompany - - value: lines,tracking_categories,company,accounting_period - name: LinesTrackingCategoriesCompanyAccountingPeriod - - value: lines,tracking_categories,vendor - name: LinesTrackingCategoriesVendor - - value: lines,tracking_categories,vendor,accounting_period - name: LinesTrackingCategoriesVendorAccountingPeriod - - value: lines,tracking_categories,vendor,company - name: LinesTrackingCategoriesVendorCompany - - value: lines,tracking_categories,vendor,company,accounting_period - name: LinesTrackingCategoriesVendorCompanyAccountingPeriod - - value: lines,vendor - name: LinesVendor - - value: lines,vendor,accounting_period - name: LinesVendorAccountingPeriod - - value: lines,vendor,company - name: LinesVendorCompany - - value: lines,vendor,company,accounting_period - name: LinesVendorCompanyAccountingPeriod - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,vendor - name: TrackingCategoriesVendor - - value: tracking_categories,vendor,accounting_period - name: TrackingCategoriesVendorAccountingPeriod - - value: tracking_categories,vendor,company - name: TrackingCategoriesVendorCompany - - value: tracking_categories,vendor,company,accounting_period - name: TrackingCategoriesVendorCompanyAccountingPeriod - vendor - - value: vendor,accounting_period - name: VendorAccountingPeriod - - value: vendor,company - name: VendorCompany - - value: vendor,company,accounting_period - name: VendorCompanyAccountingPeriod source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -130,10 +26,15 @@ service: list: path: /accounting/v1/vendor-credits method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `VendorCredit` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: VendorCreditsListRequest query-parameters: @@ -152,7 +53,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -200,10 +102,25 @@ service: datetime. response: docs: '' - type: root.PaginatedVendorCreditList + type: accountingRoot.PaginatedVendorCreditList status-code: 200 examples: - - headers: {} + - 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 @@ -274,10 +191,11 @@ service: create: path: /accounting/v1/vendor-credits method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `VendorCredit` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: VendorCreditEndpointRequest query-parameters: @@ -291,14 +209,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.VendorCreditRequest + model: accountingRoot.VendorCreditRequest content-type: application/json response: docs: '' - type: root.VendorCreditResponse + type: accountingRoot.VendorCreditResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -389,17 +311,19 @@ service: retrieve: path: /accounting/v1/vendor-credits/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `VendorCredit` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml path-parameters: id: string request: name: VendorCreditsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -415,12 +339,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.VendorCredit + type: accountingRoot.VendorCredit status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -441,7 +369,6 @@ service: created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' net_amount: 25.54 - tracking_category: tracking_category tracking_categories: - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - 9b840d2-686a-465a-8a8e-7b028498f8e4 @@ -459,7 +386,6 @@ service: created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' net_amount: 10 - tracking_category: tracking_category tracking_categories: - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - 9b840d2-686a-465a-8a8e-7b028498f8e4 @@ -498,16 +424,18 @@ service: metaPostRetrieve: path: /accounting/v1/vendor-credits/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `VendorCredit` POSTs. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: root.MetaResponse + type: accountingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -680,4 +608,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/accounting/webhookReceivers.yml b/.mock/definition/Accounting/webhookReceivers.yml similarity index 73% rename from .mock/definition/accounting/webhookReceivers.yml rename to .mock/definition/Accounting/webhookReceivers.yml index 0c90c82..eb04b34 100644 --- a/.mock/definition/accounting/webhookReceivers.yml +++ b/.mock/definition/Accounting/webhookReceivers.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + accountingRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: list: path: /accounting/v1/webhook-receivers method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `WebhookReceiver` objects. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - event: event @@ -25,10 +27,11 @@ service: create: path: /accounting/v1/webhook-receivers method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `WebhookReceiver` object with the given values. source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml request: name: WebhookReceiverRequest body: @@ -45,10 +48,11 @@ service: content-type: application/json response: docs: '' - type: root.WebhookReceiver + type: accountingRoot.WebhookReceiver status-code: 201 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: event: event is_active: true @@ -58,4 +62,4 @@ service: is_active: true key: key source: - openapi: openapi/openapi.yml + openapi: accounting_v3.yml diff --git a/.mock/definition/crm/__package__.yml b/.mock/definition/CRM/__package__.yml similarity index 80% rename from .mock/definition/crm/__package__.yml rename to .mock/definition/CRM/__package__.yml index 4146a38..d5382cc 100644 --- a/.mock/definition/crm/__package__.yml +++ b/.mock/definition/CRM/__package__.yml @@ -8,7 +8,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true Account: docs: |- @@ -94,7 +94,15 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml + AccountDetailsCategory: + discriminated: false + union: + - CategoryEnum + - string + source: + openapi: crm_v3.yml + inline: true AccountDetails: properties: id: @@ -108,7 +116,7 @@ types: integration_slug: type: optional access: read-only - category: optional + category: optional end_user_origin_id: type: optional access: read-only @@ -143,7 +151,23 @@ types: type: optional docs: The time at which account completes the linking flow. source: - openapi: openapi/openapi.yml + 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 @@ -159,8 +183,8 @@ types: View a list of your organization's `LinkedAccount` objects. properties: id: string - category: optional - status: AccountDetailsAndActionsStatusEnum + category: optional + status: AccountDetailsAndActionsStatus status_detail: optional end_user_origin_id: optional end_user_organization_name: string @@ -180,7 +204,7 @@ types: account_type: string completed_at: datetime source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AccountDetailsAndActionsIntegration: properties: name: string @@ -192,7 +216,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AccountDetailsAndActionsStatusEnum: enum: - COMPLETE @@ -205,7 +229,7 @@ types: * `RELINK_NEEDED` - RELINK_NEEDED * `IDLE` - IDLE source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AccountIntegration: properties: name: @@ -263,7 +287,7 @@ types: docs: Category or categories this integration is in beta status for. access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AccountRequestOwner: discriminated: false docs: The account's owner. @@ -273,7 +297,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true AccountRequest: docs: |- @@ -323,14 +347,14 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AccountToken: properties: account_token: string integration: AccountIntegration id: string source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ActivityTypeEnum: enum: - CALL @@ -341,7 +365,280 @@ types: * `MEETING` - MEETING * `EMAIL` - EMAIL source: - openapi: openapi/openapi.yml + 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 @@ -374,7 +671,7 @@ types: type: optional docs: The address's postal code. country: - type: optional + type: optional docs: |- The address's country. @@ -628,14 +925,287 @@ types: * `ZM` - Zambia * `ZW` - Zimbabwe address_type: - type: optional + type: optional docs: |- The address type. - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING + * `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: openapi/openapi.yml + openapi: crm_v3.yml + inline: true AddressRequest: docs: |- # The Address Object @@ -660,7 +1230,7 @@ types: type: optional docs: The address's postal code. country: - type: optional + type: optional docs: |- The address's country. @@ -914,7 +1484,7 @@ types: * `ZM` - Zambia * `ZW` - Zimbabwe address_type: - type: optional + type: optional docs: |- The address type. @@ -927,7 +1497,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AddressTypeEnum: enum: - BILLING @@ -936,7 +1506,7 @@ types: * `BILLING` - BILLING * `SHIPPING` - SHIPPING source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AdvancedMetadata: properties: id: @@ -949,7 +1519,7 @@ types: is_custom: optional field_choices: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AssociationAssociationType: discriminated: false docs: The association type the association belongs to. @@ -959,7 +1529,7 @@ types: format: uuid - AssociationType source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true Association: docs: |- @@ -991,7 +1561,7 @@ types: type: optional docs: The association type the association belongs to. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AssociationSubType: properties: id: @@ -1009,77 +1579,220 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml + AssociationTypeCardinality: + discriminated: false + union: + - CardinalityEnum + - string + source: + openapi: crm_v3.yml + inline: true AssociationType: docs: >- # The AssociationType Object - ### Description + ### 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 - The `Association Type` object represents the relationship between two - objects. + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ### Usage Example + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - 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: openapi/openapi.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: openapi/openapi.yml - AsyncPassthroughReciept: - properties: - async_passthrough_receipt_id: - type: string - validation: - format: uuid + * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - + CREATED_INTEGRATION_WIDE_FIELD_MAPPING + + * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - + CREATED_LINKED_ACCOUNT_FIELD_MAPPING + + * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + + * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + + * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - + DELETED_INTEGRATION_WIDE_FIELD_MAPPING + + * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - + DELETED_LINKED_ACCOUNT_FIELD_MAPPING + + * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC + + * `MUTED_ISSUE` - MUTED_ISSUE + + * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + + * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + + * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + + * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED + + * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED + union: + - EventTypeEnum + - string source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml + inline: true AuditLogEvent: properties: id: @@ -1099,7 +1812,7 @@ types: format: email maxLength: 254 role: - type: RoleEnum + 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. @@ -1121,7 +1834,7 @@ types: validation: maxLength: 45 event_type: - type: EventTypeEnum + type: AuditLogEventEventType docs: >- Designates the type of event that occurred. @@ -1232,7 +1945,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml AvailableActions: docs: >- # The AvailableActions Object @@ -1251,7 +1964,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CrmAccountResponse: properties: model: Account @@ -1259,7 +1972,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CrmAssociationTypeResponse: properties: model: AssociationType @@ -1267,7 +1980,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CrmContactResponse: properties: model: Contact @@ -1275,7 +1988,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CrmCustomObjectResponse: properties: model: CustomObject @@ -1283,7 +1996,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CardinalityEnum: enum: - ONE_TO_ONE @@ -1296,7 +2009,7 @@ types: * `MANY_TO_MANY` - MANY_TO_MANY * `ONE_TO_MANY` - ONE_TO_MANY source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CategoriesEnum: enum: - hris @@ -1315,7 +2028,7 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CategoryEnum: enum: - hris @@ -1334,14 +2047,14 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CommonModelScopeApi: properties: common_models: docs: The common models you want to update the scopes for type: list source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CommonModelScopesBodyRequest: properties: model_id: @@ -1351,7 +2064,7 @@ types: enabled_actions: list disabled_fields: list source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ContactAccount: discriminated: false docs: The contact's account. @@ -1361,7 +2074,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true ContactOwner: discriminated: false @@ -1372,7 +2085,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true Contact: docs: >- @@ -1443,7 +2156,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ContactRequestAccount: discriminated: false docs: The contact's account. @@ -1453,7 +2166,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true ContactRequestOwner: discriminated: false @@ -1464,7 +2177,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true ContactRequest: docs: >- @@ -1507,7 +2220,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CountryEnum: enum: - AF @@ -2010,7 +2723,7 @@ types: * `ZM` - Zambia * `ZW` - Zimbabwe source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CustomObject: docs: |- # The CustomObject Object @@ -2048,7 +2761,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CustomObjectClass: docs: >- # The Custom Object Class Object @@ -2096,7 +2809,7 @@ types: class can have. access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml CustomObjectRequest: properties: fields: map @@ -2107,7 +2820,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml DataPassthroughRequest: docs: >- # The DataPassthrough Object @@ -2161,21 +2874,21 @@ types: `{"type": T, "value": ...}` where `T` will be one of `string, boolean, number, null, array, object`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml DebugModeLog: properties: log_id: string dashboard_view: string log_summary: DebugModelLogSummary source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml DebugModelLogSummary: properties: url: string method: string status_code: integer source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml DirectionEnum: enum: - INBOUND @@ -2184,7 +2897,7 @@ types: * `INBOUND` - INBOUND * `OUTBOUND` - OUTBOUND source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml EmailAddress: docs: |- # The EmailAddress Object @@ -2208,7 +2921,7 @@ types: type: optional docs: The email address's type. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml EmailAddressRequest: docs: |- # The EmailAddress Object @@ -2230,7 +2943,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml EnabledActionsEnum: enum: - READ @@ -2239,7 +2952,7 @@ types: * `READ` - READ * `WRITE` - WRITE source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml EncodingEnum: enum: - RAW @@ -2250,7 +2963,7 @@ types: * `BASE64` - BASE64 * `GZIP_BASE64` - GZIP_BASE64 source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml EngagementOwner: discriminated: false docs: The engagement's owner. @@ -2260,7 +2973,20 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + 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 @@ -2271,7 +2997,7 @@ types: format: uuid - EngagementType source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true EngagementAccount: discriminated: false @@ -2282,7 +3008,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true EngagementContactsItem: discriminated: false @@ -2292,7 +3018,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true Engagement: docs: >- @@ -2333,7 +3059,7 @@ types: type: optional docs: The engagement's subject. direction: - type: optional + type: optional docs: |- The engagement's direction. @@ -2371,7 +3097,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml EngagementRequestOwner: discriminated: false docs: The engagement's owner. @@ -2381,7 +3107,20 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + 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 @@ -2392,7 +3131,7 @@ types: format: uuid - EngagementType source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true EngagementRequestAccount: discriminated: false @@ -2403,7 +3142,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true EngagementRequestContactsItem: discriminated: false @@ -2413,7 +3152,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true EngagementRequest: docs: >- @@ -2438,7 +3177,7 @@ types: type: optional docs: The engagement's subject. direction: - type: optional + type: optional docs: |- The engagement's direction. @@ -2467,7 +3206,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml EngagementResponse: properties: model: Engagement @@ -2475,7 +3214,21 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + 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 @@ -2507,7 +3260,7 @@ types: docs: The datetime that this object was modified by Merge. access: read-only activity_type: - type: optional + type: optional docs: |- The engagement type's activity type. @@ -2521,7 +3274,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ErrorValidationProblem: properties: source: optional @@ -2529,7 +3282,7 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml EventTypeEnum: enum: - CREATED_REMOTE_PRODUCTION_API_KEY @@ -2676,7 +3429,7 @@ types: * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ExternalTargetFieldApi: properties: name: @@ -2689,7 +3442,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ExternalTargetFieldApiResponse: properties: Account: optional> @@ -2702,7 +3455,7 @@ types: Task: optional> Engagement: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml FieldFormatEnum: enum: - string @@ -2719,14 +3472,14 @@ types: * `bool` - bool * `list` - list source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml FieldMappingApiInstanceTargetField: properties: name: string description: string is_organization_wide: boolean source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: properties: @@ -2734,7 +3487,7 @@ types: url_path: optional field_traversal_path: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true FieldMappingApiInstanceRemoteField: properties: @@ -2742,7 +3495,7 @@ types: schema: optional> remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true FieldMappingApiInstance: properties: @@ -2761,7 +3514,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml FieldMappingApiInstanceResponse: properties: Account: optional> @@ -2774,7 +3527,7 @@ types: Task: optional> Engagement: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml FieldMappingInstanceResponse: properties: model: FieldMappingApiInstance @@ -2782,19 +3535,19 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml FieldPermissionDeserializer: properties: enabled_fields: optional> disabled_fields: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml FieldPermissionDeserializerRequest: properties: enabled_fields: optional> disabled_fields: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml FieldTypeEnum: enum: - string @@ -2811,24 +3564,32 @@ types: * `bool` - bool * `list` - list source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml + IgnoreCommonModelRequestReason: + discriminated: false + union: + - ReasonEnum + - string + source: + openapi: crm_v3.yml + inline: true IgnoreCommonModelRequest: properties: - reason: ReasonEnum + reason: IgnoreCommonModelRequestReason message: type: optional validation: minLength: 1 maxLength: 256 source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml IndividualCommonModelScopeDeserializer: properties: model_name: string model_permissions: optional> field_permissions: optional source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml IndividualCommonModelScopeDeserializerRequest: properties: model_name: @@ -2838,7 +3599,20 @@ types: model_permissions: optional> field_permissions: optional source: - openapi: openapi/openapi.yml + 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: @@ -2847,7 +3621,7 @@ types: format: uuid access: read-only status: - type: optional + type: optional docs: |- Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -2866,7 +3640,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml IssueStatusEnum: enum: - ONGOING @@ -2875,7 +3649,7 @@ types: * `ONGOING` - ONGOING * `RESOLVED` - RESOLVED source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ItemFormatEnum: enum: - string @@ -2892,14 +3666,14 @@ types: * `bool` - currency * `list` - decimal source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ItemSchema: properties: item_type: optional item_format: optional item_choices: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ItemTypeEnum: enum: - string @@ -2916,7 +3690,7 @@ types: * `bool` - bool * `list` - list source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml LanguageEnum: enum: - en @@ -2925,7 +3699,7 @@ types: * `en` - en * `de` - de source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml LastSyncResultEnum: enum: - SYNCING @@ -2942,7 +3716,7 @@ types: * `PAUSED` - PAUSED * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml LeadOwner: discriminated: false docs: The lead's owner. @@ -2952,7 +3726,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true LeadConvertedContact: discriminated: false @@ -2963,7 +3737,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true LeadConvertedAccount: discriminated: false @@ -2974,7 +3748,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true Lead: docs: >- @@ -3066,7 +3840,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml LeadRequestOwner: discriminated: false docs: The lead's owner. @@ -3076,7 +3850,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true LeadRequestConvertedContact: discriminated: false @@ -3087,7 +3861,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true LeadRequestConvertedAccount: discriminated: false @@ -3098,7 +3872,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true LeadRequest: docs: >- @@ -3153,7 +3927,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml LeadResponse: properties: model: Lead @@ -3161,20 +3935,20 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml LinkToken: properties: link_token: string integration_name: optional magic_link_url: optional source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml LinkedAccountStatus: properties: linked_account_status: string can_make_request: boolean source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml MetaResponse: properties: request_schema: map @@ -3183,7 +3957,7 @@ types: has_conditional_params: boolean has_required_linked_account_params: boolean source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml MethodEnum: enum: - GET @@ -3202,7 +3976,7 @@ types: * `PATCH` - PATCH * `DELETE` - DELETE source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ModelOperation: docs: >- # The ModelOperation Object @@ -3222,17 +3996,31 @@ types: required_post_parameters: list supported_fields: list source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ModelPermissionDeserializer: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ModelPermissionDeserializerRequest: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + 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 @@ -3258,7 +4046,7 @@ types: validation: minLength: 1 encoding: - type: optional + type: optional docs: |- The encoding of the value of `data`. Defaults to `RAW` if not defined. @@ -3276,7 +4064,7 @@ types: validation: minLength: 1 source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml NoteOwner: discriminated: false docs: The note's owner. @@ -3286,7 +4074,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true NoteContact: discriminated: false @@ -3297,7 +4085,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true NoteAccount: discriminated: false @@ -3308,7 +4096,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true NoteOpportunity: discriminated: false @@ -3319,7 +4107,7 @@ types: format: uuid - Opportunity source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true Note: docs: |- @@ -3385,7 +4173,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml NoteRequestOwner: discriminated: false docs: The note's owner. @@ -3395,7 +4183,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true NoteRequestContact: discriminated: false @@ -3406,7 +4194,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true NoteRequestAccount: discriminated: false @@ -3417,7 +4205,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true NoteRequestOpportunity: discriminated: false @@ -3428,7 +4216,7 @@ types: format: uuid - Opportunity source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true NoteRequest: docs: |- @@ -3463,7 +4251,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml NoteResponse: properties: model: Note @@ -3471,7 +4259,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ObjectClassDescriptionRequest: properties: id: @@ -3480,7 +4268,7 @@ types: minLength: 1 origin_type: OriginTypeEnum source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml OpportunityOwner: discriminated: false docs: The opportunity's owner. @@ -3490,7 +4278,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true OpportunityAccount: discriminated: false @@ -3501,7 +4289,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true OpportunityStage: discriminated: false @@ -3512,7 +4300,21 @@ types: format: uuid - Stage source: - openapi: openapi/openapi.yml + 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: >- @@ -3565,7 +4367,7 @@ types: type: optional docs: The stage of the opportunity. status: - type: optional + type: optional docs: |- The opportunity's status. @@ -3600,7 +4402,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml OpportunityRequestOwner: discriminated: false docs: The opportunity's owner. @@ -3610,7 +4412,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true OpportunityRequestAccount: discriminated: false @@ -3621,7 +4423,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true OpportunityRequestStage: discriminated: false @@ -3632,7 +4434,21 @@ types: format: uuid - Stage source: - openapi: openapi/openapi.yml + 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: >- @@ -3669,7 +4485,7 @@ types: type: optional docs: The stage of the opportunity. status: - type: optional + type: optional docs: |- The opportunity's status. @@ -3692,7 +4508,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml OpportunityResponse: properties: model: Opportunity @@ -3700,7 +4516,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml OpportunityStatusEnum: enum: - OPEN @@ -3711,7 +4527,7 @@ types: * `WON` - WON * `LOST` - LOST source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml OriginTypeEnum: enum: - CUSTOM_OBJECT @@ -3722,140 +4538,140 @@ types: * `COMMON_MODEL` - COMMON_MODEL * `REMOTE_ONLY_MODEL` - REMOTE_ONLY_MODEL source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedAccountDetailsAndActionsList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedAccountList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedAssociationList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedAssociationTypeList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedAuditLogEventList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedContactList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedCustomObjectClassList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedCustomObjectList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedEngagementList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedEngagementTypeList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedIssueList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedLeadList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedNoteList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedOpportunityList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedRemoteFieldClassList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedStageList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedSyncStatusList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedTaskList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PaginatedUserList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PatchedAccountRequest: docs: |- # The Account Object @@ -3906,7 +4722,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PatchedContactRequestOwner: discriminated: false docs: The contact's owner. @@ -3916,7 +4732,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true PatchedContactRequest: docs: >- @@ -3961,7 +4777,20 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + 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 @@ -3987,7 +4816,7 @@ types: type: optional docs: The engagement's subject. direction: - type: optional + type: optional docs: |- The engagement's direction. @@ -4020,7 +4849,21 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + 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 @@ -4062,7 +4905,7 @@ types: validation: format: uuid status: - type: optional + type: optional docs: |- The opportunity's status. @@ -4085,7 +4928,20 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + 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 @@ -4122,7 +4978,7 @@ types: type: optional docs: When the task is due. status: - type: optional + type: optional docs: |- The task's status. @@ -4138,7 +4994,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PhoneNumber: docs: |- # The PhoneNumber Object @@ -4162,7 +5018,7 @@ types: type: optional docs: The phone number's type. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml PhoneNumberRequest: docs: |- # The PhoneNumber Object @@ -4184,7 +5040,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ReasonEnum: enum: - GENERAL_CUSTOMER_REQUEST @@ -4195,7 +5051,7 @@ types: * `GDPR` - GDPR * `OTHER` - OTHER source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RemoteData: docs: >- # The RemoteData Object @@ -4217,35 +5073,35 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RemoteEndpointInfo: properties: method: string url_path: string field_traversal_path: list source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RemoteFieldRemoteFieldClass: discriminated: false union: - string - RemoteFieldClass source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true RemoteField: properties: remote_field_class: RemoteFieldRemoteFieldClass value: optional source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RemoteFieldApiCoverage: discriminated: false union: - integer - double source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true RemoteFieldApi: properties: @@ -4258,7 +5114,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RemoteFieldApiResponse: properties: Account: optional> @@ -4271,13 +5127,13 @@ types: Task: optional> Engagement: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RemoteFieldClassFieldChoicesItem: properties: value: optional display_name: optional source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true RemoteFieldClass: properties: @@ -4292,13 +5148,29 @@ types: field_choices: optional> item_schema: optional source: - openapi: openapi/openapi.yml + 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: openapi/openapi.yml + openapi: crm_v3.yml inline: true RemoteFieldClassForCustomObjectClassItemSchema: properties: @@ -4306,7 +5178,7 @@ types: item_format: optional item_choices: optional>> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true RemoteFieldClassForCustomObjectClass: properties: @@ -4322,8 +5194,12 @@ types: remote_key_name: optional description: optional is_required: optional - field_type: optional - field_format: optional + field_type: + type: optional + access: read-only + field_format: + type: optional + access: read-only field_choices: type: optional> access: read-only @@ -4331,7 +5207,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RemoteFieldRequestRemoteFieldClass: discriminated: false union: @@ -4340,14 +5216,14 @@ types: format: uuid - RemoteFieldClass source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true RemoteFieldRequest: properties: remote_field_class: RemoteFieldRequestRemoteFieldClass value: optional source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RemoteKey: docs: >- # The RemoteKey Object @@ -4365,7 +5241,15 @@ types: name: string key: string source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml + RemoteResponseResponseType: + discriminated: false + union: + - ResponseTypeEnum + - string + source: + openapi: crm_v3.yml + inline: true RemoteResponse: docs: >- # The RemoteResponse Object @@ -4385,10 +5269,10 @@ types: status: integer response: unknown response_headers: optional> - response_type: optional + response_type: optional headers: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RequestFormatEnum: enum: - JSON @@ -4399,7 +5283,7 @@ types: * `XML` - XML * `MULTIPART` - MULTIPART source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ResponseTypeEnum: enum: - JSON @@ -4408,7 +5292,7 @@ types: * `JSON` - JSON * `BASE64_GZIP` - BASE64_GZIP source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml RoleEnum: enum: - ADMIN @@ -4425,7 +5309,7 @@ types: * `SYSTEM` - SYSTEM * `MERGE_TEAM` - MERGE_TEAM source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml SelectiveSyncConfigurationsUsageEnum: enum: - IN_NEXT_SYNC @@ -4434,7 +5318,7 @@ types: * `IN_NEXT_SYNC` - IN_NEXT_SYNC * `IN_LAST_SYNC` - IN_LAST_SYNC source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml Stage: docs: |- # The Stage Object @@ -4481,7 +5365,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml StatusFd5Enum: enum: - SYNCING @@ -4498,7 +5382,23 @@ types: * `PAUSED` - PAUSED * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED source: - openapi: openapi/openapi.yml + 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 @@ -4518,13 +5418,13 @@ types: model_id: string last_sync_start: optional next_sync_start: optional - last_sync_result: optional + last_sync_result: optional last_sync_finished: optional - status: StatusFd5Enum + status: SyncStatusStatus is_initial_sync: boolean selective_sync_configurations_usage: optional source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml TaskOwner: discriminated: false docs: The task's owner. @@ -4534,7 +5434,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true TaskAccount: discriminated: false @@ -4545,7 +5445,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true TaskOpportunity: discriminated: false @@ -4556,7 +5456,20 @@ types: format: uuid - Opportunity source: - openapi: openapi/openapi.yml + 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: |- @@ -4604,7 +5517,7 @@ types: type: optional docs: When the task is due. status: - type: optional + type: optional docs: |- The task's status. @@ -4629,7 +5542,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml TaskRequestOwner: discriminated: false docs: The task's owner. @@ -4639,7 +5552,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true TaskRequestAccount: discriminated: false @@ -4650,7 +5563,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml inline: true TaskRequestOpportunity: discriminated: false @@ -4661,7 +5574,20 @@ types: format: uuid - Opportunity source: - openapi: openapi/openapi.yml + 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: |- @@ -4693,7 +5619,7 @@ types: type: optional docs: When the task is due. status: - type: optional + type: optional docs: |- The task's status. @@ -4709,7 +5635,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml TaskResponse: properties: model: Task @@ -4717,7 +5643,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml TaskStatusEnum: enum: - OPEN @@ -4726,7 +5652,7 @@ types: * `OPEN` - OPEN * `CLOSED` - CLOSED source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml User: docs: >- # The User Object @@ -4784,12 +5710,12 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml ValidationProblemSource: properties: pointer: string source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml WarningValidationProblem: properties: source: optional @@ -4797,11 +5723,11 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml WebhookReceiver: properties: event: string is_active: boolean key: optional source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/accountDetails.yml b/.mock/definition/CRM/accountDetails.yml similarity index 81% rename from .mock/definition/crm/accountDetails.yml rename to .mock/definition/CRM/accountDetails.yml index 4fe53ba..a624217 100644 --- a/.mock/definition/crm/accountDetails.yml +++ b/.mock/definition/CRM/accountDetails.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /crm/v1/account-details method: GET - auth: true + auth: + - tokenAuth: [] docs: Get details for a linked account. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.AccountDetails + type: crmRoot.AccountDetails status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd @@ -33,4 +35,4 @@ service: account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/accountToken.yml b/.mock/definition/CRM/accountToken.yml similarity index 83% rename from .mock/definition/crm/accountToken.yml rename to .mock/definition/CRM/accountToken.yml index f06c40c..a58e520 100644 --- a/.mock/definition/crm/accountToken.yml +++ b/.mock/definition/CRM/accountToken.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,24 @@ service: retrieve: path: /crm/v1/account-token/{public_token} method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Returns the account token for the end user with the provided public token. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: public_token: string response: docs: '' - type: root.AccountToken + type: crmRoot.AccountToken status-code: 200 examples: - path-parameters: public_token: public_token + headers: + X-Account-Token: '[object Object]' response: body: account_token: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB @@ -41,4 +44,4 @@ service: key: value id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/accounts.yml b/.mock/definition/CRM/accounts.yml similarity index 91% rename from .mock/definition/crm/accounts.yml rename to .mock/definition/CRM/accounts.yml index 5893b29..e92b3ae 100644 --- a/.mock/definition/crm/accounts.yml +++ b/.mock/definition/CRM/accounts.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /crm/v1/accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Account` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: AccountsListRequest query-parameters: @@ -27,6 +32,7 @@ service: 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. @@ -77,10 +83,25 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedAccountList + type: crmRoot.PaginatedAccountList status-code: 200 examples: - - headers: {} + - 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 @@ -105,7 +126,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping phone_numbers: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -129,10 +150,11 @@ service: create: path: /crm/v1/accounts method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `Account` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: CrmAccountEndpointRequest query-parameters: @@ -146,14 +168,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.AccountRequest + model: crmRoot.AccountRequest content-type: application/json response: docs: '' - type: root.CrmAccountResponse + type: crmRoot.CrmAccountResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -178,7 +204,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping phone_numbers: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -222,10 +248,11 @@ service: retrieve: path: /crm/v1/accounts/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Account` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -233,6 +260,7 @@ service: 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. @@ -253,12 +281,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Account + type: crmRoot.Account status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -280,7 +313,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping phone_numbers: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -306,10 +339,11 @@ service: partialUpdate: path: /crm/v1/accounts/{id} method: PATCH - auth: true + auth: + - tokenAuth: [] docs: Updates an `Account` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -325,16 +359,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.PatchedAccountRequest + model: crmRoot.PatchedAccountRequest content-type: application/json response: docs: '' - type: root.CrmAccountResponse + type: crmRoot.CrmAccountResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -359,7 +397,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping phone_numbers: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -403,20 +441,22 @@ service: metaPatchRetrieve: path: /crm/v1/accounts/meta/patch/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `CRMAccount` PATCHs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -591,16 +631,18 @@ service: metaPostRetrieve: path: /crm/v1/accounts/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `CRMAccount` POSTs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -775,10 +817,15 @@ service: remoteFieldClassesList: path: /crm/v1/accounts/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: AccountsRemoteFieldClassesListRequest query-parameters: @@ -823,10 +870,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -843,4 +900,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/associationTypes.yml b/.mock/definition/CRM/associationTypes.yml similarity index 90% rename from .mock/definition/crm/associationTypes.yml rename to .mock/definition/CRM/associationTypes.yml index 01f582d..309496c 100644 --- a/.mock/definition/crm/associationTypes.yml +++ b/.mock/definition/CRM/associationTypes.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: custom_object_classes_association_types_list: path: /crm/v1/custom-object-classes/{custom_object_class_id}/association-types method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `AssociationType` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: custom_object_class_id: string request: @@ -29,6 +34,7 @@ service: 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. @@ -68,12 +74,24 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedAssociationTypeList + type: crmRoot.PaginatedAssociationTypeList status-code: 200 examples: - path-parameters: custom_object_class_id: custom_object_class_id - headers: {} + 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 @@ -96,10 +114,11 @@ service: custom_object_classes_association_types_create: path: /crm/v1/custom-object-classes/{custom_object_class_id}/association-types method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `AssociationType` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: custom_object_class_id: string request: @@ -115,16 +134,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.AssociationTypeRequestRequest + model: crmRoot.AssociationTypeRequestRequest content-type: application/json response: docs: '' - type: root.CrmAssociationTypeResponse + type: crmRoot.CrmAssociationTypeResponse status-code: 201 examples: - path-parameters: custom_object_class_id: custom_object_class_id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: source_object_class: @@ -175,10 +198,11 @@ service: path: >- /crm/v1/custom-object-classes/{custom_object_class_id}/association-types/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `AssociationType` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: custom_object_class_id: string id: string @@ -187,6 +211,7 @@ service: 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. @@ -202,13 +227,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.AssociationType + type: crmRoot.AssociationType status-code: 200 examples: - path-parameters: custom_object_class_id: custom_object_class_id id: id - headers: {} + 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 @@ -231,20 +260,22 @@ service: path: >- /crm/v1/custom-object-classes/{custom_object_class_id}/association-types/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `CRMAssociationType` POSTs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: custom_object_class_id: string response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - path-parameters: custom_object_class_id: custom_object_class_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -417,4 +448,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/associations.yml b/.mock/definition/CRM/associations.yml similarity index 82% rename from .mock/definition/crm/associations.yml rename to .mock/definition/CRM/associations.yml index bf27f3e..435eb24 100644 --- a/.mock/definition/crm/associations.yml +++ b/.mock/definition/CRM/associations.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -8,10 +8,15 @@ service: path: >- /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/{object_id}/associations method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Association` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: custom_object_class_id: string object_id: string @@ -36,6 +41,7 @@ service: 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. @@ -75,13 +81,26 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedAssociationList + type: crmRoot.PaginatedAssociationList status-code: 200 examples: - path-parameters: custom_object_class_id: custom_object_class_id object_id: object_id - headers: {} + 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 @@ -96,18 +115,19 @@ service: 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: true + auth: + - tokenAuth: [] docs: >- Creates an Association between `source_object_id` and `target_object_id` of type `association_type_id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: - association_type_id: string 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: @@ -121,16 +141,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. response: docs: '' - type: root.Association + type: crmRoot.Association status-code: 200 examples: - path-parameters: - association_type_id: association_type_id source_class_id: source_class_id source_object_id: source_object_id target_class_id: target_class_id target_object_id: target_object_id - headers: {} + 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' @@ -139,4 +163,4 @@ service: target_object: da0b1963-be70-469c-9f8c-06a81d0fe759 association_type: association_type source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/asyncPassthrough.yml b/.mock/definition/CRM/asyncPassthrough.yml similarity index 77% rename from .mock/definition/crm/asyncPassthrough.yml rename to .mock/definition/CRM/asyncPassthrough.yml index 6a7e257..ee31556 100644 --- a/.mock/definition/crm/asyncPassthrough.yml +++ b/.mock/definition/CRM/asyncPassthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,23 @@ service: create: path: /crm/v1/async-passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: >- Asynchronously pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: - body: root.DataPassthroughRequest + body: crmRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.AsyncPassthroughReciept + type: crmRoot.AsyncPassthroughReciept status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -31,10 +33,11 @@ service: retrieve: path: /crm/v1/async-passthrough/{async_passthrough_receipt_id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Retrieves data from earlier async-passthrough POST request source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: async_passthrough_receipt_id: string response: @@ -44,7 +47,8 @@ service: examples: - path-parameters: async_passthrough_receipt_id: async_passthrough_receipt_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: method: GET @@ -59,12 +63,12 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml types: AsyncPassthroughRetrieveResponse: discriminated: false union: - - root.RemoteResponse + - crmRoot.RemoteResponse - string source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/auditTrail.yml b/.mock/definition/CRM/auditTrail.yml similarity index 86% rename from .mock/definition/crm/auditTrail.yml rename to .mock/definition/CRM/auditTrail.yml index 68ad5c2..e12fd47 100644 --- a/.mock/definition/crm/auditTrail.yml +++ b/.mock/definition/CRM/auditTrail.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /crm/v1/audit-trail method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets a list of audit trail events. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: AuditTrailListRequest query-parameters: @@ -72,10 +77,19 @@ service: email. response: docs: '' - type: root.PaginatedAuditLogEventList + type: crmRoot.PaginatedAuditLogEventList status-code: 200 examples: - - response: + - 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 @@ -91,4 +105,4 @@ service: from Read to Read+Write created_at: '2024-01-15T09:30:00Z' source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/availableActions.yml b/.mock/definition/CRM/availableActions.yml similarity index 85% rename from .mock/definition/crm/availableActions.yml rename to .mock/definition/CRM/availableActions.yml index 4033803..44a78da 100644 --- a/.mock/definition/crm/availableActions.yml +++ b/.mock/definition/CRM/availableActions.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /crm/v1/available-actions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of models and actions available for an account. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.AvailableActions + type: crmRoot.AvailableActions status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: integration: @@ -47,4 +49,4 @@ service: - company - title source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/contacts.yml b/.mock/definition/CRM/contacts.yml similarity index 90% rename from .mock/definition/crm/contacts.yml rename to .mock/definition/CRM/contacts.yml index 692d06b..c9b501e 100644 --- a/.mock/definition/crm/contacts.yml +++ b/.mock/definition/CRM/contacts.yml @@ -1,22 +1,18 @@ types: - ContactsListRequestExpand: + ContactsListRequestExpandItem: enum: - account - - value: account,owner - name: AccountOwner - owner source: - openapi: openapi/openapi.yml - ContactsRetrieveRequestExpand: + openapi: crm_v3.yml + ContactsRetrieveRequestExpandItem: enum: - account - - value: account,owner - name: AccountOwner - owner source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -24,10 +20,15 @@ service: list: path: /crm/v1/contacts method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Contact` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: ContactsListRequest query-parameters: @@ -51,7 +52,8 @@ service: If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -101,10 +103,26 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedContactList + type: crmRoot.PaginatedContactList status-code: 200 examples: - - headers: {} + - 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 @@ -127,7 +145,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping email_addresses: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -155,10 +173,11 @@ service: create: path: /crm/v1/contacts method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Contact` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: CrmContactEndpointRequest query-parameters: @@ -172,14 +191,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.ContactRequest + model: crmRoot.ContactRequest content-type: application/json response: docs: '' - type: root.CrmContactResponse + type: crmRoot.CrmContactResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -202,7 +225,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping email_addresses: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -250,17 +273,19 @@ service: retrieve: path: /crm/v1/contacts/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Contact` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: name: ContactsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -281,12 +306,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Contact + type: crmRoot.Contact status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -306,7 +336,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping email_addresses: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -336,10 +366,11 @@ service: partialUpdate: path: /crm/v1/contacts/{id} method: PATCH - auth: true + auth: + - tokenAuth: [] docs: Updates a `Contact` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -355,16 +386,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.PatchedContactRequest + model: crmRoot.PatchedContactRequest content-type: application/json response: docs: '' - type: root.CrmContactResponse + type: crmRoot.CrmContactResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -387,7 +422,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping email_addresses: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -435,42 +470,46 @@ service: ignoreCreate: path: /crm/v1/contacts/ignore/{model_id} method: POST - auth: true + 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: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: model_id: string request: - body: root.IgnoreCommonModelRequest + body: crmRoot.IgnoreCommonModelRequest content-type: application/json examples: - path-parameters: model_id: model_id - headers: {} + headers: + X-Account-Token: X-Account-Token request: reason: GENERAL_CUSTOMER_REQUEST metaPatchRetrieve: path: /crm/v1/contacts/meta/patch/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `CRMContact` PATCHs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -645,16 +684,18 @@ service: metaPostRetrieve: path: /crm/v1/contacts/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `CRMContact` POSTs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -829,10 +870,15 @@ service: remoteFieldClassesList: path: /crm/v1/contacts/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: ContactsRemoteFieldClassesListRequest query-parameters: @@ -877,10 +923,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -897,4 +953,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/customObjectClasses.yml b/.mock/definition/CRM/customObjectClasses.yml similarity index 79% rename from .mock/definition/crm/customObjectClasses.yml rename to .mock/definition/CRM/customObjectClasses.yml index 094efd7..abba319 100644 --- a/.mock/definition/crm/customObjectClasses.yml +++ b/.mock/definition/CRM/customObjectClasses.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /crm/v1/custom-object-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `CustomObjectClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: CustomObjectClassesListRequest query-parameters: @@ -27,6 +32,7 @@ service: 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. @@ -66,10 +72,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedCustomObjectClassList + type: crmRoot.PaginatedCustomObjectClassList status-code: 200 examples: - - headers: {} + - 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 @@ -93,6 +111,10 @@ service: 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. @@ -101,12 +123,16 @@ service: 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: string + field_format: enumeration field_choices: - {} - {} @@ -115,10 +141,11 @@ service: retrieve: path: /crm/v1/custom-object-classes/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `CustomObjectClass` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -126,6 +153,7 @@ service: 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. @@ -141,12 +169,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.CustomObjectClass + type: crmRoot.CustomObjectClass status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -169,6 +201,10 @@ service: 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 @@ -179,6 +215,10 @@ service: 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 @@ -186,11 +226,11 @@ service: description: The type of customer. is_required: true field_type: string - field_format: string + field_format: enumeration field_choices: - {} - {} association_types: - key: value source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/customObjects.yml b/.mock/definition/CRM/customObjects.yml similarity index 89% rename from .mock/definition/crm/customObjects.yml rename to .mock/definition/CRM/customObjects.yml index d4904e5..ac8b545 100644 --- a/.mock/definition/crm/customObjects.yml +++ b/.mock/definition/CRM/customObjects.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: custom_object_classes_custom_objects_list: path: /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `CustomObject` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: custom_object_class_id: string request: @@ -68,12 +73,25 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedCustomObjectList + type: crmRoot.PaginatedCustomObjectList status-code: 200 examples: - path-parameters: custom_object_class_id: custom_object_class_id - headers: {} + 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 @@ -93,10 +111,11 @@ service: custom_object_classes_custom_objects_create: path: /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `CustomObject` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: custom_object_class_id: string request: @@ -112,16 +131,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.CustomObjectRequest + model: crmRoot.CustomObjectRequest content-type: application/json response: docs: '' - type: root.CrmCustomObjectResponse + type: crmRoot.CrmCustomObjectResponse status-code: 201 examples: - path-parameters: custom_object_class_id: custom_object_class_id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: fields: @@ -164,10 +187,11 @@ service: path: >- /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `CustomObject` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: custom_object_class_id: string id: string @@ -191,13 +215,18 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.CustomObject + type: crmRoot.CustomObject status-code: 200 examples: - path-parameters: custom_object_class_id: custom_object_class_id id: id - headers: {} + 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 @@ -217,20 +246,22 @@ service: path: >- /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `CRMCustomObject` POSTs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: custom_object_class_id: string response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - path-parameters: custom_object_class_id: custom_object_class_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -405,10 +436,15 @@ service: custom_object_classes_custom_objects_remote_field_classes_list: path: /crm/v1/custom-object-classes/custom-objects/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest query-parameters: @@ -453,10 +489,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -473,4 +519,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/deleteAccount.yml b/.mock/definition/CRM/deleteAccount.yml similarity index 56% rename from .mock/definition/crm/deleteAccount.yml rename to .mock/definition/CRM/deleteAccount.yml index b0bfe1c..3808428 100644 --- a/.mock/definition/crm/deleteAccount.yml +++ b/.mock/definition/CRM/deleteAccount.yml @@ -5,11 +5,13 @@ service: delete: path: /crm/v1/delete-account method: POST - auth: true + auth: + - tokenAuth: [] docs: Delete a linked account. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/engagementTypes.yml b/.mock/definition/CRM/engagementTypes.yml similarity index 80% rename from .mock/definition/crm/engagementTypes.yml rename to .mock/definition/CRM/engagementTypes.yml index 2070b2e..f4d2dbf 100644 --- a/.mock/definition/crm/engagementTypes.yml +++ b/.mock/definition/CRM/engagementTypes.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /crm/v1/engagement-types method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `EngagementType` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: EngagementTypesListRequest query-parameters: @@ -66,10 +71,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedEngagementTypeList + type: crmRoot.PaginatedEngagementTypeList status-code: 200 examples: - - headers: {} + - 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 @@ -86,10 +104,11 @@ service: retrieve: path: /crm/v1/engagement-types/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `EngagementType` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -112,12 +131,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.EngagementType + type: crmRoot.EngagementType status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -133,10 +157,15 @@ service: remoteFieldClassesList: path: /crm/v1/engagement-types/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: EngagementTypesRemoteFieldClassesListRequest query-parameters: @@ -181,10 +210,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -201,4 +240,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/engagements.yml b/.mock/definition/CRM/engagements.yml similarity index 90% rename from .mock/definition/crm/engagements.yml rename to .mock/definition/CRM/engagements.yml index aaf88ac..194abfd 100644 --- a/.mock/definition/crm/engagements.yml +++ b/.mock/definition/CRM/engagements.yml @@ -1,66 +1,22 @@ types: - EngagementsListRequestExpand: + EngagementsListRequestExpandItem: enum: - account - - value: account,engagement_type - name: AccountEngagementType - contacts - - value: contacts,account - name: ContactsAccount - - value: contacts,account,engagement_type - name: ContactsAccountEngagementType - - value: contacts,engagement_type - name: ContactsEngagementType - - value: contacts,owner - name: ContactsOwner - - value: contacts,owner,account - name: ContactsOwnerAccount - - value: contacts,owner,account,engagement_type - name: ContactsOwnerAccountEngagementType - - value: contacts,owner,engagement_type - name: ContactsOwnerEngagementType - engagement_type - owner - - value: owner,account - name: OwnerAccount - - value: owner,account,engagement_type - name: OwnerAccountEngagementType - - value: owner,engagement_type - name: OwnerEngagementType source: - openapi: openapi/openapi.yml - EngagementsRetrieveRequestExpand: + openapi: crm_v3.yml + EngagementsRetrieveRequestExpandItem: enum: - account - - value: account,engagement_type - name: AccountEngagementType - contacts - - value: contacts,account - name: ContactsAccount - - value: contacts,account,engagement_type - name: ContactsAccountEngagementType - - value: contacts,engagement_type - name: ContactsEngagementType - - value: contacts,owner - name: ContactsOwner - - value: contacts,owner,account - name: ContactsOwnerAccount - - value: contacts,owner,account,engagement_type - name: ContactsOwnerAccountEngagementType - - value: contacts,owner,engagement_type - name: ContactsOwnerEngagementType - engagement_type - owner - - value: owner,account - name: OwnerAccount - - value: owner,account,engagement_type - name: OwnerAccountEngagementType - - value: owner,engagement_type - name: OwnerEngagementType source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -68,10 +24,15 @@ service: list: path: /crm/v1/engagements method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Engagement` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: EngagementsListRequest query-parameters: @@ -87,7 +48,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -142,10 +104,25 @@ service: datetime. response: docs: '' - type: root.PaginatedEngagementList + type: crmRoot.PaginatedEngagementList status-code: 200 examples: - - headers: {} + - 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 @@ -180,10 +157,11 @@ service: create: path: /crm/v1/engagements method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `Engagement` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: EngagementEndpointRequest query-parameters: @@ -197,14 +175,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.EngagementRequest + model: crmRoot.EngagementRequest content-type: application/json response: docs: '' - type: root.EngagementResponse + type: crmRoot.EngagementResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -259,17 +241,19 @@ service: retrieve: path: /crm/v1/engagements/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Engagement` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: name: EngagementsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -290,12 +274,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Engagement + type: crmRoot.Engagement status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -329,10 +318,11 @@ service: partialUpdate: path: /crm/v1/engagements/{id} method: PATCH - auth: true + auth: + - tokenAuth: [] docs: Updates an `Engagement` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -348,16 +338,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.PatchedEngagementRequest + model: crmRoot.PatchedEngagementRequest content-type: application/json response: docs: '' - type: root.EngagementResponse + type: crmRoot.EngagementResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -412,20 +406,22 @@ service: metaPatchRetrieve: path: /crm/v1/engagements/meta/patch/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Engagement` PATCHs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -600,16 +596,18 @@ service: metaPostRetrieve: path: /crm/v1/engagements/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Engagement` POSTs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -784,10 +782,15 @@ service: remoteFieldClassesList: path: /crm/v1/engagements/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: EngagementsRemoteFieldClassesListRequest query-parameters: @@ -832,10 +835,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -852,4 +865,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/fieldMapping.yml b/.mock/definition/CRM/fieldMapping.yml similarity index 94% rename from .mock/definition/crm/fieldMapping.yml rename to .mock/definition/CRM/fieldMapping.yml index 5318dcf..efd75ff 100644 --- a/.mock/definition/crm/fieldMapping.yml +++ b/.mock/definition/CRM/fieldMapping.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,14 +7,15 @@ service: field_mappings_retrieve: path: /crm/v1/field-mappings method: GET - auth: true + 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: openapi/openapi.yml + openapi: crm_v3.yml request: name: FieldMappingsRetrieveRequest query-parameters: @@ -27,10 +28,13 @@ service: of the request since these fields require some calculations. response: docs: '' - type: root.FieldMappingApiInstanceResponse + type: crmRoot.FieldMappingApiInstanceResponse status-code: 200 examples: - - headers: {} + - query-parameters: + exclude_remote_field_metadata: true + headers: + X-Account-Token: X-Account-Token response: body: Account: @@ -180,13 +184,14 @@ service: field_mappings_create: path: /crm/v1/field-mappings method: POST - auth: true + 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: openapi/openapi.yml + openapi: crm_v3.yml request: name: CreateFieldMappingRequest query-parameters: @@ -242,10 +247,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: crmRoot.FieldMappingInstanceResponse status-code: 201 examples: - - headers: {} + - 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 @@ -295,24 +303,26 @@ service: field_mappings_destroy: path: /crm/v1/field-mappings/{field_mapping_id} method: DELETE - auth: true + 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: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: field_mapping_id: string response: docs: '' - type: root.FieldMappingInstanceResponse + type: crmRoot.FieldMappingInstanceResponse status-code: 204 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: model: @@ -354,13 +364,14 @@ service: field_mappings_partial_update: path: /crm/v1/field-mappings/{field_mapping_id} method: PATCH - auth: true + 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: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: field_mapping_id: string request: @@ -389,12 +400,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: crmRoot.FieldMappingInstanceResponse status-code: 200 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token request: {} response: body: @@ -437,7 +449,8 @@ service: remote_fields_retrieve: path: /crm/v1/remote-fields method: GET - auth: true + 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 @@ -445,7 +458,7 @@ service: or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: RemoteFieldsRetrieveRequest query-parameters: @@ -462,10 +475,14 @@ service: data from your customers. response: docs: '' - type: root.RemoteFieldApiResponse + type: crmRoot.RemoteFieldApiResponse status-code: 200 examples: - - headers: {} + - query-parameters: + common_models: common_models + include_example_values: include_example_values + headers: + X-Account-Token: X-Account-Token response: body: Account: @@ -597,7 +614,8 @@ service: target_fields_retrieve: path: /crm/v1/target-fields method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields @@ -605,13 +623,14 @@ service: Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.ExternalTargetFieldApiResponse + type: crmRoot.ExternalTargetFieldApiResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: Account: @@ -651,4 +670,4 @@ service: description: this is a example description of a target field is_mapped: is_mapped source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/forceResync.yml b/.mock/definition/CRM/forceResync.yml similarity index 83% rename from .mock/definition/crm/forceResync.yml rename to .mock/definition/CRM/forceResync.yml index eb74ba1..0e4c7b7 100644 --- a/.mock/definition/crm/forceResync.yml +++ b/.mock/definition/CRM/forceResync.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: sync_status_resync_create: path: /crm/v1/sync-status/resync method: POST - auth: true + 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 @@ -15,13 +16,14 @@ service: linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - model_name: Account @@ -34,4 +36,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/generateKey.yml b/.mock/definition/CRM/generateKey.yml similarity index 75% rename from .mock/definition/crm/generateKey.yml rename to .mock/definition/CRM/generateKey.yml index 233479d..939253d 100644 --- a/.mock/definition/crm/generateKey.yml +++ b/.mock/definition/CRM/generateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /crm/v1/generate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Create a remote key. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: GenerateRemoteKeyRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: crmRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/issues.yml b/.mock/definition/CRM/issues.yml similarity index 76% rename from .mock/definition/crm/issues.yml rename to .mock/definition/CRM/issues.yml index ed21c69..5f20722 100644 --- a/.mock/definition/crm/issues.yml +++ b/.mock/definition/CRM/issues.yml @@ -4,9 +4,9 @@ types: - ONGOING - RESOLVED source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -14,10 +14,15 @@ service: list: path: /crm/v1/issues method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets all issues for Organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: IssuesListRequest query-parameters: @@ -77,10 +82,27 @@ service: * `RESOLVED` - RESOLVED response: docs: '' - type: root.PaginatedIssueList + type: crmRoot.PaginatedIssueList status-code: 200 examples: - - response: + - 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 @@ -99,19 +121,22 @@ service: retrieve: path: /crm/v1/issues/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Get a specific issue. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string response: docs: '' - type: root.Issue + 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 @@ -126,4 +151,4 @@ service: - Missing employee permissions. - Missing time off permissions. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/leads.yml b/.mock/definition/CRM/leads.yml similarity index 88% rename from .mock/definition/crm/leads.yml rename to .mock/definition/CRM/leads.yml index d487027..8533bc1 100644 --- a/.mock/definition/crm/leads.yml +++ b/.mock/definition/CRM/leads.yml @@ -1,36 +1,20 @@ types: - LeadsListRequestExpand: + LeadsListRequestExpandItem: enum: - converted_account - converted_contact - - value: converted_contact,converted_account - name: ConvertedContactConvertedAccount - owner - - value: owner,converted_account - name: OwnerConvertedAccount - - value: owner,converted_contact - name: OwnerConvertedContact - - value: owner,converted_contact,converted_account - name: OwnerConvertedContactConvertedAccount source: - openapi: openapi/openapi.yml - LeadsRetrieveRequestExpand: + openapi: crm_v3.yml + LeadsRetrieveRequestExpandItem: enum: - converted_account - converted_contact - - value: converted_contact,converted_account - name: ConvertedContactConvertedAccount - owner - - value: owner,converted_account - name: OwnerConvertedAccount - - value: owner,converted_contact - name: OwnerConvertedContact - - value: owner,converted_contact,converted_account - name: OwnerConvertedContactConvertedAccount source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -38,10 +22,15 @@ service: list: path: /crm/v1/leads method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Lead` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: LeadsListRequest query-parameters: @@ -68,7 +57,8 @@ service: If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -121,10 +111,28 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedLeadList + type: crmRoot.PaginatedLeadList status-code: 200 examples: - - headers: {} + - 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 @@ -149,7 +157,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping email_addresses: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -180,10 +188,11 @@ service: create: path: /crm/v1/leads method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Lead` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: LeadEndpointRequest query-parameters: @@ -197,14 +206,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.LeadRequest + model: crmRoot.LeadRequest content-type: application/json response: docs: '' - type: root.LeadResponse + type: crmRoot.LeadResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -229,7 +242,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping email_addresses: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -280,17 +293,19 @@ service: retrieve: path: /crm/v1/leads/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Lead` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: name: LeadsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -311,12 +326,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Lead + type: crmRoot.Lead status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -338,7 +358,7 @@ service: state: CA postal_code: '94122' country: US - address_type: BILLING + address_type: Shipping email_addresses: - created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' @@ -371,16 +391,18 @@ service: metaPostRetrieve: path: /crm/v1/leads/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Lead` POSTs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -555,10 +577,15 @@ service: remoteFieldClassesList: path: /crm/v1/leads/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: LeadsRemoteFieldClassesListRequest query-parameters: @@ -603,10 +630,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -623,4 +660,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/linkToken.yml b/.mock/definition/CRM/linkToken.yml similarity index 85% rename from .mock/definition/crm/linkToken.yml rename to .mock/definition/CRM/linkToken.yml index 036f826..b1945f3 100644 --- a/.mock/definition/crm/linkToken.yml +++ b/.mock/definition/CRM/linkToken.yml @@ -1,5 +1,22 @@ imports: - root: __package__.yml + 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: '' @@ -7,10 +24,11 @@ service: create: path: /crm/v1/link-token method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a link token to be used when linking a new end user. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: EndUserDetailsRequest body: @@ -41,7 +59,7 @@ service: maxLength: 100 categories: docs: The integration categories to show in Merge Link. - type: list + type: list integration: type: optional docs: >- @@ -76,7 +94,7 @@ service: https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. default: false common_models: - type: optional> + 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 @@ -86,14 +104,14 @@ service: category_common_model_scopes: type: >- optional>>> + 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 + type: optional docs: >- The following subset of IETF language tags can be used to configure localization. @@ -116,10 +134,12 @@ service: content-type: application/json response: docs: '' - type: root.LinkToken + type: crmRoot.LinkToken status-code: 200 examples: - - request: + - 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' @@ -132,4 +152,4 @@ service: integration_name: Lever magic_link_url: https://link.merge.dev/asdfjkl12345jsndfgi2i83n source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/linkedAccounts.yml b/.mock/definition/CRM/linkedAccounts.yml similarity index 83% rename from .mock/definition/crm/linkedAccounts.yml rename to .mock/definition/CRM/linkedAccounts.yml index c6f4399..f938ea5 100644 --- a/.mock/definition/crm/linkedAccounts.yml +++ b/.mock/definition/CRM/linkedAccounts.yml @@ -9,9 +9,9 @@ types: - mktg - ticketing source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -19,10 +19,15 @@ service: list: path: /crm/v1/linked-accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: List linked accounts for your organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: LinkedAccountsListRequest query-parameters: @@ -104,10 +109,26 @@ service: `RELINK_NEEDED` response: docs: '' - type: root.PaginatedAccountDetailsAndActionsList + type: crmRoot.PaginatedAccountDetailsAndActionsList status-code: 200 examples: - - response: + - 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 @@ -145,4 +166,4 @@ service: account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/notes.yml b/.mock/definition/CRM/notes.yml similarity index 88% rename from .mock/definition/crm/notes.yml rename to .mock/definition/CRM/notes.yml index df9293a..de0873c 100644 --- a/.mock/definition/crm/notes.yml +++ b/.mock/definition/CRM/notes.yml @@ -1,66 +1,22 @@ types: - NotesListRequestExpand: + NotesListRequestExpandItem: enum: - account - - value: account,opportunity - name: AccountOpportunity - contact - - value: contact,account - name: ContactAccount - - value: contact,account,opportunity - name: ContactAccountOpportunity - - value: contact,opportunity - name: ContactOpportunity - opportunity - owner - - value: owner,account - name: OwnerAccount - - value: owner,account,opportunity - name: OwnerAccountOpportunity - - value: owner,contact - name: OwnerContact - - value: owner,contact,account - name: OwnerContactAccount - - value: owner,contact,account,opportunity - name: OwnerContactAccountOpportunity - - value: owner,contact,opportunity - name: OwnerContactOpportunity - - value: owner,opportunity - name: OwnerOpportunity source: - openapi: openapi/openapi.yml - NotesRetrieveRequestExpand: + openapi: crm_v3.yml + NotesRetrieveRequestExpandItem: enum: - account - - value: account,opportunity - name: AccountOpportunity - contact - - value: contact,account - name: ContactAccount - - value: contact,account,opportunity - name: ContactAccountOpportunity - - value: contact,opportunity - name: ContactOpportunity - opportunity - owner - - value: owner,account - name: OwnerAccount - - value: owner,account,opportunity - name: OwnerAccountOpportunity - - value: owner,contact - name: OwnerContact - - value: owner,contact,account - name: OwnerContactAccount - - value: owner,contact,account,opportunity - name: OwnerContactAccountOpportunity - - value: owner,contact,opportunity - name: OwnerContactOpportunity - - value: owner,opportunity - name: OwnerOpportunity source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -68,10 +24,15 @@ service: list: path: /crm/v1/notes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Note` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: NotesListRequest query-parameters: @@ -93,7 +54,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -144,10 +106,27 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedNoteList + type: crmRoot.PaginatedNoteList status-code: 200 examples: - - headers: {} + - 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 @@ -179,10 +158,11 @@ service: create: path: /crm/v1/notes method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Note` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: NoteEndpointRequest query-parameters: @@ -196,14 +176,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.NoteRequest + model: crmRoot.NoteRequest content-type: application/json response: docs: '' - type: root.NoteResponse + type: crmRoot.NoteResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -255,17 +239,19 @@ service: retrieve: path: /crm/v1/notes/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Note` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: name: NotesRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -286,12 +272,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Note + type: crmRoot.Note status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -322,16 +313,18 @@ service: metaPostRetrieve: path: /crm/v1/notes/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Note` POSTs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -506,10 +499,15 @@ service: remoteFieldClassesList: path: /crm/v1/notes/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: NotesRemoteFieldClassesListRequest query-parameters: @@ -554,10 +552,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -574,4 +582,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/opportunities.yml b/.mock/definition/CRM/opportunities.yml similarity index 90% rename from .mock/definition/crm/opportunities.yml rename to .mock/definition/CRM/opportunities.yml index 4a0253a..5b149aa 100644 --- a/.mock/definition/crm/opportunities.yml +++ b/.mock/definition/CRM/opportunities.yml @@ -1,43 +1,27 @@ types: - OpportunitiesListRequestExpand: + OpportunitiesListRequestExpandItem: enum: - account - owner - - value: owner,account - name: OwnerAccount - - value: owner,stage - name: OwnerStage - - value: owner,stage,account - name: OwnerStageAccount - stage - - value: stage,account - name: StageAccount source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml OpportunitiesListRequestStatus: enum: - LOST - OPEN - WON source: - openapi: openapi/openapi.yml - OpportunitiesRetrieveRequestExpand: + openapi: crm_v3.yml + OpportunitiesRetrieveRequestExpandItem: enum: - account - owner - - value: owner,account - name: OwnerAccount - - value: owner,stage - name: OwnerStage - - value: owner,stage,account - name: OwnerStageAccount - stage - - value: stage,account - name: StageAccount source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -45,10 +29,15 @@ service: list: path: /crm/v1/opportunities method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Opportunity` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: OpportunitiesListRequest query-parameters: @@ -67,7 +56,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -145,10 +135,30 @@ service: * `LOST` - LOST response: docs: '' - type: root.PaginatedOpportunityList + type: crmRoot.PaginatedOpportunityList status-code: 200 examples: - - headers: {} + - 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 @@ -183,10 +193,11 @@ service: create: path: /crm/v1/opportunities method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `Opportunity` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: OpportunityEndpointRequest query-parameters: @@ -200,14 +211,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.OpportunityRequest + model: crmRoot.OpportunityRequest content-type: application/json response: docs: '' - type: root.OpportunityResponse + type: crmRoot.OpportunityResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -262,17 +277,19 @@ service: retrieve: path: /crm/v1/opportunities/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Opportunity` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: name: OpportunitiesRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -303,12 +320,19 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Opportunity + type: crmRoot.Opportunity status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -342,10 +366,11 @@ service: partialUpdate: path: /crm/v1/opportunities/{id} method: PATCH - auth: true + auth: + - tokenAuth: [] docs: Updates an `Opportunity` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -361,16 +386,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.PatchedOpportunityRequest + model: crmRoot.PatchedOpportunityRequest content-type: application/json response: docs: '' - type: root.OpportunityResponse + type: crmRoot.OpportunityResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -425,20 +454,22 @@ service: metaPatchRetrieve: path: /crm/v1/opportunities/meta/patch/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Opportunity` PATCHs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -613,16 +644,18 @@ service: metaPostRetrieve: path: /crm/v1/opportunities/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Opportunity` POSTs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -797,10 +830,15 @@ service: remoteFieldClassesList: path: /crm/v1/opportunities/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: OpportunitiesRemoteFieldClassesListRequest query-parameters: @@ -845,10 +883,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -865,4 +913,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/passthrough.yml b/.mock/definition/CRM/passthrough.yml similarity index 75% rename from .mock/definition/crm/passthrough.yml rename to .mock/definition/CRM/passthrough.yml index 902b459..98ff45f 100644 --- a/.mock/definition/crm/passthrough.yml +++ b/.mock/definition/CRM/passthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,21 @@ service: create: path: /crm/v1/passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: Pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: - body: root.DataPassthroughRequest + body: crmRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.RemoteResponse + type: crmRoot.RemoteResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -37,4 +39,4 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/regenerateKey.yml b/.mock/definition/CRM/regenerateKey.yml similarity index 76% rename from .mock/definition/crm/regenerateKey.yml rename to .mock/definition/CRM/regenerateKey.yml index 06a1b85..a926ee2 100644 --- a/.mock/definition/crm/regenerateKey.yml +++ b/.mock/definition/CRM/regenerateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /crm/v1/regenerate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Exchange remote keys. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: RemoteKeyForRegenerationRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: crmRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/scopes.yml b/.mock/definition/CRM/scopes.yml similarity index 87% rename from .mock/definition/crm/scopes.yml rename to .mock/definition/CRM/scopes.yml index 67286e7..1c60baa 100644 --- a/.mock/definition/crm/scopes.yml +++ b/.mock/definition/CRM/scopes.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,22 @@ service: default_scopes_retrieve: path: /crm/v1/default-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: crmRoot.CommonModelScopeApi status-code: 200 examples: - - response: + - headers: + X-Account-Token: '[object Object]' + response: body: common_models: - model_name: Employee @@ -48,19 +51,21 @@ service: linked_account_scopes_retrieve: path: /crm/v1/linked-account-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: crmRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: common_models: @@ -90,28 +95,30 @@ service: linked_account_scopes_create: path: /crm/v1/linked-account-scopes method: POST - auth: true + 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: openapi/openapi.yml + openapi: crm_v3.yml request: name: LinkedAccountCommonModelScopeDeserializerRequest body: properties: common_models: docs: The common models you want to update the scopes for - type: list + type: list content-type: application/json response: docs: '' - type: root.CommonModelScopeApi + type: crmRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: common_models: - model_name: Employee @@ -157,4 +164,4 @@ service: - manager - work_location source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/stages.yml b/.mock/definition/CRM/stages.yml similarity index 81% rename from .mock/definition/crm/stages.yml rename to .mock/definition/CRM/stages.yml index a8676fa..74830b9 100644 --- a/.mock/definition/crm/stages.yml +++ b/.mock/definition/CRM/stages.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /crm/v1/stages method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Stage` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: StagesListRequest query-parameters: @@ -66,10 +71,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedStageList + type: crmRoot.PaginatedStageList status-code: 200 examples: - - headers: {} + - 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 @@ -95,10 +113,11 @@ service: retrieve: path: /crm/v1/stages/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Stage` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -121,12 +140,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Stage + type: crmRoot.Stage status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -151,10 +175,15 @@ service: remoteFieldClassesList: path: /crm/v1/stages/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: StagesRemoteFieldClassesListRequest query-parameters: @@ -199,10 +228,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -219,4 +258,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/syncStatus.yml b/.mock/definition/CRM/syncStatus.yml similarity index 84% rename from .mock/definition/crm/syncStatus.yml rename to .mock/definition/CRM/syncStatus.yml index 52d8c36..ec796fc 100644 --- a/.mock/definition/crm/syncStatus.yml +++ b/.mock/definition/CRM/syncStatus.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: list: path: /crm/v1/sync-status method: GET - auth: true + 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. @@ -21,7 +22,7 @@ service: about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: SyncStatusListRequest query-parameters: @@ -33,10 +34,14 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedSyncStatusList + type: crmRoot.PaginatedSyncStatusList status-code: 200 examples: - - headers: {} + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + page_size: 1 + headers: + X-Account-Token: X-Account-Token response: body: next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw @@ -52,4 +57,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/tasks.yml b/.mock/definition/CRM/tasks.yml similarity index 90% rename from .mock/definition/crm/tasks.yml rename to .mock/definition/CRM/tasks.yml index befb0c5..b91eaeb 100644 --- a/.mock/definition/crm/tasks.yml +++ b/.mock/definition/CRM/tasks.yml @@ -1,36 +1,20 @@ types: - TasksListRequestExpand: + TasksListRequestExpandItem: enum: - account - - value: account,opportunity - name: AccountOpportunity - opportunity - owner - - value: owner,account - name: OwnerAccount - - value: owner,account,opportunity - name: OwnerAccountOpportunity - - value: owner,opportunity - name: OwnerOpportunity source: - openapi: openapi/openapi.yml - TasksRetrieveRequestExpand: + openapi: crm_v3.yml + TasksRetrieveRequestExpandItem: enum: - account - - value: account,opportunity - name: AccountOpportunity - opportunity - owner - - value: owner,account - name: OwnerAccount - - value: owner,account,opportunity - name: OwnerAccountOpportunity - - value: owner,opportunity - name: OwnerOpportunity source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -38,10 +22,15 @@ service: list: path: /crm/v1/tasks method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Task` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: TasksListRequest query-parameters: @@ -57,7 +46,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -102,10 +92,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedTaskList + type: crmRoot.PaginatedTaskList status-code: 200 examples: - - headers: {} + - 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 @@ -138,10 +141,11 @@ service: create: path: /crm/v1/tasks method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Task` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: TaskEndpointRequest query-parameters: @@ -155,14 +159,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.TaskRequest + model: crmRoot.TaskRequest content-type: application/json response: docs: '' - type: root.TaskResponse + type: crmRoot.TaskResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -215,17 +223,19 @@ service: retrieve: path: /crm/v1/tasks/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Task` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: name: TasksRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -246,12 +256,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Task + type: crmRoot.Task status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -283,10 +298,11 @@ service: partialUpdate: path: /crm/v1/tasks/{id} method: PATCH - auth: true + auth: + - tokenAuth: [] docs: Updates a `Task` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -302,16 +318,20 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.PatchedTaskRequest + model: crmRoot.PatchedTaskRequest content-type: application/json response: docs: '' - type: root.TaskResponse + type: crmRoot.TaskResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -364,20 +384,22 @@ service: metaPatchRetrieve: path: /crm/v1/tasks/meta/patch/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Task` PATCHs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - path-parameters: id: id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -552,16 +574,18 @@ service: metaPostRetrieve: path: /crm/v1/tasks/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Task` POSTs. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: root.MetaResponse + type: crmRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -736,10 +760,15 @@ service: remoteFieldClassesList: path: /crm/v1/tasks/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: TasksRemoteFieldClassesListRequest query-parameters: @@ -784,10 +813,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -804,4 +843,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/users.yml b/.mock/definition/CRM/users.yml similarity index 81% rename from .mock/definition/crm/users.yml rename to .mock/definition/CRM/users.yml index 6762984..350a5a2 100644 --- a/.mock/definition/crm/users.yml +++ b/.mock/definition/CRM/users.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /crm/v1/users method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `User` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: UsersListRequest query-parameters: @@ -69,10 +74,24 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedUserList + type: crmRoot.PaginatedUserList status-code: 200 examples: - - headers: {} + - 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 @@ -100,10 +119,11 @@ service: retrieve: path: /crm/v1/users/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `User` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: id: string request: @@ -126,12 +146,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.User + type: crmRoot.User status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -158,32 +183,39 @@ service: ignoreCreate: path: /crm/v1/users/ignore/{model_id} method: POST - auth: true + 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: openapi/openapi.yml + openapi: crm_v3.yml path-parameters: model_id: string request: - body: root.IgnoreCommonModelRequest + body: crmRoot.IgnoreCommonModelRequest content-type: application/json examples: - path-parameters: model_id: model_id - headers: {} + headers: + X-Account-Token: X-Account-Token request: reason: GENERAL_CUSTOMER_REQUEST remoteFieldClassesList: path: /crm/v1/users/remote-field-classes method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `RemoteFieldClass` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: UsersRemoteFieldClassesListRequest query-parameters: @@ -228,10 +260,20 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedRemoteFieldClassList + type: crmRoot.PaginatedRemoteFieldClassList status-code: 200 examples: - - headers: {} + - 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 @@ -248,4 +290,4 @@ service: field_choices: - {} source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/crm/webhookReceivers.yml b/.mock/definition/CRM/webhookReceivers.yml similarity index 75% rename from .mock/definition/crm/webhookReceivers.yml rename to .mock/definition/CRM/webhookReceivers.yml index c68cd98..03ae2b0 100644 --- a/.mock/definition/crm/webhookReceivers.yml +++ b/.mock/definition/CRM/webhookReceivers.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + crmRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: list: path: /crm/v1/webhook-receivers method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `WebhookReceiver` objects. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - event: event @@ -25,10 +27,11 @@ service: create: path: /crm/v1/webhook-receivers method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `WebhookReceiver` object with the given values. source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml request: name: WebhookReceiverRequest body: @@ -45,10 +48,11 @@ service: content-type: application/json response: docs: '' - type: root.WebhookReceiver + type: crmRoot.WebhookReceiver status-code: 201 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: event: event is_active: true @@ -58,4 +62,4 @@ service: is_active: true key: key source: - openapi: openapi/openapi.yml + openapi: crm_v3.yml diff --git a/.mock/definition/filestorage/__package__.yml b/.mock/definition/FileStorage/__package__.yml similarity index 83% rename from .mock/definition/filestorage/__package__.yml rename to .mock/definition/FileStorage/__package__.yml index 1d955bc..f07c96e 100644 --- a/.mock/definition/filestorage/__package__.yml +++ b/.mock/definition/FileStorage/__package__.yml @@ -1,4 +1,12 @@ types: + AccountDetailsCategory: + discriminated: false + union: + - CategoryEnum + - string + source: + openapi: filestorage_v3.yml + inline: true AccountDetails: properties: id: @@ -12,7 +20,7 @@ types: integration_slug: type: optional access: read-only - category: optional + category: optional end_user_origin_id: type: optional access: read-only @@ -47,7 +55,23 @@ types: type: optional docs: The time at which account completes the linking flow. source: - openapi: openapi/openapi.yml + 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 @@ -63,8 +87,8 @@ types: View a list of your organization's `LinkedAccount` objects. properties: id: string - category: optional - status: AccountDetailsAndActionsStatusEnum + category: optional + status: AccountDetailsAndActionsStatus status_detail: optional end_user_origin_id: optional end_user_organization_name: string @@ -83,9 +107,8 @@ types: integration: optional account_type: string completed_at: datetime - integration_specific_fields: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml AccountDetailsAndActionsIntegration: properties: name: string @@ -97,7 +120,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml AccountDetailsAndActionsStatusEnum: enum: - COMPLETE @@ -110,7 +133,7 @@ types: * `RELINK_NEEDED` - RELINK_NEEDED * `IDLE` - IDLE source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml AccountIntegration: properties: name: @@ -168,14 +191,14 @@ types: docs: Category or categories this integration is in beta status for. access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml AccountToken: properties: account_token: string integration: AccountIntegration id: string source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml AdvancedMetadata: properties: id: @@ -188,7 +211,7 @@ types: is_custom: optional field_choices: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml AsyncPassthroughReciept: properties: async_passthrough_receipt_id: @@ -196,7 +219,142 @@ types: validation: format: uuid source: - openapi: openapi/openapi.yml + 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: @@ -216,7 +374,7 @@ types: format: email maxLength: 254 role: - type: RoleEnum + 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. @@ -238,7 +396,7 @@ types: validation: maxLength: 45 event_type: - type: EventTypeEnum + type: AuditLogEventEventType docs: >- Designates the type of event that occurred. @@ -349,7 +507,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml AvailableActions: docs: >- # The AvailableActions Object @@ -368,7 +526,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml CategoriesEnum: enum: - hris @@ -387,7 +545,7 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml CategoryEnum: enum: - hris @@ -406,14 +564,14 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml CommonModelScopeApi: properties: common_models: docs: The common models you want to update the scopes for type: list source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml CommonModelScopesBodyRequest: properties: model_id: @@ -423,7 +581,7 @@ types: enabled_actions: list disabled_fields: list source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml DataPassthroughRequest: docs: >- # The DataPassthrough Object @@ -477,21 +635,21 @@ types: `{"type": T, "value": ...}` where `T` will be one of `string, boolean, number, null, array, object`. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml DebugModeLog: properties: log_id: string dashboard_view: string log_summary: DebugModelLogSummary source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml DebugModelLogSummary: properties: url: string method: string status_code: integer source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml DownloadRequestMeta: properties: id: string @@ -499,7 +657,7 @@ types: method: string headers: map source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml Drive: docs: >- # The Drive Object @@ -558,7 +716,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml EnabledActionsEnum: enum: - READ @@ -567,7 +725,7 @@ types: * `READ` - READ * `WRITE` - WRITE source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml EncodingEnum: enum: - RAW @@ -578,7 +736,7 @@ types: * `BASE64` - BASE64 * `GZIP_BASE64` - GZIP_BASE64 source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml ErrorValidationProblem: properties: source: optional @@ -586,7 +744,7 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml EventTypeEnum: enum: - CREATED_REMOTE_PRODUCTION_API_KEY @@ -733,7 +891,7 @@ types: * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml ExternalTargetFieldApi: properties: name: @@ -746,7 +904,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml ExternalTargetFieldApiResponse: properties: File: optional> @@ -755,14 +913,14 @@ types: Group: optional> User: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FieldMappingApiInstanceTargetField: properties: name: string description: string is_organization_wide: boolean source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: properties: @@ -770,7 +928,7 @@ types: url_path: optional field_traversal_path: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FieldMappingApiInstanceRemoteField: properties: @@ -778,7 +936,7 @@ types: schema: optional> remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FieldMappingApiInstance: properties: @@ -797,7 +955,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FieldMappingApiInstanceResponse: properties: File: optional> @@ -806,7 +964,7 @@ types: Group: optional> User: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FieldMappingInstanceResponse: properties: model: FieldMappingApiInstance @@ -814,19 +972,19 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FieldPermissionDeserializer: properties: enabled_fields: optional> disabled_fields: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FieldPermissionDeserializerRequest: properties: enabled_fields: optional> disabled_fields: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FileFolder: discriminated: false docs: The folder that the file belongs to. @@ -836,7 +994,7 @@ types: format: uuid - Folder source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FilePermissionsItem: discriminated: false @@ -846,7 +1004,7 @@ types: format: uuid - Permission source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FilePermissions: discriminated: false @@ -861,7 +1019,7 @@ types: - Permission - list source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FileDrive: discriminated: false @@ -872,7 +1030,7 @@ types: format: uuid - Drive source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true File: docs: >- @@ -974,7 +1132,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FileRequestFolder: discriminated: false docs: The folder that the file belongs to. @@ -984,7 +1142,7 @@ types: format: uuid - Folder source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FileRequestPermissionsItem: discriminated: false @@ -994,7 +1152,7 @@ types: format: uuid - PermissionRequest source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FileRequestPermissions: discriminated: false @@ -1009,7 +1167,7 @@ types: - PermissionRequest - list source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FileRequestDrive: discriminated: false @@ -1020,7 +1178,7 @@ types: format: uuid - Drive source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FileRequest: docs: >- @@ -1092,7 +1250,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FileStorageFileResponse: properties: model: File @@ -1100,7 +1258,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FileStorageFolderResponse: properties: model: Folder @@ -1108,7 +1266,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FolderParentFolder: discriminated: false docs: The folder that the folder belongs to. @@ -1118,7 +1276,7 @@ types: format: uuid - Folder source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FolderDrive: discriminated: false @@ -1129,7 +1287,7 @@ types: format: uuid - Drive source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FolderPermissionsItem: discriminated: false @@ -1139,7 +1297,7 @@ types: format: uuid - Permission source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FolderPermissions: discriminated: false @@ -1154,7 +1312,7 @@ types: - Permission - list source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true Folder: docs: >- @@ -1238,7 +1396,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FolderRequestParentFolder: discriminated: false docs: The folder that the folder belongs to. @@ -1248,7 +1406,7 @@ types: format: uuid - Folder source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FolderRequestDrive: discriminated: false @@ -1259,7 +1417,7 @@ types: format: uuid - Drive source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FolderRequestPermissionsItem: discriminated: false @@ -1269,7 +1427,7 @@ types: format: uuid - PermissionRequest source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FolderRequestPermissions: discriminated: false @@ -1284,7 +1442,7 @@ types: - PermissionRequest - list source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true FolderRequest: docs: >- @@ -1338,7 +1496,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml GroupChildGroupsItem: discriminated: false union: @@ -1347,7 +1505,7 @@ types: format: uuid - Group source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true Group: docs: >- @@ -1409,14 +1567,14 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml IndividualCommonModelScopeDeserializer: properties: model_name: string model_permissions: optional> field_permissions: optional source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml IndividualCommonModelScopeDeserializerRequest: properties: model_name: @@ -1426,7 +1584,20 @@ types: model_permissions: optional> field_permissions: optional source: - openapi: openapi/openapi.yml + 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: @@ -1435,7 +1606,7 @@ types: format: uuid access: read-only status: - type: optional + type: optional docs: |- Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -1454,7 +1625,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml IssueStatusEnum: enum: - ONGOING @@ -1463,7 +1634,7 @@ types: * `ONGOING` - ONGOING * `RESOLVED` - RESOLVED source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml LanguageEnum: enum: - en @@ -1472,7 +1643,7 @@ types: * `en` - en * `de` - de source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml LastSyncResultEnum: enum: - SYNCING @@ -1489,20 +1660,20 @@ types: * `PAUSED` - PAUSED * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml LinkToken: properties: link_token: string integration_name: optional magic_link_url: optional source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml LinkedAccountStatus: properties: linked_account_status: string can_make_request: boolean source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml MetaResponse: properties: request_schema: map @@ -1511,7 +1682,7 @@ types: has_conditional_params: boolean has_required_linked_account_params: boolean source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml MethodEnum: enum: - GET @@ -1530,7 +1701,7 @@ types: * `PATCH` - PATCH * `DELETE` - DELETE source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml ModelOperation: docs: >- # The ModelOperation Object @@ -1550,17 +1721,31 @@ types: required_post_parameters: list supported_fields: list source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml ModelPermissionDeserializer: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml ModelPermissionDeserializerRequest: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + 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 @@ -1586,7 +1771,7 @@ types: validation: minLength: 1 encoding: - type: optional + type: optional docs: |- The encoding of the value of `data`. Defaults to `RAW` if not defined. @@ -1604,77 +1789,77 @@ types: validation: minLength: 1 source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedAccountDetailsAndActionsList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedAuditLogEventList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedDownloadRequestMetaList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedDriveList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedFileList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedFolderList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedGroupList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedIssueList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedSyncStatusList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PaginatedUserList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PermissionUser: discriminated: false docs: >- @@ -1686,7 +1871,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true PermissionGroup: discriminated: false @@ -1699,7 +1884,36 @@ types: format: uuid - Group source: - openapi: openapi/openapi.yml + 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: >- @@ -1744,7 +1958,7 @@ types: The group that is granted this permission. This will only be populated if the type is `GROUP`. type: - type: optional + type: optional docs: |- Denotes what type of people have access to the file. @@ -1753,7 +1967,7 @@ types: * `COMPANY` - COMPANY * `ANYONE` - ANYONE roles: - type: optional> + 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 @@ -1761,7 +1975,7 @@ types: `OWNER`. In cases where there is no clear mapping, the original value passed through will be returned. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml PermissionRequestUser: discriminated: false docs: >- @@ -1773,7 +1987,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true PermissionRequestGroup: discriminated: false @@ -1786,7 +2000,36 @@ types: format: uuid - Group source: - openapi: openapi/openapi.yml + 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: >- @@ -1818,7 +2061,7 @@ types: The group that is granted this permission. This will only be populated if the type is `GROUP`. type: - type: optional + type: optional docs: |- Denotes what type of people have access to the file. @@ -1827,7 +2070,7 @@ types: * `COMPANY` - COMPANY * `ANYONE` - ANYONE roles: - type: optional> + 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 @@ -1841,7 +2084,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml RemoteData: docs: >- # The RemoteData Object @@ -1863,21 +2106,21 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml RemoteEndpointInfo: properties: method: string url_path: string field_traversal_path: list source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml RemoteFieldApiCoverage: discriminated: false union: - integer - double source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml inline: true RemoteFieldApi: properties: @@ -1890,7 +2133,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml RemoteFieldApiResponse: properties: File: optional> @@ -1899,7 +2142,7 @@ types: Group: optional> User: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml RemoteKey: docs: >- # The RemoteKey Object @@ -1917,7 +2160,15 @@ types: name: string key: string source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml + RemoteResponseResponseType: + discriminated: false + union: + - ResponseTypeEnum + - string + source: + openapi: filestorage_v3.yml + inline: true RemoteResponse: docs: >- # The RemoteResponse Object @@ -1937,10 +2188,10 @@ types: status: integer response: unknown response_headers: optional> - response_type: optional + response_type: optional headers: optional> source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml RequestFormatEnum: enum: - JSON @@ -1951,7 +2202,7 @@ types: * `XML` - XML * `MULTIPART` - MULTIPART source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml ResponseTypeEnum: enum: - JSON @@ -1960,7 +2211,7 @@ types: * `JSON` - JSON * `BASE64_GZIP` - BASE64_GZIP source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml RoleEnum: enum: - ADMIN @@ -1977,7 +2228,7 @@ types: * `SYSTEM` - SYSTEM * `MERGE_TEAM` - MERGE_TEAM source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml RolesEnum: enum: - READ @@ -1988,7 +2239,7 @@ types: * `WRITE` - WRITE * `OWNER` - OWNER source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml SelectiveSyncConfigurationsUsageEnum: enum: - IN_NEXT_SYNC @@ -1997,7 +2248,7 @@ types: * `IN_NEXT_SYNC` - IN_NEXT_SYNC * `IN_LAST_SYNC` - IN_LAST_SYNC source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml StatusFd5Enum: enum: - SYNCING @@ -2014,7 +2265,23 @@ types: * `PAUSED` - PAUSED * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED source: - openapi: openapi/openapi.yml + 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 @@ -2034,13 +2301,13 @@ types: model_id: string last_sync_start: optional next_sync_start: optional - last_sync_result: optional + last_sync_result: optional last_sync_finished: optional - status: StatusFd5Enum + status: SyncStatusStatus is_initial_sync: boolean selective_sync_configurations_usage: optional source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml TypeEnum: enum: - USER @@ -2053,7 +2320,7 @@ types: * `COMPANY` - COMPANY * `ANYONE` - ANYONE source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml User: docs: >- # The User Object @@ -2114,12 +2381,12 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml ValidationProblemSource: properties: pointer: string source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml WarningValidationProblem: properties: source: optional @@ -2127,11 +2394,11 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml WebhookReceiver: properties: event: string is_active: boolean key: optional source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/accountDetails.yml b/.mock/definition/FileStorage/accountDetails.yml similarity index 79% rename from .mock/definition/filestorage/accountDetails.yml rename to .mock/definition/FileStorage/accountDetails.yml index 2411f37..e6b0a38 100644 --- a/.mock/definition/filestorage/accountDetails.yml +++ b/.mock/definition/FileStorage/accountDetails.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /filestorage/v1/account-details method: GET - auth: true + auth: + - tokenAuth: [] docs: Get details for a linked account. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml response: docs: '' - type: root.AccountDetails + type: fileStorageRoot.AccountDetails status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd @@ -33,4 +35,4 @@ service: account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/accountToken.yml b/.mock/definition/FileStorage/accountToken.yml similarity index 82% rename from .mock/definition/filestorage/accountToken.yml rename to .mock/definition/FileStorage/accountToken.yml index 2c17a04..5027e47 100644 --- a/.mock/definition/filestorage/accountToken.yml +++ b/.mock/definition/FileStorage/accountToken.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,24 @@ service: retrieve: path: /filestorage/v1/account-token/{public_token} method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Returns the account token for the end user with the provided public token. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: public_token: string response: docs: '' - type: root.AccountToken + type: fileStorageRoot.AccountToken status-code: 200 examples: - path-parameters: public_token: public_token + headers: + X-Account-Token: '[object Object]' response: body: account_token: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB @@ -41,4 +44,4 @@ service: key: value id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/asyncPassthrough.yml b/.mock/definition/FileStorage/asyncPassthrough.yml similarity index 74% rename from .mock/definition/filestorage/asyncPassthrough.yml rename to .mock/definition/FileStorage/asyncPassthrough.yml index 58df835..917001a 100644 --- a/.mock/definition/filestorage/asyncPassthrough.yml +++ b/.mock/definition/FileStorage/asyncPassthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,23 @@ service: create: path: /filestorage/v1/async-passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: >- Asynchronously pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: - body: root.DataPassthroughRequest + body: fileStorageRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.AsyncPassthroughReciept + type: fileStorageRoot.AsyncPassthroughReciept status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -31,10 +33,11 @@ service: retrieve: path: /filestorage/v1/async-passthrough/{async_passthrough_receipt_id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Retrieves data from earlier async-passthrough POST request source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: async_passthrough_receipt_id: string response: @@ -44,7 +47,8 @@ service: examples: - path-parameters: async_passthrough_receipt_id: async_passthrough_receipt_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: method: GET @@ -59,12 +63,12 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml types: AsyncPassthroughRetrieveResponse: discriminated: false union: - - root.RemoteResponse + - fileStorageRoot.RemoteResponse - string source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/auditTrail.yml b/.mock/definition/FileStorage/auditTrail.yml similarity index 85% rename from .mock/definition/filestorage/auditTrail.yml rename to .mock/definition/FileStorage/auditTrail.yml index f21c35f..5147ae3 100644 --- a/.mock/definition/filestorage/auditTrail.yml +++ b/.mock/definition/FileStorage/auditTrail.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /filestorage/v1/audit-trail method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets a list of audit trail events. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: AuditTrailListRequest query-parameters: @@ -72,10 +77,19 @@ service: email. response: docs: '' - type: root.PaginatedAuditLogEventList + type: fileStorageRoot.PaginatedAuditLogEventList status-code: 200 examples: - - response: + - 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 @@ -91,4 +105,4 @@ service: from Read to Read+Write created_at: '2024-01-15T09:30:00Z' source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/availableActions.yml b/.mock/definition/FileStorage/availableActions.yml similarity index 83% rename from .mock/definition/filestorage/availableActions.yml rename to .mock/definition/FileStorage/availableActions.yml index b7a5e2b..a9ab1fa 100644 --- a/.mock/definition/filestorage/availableActions.yml +++ b/.mock/definition/FileStorage/availableActions.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /filestorage/v1/available-actions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of models and actions available for an account. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml response: docs: '' - type: root.AvailableActions + type: fileStorageRoot.AvailableActions status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: integration: @@ -47,4 +49,4 @@ service: - company - title source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/deleteAccount.yml b/.mock/definition/FileStorage/deleteAccount.yml similarity index 54% rename from .mock/definition/filestorage/deleteAccount.yml rename to .mock/definition/FileStorage/deleteAccount.yml index 9b69115..767689f 100644 --- a/.mock/definition/filestorage/deleteAccount.yml +++ b/.mock/definition/FileStorage/deleteAccount.yml @@ -5,11 +5,13 @@ service: delete: path: /filestorage/v1/delete-account method: POST - auth: true + auth: + - tokenAuth: [] docs: Delete a linked account. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/drives.yml b/.mock/definition/FileStorage/drives.yml similarity index 81% rename from .mock/definition/filestorage/drives.yml rename to .mock/definition/FileStorage/drives.yml index 969b232..d02d4f3 100644 --- a/.mock/definition/filestorage/drives.yml +++ b/.mock/definition/FileStorage/drives.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /filestorage/v1/drives method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Drive` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: DrivesListRequest query-parameters: @@ -66,10 +71,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedDriveList + type: fileStorageRoot.PaginatedDriveList status-code: 200 examples: - - headers: {} + - 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 @@ -95,10 +113,11 @@ service: retrieve: path: /filestorage/v1/drives/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Drive` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: id: string request: @@ -116,12 +135,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Drive + type: fileStorageRoot.Drive status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -142,4 +165,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/fieldMapping.yml b/.mock/definition/FileStorage/fieldMapping.yml similarity index 92% rename from .mock/definition/filestorage/fieldMapping.yml rename to .mock/definition/FileStorage/fieldMapping.yml index 0ef97a1..34013d3 100644 --- a/.mock/definition/filestorage/fieldMapping.yml +++ b/.mock/definition/FileStorage/fieldMapping.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,14 +7,15 @@ service: field_mappings_retrieve: path: /filestorage/v1/field-mappings method: GET - auth: true + 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: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: FieldMappingsRetrieveRequest query-parameters: @@ -27,10 +28,13 @@ service: of the request since these fields require some calculations. response: docs: '' - type: root.FieldMappingApiInstanceResponse + type: fileStorageRoot.FieldMappingApiInstanceResponse status-code: 200 examples: - - headers: {} + - query-parameters: + exclude_remote_field_metadata: true + headers: + X-Account-Token: X-Account-Token response: body: File: @@ -116,13 +120,14 @@ service: field_mappings_create: path: /filestorage/v1/field-mappings method: POST - auth: true + 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: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: CreateFieldMappingRequest query-parameters: @@ -178,10 +183,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: fileStorageRoot.FieldMappingInstanceResponse status-code: 201 examples: - - headers: {} + - 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 @@ -231,24 +239,26 @@ service: field_mappings_destroy: path: /filestorage/v1/field-mappings/{field_mapping_id} method: DELETE - auth: true + 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: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: field_mapping_id: string response: docs: '' - type: root.FieldMappingInstanceResponse + type: fileStorageRoot.FieldMappingInstanceResponse status-code: 204 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: model: @@ -290,13 +300,14 @@ service: field_mappings_partial_update: path: /filestorage/v1/field-mappings/{field_mapping_id} method: PATCH - auth: true + 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: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: field_mapping_id: string request: @@ -325,12 +336,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: fileStorageRoot.FieldMappingInstanceResponse status-code: 200 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token request: {} response: body: @@ -373,7 +385,8 @@ service: remote_fields_retrieve: path: /filestorage/v1/remote-fields method: GET - auth: true + 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 @@ -381,7 +394,7 @@ service: or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: RemoteFieldsRetrieveRequest query-parameters: @@ -398,10 +411,14 @@ service: data from your customers. response: docs: '' - type: root.RemoteFieldApiResponse + type: fileStorageRoot.RemoteFieldApiResponse status-code: 200 examples: - - headers: {} + - query-parameters: + common_models: common_models + include_example_values: include_example_values + headers: + X-Account-Token: X-Account-Token response: body: File: @@ -477,7 +494,8 @@ service: target_fields_retrieve: path: /filestorage/v1/target-fields method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields @@ -485,13 +503,14 @@ service: Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml response: docs: '' - type: root.ExternalTargetFieldApiResponse + type: fileStorageRoot.ExternalTargetFieldApiResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: File: @@ -515,4 +534,4 @@ service: description: this is a example description of a target field is_mapped: is_mapped source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/files.yml b/.mock/definition/FileStorage/files.yml similarity index 88% rename from .mock/definition/filestorage/files.yml rename to .mock/definition/FileStorage/files.yml index 7230424..ea98b7d 100644 --- a/.mock/definition/filestorage/files.yml +++ b/.mock/definition/FileStorage/files.yml @@ -1,19 +1,11 @@ types: - FilesListRequestExpand: + FilesListRequestExpandItem: enum: - drive - folder - - value: folder,drive - name: FolderDrive - permissions - - value: permissions,drive - name: PermissionsDrive - - value: permissions,folder - name: PermissionsFolder - - value: permissions,folder,drive - name: PermissionsFolderDrive source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FilesListRequestOrderBy: enum: - value: '-created_at' @@ -25,22 +17,14 @@ types: - value: modified_at name: ModifiedAtAscending source: - openapi: openapi/openapi.yml - FilesRetrieveRequestExpand: + openapi: filestorage_v3.yml + FilesRetrieveRequestExpandItem: enum: - drive - folder - - value: folder,drive - name: FolderDrive - permissions - - value: permissions,drive - name: PermissionsDrive - - value: permissions,folder - name: PermissionsFolder - - value: permissions,folder,drive - name: PermissionsFolderDrive source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml FilesDownloadRequestMetaListRequestOrderBy: enum: - value: '-created_at' @@ -52,9 +36,9 @@ types: - value: modified_at name: ModifiedAtAscending source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -62,10 +46,15 @@ service: list: path: /filestorage/v1/files method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `File` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: FilesListRequest query-parameters: @@ -87,7 +76,8 @@ service: Specifying null returns only the files outside the top-level drive. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -147,10 +137,27 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedFileList + type: fileStorageRoot.PaginatedFileList status-code: 200 examples: - - headers: {} + - 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 @@ -191,10 +198,11 @@ service: create: path: /filestorage/v1/files method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `File` object with the given values. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: FileStorageFileEndpointRequest query-parameters: @@ -208,14 +216,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.FileRequest + model: fileStorageRoot.FileRequest content-type: application/json response: docs: '' - type: root.FileStorageFileResponse + type: fileStorageRoot.FileStorageFileResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -276,17 +288,19 @@ service: retrieve: path: /filestorage/v1/files/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `File` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: id: string request: name: FilesRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -302,12 +316,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.File + type: fileStorageRoot.File status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -345,10 +363,11 @@ service: downloadRetrieve: path: /filestorage/v1/files/{id}/download method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns the `File` content with the given `id` as a stream of bytes. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: id: string request: @@ -374,13 +393,14 @@ service: downloadRequestMetaRetrieve: path: /filestorage/v1/files/{id}/download/request-meta method: GET - auth: true + 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: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: id: string request: @@ -396,12 +416,15 @@ service: target='_blank'>export format help center article. response: docs: '' - type: root.DownloadRequestMeta + type: fileStorageRoot.DownloadRequestMeta status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + mime_type: mime_type + headers: + X-Account-Token: X-Account-Token response: body: id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 @@ -412,12 +435,17 @@ service: downloadRequestMetaList: path: /filestorage/v1/files/download/request-meta method: GET - auth: true + 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: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: FilesDownloadRequestMetaListRequest query-parameters: @@ -470,10 +498,21 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedDownloadRequestMetaList + type: fileStorageRoot.PaginatedDownloadRequestMetaList status-code: 200 examples: - - headers: {} + - 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 @@ -487,16 +526,18 @@ service: metaPostRetrieve: path: /filestorage/v1/files/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `FileStorageFile` POSTs. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml response: docs: '' - type: root.MetaResponse + type: fileStorageRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -669,4 +710,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/folders.yml b/.mock/definition/FileStorage/folders.yml similarity index 89% rename from .mock/definition/filestorage/folders.yml rename to .mock/definition/FileStorage/folders.yml index 50ad205..c95cff0 100644 --- a/.mock/definition/filestorage/folders.yml +++ b/.mock/definition/FileStorage/folders.yml @@ -1,36 +1,20 @@ types: - FoldersListRequestExpand: + FoldersListRequestExpandItem: enum: - drive - parent_folder - - value: parent_folder,drive - name: ParentFolderDrive - permissions - - value: permissions,drive - name: PermissionsDrive - - value: permissions,parent_folder - name: PermissionsParentFolder - - value: permissions,parent_folder,drive - name: PermissionsParentFolderDrive source: - openapi: openapi/openapi.yml - FoldersRetrieveRequestExpand: + openapi: filestorage_v3.yml + FoldersRetrieveRequestExpandItem: enum: - drive - parent_folder - - value: parent_folder,drive - name: ParentFolderDrive - permissions - - value: permissions,drive - name: PermissionsDrive - - value: permissions,parent_folder - name: PermissionsParentFolder - - value: permissions,parent_folder,drive - name: PermissionsParentFolderDrive source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -38,10 +22,15 @@ service: list: path: /filestorage/v1/folders method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Folder` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: FoldersListRequest query-parameters: @@ -60,7 +49,8 @@ service: type: optional docs: If provided, will only return folders in this drive. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -110,10 +100,25 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedFolderList + type: fileStorageRoot.PaginatedFolderList status-code: 200 examples: - - headers: {} + - 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 @@ -145,10 +150,11 @@ service: create: path: /filestorage/v1/folders method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Folder` object with the given values. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: FileStorageFolderEndpointRequest query-parameters: @@ -162,14 +168,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.FolderRequest + model: fileStorageRoot.FolderRequest content-type: application/json response: docs: '' - type: root.FileStorageFolderResponse + type: fileStorageRoot.FileStorageFolderResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -221,17 +231,19 @@ service: retrieve: path: /filestorage/v1/folders/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Folder` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: id: string request: name: FoldersRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -247,12 +259,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Folder + type: fileStorageRoot.Folder status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -281,16 +297,18 @@ service: metaPostRetrieve: path: /filestorage/v1/folders/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `FileStorageFolder` POSTs. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml response: docs: '' - type: root.MetaResponse + type: fileStorageRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -463,4 +481,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/forceResync.yml b/.mock/definition/FileStorage/forceResync.yml similarity index 81% rename from .mock/definition/filestorage/forceResync.yml rename to .mock/definition/FileStorage/forceResync.yml index 644c49b..d280ccd 100644 --- a/.mock/definition/filestorage/forceResync.yml +++ b/.mock/definition/FileStorage/forceResync.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: sync_status_resync_create: path: /filestorage/v1/sync-status/resync method: POST - auth: true + 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 @@ -15,13 +16,14 @@ service: linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - model_name: File @@ -34,4 +36,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/generateKey.yml b/.mock/definition/FileStorage/generateKey.yml similarity index 73% rename from .mock/definition/filestorage/generateKey.yml rename to .mock/definition/FileStorage/generateKey.yml index 04ac41b..4cc23f5 100644 --- a/.mock/definition/filestorage/generateKey.yml +++ b/.mock/definition/FileStorage/generateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /filestorage/v1/generate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Create a remote key. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: GenerateRemoteKeyRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: fileStorageRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/groups.yml b/.mock/definition/FileStorage/groups.yml similarity index 77% rename from .mock/definition/filestorage/groups.yml rename to .mock/definition/FileStorage/groups.yml index 247ce30..c7b80bf 100644 --- a/.mock/definition/filestorage/groups.yml +++ b/.mock/definition/FileStorage/groups.yml @@ -1,5 +1,18 @@ +types: + GroupsListRequestExpandItem: + enum: + - child_groups + - users + source: + openapi: filestorage_v3.yml + GroupsRetrieveRequestExpandItem: + enum: + - child_groups + - users + source: + openapi: filestorage_v3.yml imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +20,15 @@ service: list: path: /filestorage/v1/groups method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Group` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: GroupsListRequest query-parameters: @@ -26,7 +44,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional> + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -66,10 +85,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedGroupList + type: fileStorageRoot.PaginatedGroupList status-code: 200 examples: - - headers: {} + - 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 @@ -97,17 +128,19 @@ service: retrieve: path: /filestorage/v1/groups/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Group` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: id: string request: name: GroupsRetrieveRequest query-parameters: expand: - type: optional> + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -123,12 +156,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Group + type: fileStorageRoot.Group status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -151,4 +188,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/issues.yml b/.mock/definition/FileStorage/issues.yml similarity index 75% rename from .mock/definition/filestorage/issues.yml rename to .mock/definition/FileStorage/issues.yml index b6a1d19..90fd8d7 100644 --- a/.mock/definition/filestorage/issues.yml +++ b/.mock/definition/FileStorage/issues.yml @@ -4,9 +4,9 @@ types: - ONGOING - RESOLVED source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -14,10 +14,15 @@ service: list: path: /filestorage/v1/issues method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets all issues for Organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: IssuesListRequest query-parameters: @@ -77,10 +82,27 @@ service: * `RESOLVED` - RESOLVED response: docs: '' - type: root.PaginatedIssueList + type: fileStorageRoot.PaginatedIssueList status-code: 200 examples: - - response: + - 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 @@ -99,19 +121,22 @@ service: retrieve: path: /filestorage/v1/issues/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Get a specific issue. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: id: string response: docs: '' - type: root.Issue + 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 @@ -126,4 +151,4 @@ service: - Missing employee permissions. - Missing time off permissions. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/linkToken.yml b/.mock/definition/FileStorage/linkToken.yml similarity index 84% rename from .mock/definition/filestorage/linkToken.yml rename to .mock/definition/FileStorage/linkToken.yml index fda54a0..fedfc89 100644 --- a/.mock/definition/filestorage/linkToken.yml +++ b/.mock/definition/FileStorage/linkToken.yml @@ -1,5 +1,22 @@ imports: - root: __package__.yml + 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: '' @@ -7,10 +24,11 @@ service: create: path: /filestorage/v1/link-token method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a link token to be used when linking a new end user. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: EndUserDetailsRequest body: @@ -41,7 +59,7 @@ service: maxLength: 100 categories: docs: The integration categories to show in Merge Link. - type: list + type: list integration: type: optional docs: >- @@ -76,7 +94,7 @@ service: https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. default: false common_models: - type: optional> + 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 @@ -86,14 +104,14 @@ service: category_common_model_scopes: type: >- optional>>> + 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 + type: optional docs: >- The following subset of IETF language tags can be used to configure localization. @@ -116,10 +134,12 @@ service: content-type: application/json response: docs: '' - type: root.LinkToken + type: fileStorageRoot.LinkToken status-code: 200 examples: - - request: + - 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' @@ -132,4 +152,4 @@ service: integration_name: Lever magic_link_url: https://link.merge.dev/asdfjkl12345jsndfgi2i83n source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/linkedAccounts.yml b/.mock/definition/FileStorage/linkedAccounts.yml similarity index 82% rename from .mock/definition/filestorage/linkedAccounts.yml rename to .mock/definition/FileStorage/linkedAccounts.yml index d8fb0eb..c74865c 100644 --- a/.mock/definition/filestorage/linkedAccounts.yml +++ b/.mock/definition/FileStorage/linkedAccounts.yml @@ -9,9 +9,9 @@ types: - mktg - ticketing source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -19,10 +19,15 @@ service: list: path: /filestorage/v1/linked-accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: List linked accounts for your organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: LinkedAccountsListRequest query-parameters: @@ -104,10 +109,26 @@ service: `RELINK_NEEDED` response: docs: '' - type: root.PaginatedAccountDetailsAndActionsList + type: fileStorageRoot.PaginatedAccountDetailsAndActionsList status-code: 200 examples: - - response: + - 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 @@ -144,7 +165,5 @@ service: - title account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' - integration_specific_fields: - integration_specific_field: Varies by platform source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/passthrough.yml b/.mock/definition/FileStorage/passthrough.yml similarity index 72% rename from .mock/definition/filestorage/passthrough.yml rename to .mock/definition/FileStorage/passthrough.yml index 432034b..9854d3a 100644 --- a/.mock/definition/filestorage/passthrough.yml +++ b/.mock/definition/FileStorage/passthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,21 @@ service: create: path: /filestorage/v1/passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: Pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: - body: root.DataPassthroughRequest + body: fileStorageRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.RemoteResponse + type: fileStorageRoot.RemoteResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -37,4 +39,4 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/regenerateKey.yml b/.mock/definition/FileStorage/regenerateKey.yml similarity index 73% rename from .mock/definition/filestorage/regenerateKey.yml rename to .mock/definition/FileStorage/regenerateKey.yml index cd80f78..e23e337 100644 --- a/.mock/definition/filestorage/regenerateKey.yml +++ b/.mock/definition/FileStorage/regenerateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /filestorage/v1/regenerate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Exchange remote keys. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: RemoteKeyForRegenerationRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: fileStorageRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/scopes.yml b/.mock/definition/FileStorage/scopes.yml similarity index 86% rename from .mock/definition/filestorage/scopes.yml rename to .mock/definition/FileStorage/scopes.yml index a48a164..49e604a 100644 --- a/.mock/definition/filestorage/scopes.yml +++ b/.mock/definition/FileStorage/scopes.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,22 @@ service: default_scopes_retrieve: path: /filestorage/v1/default-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: filestorage_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: fileStorageRoot.CommonModelScopeApi status-code: 200 examples: - - response: + - headers: + X-Account-Token: '[object Object]' + response: body: common_models: - model_name: Employee @@ -48,19 +51,21 @@ service: linked_account_scopes_retrieve: path: /filestorage/v1/linked-account-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: filestorage_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: fileStorageRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: common_models: @@ -90,28 +95,31 @@ service: linked_account_scopes_create: path: /filestorage/v1/linked-account-scopes method: POST - auth: true + 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: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: LinkedAccountCommonModelScopeDeserializerRequest body: properties: common_models: docs: The common models you want to update the scopes for - type: list + type: >- + list content-type: application/json response: docs: '' - type: root.CommonModelScopeApi + type: fileStorageRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: common_models: - model_name: Employee @@ -157,4 +165,4 @@ service: - manager - work_location source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/syncStatus.yml b/.mock/definition/FileStorage/syncStatus.yml similarity index 79% rename from .mock/definition/filestorage/syncStatus.yml rename to .mock/definition/FileStorage/syncStatus.yml index 53140e4..ffa8a97 100644 --- a/.mock/definition/filestorage/syncStatus.yml +++ b/.mock/definition/FileStorage/syncStatus.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: list: path: /filestorage/v1/sync-status method: GET - auth: true + 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. @@ -20,8 +21,12 @@ service: `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: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: SyncStatusListRequest query-parameters: @@ -33,10 +38,14 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedSyncStatusList + type: fileStorageRoot.PaginatedSyncStatusList status-code: 200 examples: - - headers: {} + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + page_size: 1 + headers: + X-Account-Token: X-Account-Token response: body: next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw @@ -52,4 +61,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/users.yml b/.mock/definition/FileStorage/users.yml similarity index 80% rename from .mock/definition/filestorage/users.yml rename to .mock/definition/FileStorage/users.yml index 6921bd6..9a388d3 100644 --- a/.mock/definition/filestorage/users.yml +++ b/.mock/definition/FileStorage/users.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /filestorage/v1/users method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `User` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: UsersListRequest query-parameters: @@ -64,10 +69,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedUserList + type: fileStorageRoot.PaginatedUserList status-code: 200 examples: - - headers: {} + - 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 @@ -93,10 +111,11 @@ service: retrieve: path: /filestorage/v1/users/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `User` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml path-parameters: id: string request: @@ -114,12 +133,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.User + type: fileStorageRoot.User status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -140,4 +163,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/filestorage/webhookReceivers.yml b/.mock/definition/FileStorage/webhookReceivers.yml similarity index 73% rename from .mock/definition/filestorage/webhookReceivers.yml rename to .mock/definition/FileStorage/webhookReceivers.yml index 3b0bcac..fa7e6fd 100644 --- a/.mock/definition/filestorage/webhookReceivers.yml +++ b/.mock/definition/FileStorage/webhookReceivers.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + fileStorageRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: list: path: /filestorage/v1/webhook-receivers method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `WebhookReceiver` objects. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - event: event @@ -25,10 +27,11 @@ service: create: path: /filestorage/v1/webhook-receivers method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `WebhookReceiver` object with the given values. source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml request: name: WebhookReceiverRequest body: @@ -45,10 +48,11 @@ service: content-type: application/json response: docs: '' - type: root.WebhookReceiver + type: fileStorageRoot.WebhookReceiver status-code: 201 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: event: event is_active: true @@ -58,4 +62,4 @@ service: is_active: true key: key source: - openapi: openapi/openapi.yml + openapi: filestorage_v3.yml diff --git a/.mock/definition/hris/__package__.yml b/.mock/definition/HRIS/__package__.yml similarity index 78% rename from .mock/definition/hris/__package__.yml rename to .mock/definition/HRIS/__package__.yml index 40543cd..61e76ec 100644 --- a/.mock/definition/hris/__package__.yml +++ b/.mock/definition/HRIS/__package__.yml @@ -1,4 +1,12 @@ types: + AccountDetailsCategory: + discriminated: false + union: + - CategoryEnum + - string + source: + openapi: hris_v3.yml + inline: true AccountDetails: properties: id: @@ -12,7 +20,7 @@ types: integration_slug: type: optional access: read-only - category: optional + category: optional end_user_origin_id: type: optional access: read-only @@ -47,7 +55,23 @@ types: type: optional docs: The time at which account completes the linking flow. source: - openapi: openapi/openapi.yml + 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 @@ -63,8 +87,8 @@ types: View a list of your organization's `LinkedAccount` objects. properties: id: string - category: optional - status: AccountDetailsAndActionsStatusEnum + category: optional + status: AccountDetailsAndActionsStatus status_detail: optional end_user_origin_id: optional end_user_organization_name: string @@ -83,9 +107,8 @@ types: integration: optional account_type: string completed_at: datetime - integration_specific_fields: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml AccountDetailsAndActionsIntegration: properties: name: string @@ -97,7 +120,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml AccountDetailsAndActionsStatusEnum: enum: - COMPLETE @@ -110,7 +133,7 @@ types: * `RELINK_NEEDED` - RELINK_NEEDED * `IDLE` - IDLE source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml AccountIntegration: properties: name: @@ -168,14 +191,14 @@ types: docs: Category or categories this integration is in beta status for. access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml AccountToken: properties: account_token: string integration: AccountIntegration id: string source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml AccountTypeEnum: enum: - SAVINGS @@ -184,7 +207,7 @@ types: * `SAVINGS` - SAVINGS * `CHECKING` - CHECKING source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml AdvancedMetadata: properties: id: @@ -197,7 +220,7 @@ types: is_custom: optional field_choices: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml AsyncPassthroughReciept: properties: async_passthrough_receipt_id: @@ -205,7 +228,142 @@ types: validation: format: uuid source: - openapi: openapi/openapi.yml + 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: @@ -225,7 +383,7 @@ types: format: email maxLength: 254 role: - type: RoleEnum + 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. @@ -247,7 +405,7 @@ types: validation: maxLength: 45 event_type: - type: EventTypeEnum + type: AuditLogEventEventType docs: >- Designates the type of event that occurred. @@ -358,7 +516,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml AvailableActions: docs: >- # The AvailableActions Object @@ -377,7 +535,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml BankInfoEmployee: discriminated: false docs: The employee with this bank account. @@ -387,7 +545,20 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + 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: >- @@ -435,7 +606,7 @@ types: type: optional docs: The bank name. account_type: - type: optional + type: optional docs: |- The bank account type @@ -460,7 +631,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml BenefitEmployee: discriminated: false docs: The employee on the plan. @@ -470,7 +641,7 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true Benefit: docs: >- @@ -546,7 +717,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml BenefitPlanTypeEnum: enum: - MEDICAL @@ -561,7 +732,7 @@ types: * `RETIREMENT` - RETIREMENT * `OTHER` - OTHER source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml CategoriesEnum: enum: - hris @@ -580,7 +751,7 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml CategoryEnum: enum: - hris @@ -599,14 +770,14 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml CommonModelScopeApi: properties: common_models: docs: The common models you want to update the scopes for type: list source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml CommonModelScopesBodyRequest: properties: model_id: @@ -616,7 +787,7 @@ types: enabled_actions: list disabled_fields: list source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml Company: docs: >- # The Company Object @@ -673,7 +844,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml CountryEnum: enum: - AF @@ -1176,7 +1347,7 @@ types: * `ZM` - Zambia * `ZW` - Zimbabwe source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml DataPassthroughRequest: docs: >- # The DataPassthrough Object @@ -1230,21 +1401,21 @@ types: `{"type": T, "value": ...}` where `T` will be one of `string, boolean, number, null, array, object`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml DebugModeLog: properties: log_id: string dashboard_view: string log_summary: DebugModelLogSummary source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml DebugModelLogSummary: properties: url: string method: string status_code: integer source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml Deduction: docs: >- # The Deduction Object @@ -1308,7 +1479,37 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + 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 @@ -1356,7 +1557,7 @@ types: validation: maxLength: 60 relationship: - type: optional + type: optional docs: |- The dependent's relationship to the employee. @@ -1372,7 +1573,7 @@ types: type: optional docs: The dependent's date of birth. gender: - type: optional + type: optional docs: |- The dependent's gender. @@ -1415,7 +1616,22 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + 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 @@ -1455,7 +1671,7 @@ types: type: optional docs: The amount earned. type: - type: optional + type: optional docs: |- The type of earning. @@ -1478,7 +1694,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EarningTypeEnum: enum: - SALARY @@ -1491,7 +1707,7 @@ types: * `OVERTIME` - OVERTIME * `BONUS` - BONUS source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmployeeCompany: discriminated: false docs: The ID of the employee's company. @@ -1501,7 +1717,7 @@ types: format: uuid - Company source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeGroupsItem: discriminated: false @@ -1511,7 +1727,7 @@ types: format: uuid - Group source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeEmploymentsItem: discriminated: false @@ -1521,7 +1737,7 @@ types: format: uuid - Employment source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeHomeLocation: discriminated: false @@ -1532,7 +1748,7 @@ types: format: uuid - Location source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeWorkLocation: discriminated: false @@ -1543,7 +1759,7 @@ types: format: uuid - Location source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeManager: discriminated: false @@ -1554,7 +1770,7 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeTeam: discriminated: false @@ -1565,7 +1781,7 @@ types: format: uuid - Team source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeePayGroup: discriminated: false @@ -1576,7 +1792,87 @@ types: format: uuid - PayGroup source: - openapi: openapi/openapi.yml + 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: >- @@ -1678,7 +1974,7 @@ types: validation: maxLength: 100 gender: - type: optional + type: optional docs: |- The employee's gender. @@ -1688,7 +1984,7 @@ types: * `OTHER` - OTHER * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE ethnicity: - type: optional + type: optional docs: >- The employee's ethnicity. @@ -1711,7 +2007,7 @@ types: * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE marital_status: - type: optional + type: optional docs: >- The employee's filing status as related to marital status. @@ -1747,7 +2043,7 @@ types: type: optional docs: When the third party's employee was created. employment_status: - type: optional + type: optional docs: |- The employment status of the employee. @@ -1782,7 +2078,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmployeePayrollRunEmployee: discriminated: false docs: The employee whose payroll is being run. @@ -1792,7 +2088,7 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeePayrollRunPayrollRun: discriminated: false @@ -1803,7 +2099,7 @@ types: format: uuid - PayrollRun source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeePayrollRun: docs: >- @@ -1886,7 +2182,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmployeeRequestCompany: discriminated: false docs: The ID of the employee's company. @@ -1896,7 +2192,7 @@ types: format: uuid - Company source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeRequestGroupsItem: discriminated: false @@ -1906,7 +2202,7 @@ types: format: uuid - Group source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeRequestEmploymentsItem: discriminated: false @@ -1916,7 +2212,7 @@ types: format: uuid - Employment source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeRequestHomeLocation: discriminated: false @@ -1927,7 +2223,7 @@ types: format: uuid - Location source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeRequestWorkLocation: discriminated: false @@ -1938,7 +2234,7 @@ types: format: uuid - Location source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeRequestManager: discriminated: false @@ -1949,7 +2245,7 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeRequestTeam: discriminated: false @@ -1960,7 +2256,7 @@ types: format: uuid - Team source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true EmployeeRequestPayGroup: discriminated: false @@ -1971,21 +2267,101 @@ types: format: uuid - PayGroup source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true - EmployeeRequest: + 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 Object + The employee's ethnicity. - ### 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`. + * `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 + + ### Usage Example Fetch from the `LIST Employee` endpoint and filter by `ID` to show all employees. @@ -2057,7 +2433,7 @@ types: validation: maxLength: 100 gender: - type: optional + type: optional docs: |- The employee's gender. @@ -2067,7 +2443,7 @@ types: * `OTHER` - OTHER * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE ethnicity: - type: optional + type: optional docs: >- The employee's ethnicity. @@ -2090,7 +2466,7 @@ types: * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE marital_status: - type: optional + type: optional docs: >- The employee's filing status as related to marital status. @@ -2123,7 +2499,7 @@ types: The date that the employee started working. If an employee was rehired, the most recent start date will be returned. employment_status: - type: optional + type: optional docs: |- The employment status of the employee. @@ -2146,7 +2522,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmployeeResponse: properties: model: Employee @@ -2154,7 +2530,23 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + 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 @@ -2187,7 +2579,7 @@ types: docs: The datetime that this object was modified by Merge. access: read-only benefit_plan_type: - type: optional + type: optional docs: |- The type of benefit plan. @@ -2227,7 +2619,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmploymentEmployee: discriminated: false docs: The employee holding this position. @@ -2237,1160 +2629,1871 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true - EmploymentPayGroup: + EmploymentPayPeriod: discriminated: false - docs: The employment's pay group + 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: - - type: string - validation: - format: uuid - - PayGroup + - PayPeriodEnum + - string source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true - Employment: + 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 Employment Object + The position's currency code. - ### Description - The `Employment` object is used to represent a job position at a company. + * `XUA` - ADB Unit of Account + * `AFN` - Afghan Afghani - 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. + * `AFA` - Afghan Afghani (1927–2002) + * `ALL` - Albanian Lek - ### Usage Example + * `ALK` - Albanian Lek (1946–1965) - 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. + * `DZD` - Algerian Dinar - * `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. + * `ADP` - Andorran Peseta - * `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. + * `AOA` - Angolan Kwanza + * `AOK` - Angolan Kwanza (1977–1991) - * `XUA` - ADB Unit of Account + * `AON` - Angolan New Kwanza (1990–2000) - * `AFN` - Afghan Afghani + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `AFA` - Afghan Afghani (1927–2002) + * `ARA` - Argentine Austral - * `ALL` - Albanian Lek + * `ARS` - Argentine Peso - * `ALK` - Albanian Lek (1946–1965) + * `ARM` - Argentine Peso (1881–1970) - * `DZD` - Algerian Dinar + * `ARP` - Argentine Peso (1983–1985) - * `ADP` - Andorran Peseta + * `ARL` - Argentine Peso Ley (1970–1983) - * `AOA` - Angolan Kwanza + * `AMD` - Armenian Dram - * `AOK` - Angolan Kwanza (1977–1991) + * `AWG` - Aruban Florin - * `AON` - Angolan New Kwanza (1990–2000) + * `AUD` - Australian Dollar - * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `ATS` - Austrian Schilling - * `ARA` - Argentine Austral + * `AZN` - Azerbaijani Manat - * `ARS` - Argentine Peso + * `AZM` - Azerbaijani Manat (1993–2006) - * `ARM` - Argentine Peso (1881–1970) + * `BSD` - Bahamian Dollar - * `ARP` - Argentine Peso (1983–1985) + * `BHD` - Bahraini Dinar - * `ARL` - Argentine Peso Ley (1970–1983) + * `BDT` - Bangladeshi Taka - * `AMD` - Armenian Dram + * `BBD` - Barbadian Dollar - * `AWG` - Aruban Florin + * `BYN` - Belarusian Ruble - * `AUD` - Australian Dollar + * `BYB` - Belarusian Ruble (1994–1999) - * `ATS` - Austrian Schilling + * `BYR` - Belarusian Ruble (2000–2016) - * `AZN` - Azerbaijani Manat + * `BEF` - Belgian Franc - * `AZM` - Azerbaijani Manat (1993–2006) + * `BEC` - Belgian Franc (convertible) - * `BSD` - Bahamian Dollar + * `BEL` - Belgian Franc (financial) - * `BHD` - Bahraini Dinar + * `BZD` - Belize Dollar - * `BDT` - Bangladeshi Taka + * `BMD` - Bermudan Dollar - * `BBD` - Barbadian Dollar + * `BTN` - Bhutanese Ngultrum - * `BYN` - Belarusian Ruble + * `BOB` - Bolivian Boliviano - * `BYB` - Belarusian Ruble (1994–1999) + * `BOL` - Bolivian Boliviano (1863–1963) - * `BYR` - Belarusian Ruble (2000–2016) + * `BOV` - Bolivian Mvdol - * `BEF` - Belgian Franc + * `BOP` - Bolivian Peso - * `BEC` - Belgian Franc (convertible) + * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BEL` - Belgian Franc (financial) + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BZD` - Belize Dollar + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BMD` - Bermudan Dollar + * `BWP` - Botswanan Pula - * `BTN` - Bhutanese Ngultrum + * `BRC` - Brazilian Cruzado (1986–1989) - * `BOB` - Bolivian Boliviano + * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BOL` - Bolivian Boliviano (1863–1963) + * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BOV` - Bolivian Mvdol + * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BOP` - Bolivian Peso + * `BRN` - Brazilian New Cruzado (1989–1990) - * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BRL` - Brazilian Real - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `GBP` - British Pound - * `BWP` - Botswanan Pula + * `BND` - Brunei Dollar - * `BRC` - Brazilian Cruzado (1986–1989) + * `BGL` - Bulgarian Hard Lev - * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BGN` - Bulgarian Lev - * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BGO` - Bulgarian Lev (1879–1952) - * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BGM` - Bulgarian Socialist Lev - * `BRN` - Brazilian New Cruzado (1989–1990) + * `BUK` - Burmese Kyat - * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BIF` - Burundian Franc - * `BRL` - Brazilian Real + * `XPF` - CFP Franc - * `GBP` - British Pound + * `KHR` - Cambodian Riel - * `BND` - Brunei Dollar + * `CAD` - Canadian Dollar - * `BGL` - Bulgarian Hard Lev + * `CVE` - Cape Verdean Escudo - * `BGN` - Bulgarian Lev + * `KYD` - Cayman Islands Dollar - * `BGO` - Bulgarian Lev (1879–1952) + * `XAF` - Central African CFA Franc - * `BGM` - Bulgarian Socialist Lev + * `CLE` - Chilean Escudo - * `BUK` - Burmese Kyat + * `CLP` - Chilean Peso - * `BIF` - Burundian Franc + * `CLF` - Chilean Unit of Account (UF) - * `XPF` - CFP Franc + * `CNX` - Chinese People’s Bank Dollar - * `KHR` - Cambodian Riel + * `CNY` - Chinese Yuan - * `CAD` - Canadian Dollar + * `CNH` - Chinese Yuan (offshore) - * `CVE` - Cape Verdean Escudo + * `COP` - Colombian Peso - * `KYD` - Cayman Islands Dollar + * `COU` - Colombian Real Value Unit - * `XAF` - Central African CFA Franc + * `KMF` - Comorian Franc - * `CLE` - Chilean Escudo + * `CDF` - Congolese Franc - * `CLP` - Chilean Peso + * `CRC` - Costa Rican Colón - * `CLF` - Chilean Unit of Account (UF) + * `HRD` - Croatian Dinar - * `CNX` - Chinese People’s Bank Dollar + * `HRK` - Croatian Kuna - * `CNY` - Chinese Yuan + * `CUC` - Cuban Convertible Peso - * `CNH` - Chinese Yuan (offshore) + * `CUP` - Cuban Peso - * `COP` - Colombian Peso + * `CYP` - Cypriot Pound - * `COU` - Colombian Real Value Unit + * `CZK` - Czech Koruna - * `KMF` - Comorian Franc + * `CSK` - Czechoslovak Hard Koruna - * `CDF` - Congolese Franc + * `DKK` - Danish Krone - * `CRC` - Costa Rican Colón + * `DJF` - Djiboutian Franc - * `HRD` - Croatian Dinar + * `DOP` - Dominican Peso - * `HRK` - Croatian Kuna + * `NLG` - Dutch Guilder - * `CUC` - Cuban Convertible Peso + * `XCD` - East Caribbean Dollar - * `CUP` - Cuban Peso + * `DDM` - East German Mark - * `CYP` - Cypriot Pound + * `ECS` - Ecuadorian Sucre - * `CZK` - Czech Koruna + * `ECV` - Ecuadorian Unit of Constant Value - * `CSK` - Czechoslovak Hard Koruna + * `EGP` - Egyptian Pound - * `DKK` - Danish Krone + * `GQE` - Equatorial Guinean Ekwele - * `DJF` - Djiboutian Franc + * `ERN` - Eritrean Nakfa - * `DOP` - Dominican Peso + * `EEK` - Estonian Kroon - * `NLG` - Dutch Guilder + * `ETB` - Ethiopian Birr - * `XCD` - East Caribbean Dollar + * `EUR` - Euro - * `DDM` - East German Mark + * `XBA` - European Composite Unit - * `ECS` - Ecuadorian Sucre + * `XEU` - European Currency Unit - * `ECV` - Ecuadorian Unit of Constant Value + * `XBB` - European Monetary Unit - * `EGP` - Egyptian Pound + * `XBC` - European Unit of Account (XBC) - * `GQE` - Equatorial Guinean Ekwele + * `XBD` - European Unit of Account (XBD) - * `ERN` - Eritrean Nakfa + * `FKP` - Falkland Islands Pound - * `EEK` - Estonian Kroon + * `FJD` - Fijian Dollar - * `ETB` - Ethiopian Birr + * `FIM` - Finnish Markka - * `EUR` - Euro + * `FRF` - French Franc - * `XBA` - European Composite Unit + * `XFO` - French Gold Franc - * `XEU` - European Currency Unit + * `XFU` - French UIC-Franc - * `XBB` - European Monetary Unit + * `GMD` - Gambian Dalasi - * `XBC` - European Unit of Account (XBC) + * `GEK` - Georgian Kupon Larit - * `XBD` - European Unit of Account (XBD) + * `GEL` - Georgian Lari - * `FKP` - Falkland Islands Pound + * `DEM` - German Mark - * `FJD` - Fijian Dollar + * `GHS` - Ghanaian Cedi - * `FIM` - Finnish Markka + * `GHC` - Ghanaian Cedi (1979–2007) - * `FRF` - French Franc + * `GIP` - Gibraltar Pound - * `XFO` - French Gold Franc + * `XAU` - Gold - * `XFU` - French UIC-Franc + * `GRD` - Greek Drachma - * `GMD` - Gambian Dalasi + * `GTQ` - Guatemalan Quetzal - * `GEK` - Georgian Kupon Larit + * `GWP` - Guinea-Bissau Peso - * `GEL` - Georgian Lari + * `GNF` - Guinean Franc - * `DEM` - German Mark + * `GNS` - Guinean Syli - * `GHS` - Ghanaian Cedi + * `GYD` - Guyanaese Dollar - * `GHC` - Ghanaian Cedi (1979–2007) + * `HTG` - Haitian Gourde - * `GIP` - Gibraltar Pound + * `HNL` - Honduran Lempira - * `XAU` - Gold + * `HKD` - Hong Kong Dollar - * `GRD` - Greek Drachma + * `HUF` - Hungarian Forint - * `GTQ` - Guatemalan Quetzal + * `IMP` - IMP - * `GWP` - Guinea-Bissau Peso + * `ISK` - Icelandic Króna - * `GNF` - Guinean Franc + * `ISJ` - Icelandic Króna (1918–1981) - * `GNS` - Guinean Syli + * `INR` - Indian Rupee - * `GYD` - Guyanaese Dollar + * `IDR` - Indonesian Rupiah - * `HTG` - Haitian Gourde + * `IRR` - Iranian Rial - * `HNL` - Honduran Lempira + * `IQD` - Iraqi Dinar - * `HKD` - Hong Kong Dollar + * `IEP` - Irish Pound - * `HUF` - Hungarian Forint + * `ILS` - Israeli New Shekel - * `IMP` - IMP + * `ILP` - Israeli Pound - * `ISK` - Icelandic Króna + * `ILR` - Israeli Shekel (1980–1985) - * `ISJ` - Icelandic Króna (1918–1981) + * `ITL` - Italian Lira - * `INR` - Indian Rupee + * `JMD` - Jamaican Dollar - * `IDR` - Indonesian Rupiah + * `JPY` - Japanese Yen - * `IRR` - Iranian Rial + * `JOD` - Jordanian Dinar - * `IQD` - Iraqi Dinar + * `KZT` - Kazakhstani Tenge - * `IEP` - Irish Pound + * `KES` - Kenyan Shilling - * `ILS` - Israeli New Shekel + * `KWD` - Kuwaiti Dinar - * `ILP` - Israeli Pound + * `KGS` - Kyrgystani Som - * `ILR` - Israeli Shekel (1980–1985) + * `LAK` - Laotian Kip - * `ITL` - Italian Lira + * `LVL` - Latvian Lats - * `JMD` - Jamaican Dollar + * `LVR` - Latvian Ruble - * `JPY` - Japanese Yen + * `LBP` - Lebanese Pound - * `JOD` - Jordanian Dinar + * `LSL` - Lesotho Loti - * `KZT` - Kazakhstani Tenge + * `LRD` - Liberian Dollar - * `KES` - Kenyan Shilling + * `LYD` - Libyan Dinar - * `KWD` - Kuwaiti Dinar + * `LTL` - Lithuanian Litas - * `KGS` - Kyrgystani Som + * `LTT` - Lithuanian Talonas - * `LAK` - Laotian Kip + * `LUL` - Luxembourg Financial Franc - * `LVL` - Latvian Lats + * `LUC` - Luxembourgian Convertible Franc - * `LVR` - Latvian Ruble + * `LUF` - Luxembourgian Franc - * `LBP` - Lebanese Pound + * `MOP` - Macanese Pataca - * `LSL` - Lesotho Loti + * `MKD` - Macedonian Denar - * `LRD` - Liberian Dollar + * `MKN` - Macedonian Denar (1992–1993) - * `LYD` - Libyan Dinar + * `MGA` - Malagasy Ariary - * `LTL` - Lithuanian Litas + * `MGF` - Malagasy Franc - * `LTT` - Lithuanian Talonas + * `MWK` - Malawian Kwacha - * `LUL` - Luxembourg Financial Franc + * `MYR` - Malaysian Ringgit - * `LUC` - Luxembourgian Convertible Franc + * `MVR` - Maldivian Rufiyaa - * `LUF` - Luxembourgian Franc + * `MVP` - Maldivian Rupee (1947–1981) - * `MOP` - Macanese Pataca + * `MLF` - Malian Franc - * `MKD` - Macedonian Denar + * `MTL` - Maltese Lira - * `MKN` - Macedonian Denar (1992–1993) + * `MTP` - Maltese Pound - * `MGA` - Malagasy Ariary + * `MRU` - Mauritanian Ouguiya - * `MGF` - Malagasy Franc + * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MWK` - Malawian Kwacha + * `MUR` - Mauritian Rupee - * `MYR` - Malaysian Ringgit + * `MXV` - Mexican Investment Unit - * `MVR` - Maldivian Rufiyaa + * `MXN` - Mexican Peso - * `MVP` - Maldivian Rupee (1947–1981) + * `MXP` - Mexican Silver Peso (1861–1992) - * `MLF` - Malian Franc + * `MDC` - Moldovan Cupon - * `MTL` - Maltese Lira + * `MDL` - Moldovan Leu - * `MTP` - Maltese Pound + * `MCF` - Monegasque Franc - * `MRU` - Mauritanian Ouguiya + * `MNT` - Mongolian Tugrik - * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MAD` - Moroccan Dirham - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit + * `MAF` - Moroccan Franc - * `MXN` - Mexican Peso + * `MZE` - Mozambican Escudo - * `MXP` - Mexican Silver Peso (1861–1992) + * `MZN` - Mozambican Metical - * `MDC` - Moldovan Cupon + * `MZM` - Mozambican Metical (1980–2006) - * `MDL` - Moldovan Leu + * `MMK` - Myanmar Kyat - * `MCF` - Monegasque Franc + * `NAD` - Namibian Dollar - * `MNT` - Mongolian Tugrik + * `NPR` - Nepalese Rupee - * `MAD` - Moroccan Dirham + * `ANG` - Netherlands Antillean Guilder - * `MAF` - Moroccan Franc + * `TWD` - New Taiwan Dollar - * `MZE` - Mozambican Escudo + * `NZD` - New Zealand Dollar - * `MZN` - Mozambican Metical + * `NIO` - Nicaraguan Córdoba - * `MZM` - Mozambican Metical (1980–2006) + * `NIC` - Nicaraguan Córdoba (1988–1991) - * `MMK` - Myanmar Kyat + * `NGN` - Nigerian Naira - * `NAD` - Namibian Dollar + * `KPW` - North Korean Won - * `NPR` - Nepalese Rupee + * `NOK` - Norwegian Krone - * `ANG` - Netherlands Antillean Guilder + * `OMR` - Omani Rial - * `TWD` - New Taiwan Dollar + * `PKR` - Pakistani Rupee - * `NZD` - New Zealand Dollar + * `XPD` - Palladium - * `NIO` - Nicaraguan Córdoba + * `PAB` - Panamanian Balboa - * `NIC` - Nicaraguan Córdoba (1988–1991) + * `PGK` - Papua New Guinean Kina - * `NGN` - Nigerian Naira + * `PYG` - Paraguayan Guarani - * `KPW` - North Korean Won + * `PEI` - Peruvian Inti - * `NOK` - Norwegian Krone + * `PEN` - Peruvian Sol - * `OMR` - Omani Rial + * `PES` - Peruvian Sol (1863–1965) - * `PKR` - Pakistani Rupee + * `PHP` - Philippine Peso - * `XPD` - Palladium + * `XPT` - Platinum - * `PAB` - Panamanian Balboa + * `PLN` - Polish Zloty - * `PGK` - Papua New Guinean Kina + * `PLZ` - Polish Zloty (1950–1995) - * `PYG` - Paraguayan Guarani + * `PTE` - Portuguese Escudo - * `PEI` - Peruvian Inti + * `GWE` - Portuguese Guinea Escudo - * `PEN` - Peruvian Sol + * `QAR` - Qatari Rial - * `PES` - Peruvian Sol (1863–1965) + * `XRE` - RINET Funds - * `PHP` - Philippine Peso + * `RHD` - Rhodesian Dollar - * `XPT` - Platinum + * `RON` - Romanian Leu - * `PLN` - Polish Zloty + * `ROL` - Romanian Leu (1952–2006) - * `PLZ` - Polish Zloty (1950–1995) + * `RUB` - Russian Ruble - * `PTE` - Portuguese Escudo + * `RUR` - Russian Ruble (1991–1998) - * `GWE` - Portuguese Guinea Escudo + * `RWF` - Rwandan Franc - * `QAR` - Qatari Rial + * `SVC` - Salvadoran Colón - * `XRE` - RINET Funds + * `WST` - Samoan Tala - * `RHD` - Rhodesian Dollar + * `SAR` - Saudi Riyal - * `RON` - Romanian Leu + * `RSD` - Serbian Dinar - * `ROL` - Romanian Leu (1952–2006) + * `CSD` - Serbian Dinar (2002–2006) - * `RUB` - Russian Ruble + * `SCR` - Seychellois Rupee - * `RUR` - Russian Ruble (1991–1998) + * `SLL` - Sierra Leonean Leone - * `RWF` - Rwandan Franc + * `XAG` - Silver - * `SVC` - Salvadoran Colón + * `SGD` - Singapore Dollar - * `WST` - Samoan Tala + * `SKK` - Slovak Koruna - * `SAR` - Saudi Riyal + * `SIT` - Slovenian Tolar - * `RSD` - Serbian Dinar + * `SBD` - Solomon Islands Dollar - * `CSD` - Serbian Dinar (2002–2006) + * `SOS` - Somali Shilling - * `SCR` - Seychellois Rupee + * `ZAR` - South African Rand - * `SLL` - Sierra Leonean Leone + * `ZAL` - South African Rand (financial) - * `XAG` - Silver + * `KRH` - South Korean Hwan (1953–1962) - * `SGD` - Singapore Dollar + * `KRW` - South Korean Won - * `SKK` - Slovak Koruna + * `KRO` - South Korean Won (1945–1953) - * `SIT` - Slovenian Tolar + * `SSP` - South Sudanese Pound - * `SBD` - Solomon Islands Dollar + * `SUR` - Soviet Rouble - * `SOS` - Somali Shilling + * `ESP` - Spanish Peseta - * `ZAR` - South African Rand + * `ESA` - Spanish Peseta (A account) - * `ZAL` - South African Rand (financial) + * `ESB` - Spanish Peseta (convertible account) - * `KRH` - South Korean Hwan (1953–1962) + * `XDR` - Special Drawing Rights - * `KRW` - South Korean Won + * `LKR` - Sri Lankan Rupee - * `KRO` - South Korean Won (1945–1953) + * `SHP` - St. Helena Pound - * `SSP` - South Sudanese Pound + * `XSU` - Sucre - * `SUR` - Soviet Rouble + * `SDD` - Sudanese Dinar (1992–2007) - * `ESP` - Spanish Peseta + * `SDG` - Sudanese Pound - * `ESA` - Spanish Peseta (A account) + * `SDP` - Sudanese Pound (1957–1998) - * `ESB` - Spanish Peseta (convertible account) + * `SRD` - Surinamese Dollar - * `XDR` - Special Drawing Rights + * `SRG` - Surinamese Guilder - * `LKR` - Sri Lankan Rupee + * `SZL` - Swazi Lilangeni - * `SHP` - St. Helena Pound + * `SEK` - Swedish Krona - * `XSU` - Sucre + * `CHF` - Swiss Franc - * `SDD` - Sudanese Dinar (1992–2007) + * `SYP` - Syrian Pound - * `SDG` - Sudanese Pound + * `STN` - São Tomé & Príncipe Dobra - * `SDP` - Sudanese Pound (1957–1998) + * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `SRD` - Surinamese Dollar + * `TVD` - TVD - * `SRG` - Surinamese Guilder + * `TJR` - Tajikistani Ruble - * `SZL` - Swazi Lilangeni + * `TJS` - Tajikistani Somoni - * `SEK` - Swedish Krona + * `TZS` - Tanzanian Shilling - * `CHF` - Swiss Franc + * `XTS` - Testing Currency Code - * `SYP` - Syrian Pound + * `THB` - Thai Baht - * `STN` - São Tomé & Príncipe Dobra + * `XXX` - The codes assigned for transactions where no currency is + involved - * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `TPE` - Timorese Escudo - * `TVD` - TVD + * `TOP` - Tongan Paʻanga - * `TJR` - Tajikistani Ruble + * `TTD` - Trinidad & Tobago Dollar - * `TJS` - Tajikistani Somoni + * `TND` - Tunisian Dinar - * `TZS` - Tanzanian Shilling + * `TRY` - Turkish Lira - * `XTS` - Testing Currency Code + * `TRL` - Turkish Lira (1922–2005) - * `THB` - Thai Baht + * `TMT` - Turkmenistani Manat - * `XXX` - The codes assigned for transactions where no currency is - involved + * `TMM` - Turkmenistani Manat (1993–2009) - * `TPE` - Timorese Escudo + * `USD` - US Dollar - * `TOP` - Tongan Paʻanga + * `USN` - US Dollar (Next day) - * `TTD` - Trinidad & Tobago Dollar + * `USS` - US Dollar (Same day) - * `TND` - Tunisian Dinar + * `UGX` - Ugandan Shilling - * `TRY` - Turkish Lira + * `UGS` - Ugandan Shilling (1966–1987) - * `TRL` - Turkish Lira (1922–2005) + * `UAH` - Ukrainian Hryvnia - * `TMT` - Turkmenistani Manat + * `UAK` - Ukrainian Karbovanets - * `TMM` - Turkmenistani Manat (1993–2009) + * `AED` - United Arab Emirates Dirham - * `USD` - US Dollar + * `UYW` - Uruguayan Nominal Wage Index Unit - * `USN` - US Dollar (Next day) + * `UYU` - Uruguayan Peso - * `USS` - US Dollar (Same day) + * `UYP` - Uruguayan Peso (1975–1993) - * `UGX` - Ugandan Shilling + * `UYI` - Uruguayan Peso (Indexed Units) - * `UGS` - Ugandan Shilling (1966–1987) + * `UZS` - Uzbekistani Som - * `UAH` - Ukrainian Hryvnia + * `VUV` - Vanuatu Vatu - * `UAK` - Ukrainian Karbovanets + * `VES` - Venezuelan Bolívar - * `AED` - United Arab Emirates Dirham + * `VEB` - Venezuelan Bolívar (1871–2008) - * `UYW` - Uruguayan Nominal Wage Index Unit + * `VEF` - Venezuelan Bolívar (2008–2018) - * `UYU` - Uruguayan Peso + * `VND` - Vietnamese Dong - * `UYP` - Uruguayan Peso (1975–1993) + * `VNN` - Vietnamese Dong (1978–1985) - * `UYI` - Uruguayan Peso (Indexed Units) + * `CHE` - WIR Euro - * `UZS` - Uzbekistani Som + * `CHW` - WIR Franc - * `VUV` - Vanuatu Vatu + * `XOF` - West African CFA Franc - * `VES` - Venezuelan Bolívar + * `YDD` - Yemeni Dinar - * `VEB` - Venezuelan Bolívar (1871–2008) + * `YER` - Yemeni Rial - * `VEF` - Venezuelan Bolívar (2008–2018) + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `VND` - Vietnamese Dong + * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `VNN` - Vietnamese Dong (1978–1985) + * `YUM` - Yugoslavian New Dinar (1994–2002) - * `CHE` - WIR Euro + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `CHW` - WIR Franc + * `ZWN` - ZWN - * `XOF` - West African CFA Franc + * `ZRN` - Zairean New Zaire (1993–1998) - * `YDD` - Yemeni Dinar + * `ZRZ` - Zairean Zaire (1971–1993) - * `YER` - Yemeni Rial + * `ZMW` - Zambian Kwacha - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `ZMK` - Zambian Kwacha (1968–2012) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `ZWD` - Zimbabwean Dollar (1980–2008) - * `YUM` - Yugoslavian New Dinar (1994–2002) + * `ZWR` - Zimbabwean Dollar (2008) - * `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 + * `ZWL` - Zimbabwean Dollar (2009) + union: + - PayCurrencyEnum + - string source: - openapi: openapi/openapi.yml - EmploymentStatusEnum: - enum: - - ACTIVE - - PENDING - - INACTIVE + 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: |- - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE + The position's FLSA status. + + * `EXEMPT` - EXEMPT + * `SALARIED_NONEXEMPT` - SALARIED_NONEXEMPT + * `NONEXEMPT` - NONEXEMPT + * `OWNER` - OWNER + union: + - FlsaStatusEnum + - string source: - openapi: openapi/openapi.yml - EmploymentTypeEnum: - enum: - - FULL_TIME - - PART_TIME - - INTERN - - CONTRACTOR - - FREELANCE + 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: openapi/openapi.yml - EnabledActionsEnum: - enum: - - READ - - WRITE - docs: |- - * `READ` - READ - * `WRITE` - WRITE - source: - openapi: openapi/openapi.yml - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - docs: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - source: - openapi: openapi/openapi.yml - ErrorValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: openapi/openapi.yml - 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 + openapi: hris_v3.yml + inline: true + Employment: docs: >- - * `AMERICAN_INDIAN_OR_ALASKA_NATIVE` - AMERICAN_INDIAN_OR_ALASKA_NATIVE + # The Employment Object - * `ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT + ### Description - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN + The `Employment` object is used to represent a job position at a company. - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER + 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. - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - * `WHITE` - WHITE + ### Usage Example - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - source: - openapi: openapi/openapi.yml - EventTypeEnum: - enum: - - CREATED_REMOTE_PRODUCTION_API_KEY - - DELETED_REMOTE_PRODUCTION_API_KEY - - CREATED_TEST_API_KEY - - DELETED_TEST_API_KEY - - REGENERATED_PRODUCTION_API_KEY - - REGENERATED_WEBHOOK_SIGNATURE - - INVITED_USER - - TWO_FACTOR_AUTH_ENABLED - - TWO_FACTOR_AUTH_DISABLED - - DELETED_LINKED_ACCOUNT - - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - - CREATED_DESTINATION - - DELETED_DESTINATION - - CHANGED_DESTINATION - - CHANGED_SCOPES - - CHANGED_PERSONAL_INFORMATION - - CHANGED_ORGANIZATION_SETTINGS - - ENABLED_INTEGRATION - - DISABLED_INTEGRATION - - ENABLED_CATEGORY - - DISABLED_CATEGORY - - CHANGED_PASSWORD - - RESET_PASSWORD - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - - FORCED_LINKED_ACCOUNT_RESYNC - - MUTED_ISSUE - - GENERATED_MAGIC_LINK - - ENABLED_MERGE_WEBHOOK - - DISABLED_MERGE_WEBHOOK - - MERGE_WEBHOOK_TARGET_CHANGED - - END_USER_CREDENTIALS_ACCESSED - docs: >- - * `CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY + 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. - * `DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY + * `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. - * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY + * `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. - * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY - * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY + * `XUA` - ADB Unit of Account - * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE + * `AFN` - Afghan Afghani - * `INVITED_USER` - INVITED_USER + * `AFA` - Afghan Afghani (1927–2002) - * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED + * `ALL` - Albanian Lek - * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED + * `ALK` - Albanian Lek (1946–1965) - * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT + * `DZD` - Algerian Dinar - * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT + * `ADP` - Andorran Peseta - * `CREATED_DESTINATION` - CREATED_DESTINATION + * `AOA` - Angolan Kwanza - * `DELETED_DESTINATION` - DELETED_DESTINATION + * `AOK` - Angolan Kwanza (1977–1991) - * `CHANGED_DESTINATION` - CHANGED_DESTINATION + * `AON` - Angolan New Kwanza (1990–2000) - * `CHANGED_SCOPES` - CHANGED_SCOPES + * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION + * `ARA` - Argentine Austral - * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS + * `ARS` - Argentine Peso - * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION + * `ARM` - Argentine Peso (1881–1970) - * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION + * `ARP` - Argentine Peso (1983–1985) - * `ENABLED_CATEGORY` - ENABLED_CATEGORY + * `ARL` - Argentine Peso Ley (1970–1983) - * `DISABLED_CATEGORY` - DISABLED_CATEGORY + * `AMD` - Armenian Dram - * `CHANGED_PASSWORD` - CHANGED_PASSWORD + * `AWG` - Aruban Florin - * `RESET_PASSWORD` - RESET_PASSWORD + * `AUD` - Australian Dollar - * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `ATS` - Austrian Schilling - * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `AZN` - Azerbaijani Manat - * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `AZM` - Azerbaijani Manat (1993–2006) - * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `BSD` - Bahamian Dollar - * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING + * `BHD` - Bahraini Dinar - * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING + * `BDT` - Bangladeshi Taka - * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + * `BBD` - Barbadian Dollar - * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + * `BYN` - Belarusian Ruble - * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING + * `BYB` - Belarusian Ruble (1994–1999) - * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING + * `BYR` - Belarusian Ruble (2000–2016) - * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `BEF` - Belgian Franc - * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `BEC` - Belgian Franc (convertible) - * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `BEL` - Belgian Franc (financial) - * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC + * `BZD` - Belize Dollar - * `MUTED_ISSUE` - MUTED_ISSUE + * `BMD` - Bermudan Dollar - * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + * `BTN` - Bhutanese Ngultrum - * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + * `BOB` - Bolivian Boliviano - * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + * `BOL` - Bolivian Boliviano (1863–1963) - * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED + * `BOV` - Bolivian Mvdol - * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED - source: - openapi: openapi/openapi.yml - ExternalTargetFieldApi: - properties: - name: - type: optional - access: read-only - description: - type: optional - access: read-only - is_mapped: - type: optional - access: read-only - source: - openapi: openapi/openapi.yml - ExternalTargetFieldApiResponse: - properties: - 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: openapi/openapi.yml - FieldMappingApiInstanceTargetField: - properties: - name: string - description: string - is_organization_wide: boolean - source: - openapi: openapi/openapi.yml - inline: true - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: - properties: - method: optional - url_path: optional - field_traversal_path: optional> - source: - openapi: openapi/openapi.yml - inline: true - FieldMappingApiInstanceRemoteField: - properties: - remote_key_name: optional - schema: optional> - remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - source: - openapi: openapi/openapi.yml - inline: true - FieldMappingApiInstance: - properties: - id: - type: optional - validation: - format: uuid - access: read-only - is_integration_wide: - type: optional - access: read-only - target_field: - type: optional - access: read-only - remote_field: - type: optional - access: read-only - source: - openapi: openapi/openapi.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: openapi/openapi.yml - FieldMappingInstanceResponse: - properties: - model: FieldMappingApiInstance - warnings: list - errors: list - logs: optional> - source: - openapi: openapi/openapi.yml - FieldPermissionDeserializer: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: openapi/openapi.yml - FieldPermissionDeserializerRequest: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: openapi/openapi.yml - FlsaStatusEnum: - enum: - - EXEMPT - - SALARIED_NONEXEMPT - - NONEXEMPT - - OWNER - docs: |- - * `EXEMPT` - EXEMPT - * `SALARIED_NONEXEMPT` - SALARIED_NONEXEMPT - * `NONEXEMPT` - NONEXEMPT - * `OWNER` - OWNER - source: - openapi: openapi/openapi.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: openapi/openapi.yml - Group: - docs: >- - # The Group Object + * `BOP` - Bolivian Peso - ### Description + * `BAM` - Bosnia-Herzegovina Convertible Mark - The `Group` object is used to represent any subset of employees across, - for example, `DEPARTMENT` or `TEAM`. Employees can be in multiple Groups. + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - ### Usage Example + * `BWP` - Botswanan Pula - 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 + * `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 @@ -3398,7 +4501,7 @@ types: type: optional docs: The group name. type: - type: optional + type: optional docs: |- The Group type returned directly from the third-party. @@ -3431,115 +4534,419 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml - GroupTypeEnum: - enum: - - TEAM - - DEPARTMENT - - COST_CENTER - - BUSINESS_UNIT - - GROUP + 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: |- - * `TEAM` - TEAM - * `DEPARTMENT` - DEPARTMENT - * `COST_CENTER` - COST_CENTER - * `BUSINESS_UNIT` - BUSINESS_UNIT - * `GROUP` - GROUP - source: - openapi: openapi/openapi.yml - IndividualCommonModelScopeDeserializer: - properties: - model_name: string - model_permissions: optional> - field_permissions: optional - source: - openapi: openapi/openapi.yml - IndividualCommonModelScopeDeserializerRequest: - properties: - model_name: - type: string - validation: - minLength: 1 - model_permissions: optional> - field_permissions: optional - source: - openapi: openapi/openapi.yml - Issue: - properties: - id: - type: optional - validation: - format: uuid - access: read-only - status: - type: optional - docs: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') + The location's type. Can be either WORK or HOME - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - error_description: string - end_user: - type: optional> - access: read-only - first_incident_time: optional - last_incident_time: optional - is_muted: - type: optional - access: read-only - error_details: - type: optional> - access: read-only - source: - openapi: openapi/openapi.yml - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - docs: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - source: - openapi: openapi/openapi.yml - LanguageEnum: - enum: - - en - - de - docs: |- - * `en` - en - * `de` - de - source: - openapi: openapi/openapi.yml - LastSyncResultEnum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - docs: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - source: - openapi: openapi/openapi.yml - LinkToken: - properties: - link_token: string - integration_name: optional - magic_link_url: optional - source: - openapi: openapi/openapi.yml - LinkedAccountStatus: - properties: - linked_account_status: string - can_make_request: boolean + * `HOME` - HOME + * `WORK` - WORK + union: + - LocationTypeEnum + - string source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml + inline: true Location: docs: >- # The Location Object @@ -3593,7 +5000,7 @@ types: type: optional docs: The location's zip code or postal code. country: - type: optional + type: optional docs: |- The location's country. @@ -3847,7 +5254,7 @@ types: * `ZM` - Zambia * `ZW` - Zimbabwe location_type: - type: optional + type: optional docs: |- The location's type. Can be either WORK or HOME @@ -3869,7 +5276,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml LocationTypeEnum: enum: - HOME @@ -3878,7 +5285,7 @@ types: * `HOME` - HOME * `WORK` - WORK source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml MaritalStatusEnum: enum: - SINGLE @@ -3898,7 +5305,7 @@ types: * `QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml MetaResponse: properties: request_schema: map @@ -3907,7 +5314,7 @@ types: has_conditional_params: boolean has_required_linked_account_params: boolean source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml MethodEnum: enum: - GET @@ -3926,7 +5333,7 @@ types: * `PATCH` - PATCH * `DELETE` - DELETE source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml ModelOperation: docs: >- # The ModelOperation Object @@ -3946,17 +5353,17 @@ types: required_post_parameters: list supported_fields: list source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml ModelPermissionDeserializer: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml ModelPermissionDeserializerRequest: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml MultipartFormFieldRequest: docs: >- # The MultipartFormField Object @@ -4000,147 +5407,147 @@ types: validation: minLength: 1 source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedAccountDetailsAndActionsList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedAuditLogEventList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedBankInfoList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedBenefitList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedCompanyList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedDependentList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedEmployeeList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedEmployeePayrollRunList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedEmployerBenefitList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedEmploymentList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedGroupList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedIssueList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedLocationList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedPayGroupList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedPayrollRunList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedSyncStatusList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedTeamList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedTimeOffBalanceList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedTimeOffList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PaginatedTimesheetEntryList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PayCurrencyEnum: enum: - XUA @@ -5063,7 +6470,7 @@ types: * `ZWL` - Zimbabwean Dollar (2009) source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PayFrequencyEnum: enum: - WEEKLY @@ -5087,7 +6494,7 @@ types: * `PRO_RATA` - PRO_RATA * `SEMIMONTHLY` - SEMIMONTHLY source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PayGroup: docs: >- # The PayGroup Object @@ -5138,7 +6545,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PayPeriodEnum: enum: - HOUR @@ -5161,7 +6568,39 @@ types: * `EVERY_SIX_MONTHS` - EVERY_SIX_MONTHS * `YEAR` - YEAR source: - openapi: openapi/openapi.yml + 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 @@ -5194,7 +6633,7 @@ types: docs: The datetime that this object was modified by Merge. access: read-only run_state: - type: optional + type: optional docs: |- The state of the payroll run @@ -5204,7 +6643,7 @@ types: * `FAILED` - FAILED * `CLOSED` - CLOSED run_type: - type: optional + type: optional docs: |- The type of the payroll run @@ -5238,7 +6677,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PolicyTypeEnum: enum: - VACATION @@ -5255,7 +6694,7 @@ types: * `VOLUNTEER` - VOLUNTEER * `BEREAVEMENT` - BEREAVEMENT source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml ReasonEnum: enum: - GENERAL_CUSTOMER_REQUEST @@ -5266,7 +6705,7 @@ types: * `GDPR` - GDPR * `OTHER` - OTHER source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RelationshipEnum: enum: - CHILD @@ -5277,7 +6716,7 @@ types: * `SPOUSE` - SPOUSE * `DOMESTIC_PARTNER` - DOMESTIC_PARTNER source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RemoteData: docs: >- # The RemoteData Object @@ -5299,21 +6738,21 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RemoteEndpointInfo: properties: method: string url_path: string field_traversal_path: list source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RemoteFieldApiCoverage: discriminated: false union: - integer - double source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true RemoteFieldApi: properties: @@ -5326,7 +6765,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RemoteFieldApiResponse: properties: Benefit: optional> @@ -5346,7 +6785,7 @@ types: Dependent: optional> TimesheetEntry: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RemoteKey: docs: >- # The RemoteKey Object @@ -5364,7 +6803,15 @@ types: name: string key: string source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml + RemoteResponseResponseType: + discriminated: false + union: + - ResponseTypeEnum + - string + source: + openapi: hris_v3.yml + inline: true RemoteResponse: docs: >- # The RemoteResponse Object @@ -5384,10 +6831,10 @@ types: status: integer response: unknown response_headers: optional> - response_type: optional + response_type: optional headers: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RequestFormatEnum: enum: - JSON @@ -5398,7 +6845,7 @@ types: * `XML` - XML * `MULTIPART` - MULTIPART source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RequestTypeEnum: enum: - VACATION @@ -5415,7 +6862,7 @@ types: * `VOLUNTEER` - VOLUNTEER * `BEREAVEMENT` - BEREAVEMENT source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml ResponseTypeEnum: enum: - JSON @@ -5424,7 +6871,7 @@ types: * `JSON` - JSON * `BASE64_GZIP` - BASE64_GZIP source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RoleEnum: enum: - ADMIN @@ -5441,7 +6888,7 @@ types: * `SYSTEM` - SYSTEM * `MERGE_TEAM` - MERGE_TEAM source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RunStateEnum: enum: - PAID @@ -5456,7 +6903,7 @@ types: * `FAILED` - FAILED * `CLOSED` - CLOSED source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml RunTypeEnum: enum: - REGULAR @@ -5471,7 +6918,7 @@ types: * `TERMINATION` - TERMINATION * `SIGN_ON_BONUS` - SIGN_ON_BONUS source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml SelectiveSyncConfigurationsUsageEnum: enum: - IN_NEXT_SYNC @@ -5480,7 +6927,7 @@ types: * `IN_NEXT_SYNC` - IN_NEXT_SYNC * `IN_LAST_SYNC` - IN_LAST_SYNC source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml StatusFd5Enum: enum: - SYNCING @@ -5497,7 +6944,23 @@ types: * `PAUSED` - PAUSED * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED source: - openapi: openapi/openapi.yml + 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 @@ -5517,13 +6980,13 @@ types: model_id: string last_sync_start: optional next_sync_start: optional - last_sync_result: optional + last_sync_result: optional last_sync_finished: optional - status: StatusFd5Enum + status: SyncStatusStatus is_initial_sync: boolean selective_sync_configurations_usage: optional source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml Tax: docs: >- # The Tax Object @@ -5582,7 +7045,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TeamParentTeam: discriminated: false docs: The team's parent team. @@ -5592,7 +7055,7 @@ types: format: uuid - Team source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true Team: docs: >- @@ -5649,7 +7112,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffEmployee: discriminated: false docs: The employee requesting time off. @@ -5659,7 +7122,7 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true TimeOffApprover: discriminated: false @@ -5672,7 +7135,56 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + 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: >- @@ -5713,7 +7225,7 @@ types: The Merge ID of the employee with the ability to approve the time off request. status: - type: optional + type: optional docs: |- The status of this time off request. @@ -5726,7 +7238,7 @@ types: type: optional docs: The employee note for this time off request. units: - type: optional + type: optional docs: >- The measurement that the third-party integration uses to count time requested. @@ -5739,7 +7251,7 @@ types: type: optional docs: The time off quantity measured by the prescribed “units”. request_type: - type: optional + type: optional docs: |- The type of time off request. @@ -5771,7 +7283,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffBalanceEmployee: discriminated: false docs: The employee the balance belongs to. @@ -5781,7 +7293,24 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + 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: >- @@ -5829,7 +7358,7 @@ types: 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 + type: optional docs: |- The policy type of this time off balance. @@ -5855,7 +7384,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffRequestEmployee: discriminated: false docs: The employee requesting time off. @@ -5865,7 +7394,7 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true TimeOffRequestApprover: discriminated: false @@ -5878,7 +7407,56 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + 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: >- @@ -5903,7 +7481,7 @@ types: The Merge ID of the employee with the ability to approve the time off request. status: - type: optional + type: optional docs: |- The status of this time off request. @@ -5916,7 +7494,7 @@ types: type: optional docs: The employee note for this time off request. units: - type: optional + type: optional docs: >- The measurement that the third-party integration uses to count time requested. @@ -5929,7 +7507,7 @@ types: type: optional docs: The time off quantity measured by the prescribed “units”. request_type: - type: optional + type: optional docs: |- The type of time off request. @@ -5952,7 +7530,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffResponse: properties: model: TimeOff @@ -5960,7 +7538,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffStatusEnum: enum: - REQUESTED @@ -5975,7 +7553,7 @@ types: * `CANCELLED` - CANCELLED * `DELETED` - DELETED source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimesheetEntryEmployee: discriminated: false docs: The employee the timesheet entry is for. @@ -5985,7 +7563,7 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true TimesheetEntry: docs: >- @@ -6046,7 +7624,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimesheetEntryRequestEmployee: discriminated: false docs: The employee the timesheet entry is for. @@ -6056,7 +7634,7 @@ types: format: uuid - Employee source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml inline: true TimesheetEntryRequest: docs: >- @@ -6092,7 +7670,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimesheetEntryResponse: properties: model: TimesheetEntry @@ -6100,7 +7678,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml UnitsEnum: enum: - HOURS @@ -6109,12 +7687,12 @@ types: * `HOURS` - HOURS * `DAYS` - DAYS source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml ValidationProblemSource: properties: pointer: string source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml WarningValidationProblem: properties: source: optional @@ -6122,11 +7700,11 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml WebhookReceiver: properties: event: string is_active: boolean key: optional source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/accountDetails.yml b/.mock/definition/HRIS/accountDetails.yml similarity index 81% rename from .mock/definition/hris/accountDetails.yml rename to .mock/definition/HRIS/accountDetails.yml index 2d4833d..f392c00 100644 --- a/.mock/definition/hris/accountDetails.yml +++ b/.mock/definition/HRIS/accountDetails.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /hris/v1/account-details method: GET - auth: true + auth: + - tokenAuth: [] docs: Get details for a linked account. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml response: docs: '' - type: root.AccountDetails + type: hrisRoot.AccountDetails status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd @@ -33,4 +35,4 @@ service: account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/accountToken.yml b/.mock/definition/HRIS/accountToken.yml similarity index 83% rename from .mock/definition/hris/accountToken.yml rename to .mock/definition/HRIS/accountToken.yml index 84185ff..7f9116b 100644 --- a/.mock/definition/hris/accountToken.yml +++ b/.mock/definition/HRIS/accountToken.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,24 @@ service: retrieve: path: /hris/v1/account-token/{public_token} method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Returns the account token for the end user with the provided public token. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: public_token: string response: docs: '' - type: root.AccountToken + type: hrisRoot.AccountToken status-code: 200 examples: - path-parameters: public_token: public_token + headers: + X-Account-Token: '[object Object]' response: body: account_token: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB @@ -41,4 +44,4 @@ service: key: value id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/asyncPassthrough.yml b/.mock/definition/HRIS/asyncPassthrough.yml similarity index 76% rename from .mock/definition/hris/asyncPassthrough.yml rename to .mock/definition/HRIS/asyncPassthrough.yml index 841c4d9..0b6a9ea 100644 --- a/.mock/definition/hris/asyncPassthrough.yml +++ b/.mock/definition/HRIS/asyncPassthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,23 @@ service: create: path: /hris/v1/async-passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: >- Asynchronously pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: - body: root.DataPassthroughRequest + body: hrisRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.AsyncPassthroughReciept + type: hrisRoot.AsyncPassthroughReciept status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -31,10 +33,11 @@ service: retrieve: path: /hris/v1/async-passthrough/{async_passthrough_receipt_id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Retrieves data from earlier async-passthrough POST request source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: async_passthrough_receipt_id: string response: @@ -44,7 +47,8 @@ service: examples: - path-parameters: async_passthrough_receipt_id: async_passthrough_receipt_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: method: GET @@ -59,12 +63,12 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml types: AsyncPassthroughRetrieveResponse: discriminated: false union: - - root.RemoteResponse + - hrisRoot.RemoteResponse - string source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/auditTrail.yml b/.mock/definition/HRIS/auditTrail.yml similarity index 83% rename from .mock/definition/hris/auditTrail.yml rename to .mock/definition/HRIS/auditTrail.yml index 19e653e..49c2754 100644 --- a/.mock/definition/hris/auditTrail.yml +++ b/.mock/definition/HRIS/auditTrail.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /hris/v1/audit-trail method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets a list of audit trail events. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: AuditTrailListRequest query-parameters: @@ -29,9 +34,8 @@ service: 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`, + `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`, @@ -72,10 +76,19 @@ service: email. response: docs: '' - type: root.PaginatedAuditLogEventList + type: hrisRoot.PaginatedAuditLogEventList status-code: 200 examples: - - response: + - 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 @@ -91,4 +104,4 @@ service: from Read to Read+Write created_at: '2024-01-15T09:30:00Z' source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/availableActions.yml b/.mock/definition/HRIS/availableActions.yml similarity index 85% rename from .mock/definition/hris/availableActions.yml rename to .mock/definition/HRIS/availableActions.yml index 74b6e65..0d065d2 100644 --- a/.mock/definition/hris/availableActions.yml +++ b/.mock/definition/HRIS/availableActions.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /hris/v1/available-actions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of models and actions available for an account. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml response: docs: '' - type: root.AvailableActions + type: hrisRoot.AvailableActions status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: integration: @@ -47,4 +49,4 @@ service: - company - title source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/bankInfo.yml b/.mock/definition/HRIS/bankInfo.yml similarity index 83% rename from .mock/definition/hris/bankInfo.yml rename to .mock/definition/HRIS/bankInfo.yml index d8d8fc2..3093967 100644 --- a/.mock/definition/hris/bankInfo.yml +++ b/.mock/definition/HRIS/bankInfo.yml @@ -4,7 +4,7 @@ types: - CHECKING - SAVINGS source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml BankInfoListRequestOrderBy: enum: - value: '-remote_created_at' @@ -12,9 +12,9 @@ types: - value: remote_created_at name: RemoteCreatedAtAscending source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -22,10 +22,15 @@ service: list: path: /hris/v1/bank-info method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `BankInfo` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: BankInfoListRequest query-parameters: @@ -58,6 +63,7 @@ service: 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. @@ -112,10 +118,28 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedBankInfoList + type: hrisRoot.PaginatedBankInfoList status-code: 200 examples: - - headers: {} + - 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 @@ -144,10 +168,11 @@ service: retrieve: path: /hris/v1/bank-info/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `BankInfo` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -155,6 +180,7 @@ service: 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. @@ -180,12 +206,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.BankInfo + type: hrisRoot.BankInfo status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -209,4 +241,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/benefits.yml b/.mock/definition/HRIS/benefits.yml similarity index 83% rename from .mock/definition/hris/benefits.yml rename to .mock/definition/HRIS/benefits.yml index 2a98a37..0d5618f 100644 --- a/.mock/definition/hris/benefits.yml +++ b/.mock/definition/HRIS/benefits.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /hris/v1/benefits method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Benefit` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: BenefitsListRequest query-parameters: @@ -32,6 +37,7 @@ service: 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. @@ -71,10 +77,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedBenefitList + type: hrisRoot.PaginatedBenefitList status-code: 200 examples: - - headers: {} + - 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 @@ -86,7 +105,6 @@ service: modified_at: '2021-10-16T00:00:00Z' employee: employee provider_name: Blue Shield of California - benefit_plan_type: benefit_plan_type employee_contribution: 23.65 company_contribution: 150 start_date: '2020-11-15T00:59:25Z' @@ -105,10 +123,11 @@ service: retrieve: path: /hris/v1/benefits/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Benefit` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -116,6 +135,7 @@ service: 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. @@ -131,12 +151,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Benefit + type: hrisRoot.Benefit status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -145,7 +169,6 @@ service: modified_at: '2021-10-16T00:00:00Z' employee: employee provider_name: Blue Shield of California - benefit_plan_type: benefit_plan_type employee_contribution: 23.65 company_contribution: 150 start_date: '2020-11-15T00:59:25Z' @@ -162,4 +185,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/companies.yml b/.mock/definition/HRIS/companies.yml similarity index 82% rename from .mock/definition/hris/companies.yml rename to .mock/definition/HRIS/companies.yml index 3b10795..f9025b0 100644 --- a/.mock/definition/hris/companies.yml +++ b/.mock/definition/HRIS/companies.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /hris/v1/companies method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Company` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: CompaniesListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedCompanyList + type: hrisRoot.PaginatedCompanyList status-code: 200 examples: - - headers: {} + - 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 @@ -93,10 +110,11 @@ service: retrieve: path: /hris/v1/companies/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Company` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -114,12 +132,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Company + type: hrisRoot.Company status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -143,4 +165,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/deleteAccount.yml b/.mock/definition/HRIS/deleteAccount.yml similarity index 56% rename from .mock/definition/hris/deleteAccount.yml rename to .mock/definition/HRIS/deleteAccount.yml index d8b1e45..796d144 100644 --- a/.mock/definition/hris/deleteAccount.yml +++ b/.mock/definition/HRIS/deleteAccount.yml @@ -5,11 +5,13 @@ service: delete: path: /hris/v1/delete-account method: POST - auth: true + auth: + - tokenAuth: [] docs: Delete a linked account. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/dependents.yml b/.mock/definition/HRIS/dependents.yml similarity index 83% rename from .mock/definition/hris/dependents.yml rename to .mock/definition/HRIS/dependents.yml index a4254dd..bdae829 100644 --- a/.mock/definition/hris/dependents.yml +++ b/.mock/definition/HRIS/dependents.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /hris/v1/dependents method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Dependent` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: DependentsListRequest query-parameters: @@ -66,10 +71,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedDependentList + type: hrisRoot.PaginatedDependentList status-code: 200 examples: - - headers: {} + - 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 @@ -103,10 +121,11 @@ service: retrieve: path: /hris/v1/dependents/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Dependent` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -129,12 +148,17 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Dependent + type: hrisRoot.Dependent status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -163,4 +187,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/employeePayrollRuns.yml b/.mock/definition/HRIS/employeePayrollRuns.yml similarity index 87% rename from .mock/definition/hris/employeePayrollRuns.yml rename to .mock/definition/HRIS/employeePayrollRuns.yml index c4ffb0b..e16eb56 100644 --- a/.mock/definition/hris/employeePayrollRuns.yml +++ b/.mock/definition/HRIS/employeePayrollRuns.yml @@ -1,22 +1,18 @@ types: - EmployeePayrollRunsListRequestExpand: + EmployeePayrollRunsListRequestExpandItem: enum: - employee - - value: employee,payroll_run - name: EmployeePayrollRun - payroll_run source: - openapi: openapi/openapi.yml - EmployeePayrollRunsRetrieveRequestExpand: + openapi: hris_v3.yml + EmployeePayrollRunsRetrieveRequestExpandItem: enum: - employee - - value: employee,payroll_run - name: EmployeePayrollRun - payroll_run source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -24,10 +20,15 @@ service: list: path: /hris/v1/employee-payroll-runs method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `EmployeePayrollRun` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: EmployeePayrollRunsListRequest query-parameters: @@ -58,7 +59,8 @@ service: If provided, will only return employee payroll runs ended before this datetime. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -113,10 +115,28 @@ service: this datetime. response: docs: '' - type: root.PaginatedEmployeePayrollRunList + type: hrisRoot.PaginatedEmployeePayrollRunList status-code: 200 examples: - - headers: {} + - 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 @@ -175,17 +195,19 @@ service: retrieve: path: /hris/v1/employee-payroll-runs/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `EmployeePayrollRun` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: name: EmployeePayrollRunsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -201,12 +223,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.EmployeePayrollRun + type: hrisRoot.EmployeePayrollRun status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -298,4 +324,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/employees.yml b/.mock/definition/HRIS/employees.yml new file mode 100644 index 0000000..545cc55 --- /dev/null +++ b/.mock/definition/HRIS/employees.yml @@ -0,0 +1,831 @@ +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 similarity index 81% rename from .mock/definition/hris/employerBenefits.yml rename to .mock/definition/HRIS/employerBenefits.yml index f110617..db54627 100644 --- a/.mock/definition/hris/employerBenefits.yml +++ b/.mock/definition/HRIS/employerBenefits.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /hris/v1/employer-benefits method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `EmployerBenefit` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: EmployerBenefitsListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedEmployerBenefitList + type: hrisRoot.PaginatedEmployerBenefitList status-code: 200 examples: - - headers: {} + - 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 @@ -89,10 +106,11 @@ service: retrieve: path: /hris/v1/employer-benefits/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `EmployerBenefit` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -110,12 +128,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.EmployerBenefit + type: hrisRoot.EmployerBenefit status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -137,4 +159,4 @@ service: data: key: value source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/employments.yml b/.mock/definition/HRIS/employments.yml similarity index 87% rename from .mock/definition/hris/employments.yml rename to .mock/definition/HRIS/employments.yml index f676c7d..4fdd65f 100644 --- a/.mock/definition/hris/employments.yml +++ b/.mock/definition/HRIS/employments.yml @@ -1,12 +1,10 @@ types: - EmploymentsListRequestExpand: + EmploymentsListRequestExpandItem: enum: - employee - - value: employee,pay_group - name: EmployeePayGroup - pay_group source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmploymentsListRequestOrderBy: enum: - value: '-effective_date' @@ -14,7 +12,7 @@ types: - value: effective_date name: EffectiveDateAscending source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmploymentsListRequestRemoteFields: enum: - employment_type @@ -44,7 +42,7 @@ types: name: PayFrequencyPayPeriod - pay_period source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmploymentsListRequestShowEnumOrigins: enum: - employment_type @@ -74,15 +72,13 @@ types: name: PayFrequencyPayPeriod - pay_period source: - openapi: openapi/openapi.yml - EmploymentsRetrieveRequestExpand: + openapi: hris_v3.yml + EmploymentsRetrieveRequestExpandItem: enum: - employee - - value: employee,pay_group - name: EmployeePayGroup - pay_group source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmploymentsRetrieveRequestRemoteFields: enum: - employment_type @@ -112,7 +108,7 @@ types: name: PayFrequencyPayPeriod - pay_period source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml EmploymentsRetrieveRequestShowEnumOrigins: enum: - employment_type @@ -142,9 +138,9 @@ types: name: PayFrequencyPayPeriod - pay_period source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -152,10 +148,15 @@ service: list: path: /hris/v1/employments method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Employment` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: EmploymentsListRequest query-parameters: @@ -174,7 +175,8 @@ service: type: optional docs: If provided, will only return employments for this employee. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -229,10 +231,26 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedEmploymentList + type: hrisRoot.PaginatedEmploymentList status-code: 200 examples: - - headers: {} + - 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 @@ -265,17 +283,19 @@ service: retrieve: path: /hris/v1/employments/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Employment` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: name: EmploymentsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -301,12 +321,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Employment + type: hrisRoot.Employment status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -334,4 +360,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/fieldMapping.yml b/.mock/definition/HRIS/fieldMapping.yml similarity index 96% rename from .mock/definition/hris/fieldMapping.yml rename to .mock/definition/HRIS/fieldMapping.yml index 2c83b14..995d640 100644 --- a/.mock/definition/hris/fieldMapping.yml +++ b/.mock/definition/HRIS/fieldMapping.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,14 +7,15 @@ service: field_mappings_retrieve: path: /hris/v1/field-mappings method: GET - auth: true + 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: openapi/openapi.yml + openapi: hris_v3.yml request: name: FieldMappingsRetrieveRequest query-parameters: @@ -27,10 +28,13 @@ service: of the request since these fields require some calculations. response: docs: '' - type: root.FieldMappingApiInstanceResponse + type: hrisRoot.FieldMappingApiInstanceResponse status-code: 200 examples: - - headers: {} + - query-parameters: + exclude_remote_field_metadata: true + headers: + X-Account-Token: X-Account-Token response: body: Benefit: @@ -292,13 +296,14 @@ service: field_mappings_create: path: /hris/v1/field-mappings method: POST - auth: true + 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: openapi/openapi.yml + openapi: hris_v3.yml request: name: CreateFieldMappingRequest query-parameters: @@ -354,10 +359,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: hrisRoot.FieldMappingInstanceResponse status-code: 201 examples: - - headers: {} + - 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 @@ -407,24 +415,26 @@ service: field_mappings_destroy: path: /hris/v1/field-mappings/{field_mapping_id} method: DELETE - auth: true + 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: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: field_mapping_id: string response: docs: '' - type: root.FieldMappingInstanceResponse + type: hrisRoot.FieldMappingInstanceResponse status-code: 204 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: model: @@ -466,13 +476,14 @@ service: field_mappings_partial_update: path: /hris/v1/field-mappings/{field_mapping_id} method: PATCH - auth: true + 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: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: field_mapping_id: string request: @@ -501,12 +512,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: hrisRoot.FieldMappingInstanceResponse status-code: 200 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token request: {} response: body: @@ -549,7 +561,8 @@ service: remote_fields_retrieve: path: /hris/v1/remote-fields method: GET - auth: true + 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 @@ -557,7 +570,7 @@ service: or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: RemoteFieldsRetrieveRequest query-parameters: @@ -574,10 +587,14 @@ service: data from your customers. response: docs: '' - type: root.RemoteFieldApiResponse + type: hrisRoot.RemoteFieldApiResponse status-code: 200 examples: - - headers: {} + - query-parameters: + common_models: common_models + include_example_values: include_example_values + headers: + X-Account-Token: X-Account-Token response: body: Benefit: @@ -807,7 +824,8 @@ service: target_fields_retrieve: path: /hris/v1/target-fields method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields @@ -815,13 +833,14 @@ service: Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml response: docs: '' - type: root.ExternalTargetFieldApiResponse + type: hrisRoot.ExternalTargetFieldApiResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: Benefit: @@ -889,4 +908,4 @@ service: description: this is a example description of a target field is_mapped: is_mapped source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/forceResync.yml b/.mock/definition/HRIS/forceResync.yml similarity index 83% rename from .mock/definition/hris/forceResync.yml rename to .mock/definition/HRIS/forceResync.yml index ccae8e7..bd0a385 100644 --- a/.mock/definition/hris/forceResync.yml +++ b/.mock/definition/HRIS/forceResync.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: sync_status_resync_create: path: /hris/v1/sync-status/resync method: POST - auth: true + 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 @@ -15,13 +16,14 @@ service: linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - model_name: Employee @@ -34,4 +36,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/generateKey.yml b/.mock/definition/HRIS/generateKey.yml similarity index 75% rename from .mock/definition/hris/generateKey.yml rename to .mock/definition/HRIS/generateKey.yml index 94a399f..8cb621d 100644 --- a/.mock/definition/hris/generateKey.yml +++ b/.mock/definition/HRIS/generateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /hris/v1/generate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Create a remote key. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: GenerateRemoteKeyRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: hrisRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/groups.yml b/.mock/definition/HRIS/groups.yml similarity index 83% rename from .mock/definition/hris/groups.yml rename to .mock/definition/HRIS/groups.yml index 942ebed..9693030 100644 --- a/.mock/definition/hris/groups.yml +++ b/.mock/definition/HRIS/groups.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /hris/v1/groups method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Group` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: GroupsListRequest query-parameters: @@ -88,10 +93,27 @@ service: values can be separated by commas. response: docs: '' - type: root.PaginatedGroupList + type: hrisRoot.PaginatedGroupList status-code: 200 examples: - - headers: {} + - 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 @@ -118,10 +140,11 @@ service: retrieve: path: /hris/v1/groups/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Group` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -149,12 +172,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Group + type: hrisRoot.Group status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -176,4 +205,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/issues.yml b/.mock/definition/HRIS/issues.yml similarity index 75% rename from .mock/definition/hris/issues.yml rename to .mock/definition/HRIS/issues.yml index 9fd39ae..fb74883 100644 --- a/.mock/definition/hris/issues.yml +++ b/.mock/definition/HRIS/issues.yml @@ -4,9 +4,9 @@ types: - ONGOING - RESOLVED source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -14,10 +14,15 @@ service: list: path: /hris/v1/issues method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets all issues for Organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: IssuesListRequest query-parameters: @@ -77,10 +82,27 @@ service: * `RESOLVED` - RESOLVED response: docs: '' - type: root.PaginatedIssueList + type: hrisRoot.PaginatedIssueList status-code: 200 examples: - - response: + - 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 @@ -99,19 +121,22 @@ service: retrieve: path: /hris/v1/issues/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Get a specific issue. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string response: docs: '' - type: root.Issue + 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 @@ -126,4 +151,4 @@ service: - Missing employee permissions. - Missing time off permissions. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/linkToken.yml b/.mock/definition/HRIS/linkToken.yml similarity index 85% rename from .mock/definition/hris/linkToken.yml rename to .mock/definition/HRIS/linkToken.yml index 1e78c2e..f589add 100644 --- a/.mock/definition/hris/linkToken.yml +++ b/.mock/definition/HRIS/linkToken.yml @@ -1,5 +1,22 @@ imports: - root: __package__.yml + 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: '' @@ -7,10 +24,11 @@ service: create: path: /hris/v1/link-token method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a link token to be used when linking a new end user. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: EndUserDetailsRequest body: @@ -41,7 +59,7 @@ service: maxLength: 100 categories: docs: The integration categories to show in Merge Link. - type: list + type: list integration: type: optional docs: >- @@ -76,7 +94,7 @@ service: https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. default: false common_models: - type: optional> + 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 @@ -86,14 +104,14 @@ service: category_common_model_scopes: type: >- optional>>> + 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 + type: optional docs: >- The following subset of IETF language tags can be used to configure localization. @@ -116,10 +134,12 @@ service: content-type: application/json response: docs: '' - type: root.LinkToken + type: hrisRoot.LinkToken status-code: 200 examples: - - request: + - 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' @@ -132,4 +152,4 @@ service: integration_name: Lever magic_link_url: https://link.merge.dev/asdfjkl12345jsndfgi2i83n source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/linkedAccounts.yml b/.mock/definition/HRIS/linkedAccounts.yml similarity index 82% rename from .mock/definition/hris/linkedAccounts.yml rename to .mock/definition/HRIS/linkedAccounts.yml index 3ed6393..a5afc18 100644 --- a/.mock/definition/hris/linkedAccounts.yml +++ b/.mock/definition/HRIS/linkedAccounts.yml @@ -9,9 +9,9 @@ types: - mktg - ticketing source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -19,10 +19,15 @@ service: list: path: /hris/v1/linked-accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: List linked accounts for your organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: LinkedAccountsListRequest query-parameters: @@ -104,10 +109,26 @@ service: `RELINK_NEEDED` response: docs: '' - type: root.PaginatedAccountDetailsAndActionsList + type: hrisRoot.PaginatedAccountDetailsAndActionsList status-code: 200 examples: - - response: + - 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 @@ -144,7 +165,5 @@ service: - title account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' - integration_specific_fields: - integration_specific_field: Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/locations.yml b/.mock/definition/HRIS/locations.yml similarity index 83% rename from .mock/definition/hris/locations.yml rename to .mock/definition/HRIS/locations.yml index a4c2f9b..58bafc9 100644 --- a/.mock/definition/hris/locations.yml +++ b/.mock/definition/HRIS/locations.yml @@ -4,7 +4,7 @@ types: - HOME - WORK source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml LocationsListRequestRemoteFields: enum: - country @@ -12,7 +12,7 @@ types: name: CountryLocationType - location_type source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml LocationsListRequestShowEnumOrigins: enum: - country @@ -20,7 +20,7 @@ types: name: CountryLocationType - location_type source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml LocationsRetrieveRequestRemoteFields: enum: - country @@ -28,7 +28,7 @@ types: name: CountryLocationType - location_type source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml LocationsRetrieveRequestShowEnumOrigins: enum: - country @@ -36,9 +36,9 @@ types: name: CountryLocationType - location_type source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -46,10 +46,15 @@ service: list: path: /hris/v1/locations method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Location` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: LocationsListRequest query-parameters: @@ -117,10 +122,25 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedLocationList + type: hrisRoot.PaginatedLocationList status-code: 200 examples: - - headers: {} + - 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 @@ -152,10 +172,11 @@ service: retrieve: path: /hris/v1/locations/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Location` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -183,12 +204,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Location + type: hrisRoot.Location status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -215,4 +242,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/passthrough.yml b/.mock/definition/HRIS/passthrough.yml similarity index 74% rename from .mock/definition/hris/passthrough.yml rename to .mock/definition/HRIS/passthrough.yml index 602b2cd..d3e6c86 100644 --- a/.mock/definition/hris/passthrough.yml +++ b/.mock/definition/HRIS/passthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,21 @@ service: create: path: /hris/v1/passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: Pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: - body: root.DataPassthroughRequest + body: hrisRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.RemoteResponse + type: hrisRoot.RemoteResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -37,4 +39,4 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/payGroups.yml b/.mock/definition/HRIS/payGroups.yml similarity index 81% rename from .mock/definition/hris/payGroups.yml rename to .mock/definition/HRIS/payGroups.yml index 981803d..25fa265 100644 --- a/.mock/definition/hris/payGroups.yml +++ b/.mock/definition/HRIS/payGroups.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /hris/v1/pay-groups method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `PayGroup` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: PayGroupsListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedPayGroupList + type: hrisRoot.PaginatedPayGroupList status-code: 200 examples: - - headers: {} + - 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 @@ -88,10 +105,11 @@ service: retrieve: path: /hris/v1/pay-groups/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `PayGroup` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -109,12 +127,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.PayGroup + type: hrisRoot.PayGroup status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -133,4 +155,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/payrollRuns.yml b/.mock/definition/HRIS/payrollRuns.yml similarity index 83% rename from .mock/definition/hris/payrollRuns.yml rename to .mock/definition/HRIS/payrollRuns.yml index b4414e4..2ee23ce 100644 --- a/.mock/definition/hris/payrollRuns.yml +++ b/.mock/definition/HRIS/payrollRuns.yml @@ -6,7 +6,7 @@ types: name: RunStateRunType - run_type source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PayrollRunsListRequestRunType: enum: - CORRECTION @@ -15,7 +15,7 @@ types: - SIGN_ON_BONUS - TERMINATION source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PayrollRunsListRequestShowEnumOrigins: enum: - run_state @@ -23,7 +23,7 @@ types: name: RunStateRunType - run_type source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PayrollRunsRetrieveRequestRemoteFields: enum: - run_state @@ -31,7 +31,7 @@ types: name: RunStateRunType - run_type source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml PayrollRunsRetrieveRequestShowEnumOrigins: enum: - run_state @@ -39,9 +39,9 @@ types: name: RunStateRunType - run_type source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -49,10 +49,15 @@ service: list: path: /hris/v1/payroll-runs method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `PayrollRun` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: PayrollRunsListRequest query-parameters: @@ -150,10 +155,29 @@ service: datetime. response: docs: '' - type: root.PaginatedPayrollRunList + type: hrisRoot.PaginatedPayrollRunList status-code: 200 examples: - - headers: {} + - 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 @@ -181,10 +205,11 @@ service: retrieve: path: /hris/v1/payroll-runs/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `PayrollRun` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -212,12 +237,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PayrollRun + type: hrisRoot.PayrollRun status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -240,4 +271,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/regenerateKey.yml b/.mock/definition/HRIS/regenerateKey.yml similarity index 75% rename from .mock/definition/hris/regenerateKey.yml rename to .mock/definition/HRIS/regenerateKey.yml index e29e77d..041f97c 100644 --- a/.mock/definition/hris/regenerateKey.yml +++ b/.mock/definition/HRIS/regenerateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /hris/v1/regenerate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Exchange remote keys. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: RemoteKeyForRegenerationRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: hrisRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/scopes.yml b/.mock/definition/HRIS/scopes.yml similarity index 87% rename from .mock/definition/hris/scopes.yml rename to .mock/definition/HRIS/scopes.yml index 59ec6a7..24139c3 100644 --- a/.mock/definition/hris/scopes.yml +++ b/.mock/definition/HRIS/scopes.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,22 @@ service: default_scopes_retrieve: path: /hris/v1/default-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: hris_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: hrisRoot.CommonModelScopeApi status-code: 200 examples: - - response: + - headers: + X-Account-Token: '[object Object]' + response: body: common_models: - model_name: Employee @@ -48,19 +51,21 @@ service: linked_account_scopes_retrieve: path: /hris/v1/linked-account-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: hris_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: hrisRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: common_models: @@ -90,28 +95,30 @@ service: linked_account_scopes_create: path: /hris/v1/linked-account-scopes method: POST - auth: true + 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: openapi/openapi.yml + openapi: hris_v3.yml request: name: LinkedAccountCommonModelScopeDeserializerRequest body: properties: common_models: docs: The common models you want to update the scopes for - type: list + type: list content-type: application/json response: docs: '' - type: root.CommonModelScopeApi + type: hrisRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: common_models: - model_name: Employee @@ -157,4 +164,4 @@ service: - manager - work_location source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/syncStatus.yml b/.mock/definition/HRIS/syncStatus.yml similarity index 80% rename from .mock/definition/hris/syncStatus.yml rename to .mock/definition/HRIS/syncStatus.yml index c7e03e6..8f676be 100644 --- a/.mock/definition/hris/syncStatus.yml +++ b/.mock/definition/HRIS/syncStatus.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: list: path: /hris/v1/sync-status method: GET - auth: true + 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. @@ -20,8 +21,12 @@ service: `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: openapi/openapi.yml + openapi: hris_v3.yml request: name: SyncStatusListRequest query-parameters: @@ -33,10 +38,14 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedSyncStatusList + type: hrisRoot.PaginatedSyncStatusList status-code: 200 examples: - - headers: {} + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + page_size: 1 + headers: + X-Account-Token: X-Account-Token response: body: next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw @@ -52,4 +61,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/teams.yml b/.mock/definition/HRIS/teams.yml similarity index 81% rename from .mock/definition/hris/teams.yml rename to .mock/definition/HRIS/teams.yml index 4cb8741..fce94ae 100644 --- a/.mock/definition/hris/teams.yml +++ b/.mock/definition/HRIS/teams.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /hris/v1/teams method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Team` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: TeamsListRequest query-parameters: @@ -27,6 +32,7 @@ service: 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. @@ -69,10 +75,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedTeamList + type: hrisRoot.PaginatedTeamList status-code: 200 examples: - - headers: {} + - 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 @@ -97,10 +116,11 @@ service: retrieve: path: /hris/v1/teams/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Team` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -108,6 +128,7 @@ service: 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. @@ -123,12 +144,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Team + type: hrisRoot.Team status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -148,4 +173,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/timeOff.yml b/.mock/definition/HRIS/timeOff.yml similarity index 89% rename from .mock/definition/hris/timeOff.yml rename to .mock/definition/HRIS/timeOff.yml index 9481811..4b024ba 100644 --- a/.mock/definition/hris/timeOff.yml +++ b/.mock/definition/HRIS/timeOff.yml @@ -1,12 +1,10 @@ types: - TimeOffListRequestExpand: + TimeOffListRequestExpandItem: enum: - approver - employee - - value: employee,approver - name: EmployeeApprover source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffListRequestRemoteFields: enum: - request_type @@ -21,7 +19,7 @@ types: name: StatusUnits - units source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffListRequestRequestType: enum: - BEREAVEMENT @@ -31,7 +29,7 @@ types: - VACATION - VOLUNTEER source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffListRequestShowEnumOrigins: enum: - request_type @@ -46,7 +44,7 @@ types: name: StatusUnits - units source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffListRequestStatus: enum: - APPROVED @@ -55,15 +53,13 @@ types: - DELETED - REQUESTED source: - openapi: openapi/openapi.yml - TimeOffRetrieveRequestExpand: + openapi: hris_v3.yml + TimeOffRetrieveRequestExpandItem: enum: - approver - employee - - value: employee,approver - name: EmployeeApprover source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffRetrieveRequestRemoteFields: enum: - request_type @@ -78,7 +74,7 @@ types: name: StatusUnits - units source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml TimeOffRetrieveRequestShowEnumOrigins: enum: - request_type @@ -93,9 +89,9 @@ types: name: StatusUnits - units source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -103,10 +99,15 @@ service: list: path: /hris/v1/time-off method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `TimeOff` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: TimeOffListRequest query-parameters: @@ -138,7 +139,8 @@ service: If provided, will only return time-offs that ended before this datetime. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -233,10 +235,32 @@ service: * `DELETED` - DELETED response: docs: '' - type: root.PaginatedTimeOffList + type: hrisRoot.PaginatedTimeOffList status-code: 200 examples: - - headers: {} + - 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 @@ -268,10 +292,11 @@ service: create: path: /hris/v1/time-off method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `TimeOff` object with the given values. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: TimeOffEndpointRequest query-parameters: @@ -285,14 +310,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.TimeOffRequest + model: hrisRoot.TimeOffRequest content-type: application/json response: docs: '' - type: root.TimeOffResponse + type: hrisRoot.TimeOffResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -344,17 +373,19 @@ service: retrieve: path: /hris/v1/time-off/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `TimeOff` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: name: TimeOffRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -380,12 +411,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.TimeOff + type: hrisRoot.TimeOff status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -414,16 +451,18 @@ service: metaPostRetrieve: path: /hris/v1/time-off/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `TimeOff` POSTs. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml response: docs: '' - type: root.MetaResponse + type: hrisRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -596,4 +635,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/timeOffBalances.yml b/.mock/definition/HRIS/timeOffBalances.yml similarity index 83% rename from .mock/definition/hris/timeOffBalances.yml rename to .mock/definition/HRIS/timeOffBalances.yml index 509df36..0fec21a 100644 --- a/.mock/definition/hris/timeOffBalances.yml +++ b/.mock/definition/HRIS/timeOffBalances.yml @@ -8,9 +8,9 @@ types: - VACATION - VOLUNTEER source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -18,10 +18,15 @@ service: list: path: /hris/v1/time-off-balances method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `TimeOffBalance` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: TimeOffBalancesListRequest query-parameters: @@ -41,6 +46,7 @@ service: 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. @@ -109,10 +115,26 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedTimeOffBalanceList + type: hrisRoot.PaginatedTimeOffBalanceList status-code: 200 examples: - - headers: {} + - 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 @@ -139,10 +161,11 @@ service: retrieve: path: /hris/v1/time-off-balances/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `TimeOffBalance` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -150,6 +173,7 @@ service: 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. @@ -175,12 +199,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.TimeOffBalance + type: hrisRoot.TimeOffBalance status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -202,4 +232,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/timesheetEntries.yml b/.mock/definition/HRIS/timesheetEntries.yml similarity index 89% rename from .mock/definition/hris/timesheetEntries.yml rename to .mock/definition/HRIS/timesheetEntries.yml index 69380ef..6c7fb83 100644 --- a/.mock/definition/hris/timesheetEntries.yml +++ b/.mock/definition/HRIS/timesheetEntries.yml @@ -6,9 +6,9 @@ types: - value: start_time name: StartTimeAscending source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -16,10 +16,15 @@ service: list: path: /hris/v1/timesheet-entries method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `TimesheetEntry` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: TimesheetEntriesListRequest query-parameters: @@ -49,6 +54,7 @@ service: 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. @@ -103,10 +109,28 @@ service: this datetime. response: docs: '' - type: root.PaginatedTimesheetEntryList + type: hrisRoot.PaginatedTimesheetEntryList status-code: 200 examples: - - headers: {} + - 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 @@ -133,10 +157,11 @@ service: create: path: /hris/v1/timesheet-entries method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `TimesheetEntry` object with the given values. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: TimesheetEntryEndpointRequest query-parameters: @@ -150,14 +175,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.TimesheetEntryRequest + model: hrisRoot.TimesheetEntryRequest content-type: application/json response: docs: '' - type: root.TimesheetEntryResponse + type: hrisRoot.TimesheetEntryResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -204,10 +233,11 @@ service: retrieve: path: /hris/v1/timesheet-entries/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `TimesheetEntry` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml path-parameters: id: string request: @@ -215,6 +245,7 @@ service: 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. @@ -230,12 +261,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.TimesheetEntry + type: hrisRoot.TimesheetEntry status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -259,16 +294,18 @@ service: metaPostRetrieve: path: /hris/v1/timesheet-entries/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `TimesheetEntry` POSTs. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml response: docs: '' - type: root.MetaResponse + type: hrisRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -441,4 +478,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/hris/webhookReceivers.yml b/.mock/definition/HRIS/webhookReceivers.yml similarity index 75% rename from .mock/definition/hris/webhookReceivers.yml rename to .mock/definition/HRIS/webhookReceivers.yml index 05eae39..3bc0cc7 100644 --- a/.mock/definition/hris/webhookReceivers.yml +++ b/.mock/definition/HRIS/webhookReceivers.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + hrisRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: list: path: /hris/v1/webhook-receivers method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `WebhookReceiver` objects. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - event: event @@ -25,10 +27,11 @@ service: create: path: /hris/v1/webhook-receivers method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `WebhookReceiver` object with the given values. source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml request: name: WebhookReceiverRequest body: @@ -45,10 +48,11 @@ service: content-type: application/json response: docs: '' - type: root.WebhookReceiver + type: hrisRoot.WebhookReceiver status-code: 201 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: event: event is_active: true @@ -58,4 +62,4 @@ service: is_active: true key: key source: - openapi: openapi/openapi.yml + openapi: hris_v3.yml diff --git a/.mock/definition/ticketing/__package__.yml b/.mock/definition/Ticketing/__package__.yml similarity index 84% rename from .mock/definition/ticketing/__package__.yml rename to .mock/definition/Ticketing/__package__.yml index 7b2fb89..966e736 100644 --- a/.mock/definition/ticketing/__package__.yml +++ b/.mock/definition/Ticketing/__package__.yml @@ -54,7 +54,15 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml + AccountDetailsCategory: + discriminated: false + union: + - CategoryEnum + - string + source: + openapi: ticketing_v3.yml + inline: true AccountDetails: properties: id: @@ -68,7 +76,7 @@ types: integration_slug: type: optional access: read-only - category: optional + category: optional end_user_origin_id: type: optional access: read-only @@ -103,7 +111,23 @@ types: type: optional docs: The time at which account completes the linking flow. source: - openapi: openapi/openapi.yml + 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 @@ -119,8 +143,8 @@ types: View a list of your organization's `LinkedAccount` objects. properties: id: string - category: optional - status: AccountDetailsAndActionsStatusEnum + category: optional + status: AccountDetailsAndActionsStatus status_detail: optional end_user_origin_id: optional end_user_organization_name: string @@ -139,9 +163,8 @@ types: integration: optional account_type: string completed_at: datetime - integration_specific_fields: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml AccountDetailsAndActionsIntegration: properties: name: string @@ -153,7 +176,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml AccountDetailsAndActionsStatusEnum: enum: - COMPLETE @@ -166,7 +189,7 @@ types: * `RELINK_NEEDED` - RELINK_NEEDED * `IDLE` - IDLE source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml AccountIntegration: properties: name: @@ -224,14 +247,14 @@ types: docs: Category or categories this integration is in beta status for. access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml AccountToken: properties: account_token: string integration: AccountIntegration id: string source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml AdvancedMetadata: properties: id: @@ -244,7 +267,7 @@ types: is_custom: optional field_choices: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml AsyncPassthroughReciept: properties: async_passthrough_receipt_id: @@ -252,7 +275,7 @@ types: validation: format: uuid source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml AttachmentTicket: discriminated: false docs: The ticket associated with the attachment. @@ -262,7 +285,7 @@ types: format: uuid - Ticket source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true Attachment: docs: |- @@ -329,7 +352,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml AttachmentRequestTicket: discriminated: false docs: The ticket associated with the attachment. @@ -339,7 +362,7 @@ types: format: uuid - Ticket source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true AttachmentRequest: docs: |- @@ -378,7 +401,142 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + 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: @@ -398,7 +556,7 @@ types: format: email maxLength: 254 role: - type: RoleEnum + 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. @@ -420,7 +578,7 @@ types: validation: maxLength: 45 event_type: - type: EventTypeEnum + type: AuditLogEventEventType docs: >- Designates the type of event that occurred. @@ -531,7 +689,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml AvailableActions: docs: >- # The AvailableActions Object @@ -550,7 +708,7 @@ types: passthrough_available: boolean available_model_operations: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml CategoriesEnum: enum: - hris @@ -569,7 +727,7 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml CategoryEnum: enum: - hris @@ -588,7 +746,22 @@ types: * `mktg` - mktg * `filestorage` - filestorage source: - openapi: openapi/openapi.yml + 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. @@ -598,7 +771,7 @@ types: format: uuid - Collection source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true Collection: docs: >- @@ -638,7 +811,7 @@ types: type: optional docs: The collection's description. access_level: - type: optional + type: optional docs: |- The level of access a User has to the Collection and its sub-objects. @@ -656,6 +829,18 @@ types: 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: >- @@ -671,7 +856,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml CollectionAccessLevelEnum: enum: - PRIVATE @@ -684,7 +869,7 @@ types: * `PUBLIC` - PUBLIC * `PARENT_COLLECTION` - PARENT_COLLECTION source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml CollectionTypeEnum: enum: - LIST @@ -693,7 +878,7 @@ types: * `LIST` - LIST * `PROJECT` - PROJECT source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml CommentUser: discriminated: false docs: >- @@ -706,7 +891,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true CommentContact: discriminated: false @@ -720,7 +905,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true CommentTicket: discriminated: false @@ -731,7 +916,7 @@ types: format: uuid - Ticket source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true Comment: docs: |- @@ -801,7 +986,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml CommentRequestUser: discriminated: false docs: >- @@ -814,7 +999,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true CommentRequestContact: discriminated: false @@ -828,7 +1013,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true CommentRequestTicket: discriminated: false @@ -839,7 +1024,7 @@ types: format: uuid - Ticket source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true CommentRequest: docs: |- @@ -881,7 +1066,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml CommentResponse: properties: model: Comment @@ -889,14 +1074,14 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml CommonModelScopeApi: properties: common_models: docs: The common models you want to update the scopes for type: list source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml CommonModelScopesBodyRequest: properties: model_id: @@ -906,7 +1091,7 @@ types: enabled_actions: list disabled_fields: list source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ContactAccount: discriminated: false docs: The contact's account. @@ -916,7 +1101,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true Contact: docs: >- @@ -979,7 +1164,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ContactRequestAccount: discriminated: false docs: The contact's account. @@ -989,7 +1174,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true ContactRequest: docs: >- @@ -1027,7 +1212,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml DataPassthroughRequest: docs: >- # The DataPassthrough Object @@ -1081,21 +1266,21 @@ types: `{"type": T, "value": ...}` where `T` will be one of `string, boolean, number, null, array, object`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml DebugModeLog: properties: log_id: string dashboard_view: string log_summary: DebugModelLogSummary source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml DebugModelLogSummary: properties: url: string method: string status_code: integer source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml EnabledActionsEnum: enum: - READ @@ -1104,7 +1289,7 @@ types: * `READ` - READ * `WRITE` - WRITE source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml EncodingEnum: enum: - RAW @@ -1115,7 +1300,7 @@ types: * `BASE64` - BASE64 * `GZIP_BASE64` - GZIP_BASE64 source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ErrorValidationProblem: properties: source: optional @@ -1123,7 +1308,7 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml EventTypeEnum: enum: - CREATED_REMOTE_PRODUCTION_API_KEY @@ -1270,7 +1455,7 @@ types: * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ExternalTargetFieldApi: properties: name: @@ -1283,7 +1468,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ExternalTargetFieldApiResponse: properties: Ticket: optional> @@ -1298,7 +1483,7 @@ types: Tag: optional> Contact: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml FieldFormatEnum: enum: - string @@ -1315,14 +1500,14 @@ types: * `bool` - bool * `list` - list source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml FieldMappingApiInstanceTargetField: properties: name: string description: string is_organization_wide: boolean source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: properties: @@ -1330,7 +1515,7 @@ types: url_path: optional field_traversal_path: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true FieldMappingApiInstanceRemoteField: properties: @@ -1338,7 +1523,7 @@ types: schema: optional> remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true FieldMappingApiInstance: properties: @@ -1357,7 +1542,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml FieldMappingApiInstanceResponse: properties: Ticket: optional> @@ -1372,7 +1557,7 @@ types: Tag: optional> Contact: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml FieldMappingInstanceResponse: properties: model: FieldMappingApiInstance @@ -1380,19 +1565,19 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml FieldPermissionDeserializer: properties: enabled_fields: optional> disabled_fields: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml FieldPermissionDeserializerRequest: properties: enabled_fields: optional> disabled_fields: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml FieldTypeEnum: enum: - string @@ -1409,14 +1594,14 @@ types: * `bool` - bool * `list` - list source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml IndividualCommonModelScopeDeserializer: properties: model_name: string model_permissions: optional> field_permissions: optional source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml IndividualCommonModelScopeDeserializerRequest: properties: model_name: @@ -1426,7 +1611,20 @@ types: model_permissions: optional> field_permissions: optional source: - openapi: openapi/openapi.yml + 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: @@ -1435,7 +1633,7 @@ types: format: uuid access: read-only status: - type: optional + type: optional docs: |- Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -1454,7 +1652,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml IssueStatusEnum: enum: - ONGOING @@ -1463,7 +1661,7 @@ types: * `ONGOING` - ONGOING * `RESOLVED` - RESOLVED source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ItemFormatEnum: enum: - string @@ -1480,14 +1678,14 @@ types: * `bool` - currency * `list` - decimal source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ItemSchema: properties: item_type: optional item_format: optional item_choices: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ItemTypeEnum: enum: - string @@ -1504,7 +1702,7 @@ types: * `bool` - bool * `list` - list source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml LanguageEnum: enum: - en @@ -1513,7 +1711,7 @@ types: * `en` - en * `de` - de source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml LastSyncResultEnum: enum: - SYNCING @@ -1530,20 +1728,20 @@ types: * `PAUSED` - PAUSED * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml LinkToken: properties: link_token: string integration_name: optional magic_link_url: optional source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml LinkedAccountStatus: properties: linked_account_status: string can_make_request: boolean source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml MetaResponse: properties: request_schema: map @@ -1552,7 +1750,7 @@ types: has_conditional_params: boolean has_required_linked_account_params: boolean source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml MethodEnum: enum: - GET @@ -1571,7 +1769,7 @@ types: * `PATCH` - PATCH * `DELETE` - DELETE source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ModelOperation: docs: >- # The ModelOperation Object @@ -1591,17 +1789,31 @@ types: required_post_parameters: list supported_fields: list source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ModelPermissionDeserializer: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ModelPermissionDeserializerRequest: properties: is_enabled: optional source: - openapi: openapi/openapi.yml + 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 @@ -1627,7 +1839,7 @@ types: validation: minLength: 1 encoding: - type: optional + type: optional docs: |- The encoding of the value of `data`. Defaults to `RAW` if not defined. @@ -1645,126 +1857,161 @@ types: validation: minLength: 1 source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedAccountDetailsAndActionsList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedAccountList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedAttachmentList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedAuditLogEventList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedCollectionList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedCommentList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedContactList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedIssueList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedProjectList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedRemoteFieldClassList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedRoleList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedSyncStatusList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedTagList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedTeamList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedTicketList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedUserList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PaginatedViewerList: properties: next: optional previous: optional results: optional> source: - openapi: openapi/openapi.yml + 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 @@ -1801,7 +2048,7 @@ types: type: optional docs: The ticket's due date. status: - type: optional + type: optional docs: |- The current status of the ticket. @@ -1838,7 +2085,7 @@ types: validation: format: uuid access_level: - type: optional + type: optional docs: >- The description of who is able to access a given ticket, or where access is inherited from. @@ -1881,7 +2128,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml PriorityEnum: enum: - URGENT @@ -1894,7 +2141,7 @@ types: * `NORMAL` - NORMAL * `LOW` - LOW source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml Project: docs: >- # The Project Object @@ -1946,7 +2193,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RemoteData: docs: >- # The RemoteData Object @@ -1968,35 +2215,35 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RemoteEndpointInfo: properties: method: string url_path: string field_traversal_path: list source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RemoteFieldRemoteFieldClass: discriminated: false union: - string - RemoteFieldClass source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true RemoteField: properties: remote_field_class: RemoteFieldRemoteFieldClass value: optional source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RemoteFieldApiCoverage: discriminated: false union: - integer - double source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true RemoteFieldApi: properties: @@ -2009,7 +2256,7 @@ types: type: optional access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RemoteFieldApiResponse: properties: Ticket: optional> @@ -2024,13 +2271,13 @@ types: Tag: optional> Contact: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RemoteFieldClassFieldChoicesItem: properties: value: optional display_name: optional source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true RemoteFieldClass: properties: @@ -2039,6 +2286,7 @@ types: remote_key_name: optional description: optional is_custom: optional + is_common_model_field: optional is_required: optional field_type: optional field_format: optional @@ -2047,7 +2295,7 @@ types: access: read-only item_schema: optional source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RemoteFieldRequestRemoteFieldClass: discriminated: false union: @@ -2056,14 +2304,14 @@ types: format: uuid - RemoteFieldClass source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true RemoteFieldRequest: properties: remote_field_class: RemoteFieldRequestRemoteFieldClass value: optional source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RemoteKey: docs: >- # The RemoteKey Object @@ -2081,7 +2329,15 @@ types: name: string key: string source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml + RemoteResponseResponseType: + discriminated: false + union: + - ResponseTypeEnum + - string + source: + openapi: ticketing_v3.yml + inline: true RemoteResponse: docs: >- # The RemoteResponse Object @@ -2101,10 +2357,10 @@ types: status: integer response: unknown response_headers: optional> - response_type: optional + response_type: optional headers: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RequestFormatEnum: enum: - JSON @@ -2115,7 +2371,7 @@ types: * `XML` - XML * `MULTIPART` - MULTIPART source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ResponseTypeEnum: enum: - JSON @@ -2124,7 +2380,29 @@ types: * `JSON` - JSON * `BASE64_GZIP` - BASE64_GZIP source: - openapi: openapi/openapi.yml + 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 @@ -2159,13 +2437,13 @@ types: type: optional docs: The name of the Role. ticket_actions: - type: optional> + 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 + type: optional docs: |- The level of Ticket access that a User with this Role can perform. @@ -2187,7 +2465,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml RoleEnum: enum: - ADMIN @@ -2204,7 +2482,7 @@ types: * `SYSTEM` - SYSTEM * `MERGE_TEAM` - MERGE_TEAM source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml SelectiveSyncConfigurationsUsageEnum: enum: - IN_NEXT_SYNC @@ -2213,7 +2491,7 @@ types: * `IN_NEXT_SYNC` - IN_NEXT_SYNC * `IN_LAST_SYNC` - IN_LAST_SYNC source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml StatusFd5Enum: enum: - SYNCING @@ -2230,7 +2508,23 @@ types: * `PAUSED` - PAUSED * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED source: - openapi: openapi/openapi.yml + 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 @@ -2250,13 +2544,13 @@ types: model_id: string last_sync_start: optional next_sync_start: optional - last_sync_result: optional + last_sync_result: optional last_sync_finished: optional - status: StatusFd5Enum + status: SyncStatusStatus is_initial_sync: boolean selective_sync_configurations_usage: optional source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml Tag: docs: |- # The Tag Object @@ -2300,7 +2594,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml Team: docs: >- # The Team Object @@ -2352,7 +2646,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml TicketAssigneesItem: discriminated: false union: @@ -2361,7 +2655,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketAssignedTeamsItem: discriminated: false @@ -2371,7 +2665,7 @@ types: format: uuid - Team source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketCreator: discriminated: false @@ -2382,7 +2676,22 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + 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 @@ -2392,7 +2701,7 @@ types: format: uuid - Collection source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketAccount: discriminated: false @@ -2403,7 +2712,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketContact: discriminated: false @@ -2414,7 +2723,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketParentTicket: discriminated: false @@ -2425,7 +2734,7 @@ types: format: uuid - Ticket source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketAttachmentsItem: discriminated: false @@ -2435,7 +2744,42 @@ types: format: uuid - Attachment source: - openapi: openapi/openapi.yml + 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: |- @@ -2487,7 +2831,7 @@ types: type: optional docs: The ticket's due date. status: - type: optional + type: optional docs: |- The current status of the ticket. @@ -2519,7 +2863,7 @@ types: docs: The ticket's parent ticket. attachments: optional>> access_level: - type: optional + type: optional docs: >- The description of who is able to access a given ticket, or where access is inherited from. @@ -2534,6 +2878,21 @@ types: * `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. @@ -2552,21 +2911,6 @@ types: [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). access: read-only - 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 field_mappings: type: optional> access: read-only @@ -2577,7 +2921,7 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml TicketAccessEnum: enum: - ALL @@ -2588,7 +2932,7 @@ types: * `ASSIGNED_ONLY` - ASSIGNED_ONLY * `TEAM_ONLY` - TEAM_ONLY source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml TicketAccessLevelEnum: enum: - COMPANY @@ -2601,7 +2945,7 @@ types: * `PRIVATE` - PRIVATE * `COLLECTION` - COLLECTION source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml TicketActionsEnum: enum: - VIEW @@ -2618,7 +2962,7 @@ types: * `CLOSE` - CLOSE * `ASSIGN` - ASSIGN source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml TicketRequestAssigneesItem: discriminated: false union: @@ -2627,7 +2971,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketRequestAssignedTeamsItem: discriminated: false @@ -2637,7 +2981,7 @@ types: format: uuid - Team source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketRequestCreator: discriminated: false @@ -2648,7 +2992,22 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + 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 @@ -2658,7 +3017,7 @@ types: format: uuid - Collection source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketRequestAccount: discriminated: false @@ -2669,7 +3028,7 @@ types: format: uuid - Account source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketRequestContact: discriminated: false @@ -2680,7 +3039,7 @@ types: format: uuid - Contact source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketRequestParentTicket: discriminated: false @@ -2691,7 +3050,7 @@ types: format: uuid - Ticket source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true TicketRequestAttachmentsItem: discriminated: false @@ -2701,7 +3060,42 @@ types: format: uuid - Attachment source: - openapi: openapi/openapi.yml + 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: |- @@ -2737,7 +3131,7 @@ types: type: optional docs: The ticket's due date. status: - type: optional + type: optional docs: |- The current status of the ticket. @@ -2769,7 +3163,7 @@ types: docs: The ticket's parent ticket. attachments: optional>> access_level: - type: optional + type: optional docs: >- The description of who is able to access a given ticket, or where access is inherited from. @@ -2794,7 +3188,7 @@ types: format: uri maxLength: 2000 priority: - type: optional + type: optional docs: |- The priority or urgency of the Ticket. @@ -2812,7 +3206,7 @@ types: type: optional> access: write-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml TicketResponse: properties: model: Ticket @@ -2820,7 +3214,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml TicketStatusEnum: enum: - OPEN @@ -2833,7 +3227,7 @@ types: * `IN_PROGRESS` - IN_PROGRESS * `ON_HOLD` - ON_HOLD source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml TicketingAttachmentResponse: properties: model: Attachment @@ -2841,7 +3235,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml TicketingContactResponse: properties: model: Contact @@ -2849,7 +3243,7 @@ types: errors: list logs: optional> source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml UserTeamsItem: discriminated: false union: @@ -2858,7 +3252,7 @@ types: format: uuid - Team source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true UserRolesItem: discriminated: false @@ -2868,7 +3262,7 @@ types: format: uuid - Role source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true User: docs: >- @@ -2933,12 +3327,12 @@ types: type: optional> access: read-only source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ValidationProblemSource: properties: pointer: string source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml ViewerTeam: discriminated: false docs: The Team this Viewer belongs to. @@ -2948,7 +3342,7 @@ types: format: uuid - Team source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true ViewerUser: discriminated: false @@ -2959,7 +3353,7 @@ types: format: uuid - User source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml inline: true Viewer: docs: |- @@ -2993,7 +3387,7 @@ types: type: optional docs: The User this Viewer belongs to. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml WarningValidationProblem: properties: source: optional @@ -3001,11 +3395,11 @@ types: detail: string problem_type: string source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml WebhookReceiver: properties: event: string is_active: boolean key: optional source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/accountDetails.yml b/.mock/definition/Ticketing/accountDetails.yml similarity index 79% rename from .mock/definition/ticketing/accountDetails.yml rename to .mock/definition/Ticketing/accountDetails.yml index 1cd26dd..b5b6bd4 100644 --- a/.mock/definition/ticketing/accountDetails.yml +++ b/.mock/definition/Ticketing/accountDetails.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /ticketing/v1/account-details method: GET - auth: true + auth: + - tokenAuth: [] docs: Get details for a linked account. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: root.AccountDetails + type: ticketingRoot.AccountDetails status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd @@ -33,4 +35,4 @@ service: account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/accountToken.yml b/.mock/definition/Ticketing/accountToken.yml similarity index 82% rename from .mock/definition/ticketing/accountToken.yml rename to .mock/definition/Ticketing/accountToken.yml index e3b505e..2f2e9e0 100644 --- a/.mock/definition/ticketing/accountToken.yml +++ b/.mock/definition/Ticketing/accountToken.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,24 @@ service: retrieve: path: /ticketing/v1/account-token/{public_token} method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Returns the account token for the end user with the provided public token. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: public_token: string response: docs: '' - type: root.AccountToken + type: ticketingRoot.AccountToken status-code: 200 examples: - path-parameters: public_token: public_token + headers: + X-Account-Token: '[object Object]' response: body: account_token: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB @@ -41,4 +44,4 @@ service: key: value id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/accounts.yml b/.mock/definition/Ticketing/accounts.yml similarity index 81% rename from .mock/definition/ticketing/accounts.yml rename to .mock/definition/Ticketing/accounts.yml index 9dc3f7a..f27dbee 100644 --- a/.mock/definition/ticketing/accounts.yml +++ b/.mock/definition/Ticketing/accounts.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ticketing/v1/accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Account` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: AccountsListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedAccountList + type: ticketingRoot.PaginatedAccountList status-code: 200 examples: - - headers: {} + - 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 @@ -91,10 +108,11 @@ service: retrieve: path: /ticketing/v1/accounts/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Account` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: @@ -112,12 +130,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Account + type: ticketingRoot.Account status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -139,4 +161,4 @@ service: data: - Varies by platform source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/asyncPassthrough.yml b/.mock/definition/Ticketing/asyncPassthrough.yml similarity index 75% rename from .mock/definition/ticketing/asyncPassthrough.yml rename to .mock/definition/Ticketing/asyncPassthrough.yml index 0a2001f..7f570a7 100644 --- a/.mock/definition/ticketing/asyncPassthrough.yml +++ b/.mock/definition/Ticketing/asyncPassthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,21 +7,23 @@ service: create: path: /ticketing/v1/async-passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: >- Asynchronously pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: - body: root.DataPassthroughRequest + body: ticketingRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.AsyncPassthroughReciept + type: ticketingRoot.AsyncPassthroughReciept status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -31,10 +33,11 @@ service: retrieve: path: /ticketing/v1/async-passthrough/{async_passthrough_receipt_id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Retrieves data from earlier async-passthrough POST request source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: async_passthrough_receipt_id: string response: @@ -44,7 +47,8 @@ service: examples: - path-parameters: async_passthrough_receipt_id: async_passthrough_receipt_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: method: GET @@ -59,12 +63,12 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml types: AsyncPassthroughRetrieveResponse: discriminated: false union: - - root.RemoteResponse + - ticketingRoot.RemoteResponse - string source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/attachments.yml b/.mock/definition/Ticketing/attachments.yml similarity index 90% rename from .mock/definition/ticketing/attachments.yml rename to .mock/definition/Ticketing/attachments.yml index 9a8a8a9..e1c9d0d 100644 --- a/.mock/definition/ticketing/attachments.yml +++ b/.mock/definition/Ticketing/attachments.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ticketing/v1/attachments method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Attachment` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: AttachmentsListRequest query-parameters: @@ -27,6 +32,7 @@ service: 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. @@ -74,10 +80,24 @@ service: docs: If provided, will only return comments for this ticket. response: docs: '' - type: root.PaginatedAttachmentList + type: ticketingRoot.PaginatedAttachmentList status-code: 200 examples: - - headers: {} + - 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 @@ -104,10 +124,11 @@ service: create: path: /ticketing/v1/attachments method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates an `Attachment` object with the given values. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: TicketingAttachmentEndpointRequest query-parameters: @@ -121,14 +142,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.AttachmentRequest + model: ticketingRoot.AttachmentRequest content-type: application/json response: docs: '' - type: root.TicketingAttachmentResponse + type: ticketingRoot.TicketingAttachmentResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -175,10 +200,11 @@ service: retrieve: path: /ticketing/v1/attachments/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns an `Attachment` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: @@ -186,6 +212,7 @@ service: 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. @@ -201,12 +228,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Attachment + type: ticketingRoot.Attachment status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -232,10 +263,11 @@ service: downloadRetrieve: path: /ticketing/v1/attachments/{id}/download method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns the `File` content with the given `id` as a stream of bytes. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: @@ -261,16 +293,18 @@ service: metaPostRetrieve: path: /ticketing/v1/attachments/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `TicketingAttachment` POSTs. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: root.MetaResponse + type: ticketingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -443,4 +477,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/auditTrail.yml b/.mock/definition/Ticketing/auditTrail.yml similarity index 85% rename from .mock/definition/ticketing/auditTrail.yml rename to .mock/definition/Ticketing/auditTrail.yml index 82660fa..bbc472c 100644 --- a/.mock/definition/ticketing/auditTrail.yml +++ b/.mock/definition/Ticketing/auditTrail.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ticketing/v1/audit-trail method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets a list of audit trail events. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: AuditTrailListRequest query-parameters: @@ -72,10 +77,19 @@ service: email. response: docs: '' - type: root.PaginatedAuditLogEventList + type: ticketingRoot.PaginatedAuditLogEventList status-code: 200 examples: - - response: + - 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 @@ -91,4 +105,4 @@ service: from Read to Read+Write created_at: '2024-01-15T09:30:00Z' source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/availableActions.yml b/.mock/definition/Ticketing/availableActions.yml similarity index 84% rename from .mock/definition/ticketing/availableActions.yml rename to .mock/definition/Ticketing/availableActions.yml index 745b76c..a29cc9c 100644 --- a/.mock/definition/ticketing/availableActions.yml +++ b/.mock/definition/Ticketing/availableActions.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: retrieve: path: /ticketing/v1/available-actions method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of models and actions available for an account. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: root.AvailableActions + type: ticketingRoot.AvailableActions status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: integration: @@ -47,4 +49,4 @@ service: - company - title source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/collections.yml b/.mock/definition/Ticketing/collections.yml similarity index 76% rename from .mock/definition/ticketing/collections.yml rename to .mock/definition/Ticketing/collections.yml index dbf6f13..4ad4bfe 100644 --- a/.mock/definition/ticketing/collections.yml +++ b/.mock/definition/Ticketing/collections.yml @@ -1,5 +1,20 @@ +types: + CollectionsListRequestCollectionType: + enum: + - value: '' + name: EMPTY + - LIST + - PROJECT + source: + openapi: ticketing_v3.yml + CollectionsViewersListRequestExpandItem: + enum: + - team + - user + source: + openapi: ticketing_v3.yml imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,15 +22,20 @@ service: list: path: /ticketing/v1/collections method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Collection` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: CollectionsListRequest query-parameters: collection_type: - type: optional + type: optional docs: If provided, will only return collections of the given type. created_after: type: optional @@ -30,6 +50,7 @@ service: 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. @@ -61,6 +82,9 @@ service: 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. @@ -84,10 +108,27 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.PaginatedCollectionList + type: ticketingRoot.PaginatedCollectionList status-code: 200 examples: - - headers: {} + - 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 @@ -102,6 +143,9 @@ service: 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: @@ -113,14 +157,19 @@ service: viewersList: path: /ticketing/v1/collections/{collection_id}/viewers method: GET - auth: true + 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: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: collection_id: string request: @@ -130,7 +179,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -157,12 +207,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedViewerList + type: ticketingRoot.PaginatedViewerList status-code: 200 examples: - path-parameters: collection_id: collection_id - headers: {} + 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 @@ -177,10 +234,11 @@ service: retrieve: path: /ticketing/v1/collections/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Collection` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: @@ -188,6 +246,7 @@ service: 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. @@ -213,12 +272,18 @@ service: more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) response: docs: '' - type: root.Collection + type: ticketingRoot.Collection status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -230,6 +295,9 @@ service: 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: @@ -241,13 +309,4 @@ service: data: key: value source: - openapi: openapi/openapi.yml -types: - CollectionsViewersListRequestExpand: - enum: - - team - - user - - value: user,team - name: UserTeam - source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/comments.yml b/.mock/definition/Ticketing/comments.yml similarity index 89% rename from .mock/definition/ticketing/comments.yml rename to .mock/definition/Ticketing/comments.yml index 71a70dc..a7024c5 100644 --- a/.mock/definition/ticketing/comments.yml +++ b/.mock/definition/Ticketing/comments.yml @@ -1,36 +1,20 @@ types: - CommentsListRequestExpand: + CommentsListRequestExpandItem: enum: - contact - - value: contact,ticket - name: ContactTicket - ticket - user - - value: user,contact - name: UserContact - - value: user,contact,ticket - name: UserContactTicket - - value: user,ticket - name: UserTicket source: - openapi: openapi/openapi.yml - CommentsRetrieveRequestExpand: + openapi: ticketing_v3.yml + CommentsRetrieveRequestExpandItem: enum: - contact - - value: contact,ticket - name: ContactTicket - ticket - user - - value: user,contact - name: UserContact - - value: user,contact,ticket - name: UserContactTicket - - value: user,ticket - name: UserTicket source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -38,10 +22,15 @@ service: list: path: /ticketing/v1/comments method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Comment` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: CommentsListRequest query-parameters: @@ -57,7 +46,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -105,10 +95,24 @@ service: docs: If provided, will only return comments for this ticket. response: docs: '' - type: root.PaginatedCommentList + type: ticketingRoot.PaginatedCommentList status-code: 200 examples: - - headers: {} + - 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 @@ -140,10 +144,11 @@ service: create: path: /ticketing/v1/comments method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Comment` object with the given values. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: CommentEndpointRequest query-parameters: @@ -157,14 +162,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.CommentRequest + model: ticketingRoot.CommentRequest content-type: application/json response: docs: '' - type: root.CommentResponse + type: ticketingRoot.CommentResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -216,17 +225,19 @@ service: retrieve: path: /ticketing/v1/comments/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Comment` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: name: CommentsRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -242,12 +253,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Comment + type: ticketingRoot.Comment status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -276,16 +291,18 @@ service: metaPostRetrieve: path: /ticketing/v1/comments/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `Comment` POSTs. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: root.MetaResponse + type: ticketingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -458,4 +475,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/contacts.yml b/.mock/definition/Ticketing/contacts.yml similarity index 89% rename from .mock/definition/ticketing/contacts.yml rename to .mock/definition/Ticketing/contacts.yml index e4a13d7..f152906 100644 --- a/.mock/definition/ticketing/contacts.yml +++ b/.mock/definition/Ticketing/contacts.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ticketing/v1/contacts method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Contact` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: ContactsListRequest query-parameters: @@ -25,8 +30,12 @@ service: 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. @@ -66,10 +75,23 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedContactList + type: ticketingRoot.PaginatedContactList status-code: 200 examples: - - headers: {} + - 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 @@ -95,10 +117,11 @@ service: create: path: /ticketing/v1/contacts method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `Contact` object with the given values. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: TicketingContactEndpointRequest query-parameters: @@ -112,14 +135,18 @@ service: docs: Whether or not third-party updates should be run asynchronously. body: properties: - model: root.ContactRequest + model: ticketingRoot.ContactRequest content-type: application/json response: docs: '' - type: root.TicketingContactResponse + type: ticketingRoot.TicketingContactResponse status-code: 201 examples: - - headers: {} + - query-parameters: + is_debug_mode: true + run_async: true + headers: + X-Account-Token: X-Account-Token request: model: {} response: @@ -165,10 +192,11 @@ service: retrieve: path: /ticketing/v1/contacts/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Contact` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: @@ -176,6 +204,7 @@ service: 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. @@ -191,12 +220,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Contact + type: ticketingRoot.Contact status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -221,16 +254,18 @@ service: metaPostRetrieve: path: /ticketing/v1/contacts/meta/post method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns metadata for `TicketingContact` POSTs. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: root.MetaResponse + type: ticketingRoot.MetaResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: request_schema: @@ -403,4 +438,4 @@ service: has_conditional_params: true has_required_linked_account_params: true source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/deleteAccount.yml b/.mock/definition/Ticketing/deleteAccount.yml similarity index 55% rename from .mock/definition/ticketing/deleteAccount.yml rename to .mock/definition/Ticketing/deleteAccount.yml index b2d1911..bb3fabe 100644 --- a/.mock/definition/ticketing/deleteAccount.yml +++ b/.mock/definition/Ticketing/deleteAccount.yml @@ -5,11 +5,13 @@ service: delete: path: /ticketing/v1/delete-account method: POST - auth: true + auth: + - tokenAuth: [] docs: Delete a linked account. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/fieldMapping.yml b/.mock/definition/Ticketing/fieldMapping.yml similarity index 94% rename from .mock/definition/ticketing/fieldMapping.yml rename to .mock/definition/Ticketing/fieldMapping.yml index 3051c3f..3bbc3da 100644 --- a/.mock/definition/ticketing/fieldMapping.yml +++ b/.mock/definition/Ticketing/fieldMapping.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,14 +7,15 @@ service: field_mappings_retrieve: path: /ticketing/v1/field-mappings method: GET - auth: true + 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: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: FieldMappingsRetrieveRequest query-parameters: @@ -27,10 +28,13 @@ service: of the request since these fields require some calculations. response: docs: '' - type: root.FieldMappingApiInstanceResponse + type: ticketingRoot.FieldMappingApiInstanceResponse status-code: 200 examples: - - headers: {} + - query-parameters: + exclude_remote_field_metadata: true + headers: + X-Account-Token: X-Account-Token response: body: Ticket: @@ -212,13 +216,14 @@ service: field_mappings_create: path: /ticketing/v1/field-mappings method: POST - auth: true + 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: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: CreateFieldMappingRequest query-parameters: @@ -274,10 +279,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: ticketingRoot.FieldMappingInstanceResponse status-code: 201 examples: - - headers: {} + - 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 @@ -327,24 +335,26 @@ service: field_mappings_destroy: path: /ticketing/v1/field-mappings/{field_mapping_id} method: DELETE - auth: true + 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: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: field_mapping_id: string response: docs: '' - type: root.FieldMappingInstanceResponse + type: ticketingRoot.FieldMappingInstanceResponse status-code: 204 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token response: body: model: @@ -386,13 +396,14 @@ service: field_mappings_partial_update: path: /ticketing/v1/field-mappings/{field_mapping_id} method: PATCH - auth: true + 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: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: field_mapping_id: string request: @@ -421,12 +432,13 @@ service: content-type: application/json response: docs: '' - type: root.FieldMappingInstanceResponse + type: ticketingRoot.FieldMappingInstanceResponse status-code: 200 examples: - path-parameters: field_mapping_id: field_mapping_id - headers: {} + headers: + X-Account-Token: X-Account-Token request: {} response: body: @@ -469,7 +481,8 @@ service: remote_fields_retrieve: path: /ticketing/v1/remote-fields method: GET - auth: true + 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 @@ -477,7 +490,7 @@ service: or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: RemoteFieldsRetrieveRequest query-parameters: @@ -494,10 +507,14 @@ service: data from your customers. response: docs: '' - type: root.RemoteFieldApiResponse + type: ticketingRoot.RemoteFieldApiResponse status-code: 200 examples: - - headers: {} + - query-parameters: + common_models: common_models + include_example_values: include_example_values + headers: + X-Account-Token: X-Account-Token response: body: Ticket: @@ -657,7 +674,8 @@ service: target_fields_retrieve: path: /ticketing/v1/target-fields method: GET - auth: true + auth: + - tokenAuth: [] docs: >- Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields @@ -665,13 +683,14 @@ service: Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: root.ExternalTargetFieldApiResponse + type: ticketingRoot.ExternalTargetFieldApiResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: Ticket: @@ -719,4 +738,4 @@ service: description: this is a example description of a target field is_mapped: is_mapped source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/forceResync.yml b/.mock/definition/Ticketing/forceResync.yml similarity index 82% rename from .mock/definition/ticketing/forceResync.yml rename to .mock/definition/Ticketing/forceResync.yml index a9669fa..9e91fd2 100644 --- a/.mock/definition/ticketing/forceResync.yml +++ b/.mock/definition/Ticketing/forceResync.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: sync_status_resync_create: path: /ticketing/v1/sync-status/resync method: POST - auth: true + 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 @@ -15,13 +16,14 @@ service: linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - model_name: Ticket @@ -34,4 +36,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/generateKey.yml b/.mock/definition/Ticketing/generateKey.yml similarity index 74% rename from .mock/definition/ticketing/generateKey.yml rename to .mock/definition/Ticketing/generateKey.yml index 54e7585..7e6164a 100644 --- a/.mock/definition/ticketing/generateKey.yml +++ b/.mock/definition/Ticketing/generateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /ticketing/v1/generate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Create a remote key. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: GenerateRemoteKeyRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: ticketingRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/issues.yml b/.mock/definition/Ticketing/issues.yml similarity index 75% rename from .mock/definition/ticketing/issues.yml rename to .mock/definition/Ticketing/issues.yml index badd03c..dbeaa54 100644 --- a/.mock/definition/ticketing/issues.yml +++ b/.mock/definition/Ticketing/issues.yml @@ -4,9 +4,9 @@ types: - ONGOING - RESOLVED source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -14,10 +14,15 @@ service: list: path: /ticketing/v1/issues method: GET - auth: true + auth: + - tokenAuth: [] docs: Gets all issues for Organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: IssuesListRequest query-parameters: @@ -77,10 +82,27 @@ service: * `RESOLVED` - RESOLVED response: docs: '' - type: root.PaginatedIssueList + type: ticketingRoot.PaginatedIssueList status-code: 200 examples: - - response: + - 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 @@ -99,19 +121,22 @@ service: retrieve: path: /ticketing/v1/issues/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Get a specific issue. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string response: docs: '' - type: root.Issue + 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 @@ -126,4 +151,4 @@ service: - Missing employee permissions. - Missing time off permissions. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/linkToken.yml b/.mock/definition/Ticketing/linkToken.yml similarity index 84% rename from .mock/definition/ticketing/linkToken.yml rename to .mock/definition/Ticketing/linkToken.yml index 0ad3ad1..90f0862 100644 --- a/.mock/definition/ticketing/linkToken.yml +++ b/.mock/definition/Ticketing/linkToken.yml @@ -1,5 +1,22 @@ imports: - root: __package__.yml + 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: '' @@ -7,10 +24,11 @@ service: create: path: /ticketing/v1/link-token method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a link token to be used when linking a new end user. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: EndUserDetailsRequest body: @@ -41,7 +59,7 @@ service: maxLength: 100 categories: docs: The integration categories to show in Merge Link. - type: list + type: list integration: type: optional docs: >- @@ -76,7 +94,7 @@ service: https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. default: false common_models: - type: optional> + 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 @@ -86,14 +104,14 @@ service: category_common_model_scopes: type: >- optional>>> + 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 + type: optional docs: >- The following subset of IETF language tags can be used to configure localization. @@ -116,10 +134,12 @@ service: content-type: application/json response: docs: '' - type: root.LinkToken + type: ticketingRoot.LinkToken status-code: 200 examples: - - request: + - 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' @@ -132,4 +152,4 @@ service: integration_name: Lever magic_link_url: https://link.merge.dev/asdfjkl12345jsndfgi2i83n source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/linkedAccounts.yml b/.mock/definition/Ticketing/linkedAccounts.yml similarity index 82% rename from .mock/definition/ticketing/linkedAccounts.yml rename to .mock/definition/Ticketing/linkedAccounts.yml index 072cf0e..f4d4474 100644 --- a/.mock/definition/ticketing/linkedAccounts.yml +++ b/.mock/definition/Ticketing/linkedAccounts.yml @@ -9,9 +9,9 @@ types: - mktg - ticketing source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -19,10 +19,15 @@ service: list: path: /ticketing/v1/linked-accounts method: GET - auth: true + auth: + - tokenAuth: [] docs: List linked accounts for your organization. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: LinkedAccountsListRequest query-parameters: @@ -104,10 +109,26 @@ service: `RELINK_NEEDED` response: docs: '' - type: root.PaginatedAccountDetailsAndActionsList + type: ticketingRoot.PaginatedAccountDetailsAndActionsList status-code: 200 examples: - - response: + - 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 @@ -144,7 +165,5 @@ service: - title account_type: PRODUCTION completed_at: '2024-08-26T20:11:19Z' - integration_specific_fields: - integration_specific_field: Varies by platform source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/passthrough.yml b/.mock/definition/Ticketing/passthrough.yml similarity index 73% rename from .mock/definition/ticketing/passthrough.yml rename to .mock/definition/Ticketing/passthrough.yml index 44434d1..c0968fa 100644 --- a/.mock/definition/ticketing/passthrough.yml +++ b/.mock/definition/Ticketing/passthrough.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,21 @@ service: create: path: /ticketing/v1/passthrough method: POST - auth: true + auth: + - tokenAuth: [] docs: Pull data from an endpoint not currently supported by Merge. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: - body: root.DataPassthroughRequest + body: ticketingRoot.DataPassthroughRequest content-type: application/json response: docs: '' - type: root.RemoteResponse + type: ticketingRoot.RemoteResponse status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: method: GET path: /scooters @@ -37,4 +39,4 @@ service: EXTRA-HEADER: value Authorization: source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/projects.yml b/.mock/definition/Ticketing/projects.yml similarity index 80% rename from .mock/definition/ticketing/projects.yml rename to .mock/definition/Ticketing/projects.yml index dd74934..8920b17 100644 --- a/.mock/definition/ticketing/projects.yml +++ b/.mock/definition/Ticketing/projects.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ticketing/v1/projects method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Project` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: ProjectsListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedProjectList + type: ticketingRoot.PaginatedProjectList status-code: 200 examples: - - headers: {} + - 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 @@ -87,10 +104,11 @@ service: retrieve: path: /ticketing/v1/projects/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Project` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: @@ -108,12 +126,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Project + type: ticketingRoot.Project status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -135,10 +157,15 @@ service: usersList: path: /ticketing/v1/projects/{parent_id}/users method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `User` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: parent_id: string request: @@ -148,7 +175,8 @@ service: type: optional docs: The pagination cursor value. expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -175,12 +203,19 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedUserList + type: ticketingRoot.PaginatedUserList status-code: 200 examples: - path-parameters: parent_id: parent_id - headers: {} + 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 @@ -208,13 +243,11 @@ service: remote_data: - path: /platform-endpoint source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml types: - ProjectsUsersListRequestExpand: + ProjectsUsersListRequestExpandItem: enum: - roles - teams - - value: teams,roles - name: TeamsRoles source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/regenerateKey.yml b/.mock/definition/Ticketing/regenerateKey.yml similarity index 74% rename from .mock/definition/ticketing/regenerateKey.yml rename to .mock/definition/Ticketing/regenerateKey.yml index 5dab779..054c3dc 100644 --- a/.mock/definition/ticketing/regenerateKey.yml +++ b/.mock/definition/Ticketing/regenerateKey.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,11 @@ service: create: path: /ticketing/v1/regenerate-key method: POST - auth: true + auth: + - tokenAuth: [] docs: Exchange remote keys. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: RemoteKeyForRegenerationRequest body: @@ -23,14 +24,16 @@ service: content-type: application/json response: docs: '' - type: root.RemoteKey + type: ticketingRoot.RemoteKey status-code: 200 examples: - - request: + - headers: + X-Account-Token: '[object Object]' + request: name: Remote Deployment Key 1 response: body: name: Remote Deployment Key 1 key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/roles.yml b/.mock/definition/Ticketing/roles.yml similarity index 81% rename from .mock/definition/ticketing/roles.yml rename to .mock/definition/Ticketing/roles.yml index 9e22d59..3067049 100644 --- a/.mock/definition/ticketing/roles.yml +++ b/.mock/definition/Ticketing/roles.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ticketing/v1/roles method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Role` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: RolesListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedRoleList + type: ticketingRoot.PaginatedRoleList status-code: 200 examples: - - headers: {} + - 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 @@ -91,10 +108,11 @@ service: retrieve: path: /ticketing/v1/roles/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Role` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: @@ -112,12 +130,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Role + type: ticketingRoot.Role status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -141,4 +163,4 @@ service: data: key: value source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/scopes.yml b/.mock/definition/Ticketing/scopes.yml similarity index 86% rename from .mock/definition/ticketing/scopes.yml rename to .mock/definition/Ticketing/scopes.yml index 1186665..82bf8e0 100644 --- a/.mock/definition/ticketing/scopes.yml +++ b/.mock/definition/Ticketing/scopes.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,19 +7,22 @@ service: default_scopes_retrieve: path: /ticketing/v1/default-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: ticketingRoot.CommonModelScopeApi status-code: 200 examples: - - response: + - headers: + X-Account-Token: '[object Object]' + response: body: common_models: - model_name: Employee @@ -48,19 +51,21 @@ service: linked_account_scopes_retrieve: path: /ticketing/v1/linked-account-scopes method: GET - auth: true + 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: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: root.CommonModelScopeApi + type: ticketingRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: common_models: @@ -90,28 +95,31 @@ service: linked_account_scopes_create: path: /ticketing/v1/linked-account-scopes method: POST - auth: true + 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: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: LinkedAccountCommonModelScopeDeserializerRequest body: properties: common_models: docs: The common models you want to update the scopes for - type: list + type: >- + list content-type: application/json response: docs: '' - type: root.CommonModelScopeApi + type: ticketingRoot.CommonModelScopeApi status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: common_models: - model_name: Employee @@ -157,4 +165,4 @@ service: - manager - work_location source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/syncStatus.yml b/.mock/definition/Ticketing/syncStatus.yml similarity index 80% rename from .mock/definition/ticketing/syncStatus.yml rename to .mock/definition/Ticketing/syncStatus.yml index 5b49f2a..335739b 100644 --- a/.mock/definition/ticketing/syncStatus.yml +++ b/.mock/definition/Ticketing/syncStatus.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,7 +7,8 @@ service: list: path: /ticketing/v1/sync-status method: GET - auth: true + 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. @@ -20,8 +21,12 @@ service: `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: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: SyncStatusListRequest query-parameters: @@ -33,10 +38,14 @@ service: docs: Number of results to return per page. response: docs: '' - type: root.PaginatedSyncStatusList + type: ticketingRoot.PaginatedSyncStatusList status-code: 200 examples: - - headers: {} + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + page_size: 1 + headers: + X-Account-Token: X-Account-Token response: body: next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw @@ -52,4 +61,4 @@ service: is_initial_sync: true selective_sync_configurations_usage: IN_NEXT_SYNC source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/tags.yml b/.mock/definition/Ticketing/tags.yml similarity index 80% rename from .mock/definition/ticketing/tags.yml rename to .mock/definition/Ticketing/tags.yml index 7ebaf15..69e5f04 100644 --- a/.mock/definition/ticketing/tags.yml +++ b/.mock/definition/Ticketing/tags.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ticketing/v1/tags method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Tag` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: TagsListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedTagList + type: ticketingRoot.PaginatedTagList status-code: 200 examples: - - headers: {} + - 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 @@ -86,10 +103,11 @@ service: retrieve: path: /ticketing/v1/tags/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Tag` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: @@ -107,12 +125,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Tag + type: ticketingRoot.Tag status-code: 200 examples: - path-parameters: id: id - headers: {} + query-parameters: + include_remote_data: true + include_shell_data: true + headers: + X-Account-Token: X-Account-Token response: body: remote_id: '19202938' @@ -131,4 +153,4 @@ service: data: key: value source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/teams.yml b/.mock/definition/Ticketing/teams.yml similarity index 80% rename from .mock/definition/ticketing/teams.yml rename to .mock/definition/Ticketing/teams.yml index 47bcb68..9654bf8 100644 --- a/.mock/definition/ticketing/teams.yml +++ b/.mock/definition/Ticketing/teams.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,10 +7,15 @@ service: list: path: /ticketing/v1/teams method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `Team` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: TeamsListRequest query-parameters: @@ -61,10 +66,22 @@ service: docs: The API provider's ID for the given object. response: docs: '' - type: root.PaginatedTeamList + type: ticketingRoot.PaginatedTeamList status-code: 200 examples: - - headers: {} + - 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 @@ -87,10 +104,11 @@ service: retrieve: path: /ticketing/v1/teams/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `Team` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: @@ -108,12 +126,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.Team + type: ticketingRoot.Team status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -133,4 +155,4 @@ service: data: key: value source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/tickets.yml b/.mock/definition/Ticketing/tickets.yml new file mode 100644 index 0000000..76665b7 --- /dev/null +++ b/.mock/definition/Ticketing/tickets.yml @@ -0,0 +1,1259 @@ +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 similarity index 80% rename from .mock/definition/ticketing/users.yml rename to .mock/definition/Ticketing/users.yml index 76cfbe5..8ab9181 100644 --- a/.mock/definition/ticketing/users.yml +++ b/.mock/definition/Ticketing/users.yml @@ -1,22 +1,18 @@ types: - UsersListRequestExpand: + UsersListRequestExpandItem: enum: - roles - teams - - value: teams,roles - name: TeamsRoles source: - openapi: openapi/openapi.yml - UsersRetrieveRequestExpand: + openapi: ticketing_v3.yml + UsersRetrieveRequestExpandItem: enum: - roles - teams - - value: teams,roles - name: TeamsRoles source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -24,10 +20,15 @@ service: list: path: /ticketing/v1/users method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `User` objects. + pagination: + cursor: $request.cursor + next_cursor: $response.next + results: $response.results source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: UsersListRequest query-parameters: @@ -48,7 +49,8 @@ service: If provided, will only return users with emails equal to this value (case insensitive). expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -91,10 +93,24 @@ service: docs: If provided, will only return users matching in this team. response: docs: '' - type: root.PaginatedUserList + type: ticketingRoot.PaginatedUserList status-code: 200 examples: - - headers: {} + - 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 @@ -124,17 +140,19 @@ service: retrieve: path: /ticketing/v1/users/{id} method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a `User` object with the given `id`. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml path-parameters: id: string request: name: UsersRetrieveRequest query-parameters: expand: - type: optional + type: optional + allow-multiple: true docs: >- Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. @@ -150,12 +168,16 @@ service: (they may contain some metadata but all other fields are null). response: docs: '' - type: root.User + type: ticketingRoot.User status-code: 200 examples: - path-parameters: id: id - headers: {} + 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 @@ -182,4 +204,4 @@ service: data: key: value source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/ticketing/webhookReceivers.yml b/.mock/definition/Ticketing/webhookReceivers.yml similarity index 73% rename from .mock/definition/ticketing/webhookReceivers.yml rename to .mock/definition/Ticketing/webhookReceivers.yml index 54b5126..3a10d77 100644 --- a/.mock/definition/ticketing/webhookReceivers.yml +++ b/.mock/definition/Ticketing/webhookReceivers.yml @@ -1,5 +1,5 @@ imports: - root: __package__.yml + ticketingRoot: __package__.yml service: auth: false base-path: '' @@ -7,16 +7,18 @@ service: list: path: /ticketing/v1/webhook-receivers method: GET - auth: true + auth: + - tokenAuth: [] docs: Returns a list of `WebhookReceiver` objects. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml response: docs: '' - type: list + type: list status-code: 200 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token response: body: - event: event @@ -25,10 +27,11 @@ service: create: path: /ticketing/v1/webhook-receivers method: POST - auth: true + auth: + - tokenAuth: [] docs: Creates a `WebhookReceiver` object with the given values. source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml request: name: WebhookReceiverRequest body: @@ -45,10 +48,11 @@ service: content-type: application/json response: docs: '' - type: root.WebhookReceiver + type: ticketingRoot.WebhookReceiver status-code: 201 examples: - - headers: {} + - headers: + X-Account-Token: X-Account-Token request: event: event is_active: true @@ -58,4 +62,4 @@ service: is_active: true key: key source: - openapi: openapi/openapi.yml + openapi: ticketing_v3.yml diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.mock/definition/__package__.yml @@ -0,0 +1 @@ +{} diff --git a/.mock/definition/accounting/creditNotes.yml b/.mock/definition/accounting/creditNotes.yml deleted file mode 100644 index edd1375..0000000 --- a/.mock/definition/accounting/creditNotes.yml +++ /dev/null @@ -1,1145 +0,0 @@ -types: - CreditNotesListRequestExpand: - enum: - - accounting_period - - applied_payments - - value: applied_payments,accounting_period - name: AppliedPaymentsAccountingPeriod - - value: applied_payments,company - name: AppliedPaymentsCompany - - value: applied_payments,company,accounting_period - name: AppliedPaymentsCompanyAccountingPeriod - - value: applied_payments,contact - name: AppliedPaymentsContact - - value: applied_payments,contact,accounting_period - name: AppliedPaymentsContactAccountingPeriod - - value: applied_payments,contact,company - name: AppliedPaymentsContactCompany - - value: applied_payments,contact,company,accounting_period - name: AppliedPaymentsContactCompanyAccountingPeriod - - value: applied_payments,line_items - name: AppliedPaymentsLineItems - - value: applied_payments,line_items,accounting_period - name: AppliedPaymentsLineItemsAccountingPeriod - - value: applied_payments,line_items,company - name: AppliedPaymentsLineItemsCompany - - value: applied_payments,line_items,company,accounting_period - name: AppliedPaymentsLineItemsCompanyAccountingPeriod - - value: applied_payments,line_items,contact - name: AppliedPaymentsLineItemsContact - - value: applied_payments,line_items,contact,accounting_period - name: AppliedPaymentsLineItemsContactAccountingPeriod - - value: applied_payments,line_items,contact,company - name: AppliedPaymentsLineItemsContactCompany - - value: applied_payments,line_items,contact,company,accounting_period - name: AppliedPaymentsLineItemsContactCompanyAccountingPeriod - - value: applied_payments,line_items,tracking_categories - name: AppliedPaymentsLineItemsTrackingCategories - - value: applied_payments,line_items,tracking_categories,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: applied_payments,line_items,tracking_categories,company - name: AppliedPaymentsLineItemsTrackingCategoriesCompany - - value: >- - applied_payments,line_items,tracking_categories,company,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: applied_payments,line_items,tracking_categories,contact - name: AppliedPaymentsLineItemsTrackingCategoriesContact - - value: >- - applied_payments,line_items,tracking_categories,contact,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: applied_payments,line_items,tracking_categories,contact,company - name: AppliedPaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - applied_payments,line_items,tracking_categories,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: applied_payments,tracking_categories - name: AppliedPaymentsTrackingCategories - - value: applied_payments,tracking_categories,accounting_period - name: AppliedPaymentsTrackingCategoriesAccountingPeriod - - value: applied_payments,tracking_categories,company - name: AppliedPaymentsTrackingCategoriesCompany - - value: applied_payments,tracking_categories,company,accounting_period - name: AppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: applied_payments,tracking_categories,contact - name: AppliedPaymentsTrackingCategoriesContact - - value: applied_payments,tracking_categories,contact,accounting_period - name: AppliedPaymentsTrackingCategoriesContactAccountingPeriod - - value: applied_payments,tracking_categories,contact,company - name: AppliedPaymentsTrackingCategoriesContactCompany - - value: applied_payments,tracking_categories,contact,company,accounting_period - name: AppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriod - - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - contact - - value: contact,accounting_period - name: ContactAccountingPeriod - - value: contact,company - name: ContactCompany - - value: contact,company,accounting_period - name: ContactCompanyAccountingPeriod - - line_items - - value: line_items,accounting_period - name: LineItemsAccountingPeriod - - value: line_items,company - name: LineItemsCompany - - value: line_items,company,accounting_period - name: LineItemsCompanyAccountingPeriod - - value: line_items,contact - name: LineItemsContact - - value: line_items,contact,accounting_period - name: LineItemsContactAccountingPeriod - - value: line_items,contact,company - name: LineItemsContactCompany - - value: line_items,contact,company,accounting_period - name: LineItemsContactCompanyAccountingPeriod - - value: line_items,tracking_categories - name: LineItemsTrackingCategories - - value: line_items,tracking_categories,accounting_period - name: LineItemsTrackingCategoriesAccountingPeriod - - value: line_items,tracking_categories,company - name: LineItemsTrackingCategoriesCompany - - value: line_items,tracking_categories,company,accounting_period - name: LineItemsTrackingCategoriesCompanyAccountingPeriod - - value: line_items,tracking_categories,contact - name: LineItemsTrackingCategoriesContact - - value: line_items,tracking_categories,contact,accounting_period - name: LineItemsTrackingCategoriesContactAccountingPeriod - - value: line_items,tracking_categories,contact,company - name: LineItemsTrackingCategoriesContactCompany - - value: line_items,tracking_categories,contact,company,accounting_period - name: LineItemsTrackingCategoriesContactCompanyAccountingPeriod - - payments - - value: payments,accounting_period - name: PaymentsAccountingPeriod - - value: payments,applied_payments - name: PaymentsAppliedPayments - - value: payments,applied_payments,accounting_period - name: PaymentsAppliedPaymentsAccountingPeriod - - value: payments,applied_payments,company - name: PaymentsAppliedPaymentsCompany - - value: payments,applied_payments,company,accounting_period - name: PaymentsAppliedPaymentsCompanyAccountingPeriod - - value: payments,applied_payments,contact - name: PaymentsAppliedPaymentsContact - - value: payments,applied_payments,contact,accounting_period - name: PaymentsAppliedPaymentsContactAccountingPeriod - - value: payments,applied_payments,contact,company - name: PaymentsAppliedPaymentsContactCompany - - value: payments,applied_payments,contact,company,accounting_period - name: PaymentsAppliedPaymentsContactCompanyAccountingPeriod - - value: payments,applied_payments,line_items - name: PaymentsAppliedPaymentsLineItems - - value: payments,applied_payments,line_items,accounting_period - name: PaymentsAppliedPaymentsLineItemsAccountingPeriod - - value: payments,applied_payments,line_items,company - name: PaymentsAppliedPaymentsLineItemsCompany - - value: payments,applied_payments,line_items,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsCompanyAccountingPeriod - - value: payments,applied_payments,line_items,contact - name: PaymentsAppliedPaymentsLineItemsContact - - value: payments,applied_payments,line_items,contact,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactAccountingPeriod - - value: payments,applied_payments,line_items,contact,company - name: PaymentsAppliedPaymentsLineItemsContactCompany - - value: payments,applied_payments,line_items,contact,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactCompanyAccountingPeriod - - value: payments,applied_payments,line_items,tracking_categories - name: PaymentsAppliedPaymentsLineItemsTrackingCategories - - value: >- - payments,applied_payments,line_items,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: payments,applied_payments,line_items,tracking_categories,company - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: payments,applied_payments,line_items,tracking_categories,contact - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContact - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: payments,applied_payments,tracking_categories - name: PaymentsAppliedPaymentsTrackingCategories - - value: payments,applied_payments,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: payments,applied_payments,tracking_categories,company - name: PaymentsAppliedPaymentsTrackingCategoriesCompany - - value: >- - payments,applied_payments,tracking_categories,company,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: payments,applied_payments,tracking_categories,contact - name: PaymentsAppliedPaymentsTrackingCategoriesContact - - value: >- - payments,applied_payments,tracking_categories,contact,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesContactAccountingPeriod - - value: payments,applied_payments,tracking_categories,contact,company - name: PaymentsAppliedPaymentsTrackingCategoriesContactCompany - - value: >- - payments,applied_payments,tracking_categories,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriod - - value: payments,company - name: PaymentsCompany - - value: payments,company,accounting_period - name: PaymentsCompanyAccountingPeriod - - value: payments,contact - name: PaymentsContact - - value: payments,contact,accounting_period - name: PaymentsContactAccountingPeriod - - value: payments,contact,company - name: PaymentsContactCompany - - value: payments,contact,company,accounting_period - name: PaymentsContactCompanyAccountingPeriod - - value: payments,line_items - name: PaymentsLineItems - - value: payments,line_items,accounting_period - name: PaymentsLineItemsAccountingPeriod - - value: payments,line_items,company - name: PaymentsLineItemsCompany - - value: payments,line_items,company,accounting_period - name: PaymentsLineItemsCompanyAccountingPeriod - - value: payments,line_items,contact - name: PaymentsLineItemsContact - - value: payments,line_items,contact,accounting_period - name: PaymentsLineItemsContactAccountingPeriod - - value: payments,line_items,contact,company - name: PaymentsLineItemsContactCompany - - value: payments,line_items,contact,company,accounting_period - name: PaymentsLineItemsContactCompanyAccountingPeriod - - value: payments,line_items,tracking_categories - name: PaymentsLineItemsTrackingCategories - - value: payments,line_items,tracking_categories,accounting_period - name: PaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: payments,line_items,tracking_categories,company - name: PaymentsLineItemsTrackingCategoriesCompany - - value: payments,line_items,tracking_categories,company,accounting_period - name: PaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: payments,line_items,tracking_categories,contact - name: PaymentsLineItemsTrackingCategoriesContact - - value: payments,line_items,tracking_categories,contact,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: payments,line_items,tracking_categories,contact,company - name: PaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - payments,line_items,tracking_categories,contact,company,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: payments,tracking_categories - name: PaymentsTrackingCategories - - value: payments,tracking_categories,accounting_period - name: PaymentsTrackingCategoriesAccountingPeriod - - value: payments,tracking_categories,company - name: PaymentsTrackingCategoriesCompany - - value: payments,tracking_categories,company,accounting_period - name: PaymentsTrackingCategoriesCompanyAccountingPeriod - - value: payments,tracking_categories,contact - name: PaymentsTrackingCategoriesContact - - value: payments,tracking_categories,contact,accounting_period - name: PaymentsTrackingCategoriesContactAccountingPeriod - - value: payments,tracking_categories,contact,company - name: PaymentsTrackingCategoriesContactCompany - - value: payments,tracking_categories,contact,company,accounting_period - name: PaymentsTrackingCategoriesContactCompanyAccountingPeriod - - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod - - value: tracking_categories,contact,company - name: TrackingCategoriesContactCompany - - value: tracking_categories,contact,company,accounting_period - name: TrackingCategoriesContactCompanyAccountingPeriod - source: - openapi: openapi/openapi.yml - CreditNotesListRequestRemoteFields: - enum: - - status - - value: status,type - name: StatusType - - type - source: - openapi: openapi/openapi.yml - CreditNotesListRequestShowEnumOrigins: - enum: - - status - - value: status,type - name: StatusType - - type - source: - openapi: openapi/openapi.yml - CreditNotesRetrieveRequestExpand: - enum: - - accounting_period - - applied_payments - - value: applied_payments,accounting_period - name: AppliedPaymentsAccountingPeriod - - value: applied_payments,company - name: AppliedPaymentsCompany - - value: applied_payments,company,accounting_period - name: AppliedPaymentsCompanyAccountingPeriod - - value: applied_payments,contact - name: AppliedPaymentsContact - - value: applied_payments,contact,accounting_period - name: AppliedPaymentsContactAccountingPeriod - - value: applied_payments,contact,company - name: AppliedPaymentsContactCompany - - value: applied_payments,contact,company,accounting_period - name: AppliedPaymentsContactCompanyAccountingPeriod - - value: applied_payments,line_items - name: AppliedPaymentsLineItems - - value: applied_payments,line_items,accounting_period - name: AppliedPaymentsLineItemsAccountingPeriod - - value: applied_payments,line_items,company - name: AppliedPaymentsLineItemsCompany - - value: applied_payments,line_items,company,accounting_period - name: AppliedPaymentsLineItemsCompanyAccountingPeriod - - value: applied_payments,line_items,contact - name: AppliedPaymentsLineItemsContact - - value: applied_payments,line_items,contact,accounting_period - name: AppliedPaymentsLineItemsContactAccountingPeriod - - value: applied_payments,line_items,contact,company - name: AppliedPaymentsLineItemsContactCompany - - value: applied_payments,line_items,contact,company,accounting_period - name: AppliedPaymentsLineItemsContactCompanyAccountingPeriod - - value: applied_payments,line_items,tracking_categories - name: AppliedPaymentsLineItemsTrackingCategories - - value: applied_payments,line_items,tracking_categories,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: applied_payments,line_items,tracking_categories,company - name: AppliedPaymentsLineItemsTrackingCategoriesCompany - - value: >- - applied_payments,line_items,tracking_categories,company,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: applied_payments,line_items,tracking_categories,contact - name: AppliedPaymentsLineItemsTrackingCategoriesContact - - value: >- - applied_payments,line_items,tracking_categories,contact,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: applied_payments,line_items,tracking_categories,contact,company - name: AppliedPaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - applied_payments,line_items,tracking_categories,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: applied_payments,tracking_categories - name: AppliedPaymentsTrackingCategories - - value: applied_payments,tracking_categories,accounting_period - name: AppliedPaymentsTrackingCategoriesAccountingPeriod - - value: applied_payments,tracking_categories,company - name: AppliedPaymentsTrackingCategoriesCompany - - value: applied_payments,tracking_categories,company,accounting_period - name: AppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: applied_payments,tracking_categories,contact - name: AppliedPaymentsTrackingCategoriesContact - - value: applied_payments,tracking_categories,contact,accounting_period - name: AppliedPaymentsTrackingCategoriesContactAccountingPeriod - - value: applied_payments,tracking_categories,contact,company - name: AppliedPaymentsTrackingCategoriesContactCompany - - value: applied_payments,tracking_categories,contact,company,accounting_period - name: AppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriod - - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - contact - - value: contact,accounting_period - name: ContactAccountingPeriod - - value: contact,company - name: ContactCompany - - value: contact,company,accounting_period - name: ContactCompanyAccountingPeriod - - line_items - - value: line_items,accounting_period - name: LineItemsAccountingPeriod - - value: line_items,company - name: LineItemsCompany - - value: line_items,company,accounting_period - name: LineItemsCompanyAccountingPeriod - - value: line_items,contact - name: LineItemsContact - - value: line_items,contact,accounting_period - name: LineItemsContactAccountingPeriod - - value: line_items,contact,company - name: LineItemsContactCompany - - value: line_items,contact,company,accounting_period - name: LineItemsContactCompanyAccountingPeriod - - value: line_items,tracking_categories - name: LineItemsTrackingCategories - - value: line_items,tracking_categories,accounting_period - name: LineItemsTrackingCategoriesAccountingPeriod - - value: line_items,tracking_categories,company - name: LineItemsTrackingCategoriesCompany - - value: line_items,tracking_categories,company,accounting_period - name: LineItemsTrackingCategoriesCompanyAccountingPeriod - - value: line_items,tracking_categories,contact - name: LineItemsTrackingCategoriesContact - - value: line_items,tracking_categories,contact,accounting_period - name: LineItemsTrackingCategoriesContactAccountingPeriod - - value: line_items,tracking_categories,contact,company - name: LineItemsTrackingCategoriesContactCompany - - value: line_items,tracking_categories,contact,company,accounting_period - name: LineItemsTrackingCategoriesContactCompanyAccountingPeriod - - payments - - value: payments,accounting_period - name: PaymentsAccountingPeriod - - value: payments,applied_payments - name: PaymentsAppliedPayments - - value: payments,applied_payments,accounting_period - name: PaymentsAppliedPaymentsAccountingPeriod - - value: payments,applied_payments,company - name: PaymentsAppliedPaymentsCompany - - value: payments,applied_payments,company,accounting_period - name: PaymentsAppliedPaymentsCompanyAccountingPeriod - - value: payments,applied_payments,contact - name: PaymentsAppliedPaymentsContact - - value: payments,applied_payments,contact,accounting_period - name: PaymentsAppliedPaymentsContactAccountingPeriod - - value: payments,applied_payments,contact,company - name: PaymentsAppliedPaymentsContactCompany - - value: payments,applied_payments,contact,company,accounting_period - name: PaymentsAppliedPaymentsContactCompanyAccountingPeriod - - value: payments,applied_payments,line_items - name: PaymentsAppliedPaymentsLineItems - - value: payments,applied_payments,line_items,accounting_period - name: PaymentsAppliedPaymentsLineItemsAccountingPeriod - - value: payments,applied_payments,line_items,company - name: PaymentsAppliedPaymentsLineItemsCompany - - value: payments,applied_payments,line_items,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsCompanyAccountingPeriod - - value: payments,applied_payments,line_items,contact - name: PaymentsAppliedPaymentsLineItemsContact - - value: payments,applied_payments,line_items,contact,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactAccountingPeriod - - value: payments,applied_payments,line_items,contact,company - name: PaymentsAppliedPaymentsLineItemsContactCompany - - value: payments,applied_payments,line_items,contact,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactCompanyAccountingPeriod - - value: payments,applied_payments,line_items,tracking_categories - name: PaymentsAppliedPaymentsLineItemsTrackingCategories - - value: >- - payments,applied_payments,line_items,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: payments,applied_payments,line_items,tracking_categories,company - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: payments,applied_payments,line_items,tracking_categories,contact - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContact - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: payments,applied_payments,tracking_categories - name: PaymentsAppliedPaymentsTrackingCategories - - value: payments,applied_payments,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: payments,applied_payments,tracking_categories,company - name: PaymentsAppliedPaymentsTrackingCategoriesCompany - - value: >- - payments,applied_payments,tracking_categories,company,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: payments,applied_payments,tracking_categories,contact - name: PaymentsAppliedPaymentsTrackingCategoriesContact - - value: >- - payments,applied_payments,tracking_categories,contact,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesContactAccountingPeriod - - value: payments,applied_payments,tracking_categories,contact,company - name: PaymentsAppliedPaymentsTrackingCategoriesContactCompany - - value: >- - payments,applied_payments,tracking_categories,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriod - - value: payments,company - name: PaymentsCompany - - value: payments,company,accounting_period - name: PaymentsCompanyAccountingPeriod - - value: payments,contact - name: PaymentsContact - - value: payments,contact,accounting_period - name: PaymentsContactAccountingPeriod - - value: payments,contact,company - name: PaymentsContactCompany - - value: payments,contact,company,accounting_period - name: PaymentsContactCompanyAccountingPeriod - - value: payments,line_items - name: PaymentsLineItems - - value: payments,line_items,accounting_period - name: PaymentsLineItemsAccountingPeriod - - value: payments,line_items,company - name: PaymentsLineItemsCompany - - value: payments,line_items,company,accounting_period - name: PaymentsLineItemsCompanyAccountingPeriod - - value: payments,line_items,contact - name: PaymentsLineItemsContact - - value: payments,line_items,contact,accounting_period - name: PaymentsLineItemsContactAccountingPeriod - - value: payments,line_items,contact,company - name: PaymentsLineItemsContactCompany - - value: payments,line_items,contact,company,accounting_period - name: PaymentsLineItemsContactCompanyAccountingPeriod - - value: payments,line_items,tracking_categories - name: PaymentsLineItemsTrackingCategories - - value: payments,line_items,tracking_categories,accounting_period - name: PaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: payments,line_items,tracking_categories,company - name: PaymentsLineItemsTrackingCategoriesCompany - - value: payments,line_items,tracking_categories,company,accounting_period - name: PaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: payments,line_items,tracking_categories,contact - name: PaymentsLineItemsTrackingCategoriesContact - - value: payments,line_items,tracking_categories,contact,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: payments,line_items,tracking_categories,contact,company - name: PaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - payments,line_items,tracking_categories,contact,company,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: payments,tracking_categories - name: PaymentsTrackingCategories - - value: payments,tracking_categories,accounting_period - name: PaymentsTrackingCategoriesAccountingPeriod - - value: payments,tracking_categories,company - name: PaymentsTrackingCategoriesCompany - - value: payments,tracking_categories,company,accounting_period - name: PaymentsTrackingCategoriesCompanyAccountingPeriod - - value: payments,tracking_categories,contact - name: PaymentsTrackingCategoriesContact - - value: payments,tracking_categories,contact,accounting_period - name: PaymentsTrackingCategoriesContactAccountingPeriod - - value: payments,tracking_categories,contact,company - name: PaymentsTrackingCategoriesContactCompany - - value: payments,tracking_categories,contact,company,accounting_period - name: PaymentsTrackingCategoriesContactCompanyAccountingPeriod - - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod - - value: tracking_categories,contact,company - name: TrackingCategoriesContactCompany - - value: tracking_categories,contact,company,accounting_period - name: TrackingCategoriesContactCompanyAccountingPeriod - source: - openapi: openapi/openapi.yml - CreditNotesRetrieveRequestRemoteFields: - enum: - - status - - value: status,type - name: StatusType - - type - source: - openapi: openapi/openapi.yml - CreditNotesRetrieveRequestShowEnumOrigins: - enum: - - status - - value: status,type - name: StatusType - - type - source: - openapi: openapi/openapi.yml -imports: - root: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/credit-notes - method: GET - auth: true - docs: Returns a list of `CreditNote` objects. - source: - openapi: openapi/openapi.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 - 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: root.PaginatedCreditNoteList - status-code: 200 - examples: - - headers: {} - 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: true - docs: Creates a `CreditNote` object with the given values. - source: - openapi: openapi/openapi.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: root.CreditNoteRequest - content-type: application/json - response: - docs: '' - type: root.CreditNoteResponse - status-code: 201 - examples: - - headers: {} - 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: true - docs: Returns a `CreditNote` object with the given `id`. - source: - openapi: openapi/openapi.yml - path-parameters: - id: string - request: - name: CreditNotesRetrieveRequest - query-parameters: - expand: - type: optional - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - include_remote_data: - type: optional - docs: >- - Whether to include the original data Merge fetched from the - third-party to produce these models. - include_shell_data: - type: optional - docs: >- - Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - 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: root.CreditNote - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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_category: tracking_category - 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: true - docs: Returns metadata for `CreditNote` POSTs. - source: - openapi: openapi/openapi.yml - response: - docs: '' - type: root.MetaResponse - status-code: 200 - examples: - - headers: {} - 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: openapi/openapi.yml diff --git a/.mock/definition/accounting/invoices.yml b/.mock/definition/accounting/invoices.yml deleted file mode 100644 index a3d8801..0000000 --- a/.mock/definition/accounting/invoices.yml +++ /dev/null @@ -1,28100 +0,0 @@ -types: - InvoicesListRequestExpand: - enum: - - accounting_period - - value: accounting_period,payment_term - name: AccountingPeriodPaymentTerm - - applied_credit_notes - - value: applied_credit_notes,accounting_period - name: AppliedCreditNotesAccountingPeriod - - value: applied_credit_notes,accounting_period,payment_term - name: AppliedCreditNotesAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits - name: AppliedCreditNotesAppliedVendorCredits - - value: applied_credit_notes,applied_vendor_credits,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: AppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,company - name: AppliedCreditNotesAppliedVendorCreditsCompany - - value: applied_credit_notes,applied_vendor_credits,company,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,company,employee - name: AppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: AppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: applied_credit_notes,applied_vendor_credits,company,payment_term - name: AppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact - name: AppliedCreditNotesAppliedVendorCreditsContact - - value: applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact,company - name: AppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact,company,employee - name: AppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: AppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact,employee - name: AppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: AppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact,payment_term - name: AppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,employee - name: AppliedCreditNotesAppliedVendorCreditsEmployee - - value: applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,employee,payment_term - name: AppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: applied_credit_notes,applied_vendor_credits,payment_term - name: AppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_credit_notes,company - name: AppliedCreditNotesCompany - - value: applied_credit_notes,company,accounting_period - name: AppliedCreditNotesCompanyAccountingPeriod - - value: applied_credit_notes,company,accounting_period,payment_term - name: AppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: applied_credit_notes,company,employee - name: AppliedCreditNotesCompanyEmployee - - value: applied_credit_notes,company,employee,accounting_period - name: AppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: applied_credit_notes,company,employee,accounting_period,payment_term - name: AppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,company,employee,payment_term - name: AppliedCreditNotesCompanyEmployeePaymentTerm - - value: applied_credit_notes,company,payment_term - name: AppliedCreditNotesCompanyPaymentTerm - - value: applied_credit_notes,contact - name: AppliedCreditNotesContact - - value: applied_credit_notes,contact,accounting_period - name: AppliedCreditNotesContactAccountingPeriod - - value: applied_credit_notes,contact,accounting_period,payment_term - name: AppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: applied_credit_notes,contact,company - name: AppliedCreditNotesContactCompany - - value: applied_credit_notes,contact,company,accounting_period - name: AppliedCreditNotesContactCompanyAccountingPeriod - - value: applied_credit_notes,contact,company,accounting_period,payment_term - name: AppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: applied_credit_notes,contact,company,employee - name: AppliedCreditNotesContactCompanyEmployee - - value: applied_credit_notes,contact,company,employee,accounting_period - name: AppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: AppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,contact,company,employee,payment_term - name: AppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: applied_credit_notes,contact,company,payment_term - name: AppliedCreditNotesContactCompanyPaymentTerm - - value: applied_credit_notes,contact,employee - name: AppliedCreditNotesContactEmployee - - value: applied_credit_notes,contact,employee,accounting_period - name: AppliedCreditNotesContactEmployeeAccountingPeriod - - value: applied_credit_notes,contact,employee,accounting_period,payment_term - name: AppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,contact,employee,payment_term - name: AppliedCreditNotesContactEmployeePaymentTerm - - value: applied_credit_notes,contact,payment_term - name: AppliedCreditNotesContactPaymentTerm - - value: applied_credit_notes,employee - name: AppliedCreditNotesEmployee - - value: applied_credit_notes,employee,accounting_period - name: AppliedCreditNotesEmployeeAccountingPeriod - - value: applied_credit_notes,employee,accounting_period,payment_term - name: AppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,employee,payment_term - name: AppliedCreditNotesEmployeePaymentTerm - - value: applied_credit_notes,payment_term - name: AppliedCreditNotesPaymentTerm - - applied_payments - - value: applied_payments,accounting_period - name: AppliedPaymentsAccountingPeriod - - value: applied_payments,accounting_period,payment_term - name: AppliedPaymentsAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes - name: AppliedPaymentsAppliedCreditNotes - - value: applied_payments,applied_credit_notes,accounting_period - name: AppliedPaymentsAppliedCreditNotesAccountingPeriod - - value: applied_payments,applied_credit_notes,accounting_period,payment_term - name: AppliedPaymentsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,applied_vendor_credits - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,applied_vendor_credits,company - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,employee - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,applied_credit_notes,applied_vendor_credits,contact - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,applied_credit_notes,applied_vendor_credits,employee - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,payment_term - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_payments,applied_credit_notes,company - name: AppliedPaymentsAppliedCreditNotesCompany - - value: applied_payments,applied_credit_notes,company,accounting_period - name: AppliedPaymentsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,company,accounting_period,payment_term - name: AppliedPaymentsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,company,employee - name: AppliedPaymentsAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,applied_credit_notes,company,employee,accounting_period - name: AppliedPaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,company,employee,payment_term - name: AppliedPaymentsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: applied_payments,applied_credit_notes,company,payment_term - name: AppliedPaymentsAppliedCreditNotesCompanyPaymentTerm - - value: applied_payments,applied_credit_notes,contact - name: AppliedPaymentsAppliedCreditNotesContact - - value: applied_payments,applied_credit_notes,contact,accounting_period - name: AppliedPaymentsAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,contact,accounting_period,payment_term - name: AppliedPaymentsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,contact,company - name: AppliedPaymentsAppliedCreditNotesContactCompany - - value: >- - applied_payments,applied_credit_notes,contact,company,accounting_period - name: AppliedPaymentsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,contact,company,employee - name: AppliedPaymentsAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,contact,company,employee,payment_term - name: AppliedPaymentsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: applied_payments,applied_credit_notes,contact,company,payment_term - name: AppliedPaymentsAppliedCreditNotesContactCompanyPaymentTerm - - value: applied_payments,applied_credit_notes,contact,employee - name: AppliedPaymentsAppliedCreditNotesContactEmployee - - value: >- - applied_payments,applied_credit_notes,contact,employee,accounting_period - name: AppliedPaymentsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,contact,employee,payment_term - name: AppliedPaymentsAppliedCreditNotesContactEmployeePaymentTerm - - value: applied_payments,applied_credit_notes,contact,payment_term - name: AppliedPaymentsAppliedCreditNotesContactPaymentTerm - - value: applied_payments,applied_credit_notes,employee - name: AppliedPaymentsAppliedCreditNotesEmployee - - value: applied_payments,applied_credit_notes,employee,accounting_period - name: AppliedPaymentsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,employee,accounting_period,payment_term - name: AppliedPaymentsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,employee,payment_term - name: AppliedPaymentsAppliedCreditNotesEmployeePaymentTerm - - value: applied_payments,applied_credit_notes,payment_term - name: AppliedPaymentsAppliedCreditNotesPaymentTerm - - value: applied_payments,applied_vendor_credits - name: AppliedPaymentsAppliedVendorCredits - - value: applied_payments,applied_vendor_credits,accounting_period - name: AppliedPaymentsAppliedVendorCreditsAccountingPeriod - - value: applied_payments,applied_vendor_credits,accounting_period,payment_term - name: AppliedPaymentsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,company - name: AppliedPaymentsAppliedVendorCreditsCompany - - value: applied_payments,applied_vendor_credits,company,accounting_period - name: AppliedPaymentsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,company,accounting_period,payment_term - name: AppliedPaymentsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,company,employee - name: AppliedPaymentsAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,applied_vendor_credits,company,employee,accounting_period - name: AppliedPaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,company,employee,payment_term - name: AppliedPaymentsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: applied_payments,applied_vendor_credits,company,payment_term - name: AppliedPaymentsAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,applied_vendor_credits,contact - name: AppliedPaymentsAppliedVendorCreditsContact - - value: applied_payments,applied_vendor_credits,contact,accounting_period - name: AppliedPaymentsAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,contact,accounting_period,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,contact,company - name: AppliedPaymentsAppliedVendorCreditsContactCompany - - value: >- - applied_payments,applied_vendor_credits,contact,company,accounting_period - name: AppliedPaymentsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,contact,company,employee - name: AppliedPaymentsAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_vendor_credits,contact,company,employee,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: applied_payments,applied_vendor_credits,contact,company,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactCompanyPaymentTerm - - value: applied_payments,applied_vendor_credits,contact,employee - name: AppliedPaymentsAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,applied_vendor_credits,contact,employee,accounting_period - name: AppliedPaymentsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,contact,employee,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactEmployeePaymentTerm - - value: applied_payments,applied_vendor_credits,contact,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,applied_vendor_credits,employee - name: AppliedPaymentsAppliedVendorCreditsEmployee - - value: applied_payments,applied_vendor_credits,employee,accounting_period - name: AppliedPaymentsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,employee,accounting_period,payment_term - name: AppliedPaymentsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,employee,payment_term - name: AppliedPaymentsAppliedVendorCreditsEmployeePaymentTerm - - value: applied_payments,applied_vendor_credits,payment_term - name: AppliedPaymentsAppliedVendorCreditsPaymentTerm - - value: applied_payments,company - name: AppliedPaymentsCompany - - value: applied_payments,company,accounting_period - name: AppliedPaymentsCompanyAccountingPeriod - - value: applied_payments,company,accounting_period,payment_term - name: AppliedPaymentsCompanyAccountingPeriodPaymentTerm - - value: applied_payments,company,employee - name: AppliedPaymentsCompanyEmployee - - value: applied_payments,company,employee,accounting_period - name: AppliedPaymentsCompanyEmployeeAccountingPeriod - - value: applied_payments,company,employee,accounting_period,payment_term - name: AppliedPaymentsCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,company,employee,payment_term - name: AppliedPaymentsCompanyEmployeePaymentTerm - - value: applied_payments,company,payment_term - name: AppliedPaymentsCompanyPaymentTerm - - value: applied_payments,contact - name: AppliedPaymentsContact - - value: applied_payments,contact,accounting_period - name: AppliedPaymentsContactAccountingPeriod - - value: applied_payments,contact,accounting_period,payment_term - name: AppliedPaymentsContactAccountingPeriodPaymentTerm - - value: applied_payments,contact,company - name: AppliedPaymentsContactCompany - - value: applied_payments,contact,company,accounting_period - name: AppliedPaymentsContactCompanyAccountingPeriod - - value: applied_payments,contact,company,accounting_period,payment_term - name: AppliedPaymentsContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,contact,company,employee - name: AppliedPaymentsContactCompanyEmployee - - value: applied_payments,contact,company,employee,accounting_period - name: AppliedPaymentsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,contact,company,employee,accounting_period,payment_term - name: AppliedPaymentsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,contact,company,employee,payment_term - name: AppliedPaymentsContactCompanyEmployeePaymentTerm - - value: applied_payments,contact,company,payment_term - name: AppliedPaymentsContactCompanyPaymentTerm - - value: applied_payments,contact,employee - name: AppliedPaymentsContactEmployee - - value: applied_payments,contact,employee,accounting_period - name: AppliedPaymentsContactEmployeeAccountingPeriod - - value: applied_payments,contact,employee,accounting_period,payment_term - name: AppliedPaymentsContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,contact,employee,payment_term - name: AppliedPaymentsContactEmployeePaymentTerm - - value: applied_payments,contact,payment_term - name: AppliedPaymentsContactPaymentTerm - - value: applied_payments,employee - name: AppliedPaymentsEmployee - - value: applied_payments,employee,accounting_period - name: AppliedPaymentsEmployeeAccountingPeriod - - value: applied_payments,employee,accounting_period,payment_term - name: AppliedPaymentsEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,employee,payment_term - name: AppliedPaymentsEmployeePaymentTerm - - value: applied_payments,line_items - name: AppliedPaymentsLineItems - - value: applied_payments,line_items,accounting_period - name: AppliedPaymentsLineItemsAccountingPeriod - - value: applied_payments,line_items,accounting_period,payment_term - name: AppliedPaymentsLineItemsAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_credit_notes - name: AppliedPaymentsLineItemsAppliedCreditNotes - - value: applied_payments,line_items,applied_credit_notes,accounting_period - name: AppliedPaymentsLineItemsAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,accounting_period,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits - name: AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company - name: AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact - name: AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,company - name: AppliedPaymentsLineItemsAppliedCreditNotesCompany - - value: >- - applied_payments,line_items,applied_credit_notes,company,accounting_period - name: AppliedPaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,company,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,company,employee,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: applied_payments,line_items,applied_credit_notes,company,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesCompanyPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,contact - name: AppliedPaymentsLineItemsAppliedCreditNotesContact - - value: >- - applied_payments,line_items,applied_credit_notes,contact,accounting_period - name: AppliedPaymentsLineItemsAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,contact,company - name: AppliedPaymentsLineItemsAppliedCreditNotesContactCompany - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,contact,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesContactEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,contact,employee,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesContactEmployeePaymentTerm - - value: applied_payments,line_items,applied_credit_notes,contact,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesContactPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,employee,accounting_period - name: AppliedPaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,employee,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesEmployeePaymentTerm - - value: applied_payments,line_items,applied_credit_notes,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits - name: AppliedPaymentsLineItemsAppliedVendorCredits - - value: applied_payments,line_items,applied_vendor_credits,accounting_period - name: AppliedPaymentsLineItemsAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,company - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,applied_vendor_credits,company,accounting_period - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,company,employee - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,company,employee,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,company,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,contact - name: AppliedPaymentsLineItemsAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,accounting_period - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,contact,company - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,employee - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,contact,employee - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,employee,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,employee - name: AppliedPaymentsLineItemsAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,applied_vendor_credits,employee,accounting_period - name: AppliedPaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,employee,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsEmployeePaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsPaymentTerm - - value: applied_payments,line_items,company - name: AppliedPaymentsLineItemsCompany - - value: applied_payments,line_items,company,accounting_period - name: AppliedPaymentsLineItemsCompanyAccountingPeriod - - value: applied_payments,line_items,company,accounting_period,payment_term - name: AppliedPaymentsLineItemsCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,company,employee - name: AppliedPaymentsLineItemsCompanyEmployee - - value: applied_payments,line_items,company,employee,accounting_period - name: AppliedPaymentsLineItemsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,company,employee,accounting_period,payment_term - name: AppliedPaymentsLineItemsCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,company,employee,payment_term - name: AppliedPaymentsLineItemsCompanyEmployeePaymentTerm - - value: applied_payments,line_items,company,payment_term - name: AppliedPaymentsLineItemsCompanyPaymentTerm - - value: applied_payments,line_items,contact - name: AppliedPaymentsLineItemsContact - - value: applied_payments,line_items,contact,accounting_period - name: AppliedPaymentsLineItemsContactAccountingPeriod - - value: applied_payments,line_items,contact,accounting_period,payment_term - name: AppliedPaymentsLineItemsContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,contact,company - name: AppliedPaymentsLineItemsContactCompany - - value: applied_payments,line_items,contact,company,accounting_period - name: AppliedPaymentsLineItemsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,contact,company,accounting_period,payment_term - name: AppliedPaymentsLineItemsContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,contact,company,employee - name: AppliedPaymentsLineItemsContactCompanyEmployee - - value: applied_payments,line_items,contact,company,employee,accounting_period - name: AppliedPaymentsLineItemsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,contact,company,employee,payment_term - name: AppliedPaymentsLineItemsContactCompanyEmployeePaymentTerm - - value: applied_payments,line_items,contact,company,payment_term - name: AppliedPaymentsLineItemsContactCompanyPaymentTerm - - value: applied_payments,line_items,contact,employee - name: AppliedPaymentsLineItemsContactEmployee - - value: applied_payments,line_items,contact,employee,accounting_period - name: AppliedPaymentsLineItemsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,contact,employee,accounting_period,payment_term - name: AppliedPaymentsLineItemsContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,contact,employee,payment_term - name: AppliedPaymentsLineItemsContactEmployeePaymentTerm - - value: applied_payments,line_items,contact,payment_term - name: AppliedPaymentsLineItemsContactPaymentTerm - - value: applied_payments,line_items,employee - name: AppliedPaymentsLineItemsEmployee - - value: applied_payments,line_items,employee,accounting_period - name: AppliedPaymentsLineItemsEmployeeAccountingPeriod - - value: applied_payments,line_items,employee,accounting_period,payment_term - name: AppliedPaymentsLineItemsEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,employee,payment_term - name: AppliedPaymentsLineItemsEmployeePaymentTerm - - value: applied_payments,line_items,payment_term - name: AppliedPaymentsLineItemsPaymentTerm - - value: applied_payments,line_items,purchase_orders - name: AppliedPaymentsLineItemsPurchaseOrders - - value: applied_payments,line_items,purchase_orders,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,accounting_period,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,applied_credit_notes - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotes - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContact - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,employee - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: applied_payments,line_items,purchase_orders,applied_vendor_credits - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCredits - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,employee - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: applied_payments,line_items,purchase_orders,company - name: AppliedPaymentsLineItemsPurchaseOrdersCompany - - value: applied_payments,line_items,purchase_orders,company,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,company,employee - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,company,employee,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,company,employee,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeePaymentTerm - - value: applied_payments,line_items,purchase_orders,company,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyPaymentTerm - - value: applied_payments,line_items,purchase_orders,contact - name: AppliedPaymentsLineItemsPurchaseOrdersContact - - value: applied_payments,line_items,purchase_orders,contact,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersContactAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,contact,company - name: AppliedPaymentsLineItemsPurchaseOrdersContactCompany - - value: >- - applied_payments,line_items,purchase_orders,contact,company,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,contact,company,employee - name: AppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,contact,company,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersContactCompanyPaymentTerm - - value: applied_payments,line_items,purchase_orders,contact,employee - name: AppliedPaymentsLineItemsPurchaseOrdersContactEmployee - - value: >- - applied_payments,line_items,purchase_orders,contact,employee,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,contact,employee,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersContactEmployeePaymentTerm - - value: applied_payments,line_items,purchase_orders,contact,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersContactPaymentTerm - - value: applied_payments,line_items,purchase_orders,employee - name: AppliedPaymentsLineItemsPurchaseOrdersEmployee - - value: applied_payments,line_items,purchase_orders,employee,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,employee,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersEmployeePaymentTerm - - value: applied_payments,line_items,purchase_orders,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersPaymentTerm - - value: applied_payments,line_items,tracking_categories - name: AppliedPaymentsLineItemsTrackingCategories - - value: applied_payments,line_items,tracking_categories,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,accounting_period,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: applied_payments,line_items,tracking_categories,applied_credit_notes - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotes - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContact - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,employee - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: applied_payments,line_items,tracking_categories,applied_vendor_credits - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCredits - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,employee - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: applied_payments,line_items,tracking_categories,company - name: AppliedPaymentsLineItemsTrackingCategoriesCompany - - value: >- - applied_payments,line_items,tracking_categories,company,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,tracking_categories,company,employee - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,company,employee,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeePaymentTerm - - value: applied_payments,line_items,tracking_categories,company,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyPaymentTerm - - value: applied_payments,line_items,tracking_categories,contact - name: AppliedPaymentsLineItemsTrackingCategoriesContact - - value: >- - applied_payments,line_items,tracking_categories,contact,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,tracking_categories,contact,company - name: AppliedPaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - applied_payments,line_items,tracking_categories,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,contact,company,employee - name: AppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,contact,company,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesContactCompanyPaymentTerm - - value: applied_payments,line_items,tracking_categories,contact,employee - name: AppliedPaymentsLineItemsTrackingCategoriesContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,contact,employee,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesContactEmployeePaymentTerm - - value: applied_payments,line_items,tracking_categories,contact,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesContactPaymentTerm - - value: applied_payments,line_items,tracking_categories,employee - name: AppliedPaymentsLineItemsTrackingCategoriesEmployee - - value: >- - applied_payments,line_items,tracking_categories,employee,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,tracking_categories,employee,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesEmployeePaymentTerm - - value: applied_payments,line_items,tracking_categories,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesPaymentTerm - - value: applied_payments,line_items,tracking_categories,purchase_orders - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrders - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContact - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,employee - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersPaymentTerm - - value: applied_payments,payment_term - name: AppliedPaymentsPaymentTerm - - value: applied_payments,purchase_orders - name: AppliedPaymentsPurchaseOrders - - value: applied_payments,purchase_orders,accounting_period - name: AppliedPaymentsPurchaseOrdersAccountingPeriod - - value: applied_payments,purchase_orders,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotes - - value: >- - applied_payments,purchase_orders,applied_credit_notes,accounting_period - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,company - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,accounting_period - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,company,employee - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,contact - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContact - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,contact,company - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,employee - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,contact,employee - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,employee - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,employee,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits - name: AppliedPaymentsPurchaseOrdersAppliedVendorCredits - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,accounting_period - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits,company - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,employee - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits,contact - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,employee - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits,employee - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,employee,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: applied_payments,purchase_orders,company - name: AppliedPaymentsPurchaseOrdersCompany - - value: applied_payments,purchase_orders,company,accounting_period - name: AppliedPaymentsPurchaseOrdersCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,company,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,company,employee - name: AppliedPaymentsPurchaseOrdersCompanyEmployee - - value: applied_payments,purchase_orders,company,employee,accounting_period - name: AppliedPaymentsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,company,employee,payment_term - name: AppliedPaymentsPurchaseOrdersCompanyEmployeePaymentTerm - - value: applied_payments,purchase_orders,company,payment_term - name: AppliedPaymentsPurchaseOrdersCompanyPaymentTerm - - value: applied_payments,purchase_orders,contact - name: AppliedPaymentsPurchaseOrdersContact - - value: applied_payments,purchase_orders,contact,accounting_period - name: AppliedPaymentsPurchaseOrdersContactAccountingPeriod - - value: >- - applied_payments,purchase_orders,contact,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,contact,company - name: AppliedPaymentsPurchaseOrdersContactCompany - - value: applied_payments,purchase_orders,contact,company,accounting_period - name: AppliedPaymentsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,contact,company,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,contact,company,employee - name: AppliedPaymentsPurchaseOrdersContactCompanyEmployee - - value: >- - applied_payments,purchase_orders,contact,company,employee,accounting_period - name: AppliedPaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,contact,company,employee,payment_term - name: AppliedPaymentsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: applied_payments,purchase_orders,contact,company,payment_term - name: AppliedPaymentsPurchaseOrdersContactCompanyPaymentTerm - - value: applied_payments,purchase_orders,contact,employee - name: AppliedPaymentsPurchaseOrdersContactEmployee - - value: applied_payments,purchase_orders,contact,employee,accounting_period - name: AppliedPaymentsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,contact,employee,payment_term - name: AppliedPaymentsPurchaseOrdersContactEmployeePaymentTerm - - value: applied_payments,purchase_orders,contact,payment_term - name: AppliedPaymentsPurchaseOrdersContactPaymentTerm - - value: applied_payments,purchase_orders,employee - name: AppliedPaymentsPurchaseOrdersEmployee - - value: applied_payments,purchase_orders,employee,accounting_period - name: AppliedPaymentsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,employee,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,employee,payment_term - name: AppliedPaymentsPurchaseOrdersEmployeePaymentTerm - - value: applied_payments,purchase_orders,payment_term - name: AppliedPaymentsPurchaseOrdersPaymentTerm - - value: applied_payments,tracking_categories - name: AppliedPaymentsTrackingCategories - - value: applied_payments,tracking_categories,accounting_period - name: AppliedPaymentsTrackingCategoriesAccountingPeriod - - value: applied_payments,tracking_categories,accounting_period,payment_term - name: AppliedPaymentsTrackingCategoriesAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotes - - value: >- - applied_payments,tracking_categories,applied_credit_notes,accounting_period - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes,company - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,employee - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes,contact - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesContact - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,employee - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes,employee - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,employee,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: applied_payments,tracking_categories,applied_vendor_credits - name: AppliedPaymentsTrackingCategoriesAppliedVendorCredits - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,accounting_period - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,applied_vendor_credits,company - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,employee - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,tracking_categories,applied_vendor_credits,contact - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,employee - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,tracking_categories,applied_vendor_credits,employee - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: applied_payments,tracking_categories,company - name: AppliedPaymentsTrackingCategoriesCompany - - value: applied_payments,tracking_categories,company,accounting_period - name: AppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,company,accounting_period,payment_term - name: AppliedPaymentsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,company,employee - name: AppliedPaymentsTrackingCategoriesCompanyEmployee - - value: >- - applied_payments,tracking_categories,company,employee,accounting_period - name: AppliedPaymentsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,company,employee,payment_term - name: AppliedPaymentsTrackingCategoriesCompanyEmployeePaymentTerm - - value: applied_payments,tracking_categories,company,payment_term - name: AppliedPaymentsTrackingCategoriesCompanyPaymentTerm - - value: applied_payments,tracking_categories,contact - name: AppliedPaymentsTrackingCategoriesContact - - value: applied_payments,tracking_categories,contact,accounting_period - name: AppliedPaymentsTrackingCategoriesContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,contact,accounting_period,payment_term - name: AppliedPaymentsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,contact,company - name: AppliedPaymentsTrackingCategoriesContactCompany - - value: applied_payments,tracking_categories,contact,company,accounting_period - name: AppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,contact,company,employee - name: AppliedPaymentsTrackingCategoriesContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,contact,company,employee,payment_term - name: AppliedPaymentsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: applied_payments,tracking_categories,contact,company,payment_term - name: AppliedPaymentsTrackingCategoriesContactCompanyPaymentTerm - - value: applied_payments,tracking_categories,contact,employee - name: AppliedPaymentsTrackingCategoriesContactEmployee - - value: >- - applied_payments,tracking_categories,contact,employee,accounting_period - name: AppliedPaymentsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,contact,employee,payment_term - name: AppliedPaymentsTrackingCategoriesContactEmployeePaymentTerm - - value: applied_payments,tracking_categories,contact,payment_term - name: AppliedPaymentsTrackingCategoriesContactPaymentTerm - - value: applied_payments,tracking_categories,employee - name: AppliedPaymentsTrackingCategoriesEmployee - - value: applied_payments,tracking_categories,employee,accounting_period - name: AppliedPaymentsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,employee,accounting_period,payment_term - name: AppliedPaymentsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,employee,payment_term - name: AppliedPaymentsTrackingCategoriesEmployeePaymentTerm - - value: applied_payments,tracking_categories,payment_term - name: AppliedPaymentsTrackingCategoriesPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders - name: AppliedPaymentsTrackingCategoriesPurchaseOrders - - value: applied_payments,tracking_categories,purchase_orders,accounting_period - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,company - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,company,accounting_period - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,company,employee - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,company,payment_term - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,contact - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContact - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,accounting_period - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,contact,company - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,employee - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,contact,employee - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,payment_term - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,employee - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,employee,payment_term - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,payment_term - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersPaymentTerm - - applied_vendor_credits - - value: applied_vendor_credits,accounting_period - name: AppliedVendorCreditsAccountingPeriod - - value: applied_vendor_credits,accounting_period,payment_term - name: AppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_vendor_credits,company - name: AppliedVendorCreditsCompany - - value: applied_vendor_credits,company,accounting_period - name: AppliedVendorCreditsCompanyAccountingPeriod - - value: applied_vendor_credits,company,accounting_period,payment_term - name: AppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: applied_vendor_credits,company,employee - name: AppliedVendorCreditsCompanyEmployee - - value: applied_vendor_credits,company,employee,accounting_period - name: AppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: applied_vendor_credits,company,employee,accounting_period,payment_term - name: AppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_vendor_credits,company,employee,payment_term - name: AppliedVendorCreditsCompanyEmployeePaymentTerm - - value: applied_vendor_credits,company,payment_term - name: AppliedVendorCreditsCompanyPaymentTerm - - value: applied_vendor_credits,contact - name: AppliedVendorCreditsContact - - value: applied_vendor_credits,contact,accounting_period - name: AppliedVendorCreditsContactAccountingPeriod - - value: applied_vendor_credits,contact,accounting_period,payment_term - name: AppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: applied_vendor_credits,contact,company - name: AppliedVendorCreditsContactCompany - - value: applied_vendor_credits,contact,company,accounting_period - name: AppliedVendorCreditsContactCompanyAccountingPeriod - - value: applied_vendor_credits,contact,company,accounting_period,payment_term - name: AppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: applied_vendor_credits,contact,company,employee - name: AppliedVendorCreditsContactCompanyEmployee - - value: applied_vendor_credits,contact,company,employee,accounting_period - name: AppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: AppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_vendor_credits,contact,company,employee,payment_term - name: AppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: applied_vendor_credits,contact,company,payment_term - name: AppliedVendorCreditsContactCompanyPaymentTerm - - value: applied_vendor_credits,contact,employee - name: AppliedVendorCreditsContactEmployee - - value: applied_vendor_credits,contact,employee,accounting_period - name: AppliedVendorCreditsContactEmployeeAccountingPeriod - - value: applied_vendor_credits,contact,employee,accounting_period,payment_term - name: AppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: applied_vendor_credits,contact,employee,payment_term - name: AppliedVendorCreditsContactEmployeePaymentTerm - - value: applied_vendor_credits,contact,payment_term - name: AppliedVendorCreditsContactPaymentTerm - - value: applied_vendor_credits,employee - name: AppliedVendorCreditsEmployee - - value: applied_vendor_credits,employee,accounting_period - name: AppliedVendorCreditsEmployeeAccountingPeriod - - value: applied_vendor_credits,employee,accounting_period,payment_term - name: AppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: applied_vendor_credits,employee,payment_term - name: AppliedVendorCreditsEmployeePaymentTerm - - value: applied_vendor_credits,payment_term - name: AppliedVendorCreditsPaymentTerm - - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - value: company,accounting_period,payment_term - name: CompanyAccountingPeriodPaymentTerm - - value: company,employee - name: CompanyEmployee - - value: company,employee,accounting_period - name: CompanyEmployeeAccountingPeriod - - value: company,employee,accounting_period,payment_term - name: CompanyEmployeeAccountingPeriodPaymentTerm - - value: company,employee,payment_term - name: CompanyEmployeePaymentTerm - - value: company,payment_term - name: CompanyPaymentTerm - - contact - - value: contact,accounting_period - name: ContactAccountingPeriod - - value: contact,accounting_period,payment_term - name: ContactAccountingPeriodPaymentTerm - - value: contact,company - name: ContactCompany - - value: contact,company,accounting_period - name: ContactCompanyAccountingPeriod - - value: contact,company,accounting_period,payment_term - name: ContactCompanyAccountingPeriodPaymentTerm - - value: contact,company,employee - name: ContactCompanyEmployee - - value: contact,company,employee,accounting_period - name: ContactCompanyEmployeeAccountingPeriod - - value: contact,company,employee,accounting_period,payment_term - name: ContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: contact,company,employee,payment_term - name: ContactCompanyEmployeePaymentTerm - - value: contact,company,payment_term - name: ContactCompanyPaymentTerm - - value: contact,employee - name: ContactEmployee - - value: contact,employee,accounting_period - name: ContactEmployeeAccountingPeriod - - value: contact,employee,accounting_period,payment_term - name: ContactEmployeeAccountingPeriodPaymentTerm - - value: contact,employee,payment_term - name: ContactEmployeePaymentTerm - - value: contact,payment_term - name: ContactPaymentTerm - - employee - - value: employee,accounting_period - name: EmployeeAccountingPeriod - - value: employee,accounting_period,payment_term - name: EmployeeAccountingPeriodPaymentTerm - - value: employee,payment_term - name: EmployeePaymentTerm - - line_items - - value: line_items,accounting_period - name: LineItemsAccountingPeriod - - value: line_items,accounting_period,payment_term - name: LineItemsAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes - name: LineItemsAppliedCreditNotes - - value: line_items,applied_credit_notes,accounting_period - name: LineItemsAppliedCreditNotesAccountingPeriod - - value: line_items,applied_credit_notes,accounting_period,payment_term - name: LineItemsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits - name: LineItemsAppliedCreditNotesAppliedVendorCredits - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,accounting_period - name: LineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,company - name: LineItemsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,employee - name: LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,payment_term - name: LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,contact - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,contact,company - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,employee - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,employee - name: LineItemsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: LineItemsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,payment_term - name: LineItemsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: line_items,applied_credit_notes,company - name: LineItemsAppliedCreditNotesCompany - - value: line_items,applied_credit_notes,company,accounting_period - name: LineItemsAppliedCreditNotesCompanyAccountingPeriod - - value: line_items,applied_credit_notes,company,accounting_period,payment_term - name: LineItemsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,company,employee - name: LineItemsAppliedCreditNotesCompanyEmployee - - value: line_items,applied_credit_notes,company,employee,accounting_period - name: LineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,company,employee,accounting_period,payment_term - name: LineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,company,employee,payment_term - name: LineItemsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: line_items,applied_credit_notes,company,payment_term - name: LineItemsAppliedCreditNotesCompanyPaymentTerm - - value: line_items,applied_credit_notes,contact - name: LineItemsAppliedCreditNotesContact - - value: line_items,applied_credit_notes,contact,accounting_period - name: LineItemsAppliedCreditNotesContactAccountingPeriod - - value: line_items,applied_credit_notes,contact,accounting_period,payment_term - name: LineItemsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,contact,company - name: LineItemsAppliedCreditNotesContactCompany - - value: line_items,applied_credit_notes,contact,company,accounting_period - name: LineItemsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - line_items,applied_credit_notes,contact,company,accounting_period,payment_term - name: LineItemsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,contact,company,employee - name: LineItemsAppliedCreditNotesContactCompanyEmployee - - value: >- - line_items,applied_credit_notes,contact,company,employee,accounting_period - name: LineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,contact,company,employee,payment_term - name: LineItemsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: line_items,applied_credit_notes,contact,company,payment_term - name: LineItemsAppliedCreditNotesContactCompanyPaymentTerm - - value: line_items,applied_credit_notes,contact,employee - name: LineItemsAppliedCreditNotesContactEmployee - - value: line_items,applied_credit_notes,contact,employee,accounting_period - name: LineItemsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,contact,employee,accounting_period,payment_term - name: LineItemsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,contact,employee,payment_term - name: LineItemsAppliedCreditNotesContactEmployeePaymentTerm - - value: line_items,applied_credit_notes,contact,payment_term - name: LineItemsAppliedCreditNotesContactPaymentTerm - - value: line_items,applied_credit_notes,employee - name: LineItemsAppliedCreditNotesEmployee - - value: line_items,applied_credit_notes,employee,accounting_period - name: LineItemsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,employee,accounting_period,payment_term - name: LineItemsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,employee,payment_term - name: LineItemsAppliedCreditNotesEmployeePaymentTerm - - value: line_items,applied_credit_notes,payment_term - name: LineItemsAppliedCreditNotesPaymentTerm - - value: line_items,applied_vendor_credits - name: LineItemsAppliedVendorCredits - - value: line_items,applied_vendor_credits,accounting_period - name: LineItemsAppliedVendorCreditsAccountingPeriod - - value: line_items,applied_vendor_credits,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,company - name: LineItemsAppliedVendorCreditsCompany - - value: line_items,applied_vendor_credits,company,accounting_period - name: LineItemsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,applied_vendor_credits,company,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,company,employee - name: LineItemsAppliedVendorCreditsCompanyEmployee - - value: line_items,applied_vendor_credits,company,employee,accounting_period - name: LineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,company,employee,payment_term - name: LineItemsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: line_items,applied_vendor_credits,company,payment_term - name: LineItemsAppliedVendorCreditsCompanyPaymentTerm - - value: line_items,applied_vendor_credits,contact - name: LineItemsAppliedVendorCreditsContact - - value: line_items,applied_vendor_credits,contact,accounting_period - name: LineItemsAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,applied_vendor_credits,contact,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,contact,company - name: LineItemsAppliedVendorCreditsContactCompany - - value: line_items,applied_vendor_credits,contact,company,accounting_period - name: LineItemsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,applied_vendor_credits,contact,company,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,contact,company,employee - name: LineItemsAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,applied_vendor_credits,contact,company,employee,accounting_period - name: LineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_vendor_credits,contact,company,employee,payment_term - name: LineItemsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: line_items,applied_vendor_credits,contact,company,payment_term - name: LineItemsAppliedVendorCreditsContactCompanyPaymentTerm - - value: line_items,applied_vendor_credits,contact,employee - name: LineItemsAppliedVendorCreditsContactEmployee - - value: line_items,applied_vendor_credits,contact,employee,accounting_period - name: LineItemsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,contact,employee,payment_term - name: LineItemsAppliedVendorCreditsContactEmployeePaymentTerm - - value: line_items,applied_vendor_credits,contact,payment_term - name: LineItemsAppliedVendorCreditsContactPaymentTerm - - value: line_items,applied_vendor_credits,employee - name: LineItemsAppliedVendorCreditsEmployee - - value: line_items,applied_vendor_credits,employee,accounting_period - name: LineItemsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,applied_vendor_credits,employee,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,employee,payment_term - name: LineItemsAppliedVendorCreditsEmployeePaymentTerm - - value: line_items,applied_vendor_credits,payment_term - name: LineItemsAppliedVendorCreditsPaymentTerm - - value: line_items,company - name: LineItemsCompany - - value: line_items,company,accounting_period - name: LineItemsCompanyAccountingPeriod - - value: line_items,company,accounting_period,payment_term - name: LineItemsCompanyAccountingPeriodPaymentTerm - - value: line_items,company,employee - name: LineItemsCompanyEmployee - - value: line_items,company,employee,accounting_period - name: LineItemsCompanyEmployeeAccountingPeriod - - value: line_items,company,employee,accounting_period,payment_term - name: LineItemsCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,company,employee,payment_term - name: LineItemsCompanyEmployeePaymentTerm - - value: line_items,company,payment_term - name: LineItemsCompanyPaymentTerm - - value: line_items,contact - name: LineItemsContact - - value: line_items,contact,accounting_period - name: LineItemsContactAccountingPeriod - - value: line_items,contact,accounting_period,payment_term - name: LineItemsContactAccountingPeriodPaymentTerm - - value: line_items,contact,company - name: LineItemsContactCompany - - value: line_items,contact,company,accounting_period - name: LineItemsContactCompanyAccountingPeriod - - value: line_items,contact,company,accounting_period,payment_term - name: LineItemsContactCompanyAccountingPeriodPaymentTerm - - value: line_items,contact,company,employee - name: LineItemsContactCompanyEmployee - - value: line_items,contact,company,employee,accounting_period - name: LineItemsContactCompanyEmployeeAccountingPeriod - - value: line_items,contact,company,employee,accounting_period,payment_term - name: LineItemsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,contact,company,employee,payment_term - name: LineItemsContactCompanyEmployeePaymentTerm - - value: line_items,contact,company,payment_term - name: LineItemsContactCompanyPaymentTerm - - value: line_items,contact,employee - name: LineItemsContactEmployee - - value: line_items,contact,employee,accounting_period - name: LineItemsContactEmployeeAccountingPeriod - - value: line_items,contact,employee,accounting_period,payment_term - name: LineItemsContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,contact,employee,payment_term - name: LineItemsContactEmployeePaymentTerm - - value: line_items,contact,payment_term - name: LineItemsContactPaymentTerm - - value: line_items,employee - name: LineItemsEmployee - - value: line_items,employee,accounting_period - name: LineItemsEmployeeAccountingPeriod - - value: line_items,employee,accounting_period,payment_term - name: LineItemsEmployeeAccountingPeriodPaymentTerm - - value: line_items,employee,payment_term - name: LineItemsEmployeePaymentTerm - - value: line_items,payment_term - name: LineItemsPaymentTerm - - value: line_items,purchase_orders - name: LineItemsPurchaseOrders - - value: line_items,purchase_orders,accounting_period - name: LineItemsPurchaseOrdersAccountingPeriod - - value: line_items,purchase_orders,accounting_period,payment_term - name: LineItemsPurchaseOrdersAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes - name: LineItemsPurchaseOrdersAppliedCreditNotes - - value: line_items,purchase_orders,applied_credit_notes,accounting_period - name: LineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,applied_vendor_credits - name: LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,company - name: LineItemsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - line_items,purchase_orders,applied_credit_notes,company,accounting_period - name: LineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,company,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,company,employee,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,company,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,contact - name: LineItemsPurchaseOrdersAppliedCreditNotesContact - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,accounting_period - name: LineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,contact,company - name: LineItemsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,contact,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,contact,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,employee,accounting_period - name: LineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,employee,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits - name: LineItemsPurchaseOrdersAppliedVendorCredits - - value: line_items,purchase_orders,applied_vendor_credits,accounting_period - name: LineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,company - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,accounting_period - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,company,employee - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,company,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,contact - name: LineItemsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,accounting_period - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,contact,company - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,employee - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,contact,employee - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,contact,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,employee - name: LineItemsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - line_items,purchase_orders,applied_vendor_credits,employee,accounting_period - name: LineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,employee,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: line_items,purchase_orders,company - name: LineItemsPurchaseOrdersCompany - - value: line_items,purchase_orders,company,accounting_period - name: LineItemsPurchaseOrdersCompanyAccountingPeriod - - value: line_items,purchase_orders,company,accounting_period,payment_term - name: LineItemsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,company,employee - name: LineItemsPurchaseOrdersCompanyEmployee - - value: line_items,purchase_orders,company,employee,accounting_period - name: LineItemsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,company,employee,accounting_period,payment_term - name: LineItemsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,company,employee,payment_term - name: LineItemsPurchaseOrdersCompanyEmployeePaymentTerm - - value: line_items,purchase_orders,company,payment_term - name: LineItemsPurchaseOrdersCompanyPaymentTerm - - value: line_items,purchase_orders,contact - name: LineItemsPurchaseOrdersContact - - value: line_items,purchase_orders,contact,accounting_period - name: LineItemsPurchaseOrdersContactAccountingPeriod - - value: line_items,purchase_orders,contact,accounting_period,payment_term - name: LineItemsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,contact,company - name: LineItemsPurchaseOrdersContactCompany - - value: line_items,purchase_orders,contact,company,accounting_period - name: LineItemsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,contact,company,accounting_period,payment_term - name: LineItemsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,contact,company,employee - name: LineItemsPurchaseOrdersContactCompanyEmployee - - value: line_items,purchase_orders,contact,company,employee,accounting_period - name: LineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,contact,company,employee,payment_term - name: LineItemsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: line_items,purchase_orders,contact,company,payment_term - name: LineItemsPurchaseOrdersContactCompanyPaymentTerm - - value: line_items,purchase_orders,contact,employee - name: LineItemsPurchaseOrdersContactEmployee - - value: line_items,purchase_orders,contact,employee,accounting_period - name: LineItemsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,contact,employee,accounting_period,payment_term - name: LineItemsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,contact,employee,payment_term - name: LineItemsPurchaseOrdersContactEmployeePaymentTerm - - value: line_items,purchase_orders,contact,payment_term - name: LineItemsPurchaseOrdersContactPaymentTerm - - value: line_items,purchase_orders,employee - name: LineItemsPurchaseOrdersEmployee - - value: line_items,purchase_orders,employee,accounting_period - name: LineItemsPurchaseOrdersEmployeeAccountingPeriod - - value: line_items,purchase_orders,employee,accounting_period,payment_term - name: LineItemsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,employee,payment_term - name: LineItemsPurchaseOrdersEmployeePaymentTerm - - value: line_items,purchase_orders,payment_term - name: LineItemsPurchaseOrdersPaymentTerm - - value: line_items,tracking_categories - name: LineItemsTrackingCategories - - value: line_items,tracking_categories,accounting_period - name: LineItemsTrackingCategoriesAccountingPeriod - - value: line_items,tracking_categories,accounting_period,payment_term - name: LineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes - name: LineItemsTrackingCategoriesAppliedCreditNotes - - value: line_items,tracking_categories,applied_credit_notes,accounting_period - name: LineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits - name: LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,company - name: LineItemsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - line_items,tracking_categories,applied_credit_notes,company,accounting_period - name: LineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,company,employee - name: LineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,company,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,contact - name: LineItemsTrackingCategoriesAppliedCreditNotesContact - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,accounting_period - name: LineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,contact,company - name: LineItemsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,employee - name: LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,contact,employee - name: LineItemsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,employee - name: LineItemsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,employee,accounting_period - name: LineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,employee,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits - name: LineItemsTrackingCategoriesAppliedVendorCredits - - value: >- - line_items,tracking_categories,applied_vendor_credits,accounting_period - name: LineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,company - name: LineItemsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,accounting_period - name: LineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,company,employee - name: LineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,payment_term - name: LineItemsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,contact - name: LineItemsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,accounting_period - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,contact,company - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,employee - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,contact,employee - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,payment_term - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,employee - name: LineItemsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - line_items,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,employee,payment_term - name: LineItemsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,payment_term - name: LineItemsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: line_items,tracking_categories,company - name: LineItemsTrackingCategoriesCompany - - value: line_items,tracking_categories,company,accounting_period - name: LineItemsTrackingCategoriesCompanyAccountingPeriod - - value: line_items,tracking_categories,company,accounting_period,payment_term - name: LineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,company,employee - name: LineItemsTrackingCategoriesCompanyEmployee - - value: line_items,tracking_categories,company,employee,accounting_period - name: LineItemsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,company,employee,accounting_period,payment_term - name: LineItemsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,company,employee,payment_term - name: LineItemsTrackingCategoriesCompanyEmployeePaymentTerm - - value: line_items,tracking_categories,company,payment_term - name: LineItemsTrackingCategoriesCompanyPaymentTerm - - value: line_items,tracking_categories,contact - name: LineItemsTrackingCategoriesContact - - value: line_items,tracking_categories,contact,accounting_period - name: LineItemsTrackingCategoriesContactAccountingPeriod - - value: line_items,tracking_categories,contact,accounting_period,payment_term - name: LineItemsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,contact,company - name: LineItemsTrackingCategoriesContactCompany - - value: line_items,tracking_categories,contact,company,accounting_period - name: LineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,contact,company,accounting_period,payment_term - name: LineItemsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,contact,company,employee - name: LineItemsTrackingCategoriesContactCompanyEmployee - - value: >- - line_items,tracking_categories,contact,company,employee,accounting_period - name: LineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,contact,company,employee,payment_term - name: LineItemsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: line_items,tracking_categories,contact,company,payment_term - name: LineItemsTrackingCategoriesContactCompanyPaymentTerm - - value: line_items,tracking_categories,contact,employee - name: LineItemsTrackingCategoriesContactEmployee - - value: line_items,tracking_categories,contact,employee,accounting_period - name: LineItemsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,contact,employee,accounting_period,payment_term - name: LineItemsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,contact,employee,payment_term - name: LineItemsTrackingCategoriesContactEmployeePaymentTerm - - value: line_items,tracking_categories,contact,payment_term - name: LineItemsTrackingCategoriesContactPaymentTerm - - value: line_items,tracking_categories,employee - name: LineItemsTrackingCategoriesEmployee - - value: line_items,tracking_categories,employee,accounting_period - name: LineItemsTrackingCategoriesEmployeeAccountingPeriod - - value: line_items,tracking_categories,employee,accounting_period,payment_term - name: LineItemsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,employee,payment_term - name: LineItemsTrackingCategoriesEmployeePaymentTerm - - value: line_items,tracking_categories,payment_term - name: LineItemsTrackingCategoriesPaymentTerm - - value: line_items,tracking_categories,purchase_orders - name: LineItemsTrackingCategoriesPurchaseOrders - - value: line_items,tracking_categories,purchase_orders,accounting_period - name: LineItemsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,accounting_period,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,purchase_orders,applied_credit_notes - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,employee - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: line_items,tracking_categories,purchase_orders,applied_vendor_credits - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: line_items,tracking_categories,purchase_orders,company - name: LineItemsTrackingCategoriesPurchaseOrdersCompany - - value: >- - line_items,tracking_categories,purchase_orders,company,accounting_period - name: LineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,purchase_orders,company,employee - name: LineItemsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,company,employee,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: line_items,tracking_categories,purchase_orders,company,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: line_items,tracking_categories,purchase_orders,contact - name: LineItemsTrackingCategoriesPurchaseOrdersContact - - value: >- - line_items,tracking_categories,purchase_orders,contact,accounting_period - name: LineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,purchase_orders,contact,company - name: LineItemsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,employee - name: LineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: line_items,tracking_categories,purchase_orders,contact,employee - name: LineItemsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - line_items,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,contact,employee,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: line_items,tracking_categories,purchase_orders,contact,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: line_items,tracking_categories,purchase_orders,employee - name: LineItemsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - line_items,tracking_categories,purchase_orders,employee,accounting_period - name: LineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,purchase_orders,employee,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: line_items,tracking_categories,purchase_orders,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersPaymentTerm - - payment_term - - payments - - value: payments,accounting_period - name: PaymentsAccountingPeriod - - value: payments,accounting_period,payment_term - name: PaymentsAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes - name: PaymentsAppliedCreditNotes - - value: payments,applied_credit_notes,accounting_period - name: PaymentsAppliedCreditNotesAccountingPeriod - - value: payments,applied_credit_notes,accounting_period,payment_term - name: PaymentsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits - name: PaymentsAppliedCreditNotesAppliedVendorCredits - - value: payments,applied_credit_notes,applied_vendor_credits,accounting_period - name: PaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,company - name: PaymentsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,company,employee - name: PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,payment_term - name: PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,contact - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,contact,company - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,contact,employee - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,employee - name: PaymentsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: PaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: PaymentsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,payment_term - name: PaymentsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,applied_credit_notes,company - name: PaymentsAppliedCreditNotesCompany - - value: payments,applied_credit_notes,company,accounting_period - name: PaymentsAppliedCreditNotesCompanyAccountingPeriod - - value: payments,applied_credit_notes,company,accounting_period,payment_term - name: PaymentsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,company,employee - name: PaymentsAppliedCreditNotesCompanyEmployee - - value: payments,applied_credit_notes,company,employee,accounting_period - name: PaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,company,employee,accounting_period,payment_term - name: PaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,company,employee,payment_term - name: PaymentsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,applied_credit_notes,company,payment_term - name: PaymentsAppliedCreditNotesCompanyPaymentTerm - - value: payments,applied_credit_notes,contact - name: PaymentsAppliedCreditNotesContact - - value: payments,applied_credit_notes,contact,accounting_period - name: PaymentsAppliedCreditNotesContactAccountingPeriod - - value: payments,applied_credit_notes,contact,accounting_period,payment_term - name: PaymentsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,contact,company - name: PaymentsAppliedCreditNotesContactCompany - - value: payments,applied_credit_notes,contact,company,accounting_period - name: PaymentsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_credit_notes,contact,company,accounting_period,payment_term - name: PaymentsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,contact,company,employee - name: PaymentsAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_credit_notes,contact,company,employee,accounting_period - name: PaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,contact,company,employee,payment_term - name: PaymentsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: payments,applied_credit_notes,contact,company,payment_term - name: PaymentsAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,applied_credit_notes,contact,employee - name: PaymentsAppliedCreditNotesContactEmployee - - value: payments,applied_credit_notes,contact,employee,accounting_period - name: PaymentsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,contact,employee,accounting_period,payment_term - name: PaymentsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,contact,employee,payment_term - name: PaymentsAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,applied_credit_notes,contact,payment_term - name: PaymentsAppliedCreditNotesContactPaymentTerm - - value: payments,applied_credit_notes,employee - name: PaymentsAppliedCreditNotesEmployee - - value: payments,applied_credit_notes,employee,accounting_period - name: PaymentsAppliedCreditNotesEmployeeAccountingPeriod - - value: payments,applied_credit_notes,employee,accounting_period,payment_term - name: PaymentsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,employee,payment_term - name: PaymentsAppliedCreditNotesEmployeePaymentTerm - - value: payments,applied_credit_notes,payment_term - name: PaymentsAppliedCreditNotesPaymentTerm - - value: payments,applied_payments - name: PaymentsAppliedPayments - - value: payments,applied_payments,accounting_period - name: PaymentsAppliedPaymentsAccountingPeriod - - value: payments,applied_payments,accounting_period,payment_term - name: PaymentsAppliedPaymentsAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes - name: PaymentsAppliedPaymentsAppliedCreditNotes - - value: payments,applied_payments,applied_credit_notes,accounting_period - name: PaymentsAppliedPaymentsAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,accounting_period,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes,applied_vendor_credits - name: PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company - name: PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,applied_credit_notes,company - name: PaymentsAppliedPaymentsAppliedCreditNotesCompany - - value: >- - payments,applied_payments,applied_credit_notes,company,accounting_period - name: PaymentsAppliedPaymentsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes,company,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,company,employee,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,applied_payments,applied_credit_notes,company,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesCompanyPaymentTerm - - value: payments,applied_payments,applied_credit_notes,contact - name: PaymentsAppliedPaymentsAppliedCreditNotesContact - - value: >- - payments,applied_payments,applied_credit_notes,contact,accounting_period - name: PaymentsAppliedPaymentsAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes,contact,company - name: PaymentsAppliedPaymentsAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,applied_payments,applied_credit_notes,contact,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,contact,employee,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,applied_payments,applied_credit_notes,contact,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesContactPaymentTerm - - value: payments,applied_payments,applied_credit_notes,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,applied_credit_notes,employee,accounting_period - name: PaymentsAppliedPaymentsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes,employee,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesEmployeePaymentTerm - - value: payments,applied_payments,applied_credit_notes,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesPaymentTerm - - value: payments,applied_payments,applied_vendor_credits - name: PaymentsAppliedPaymentsAppliedVendorCredits - - value: payments,applied_payments,applied_vendor_credits,accounting_period - name: PaymentsAppliedPaymentsAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,accounting_period,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,company - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,applied_vendor_credits,company,accounting_period - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,company,employee - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,company,employee,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: payments,applied_payments,applied_vendor_credits,company,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompanyPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsAppliedVendorCreditsContact - - value: >- - payments,applied_payments,applied_vendor_credits,contact,accounting_period - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,contact,company - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,employee - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,contact,employee - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,contact,employee,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactEmployeePaymentTerm - - value: payments,applied_payments,applied_vendor_credits,contact,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,applied_vendor_credits,employee,accounting_period - name: PaymentsAppliedPaymentsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,employee,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsEmployeePaymentTerm - - value: payments,applied_payments,applied_vendor_credits,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,company - name: PaymentsAppliedPaymentsCompany - - value: payments,applied_payments,company,accounting_period - name: PaymentsAppliedPaymentsCompanyAccountingPeriod - - value: payments,applied_payments,company,accounting_period,payment_term - name: PaymentsAppliedPaymentsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,company,employee - name: PaymentsAppliedPaymentsCompanyEmployee - - value: payments,applied_payments,company,employee,accounting_period - name: PaymentsAppliedPaymentsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,company,employee,accounting_period,payment_term - name: PaymentsAppliedPaymentsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,company,employee,payment_term - name: PaymentsAppliedPaymentsCompanyEmployeePaymentTerm - - value: payments,applied_payments,company,payment_term - name: PaymentsAppliedPaymentsCompanyPaymentTerm - - value: payments,applied_payments,contact - name: PaymentsAppliedPaymentsContact - - value: payments,applied_payments,contact,accounting_period - name: PaymentsAppliedPaymentsContactAccountingPeriod - - value: payments,applied_payments,contact,accounting_period,payment_term - name: PaymentsAppliedPaymentsContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,contact,company - name: PaymentsAppliedPaymentsContactCompany - - value: payments,applied_payments,contact,company,accounting_period - name: PaymentsAppliedPaymentsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,contact,company,accounting_period,payment_term - name: PaymentsAppliedPaymentsContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,contact,company,employee - name: PaymentsAppliedPaymentsContactCompanyEmployee - - value: payments,applied_payments,contact,company,employee,accounting_period - name: PaymentsAppliedPaymentsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,contact,company,employee,payment_term - name: PaymentsAppliedPaymentsContactCompanyEmployeePaymentTerm - - value: payments,applied_payments,contact,company,payment_term - name: PaymentsAppliedPaymentsContactCompanyPaymentTerm - - value: payments,applied_payments,contact,employee - name: PaymentsAppliedPaymentsContactEmployee - - value: payments,applied_payments,contact,employee,accounting_period - name: PaymentsAppliedPaymentsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,contact,employee,accounting_period,payment_term - name: PaymentsAppliedPaymentsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,contact,employee,payment_term - name: PaymentsAppliedPaymentsContactEmployeePaymentTerm - - value: payments,applied_payments,contact,payment_term - name: PaymentsAppliedPaymentsContactPaymentTerm - - value: payments,applied_payments,employee - name: PaymentsAppliedPaymentsEmployee - - value: payments,applied_payments,employee,accounting_period - name: PaymentsAppliedPaymentsEmployeeAccountingPeriod - - value: payments,applied_payments,employee,accounting_period,payment_term - name: PaymentsAppliedPaymentsEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,employee,payment_term - name: PaymentsAppliedPaymentsEmployeePaymentTerm - - value: payments,applied_payments,line_items - name: PaymentsAppliedPaymentsLineItems - - value: payments,applied_payments,line_items,accounting_period - name: PaymentsAppliedPaymentsLineItemsAccountingPeriod - - value: payments,applied_payments,line_items,accounting_period,payment_term - name: PaymentsAppliedPaymentsLineItemsAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotes - - value: >- - payments,applied_payments,line_items,applied_credit_notes,accounting_period - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes,company - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompany - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,employee - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyPaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes,contact - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContact - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,employee - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactPaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes,employee - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesEmployeePaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesPaymentTerm - - value: payments,applied_payments,line_items,applied_vendor_credits - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,accounting_period - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,applied_vendor_credits,company - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,employee - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyPaymentTerm - - value: payments,applied_payments,line_items,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,employee - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactPaymentTerm - - value: payments,applied_payments,line_items,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,line_items,company - name: PaymentsAppliedPaymentsLineItemsCompany - - value: payments,applied_payments,line_items,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,company,accounting_period,payment_term - name: PaymentsAppliedPaymentsLineItemsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,company,employee - name: PaymentsAppliedPaymentsLineItemsCompanyEmployee - - value: >- - payments,applied_payments,line_items,company,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,company,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsCompanyEmployeePaymentTerm - - value: payments,applied_payments,line_items,company,payment_term - name: PaymentsAppliedPaymentsLineItemsCompanyPaymentTerm - - value: payments,applied_payments,line_items,contact - name: PaymentsAppliedPaymentsLineItemsContact - - value: payments,applied_payments,line_items,contact,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,contact,accounting_period,payment_term - name: PaymentsAppliedPaymentsLineItemsContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,contact,company - name: PaymentsAppliedPaymentsLineItemsContactCompany - - value: payments,applied_payments,line_items,contact,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,contact,company,employee - name: PaymentsAppliedPaymentsLineItemsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,contact,company,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,contact,company,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsContactCompanyEmployeePaymentTerm - - value: payments,applied_payments,line_items,contact,company,payment_term - name: PaymentsAppliedPaymentsLineItemsContactCompanyPaymentTerm - - value: payments,applied_payments,line_items,contact,employee - name: PaymentsAppliedPaymentsLineItemsContactEmployee - - value: >- - payments,applied_payments,line_items,contact,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,contact,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsContactEmployeePaymentTerm - - value: payments,applied_payments,line_items,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsContactPaymentTerm - - value: payments,applied_payments,line_items,employee - name: PaymentsAppliedPaymentsLineItemsEmployee - - value: payments,applied_payments,line_items,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,employee,accounting_period,payment_term - name: PaymentsAppliedPaymentsLineItemsEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsEmployeePaymentTerm - - value: payments,applied_payments,line_items,payment_term - name: PaymentsAppliedPaymentsLineItemsPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders - name: PaymentsAppliedPaymentsLineItemsPurchaseOrders - - value: payments,applied_payments,line_items,purchase_orders,accounting_period - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotes - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,company - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,company,employee - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,company,payment_term - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,contact - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContact - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,accounting_period - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,contact,company - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,employee - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,contact,employee - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,employee - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersEmployeePaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,payment_term - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersPaymentTerm - - value: payments,applied_payments,line_items,tracking_categories - name: PaymentsAppliedPaymentsLineItemsTrackingCategories - - value: >- - payments,applied_payments,line_items,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotes - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContact - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,line_items,tracking_categories,company - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,company,employee - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,company,payment_term - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyPaymentTerm - - value: payments,applied_payments,line_items,tracking_categories,contact - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContact - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,employee - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactPaymentTerm - - value: payments,applied_payments,line_items,tracking_categories,employee - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesEmployeePaymentTerm - - value: payments,applied_payments,line_items,tracking_categories,payment_term - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrders - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContact - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersPaymentTerm - - value: payments,applied_payments,payment_term - name: PaymentsAppliedPaymentsPaymentTerm - - value: payments,applied_payments,purchase_orders - name: PaymentsAppliedPaymentsPurchaseOrders - - value: payments,applied_payments,purchase_orders,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,accounting_period,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,applied_credit_notes - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotes - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,purchase_orders,applied_credit_notes,company - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,employee - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: payments,applied_payments,purchase_orders,applied_credit_notes,contact - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,employee - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: payments,applied_payments,purchase_orders,applied_vendor_credits - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCredits - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,purchase_orders,company - name: PaymentsAppliedPaymentsPurchaseOrdersCompany - - value: payments,applied_payments,purchase_orders,company,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,company,employee - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,company,employee,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,company,employee,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyEmployeePaymentTerm - - value: payments,applied_payments,purchase_orders,company,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyPaymentTerm - - value: payments,applied_payments,purchase_orders,contact - name: PaymentsAppliedPaymentsPurchaseOrdersContact - - value: payments,applied_payments,purchase_orders,contact,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersContactAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,contact,company - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompany - - value: >- - payments,applied_payments,purchase_orders,contact,company,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,contact,company,employee - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,contact,company,employee,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: payments,applied_payments,purchase_orders,contact,company,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompanyPaymentTerm - - value: payments,applied_payments,purchase_orders,contact,employee - name: PaymentsAppliedPaymentsPurchaseOrdersContactEmployee - - value: >- - payments,applied_payments,purchase_orders,contact,employee,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,contact,employee,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersContactEmployeePaymentTerm - - value: payments,applied_payments,purchase_orders,contact,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersContactPaymentTerm - - value: payments,applied_payments,purchase_orders,employee - name: PaymentsAppliedPaymentsPurchaseOrdersEmployee - - value: payments,applied_payments,purchase_orders,employee,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,employee,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersEmployeePaymentTerm - - value: payments,applied_payments,purchase_orders,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersPaymentTerm - - value: payments,applied_payments,tracking_categories - name: PaymentsAppliedPaymentsTrackingCategories - - value: payments,applied_payments,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,accounting_period,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,applied_credit_notes - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotes - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContact - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,employee - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: payments,applied_payments,tracking_categories,applied_vendor_credits - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCredits - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,tracking_categories,company - name: PaymentsAppliedPaymentsTrackingCategoriesCompany - - value: >- - payments,applied_payments,tracking_categories,company,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,company,employee - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,company,employee,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyEmployeePaymentTerm - - value: payments,applied_payments,tracking_categories,company,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyPaymentTerm - - value: payments,applied_payments,tracking_categories,contact - name: PaymentsAppliedPaymentsTrackingCategoriesContact - - value: >- - payments,applied_payments,tracking_categories,contact,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,contact,company - name: PaymentsAppliedPaymentsTrackingCategoriesContactCompany - - value: >- - payments,applied_payments,tracking_categories,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,contact,company,employee - name: PaymentsAppliedPaymentsTrackingCategoriesContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,contact,company,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesContactCompanyPaymentTerm - - value: payments,applied_payments,tracking_categories,contact,employee - name: PaymentsAppliedPaymentsTrackingCategoriesContactEmployee - - value: >- - payments,applied_payments,tracking_categories,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,contact,employee,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesContactEmployeePaymentTerm - - value: payments,applied_payments,tracking_categories,contact,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesContactPaymentTerm - - value: payments,applied_payments,tracking_categories,employee - name: PaymentsAppliedPaymentsTrackingCategoriesEmployee - - value: >- - payments,applied_payments,tracking_categories,employee,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,employee,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesEmployeePaymentTerm - - value: payments,applied_payments,tracking_categories,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesPaymentTerm - - value: payments,applied_payments,tracking_categories,purchase_orders - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrders - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,tracking_categories,purchase_orders,company - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,employee - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: payments,applied_payments,tracking_categories,purchase_orders,contact - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContact - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,employee - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: payments,applied_payments,tracking_categories,purchase_orders,employee - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersPaymentTerm - - value: payments,applied_vendor_credits - name: PaymentsAppliedVendorCredits - - value: payments,applied_vendor_credits,accounting_period - name: PaymentsAppliedVendorCreditsAccountingPeriod - - value: payments,applied_vendor_credits,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,company - name: PaymentsAppliedVendorCreditsCompany - - value: payments,applied_vendor_credits,company,accounting_period - name: PaymentsAppliedVendorCreditsCompanyAccountingPeriod - - value: payments,applied_vendor_credits,company,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,company,employee - name: PaymentsAppliedVendorCreditsCompanyEmployee - - value: payments,applied_vendor_credits,company,employee,accounting_period - name: PaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_vendor_credits,company,employee,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,company,employee,payment_term - name: PaymentsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: payments,applied_vendor_credits,company,payment_term - name: PaymentsAppliedVendorCreditsCompanyPaymentTerm - - value: payments,applied_vendor_credits,contact - name: PaymentsAppliedVendorCreditsContact - - value: payments,applied_vendor_credits,contact,accounting_period - name: PaymentsAppliedVendorCreditsContactAccountingPeriod - - value: payments,applied_vendor_credits,contact,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,contact,company - name: PaymentsAppliedVendorCreditsContactCompany - - value: payments,applied_vendor_credits,contact,company,accounting_period - name: PaymentsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_vendor_credits,contact,company,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,contact,company,employee - name: PaymentsAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_vendor_credits,contact,company,employee,accounting_period - name: PaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,contact,company,employee,payment_term - name: PaymentsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: payments,applied_vendor_credits,contact,company,payment_term - name: PaymentsAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,applied_vendor_credits,contact,employee - name: PaymentsAppliedVendorCreditsContactEmployee - - value: payments,applied_vendor_credits,contact,employee,accounting_period - name: PaymentsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,contact,employee,payment_term - name: PaymentsAppliedVendorCreditsContactEmployeePaymentTerm - - value: payments,applied_vendor_credits,contact,payment_term - name: PaymentsAppliedVendorCreditsContactPaymentTerm - - value: payments,applied_vendor_credits,employee - name: PaymentsAppliedVendorCreditsEmployee - - value: payments,applied_vendor_credits,employee,accounting_period - name: PaymentsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_vendor_credits,employee,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,employee,payment_term - name: PaymentsAppliedVendorCreditsEmployeePaymentTerm - - value: payments,applied_vendor_credits,payment_term - name: PaymentsAppliedVendorCreditsPaymentTerm - - value: payments,company - name: PaymentsCompany - - value: payments,company,accounting_period - name: PaymentsCompanyAccountingPeriod - - value: payments,company,accounting_period,payment_term - name: PaymentsCompanyAccountingPeriodPaymentTerm - - value: payments,company,employee - name: PaymentsCompanyEmployee - - value: payments,company,employee,accounting_period - name: PaymentsCompanyEmployeeAccountingPeriod - - value: payments,company,employee,accounting_period,payment_term - name: PaymentsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,company,employee,payment_term - name: PaymentsCompanyEmployeePaymentTerm - - value: payments,company,payment_term - name: PaymentsCompanyPaymentTerm - - value: payments,contact - name: PaymentsContact - - value: payments,contact,accounting_period - name: PaymentsContactAccountingPeriod - - value: payments,contact,accounting_period,payment_term - name: PaymentsContactAccountingPeriodPaymentTerm - - value: payments,contact,company - name: PaymentsContactCompany - - value: payments,contact,company,accounting_period - name: PaymentsContactCompanyAccountingPeriod - - value: payments,contact,company,accounting_period,payment_term - name: PaymentsContactCompanyAccountingPeriodPaymentTerm - - value: payments,contact,company,employee - name: PaymentsContactCompanyEmployee - - value: payments,contact,company,employee,accounting_period - name: PaymentsContactCompanyEmployeeAccountingPeriod - - value: payments,contact,company,employee,accounting_period,payment_term - name: PaymentsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,contact,company,employee,payment_term - name: PaymentsContactCompanyEmployeePaymentTerm - - value: payments,contact,company,payment_term - name: PaymentsContactCompanyPaymentTerm - - value: payments,contact,employee - name: PaymentsContactEmployee - - value: payments,contact,employee,accounting_period - name: PaymentsContactEmployeeAccountingPeriod - - value: payments,contact,employee,accounting_period,payment_term - name: PaymentsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,contact,employee,payment_term - name: PaymentsContactEmployeePaymentTerm - - value: payments,contact,payment_term - name: PaymentsContactPaymentTerm - - value: payments,employee - name: PaymentsEmployee - - value: payments,employee,accounting_period - name: PaymentsEmployeeAccountingPeriod - - value: payments,employee,accounting_period,payment_term - name: PaymentsEmployeeAccountingPeriodPaymentTerm - - value: payments,employee,payment_term - name: PaymentsEmployeePaymentTerm - - value: payments,line_items - name: PaymentsLineItems - - value: payments,line_items,accounting_period - name: PaymentsLineItemsAccountingPeriod - - value: payments,line_items,accounting_period,payment_term - name: PaymentsLineItemsAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes - name: PaymentsLineItemsAppliedCreditNotes - - value: payments,line_items,applied_credit_notes,accounting_period - name: PaymentsLineItemsAppliedCreditNotesAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,accounting_period,payment_term - name: PaymentsLineItemsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,applied_vendor_credits - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,employee - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,payment_term - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,line_items,applied_credit_notes,company - name: PaymentsLineItemsAppliedCreditNotesCompany - - value: payments,line_items,applied_credit_notes,company,accounting_period - name: PaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,company,accounting_period,payment_term - name: PaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,company,employee - name: PaymentsLineItemsAppliedCreditNotesCompanyEmployee - - value: >- - payments,line_items,applied_credit_notes,company,employee,accounting_period - name: PaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,company,employee,payment_term - name: PaymentsLineItemsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,line_items,applied_credit_notes,company,payment_term - name: PaymentsLineItemsAppliedCreditNotesCompanyPaymentTerm - - value: payments,line_items,applied_credit_notes,contact - name: PaymentsLineItemsAppliedCreditNotesContact - - value: payments,line_items,applied_credit_notes,contact,accounting_period - name: PaymentsLineItemsAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,contact,accounting_period,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,contact,company - name: PaymentsLineItemsAppliedCreditNotesContactCompany - - value: >- - payments,line_items,applied_credit_notes,contact,company,accounting_period - name: PaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,contact,company,employee - name: PaymentsLineItemsAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,line_items,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,contact,company,employee,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: payments,line_items,applied_credit_notes,contact,company,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,line_items,applied_credit_notes,contact,employee - name: PaymentsLineItemsAppliedCreditNotesContactEmployee - - value: >- - payments,line_items,applied_credit_notes,contact,employee,accounting_period - name: PaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,contact,employee,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,line_items,applied_credit_notes,contact,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactPaymentTerm - - value: payments,line_items,applied_credit_notes,employee - name: PaymentsLineItemsAppliedCreditNotesEmployee - - value: payments,line_items,applied_credit_notes,employee,accounting_period - name: PaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,employee,accounting_period,payment_term - name: PaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,employee,payment_term - name: PaymentsLineItemsAppliedCreditNotesEmployeePaymentTerm - - value: payments,line_items,applied_credit_notes,payment_term - name: PaymentsLineItemsAppliedCreditNotesPaymentTerm - - value: payments,line_items,applied_vendor_credits - name: PaymentsLineItemsAppliedVendorCredits - - value: payments,line_items,applied_vendor_credits,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,accounting_period,payment_term - name: PaymentsLineItemsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,company - name: PaymentsLineItemsAppliedVendorCreditsCompany - - value: payments,line_items,applied_vendor_credits,company,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,company,employee - name: PaymentsLineItemsAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,applied_vendor_credits,company,employee,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_vendor_credits,company,employee,payment_term - name: PaymentsLineItemsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: payments,line_items,applied_vendor_credits,company,payment_term - name: PaymentsLineItemsAppliedVendorCreditsCompanyPaymentTerm - - value: payments,line_items,applied_vendor_credits,contact - name: PaymentsLineItemsAppliedVendorCreditsContact - - value: payments,line_items,applied_vendor_credits,contact,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,contact,company - name: PaymentsLineItemsAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,applied_vendor_credits,contact,company,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,contact,company,employee - name: PaymentsLineItemsAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_vendor_credits,contact,company,employee,payment_term - name: PaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,applied_vendor_credits,contact,company,payment_term - name: PaymentsLineItemsAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,line_items,applied_vendor_credits,contact,employee - name: PaymentsLineItemsAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,applied_vendor_credits,contact,employee,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_vendor_credits,contact,employee,payment_term - name: PaymentsLineItemsAppliedVendorCreditsContactEmployeePaymentTerm - - value: payments,line_items,applied_vendor_credits,contact,payment_term - name: PaymentsLineItemsAppliedVendorCreditsContactPaymentTerm - - value: payments,line_items,applied_vendor_credits,employee - name: PaymentsLineItemsAppliedVendorCreditsEmployee - - value: payments,line_items,applied_vendor_credits,employee,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,employee,payment_term - name: PaymentsLineItemsAppliedVendorCreditsEmployeePaymentTerm - - value: payments,line_items,applied_vendor_credits,payment_term - name: PaymentsLineItemsAppliedVendorCreditsPaymentTerm - - value: payments,line_items,company - name: PaymentsLineItemsCompany - - value: payments,line_items,company,accounting_period - name: PaymentsLineItemsCompanyAccountingPeriod - - value: payments,line_items,company,accounting_period,payment_term - name: PaymentsLineItemsCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,company,employee - name: PaymentsLineItemsCompanyEmployee - - value: payments,line_items,company,employee,accounting_period - name: PaymentsLineItemsCompanyEmployeeAccountingPeriod - - value: payments,line_items,company,employee,accounting_period,payment_term - name: PaymentsLineItemsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,company,employee,payment_term - name: PaymentsLineItemsCompanyEmployeePaymentTerm - - value: payments,line_items,company,payment_term - name: PaymentsLineItemsCompanyPaymentTerm - - value: payments,line_items,contact - name: PaymentsLineItemsContact - - value: payments,line_items,contact,accounting_period - name: PaymentsLineItemsContactAccountingPeriod - - value: payments,line_items,contact,accounting_period,payment_term - name: PaymentsLineItemsContactAccountingPeriodPaymentTerm - - value: payments,line_items,contact,company - name: PaymentsLineItemsContactCompany - - value: payments,line_items,contact,company,accounting_period - name: PaymentsLineItemsContactCompanyAccountingPeriod - - value: payments,line_items,contact,company,accounting_period,payment_term - name: PaymentsLineItemsContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,contact,company,employee - name: PaymentsLineItemsContactCompanyEmployee - - value: payments,line_items,contact,company,employee,accounting_period - name: PaymentsLineItemsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,contact,company,employee,accounting_period,payment_term - name: PaymentsLineItemsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,contact,company,employee,payment_term - name: PaymentsLineItemsContactCompanyEmployeePaymentTerm - - value: payments,line_items,contact,company,payment_term - name: PaymentsLineItemsContactCompanyPaymentTerm - - value: payments,line_items,contact,employee - name: PaymentsLineItemsContactEmployee - - value: payments,line_items,contact,employee,accounting_period - name: PaymentsLineItemsContactEmployeeAccountingPeriod - - value: payments,line_items,contact,employee,accounting_period,payment_term - name: PaymentsLineItemsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,contact,employee,payment_term - name: PaymentsLineItemsContactEmployeePaymentTerm - - value: payments,line_items,contact,payment_term - name: PaymentsLineItemsContactPaymentTerm - - value: payments,line_items,employee - name: PaymentsLineItemsEmployee - - value: payments,line_items,employee,accounting_period - name: PaymentsLineItemsEmployeeAccountingPeriod - - value: payments,line_items,employee,accounting_period,payment_term - name: PaymentsLineItemsEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,employee,payment_term - name: PaymentsLineItemsEmployeePaymentTerm - - value: payments,line_items,payment_term - name: PaymentsLineItemsPaymentTerm - - value: payments,line_items,purchase_orders - name: PaymentsLineItemsPurchaseOrders - - value: payments,line_items,purchase_orders,accounting_period - name: PaymentsLineItemsPurchaseOrdersAccountingPeriod - - value: payments,line_items,purchase_orders,accounting_period,payment_term - name: PaymentsLineItemsPurchaseOrdersAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotes - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,accounting_period - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes,company - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,employee - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes,contact - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,employee - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes,employee - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: payments,line_items,purchase_orders,applied_vendor_credits - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCredits - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,accounting_period - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,applied_vendor_credits,company - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,employee - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: payments,line_items,purchase_orders,applied_vendor_credits,contact - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,employee - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: payments,line_items,purchase_orders,applied_vendor_credits,employee - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,line_items,purchase_orders,company - name: PaymentsLineItemsPurchaseOrdersCompany - - value: payments,line_items,purchase_orders,company,accounting_period - name: PaymentsLineItemsPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,company,accounting_period,payment_term - name: PaymentsLineItemsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,company,employee - name: PaymentsLineItemsPurchaseOrdersCompanyEmployee - - value: payments,line_items,purchase_orders,company,employee,accounting_period - name: PaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,company,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersCompanyEmployeePaymentTerm - - value: payments,line_items,purchase_orders,company,payment_term - name: PaymentsLineItemsPurchaseOrdersCompanyPaymentTerm - - value: payments,line_items,purchase_orders,contact - name: PaymentsLineItemsPurchaseOrdersContact - - value: payments,line_items,purchase_orders,contact,accounting_period - name: PaymentsLineItemsPurchaseOrdersContactAccountingPeriod - - value: >- - payments,line_items,purchase_orders,contact,accounting_period,payment_term - name: PaymentsLineItemsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,contact,company - name: PaymentsLineItemsPurchaseOrdersContactCompany - - value: payments,line_items,purchase_orders,contact,company,accounting_period - name: PaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,contact,company,employee - name: PaymentsLineItemsPurchaseOrdersContactCompanyEmployee - - value: >- - payments,line_items,purchase_orders,contact,company,employee,accounting_period - name: PaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,contact,company,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: payments,line_items,purchase_orders,contact,company,payment_term - name: PaymentsLineItemsPurchaseOrdersContactCompanyPaymentTerm - - value: payments,line_items,purchase_orders,contact,employee - name: PaymentsLineItemsPurchaseOrdersContactEmployee - - value: payments,line_items,purchase_orders,contact,employee,accounting_period - name: PaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,contact,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersContactEmployeePaymentTerm - - value: payments,line_items,purchase_orders,contact,payment_term - name: PaymentsLineItemsPurchaseOrdersContactPaymentTerm - - value: payments,line_items,purchase_orders,employee - name: PaymentsLineItemsPurchaseOrdersEmployee - - value: payments,line_items,purchase_orders,employee,accounting_period - name: PaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,employee,accounting_period,payment_term - name: PaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersEmployeePaymentTerm - - value: payments,line_items,purchase_orders,payment_term - name: PaymentsLineItemsPurchaseOrdersPaymentTerm - - value: payments,line_items,tracking_categories - name: PaymentsLineItemsTrackingCategories - - value: payments,line_items,tracking_categories,accounting_period - name: PaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: payments,line_items,tracking_categories,accounting_period,payment_term - name: PaymentsLineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,applied_credit_notes - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotes - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,accounting_period - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,line_items,tracking_categories,applied_credit_notes,company - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,employee - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: payments,line_items,tracking_categories,applied_credit_notes,contact - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContact - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,employee - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: payments,line_items,tracking_categories,applied_credit_notes,employee - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,payment_term - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: payments,line_items,tracking_categories,applied_vendor_credits - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCredits - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,applied_vendor_credits,company - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,employee - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: payments,line_items,tracking_categories,applied_vendor_credits,contact - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,employee - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,employee - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,payment_term - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: payments,line_items,tracking_categories,company - name: PaymentsLineItemsTrackingCategoriesCompany - - value: payments,line_items,tracking_categories,company,accounting_period - name: PaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,company,accounting_period,payment_term - name: PaymentsLineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,company,employee - name: PaymentsLineItemsTrackingCategoriesCompanyEmployee - - value: >- - payments,line_items,tracking_categories,company,employee,accounting_period - name: PaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,company,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesCompanyEmployeePaymentTerm - - value: payments,line_items,tracking_categories,company,payment_term - name: PaymentsLineItemsTrackingCategoriesCompanyPaymentTerm - - value: payments,line_items,tracking_categories,contact - name: PaymentsLineItemsTrackingCategoriesContact - - value: payments,line_items,tracking_categories,contact,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,contact,accounting_period,payment_term - name: PaymentsLineItemsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,contact,company - name: PaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - payments,line_items,tracking_categories,contact,company,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,contact,company,employee - name: PaymentsLineItemsTrackingCategoriesContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,contact,company,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: payments,line_items,tracking_categories,contact,company,payment_term - name: PaymentsLineItemsTrackingCategoriesContactCompanyPaymentTerm - - value: payments,line_items,tracking_categories,contact,employee - name: PaymentsLineItemsTrackingCategoriesContactEmployee - - value: >- - payments,line_items,tracking_categories,contact,employee,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,contact,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesContactEmployeePaymentTerm - - value: payments,line_items,tracking_categories,contact,payment_term - name: PaymentsLineItemsTrackingCategoriesContactPaymentTerm - - value: payments,line_items,tracking_categories,employee - name: PaymentsLineItemsTrackingCategoriesEmployee - - value: payments,line_items,tracking_categories,employee,accounting_period - name: PaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,employee,accounting_period,payment_term - name: PaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesEmployeePaymentTerm - - value: payments,line_items,tracking_categories,payment_term - name: PaymentsLineItemsTrackingCategoriesPaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders - name: PaymentsLineItemsTrackingCategoriesPurchaseOrders - - value: >- - payments,line_items,tracking_categories,purchase_orders,accounting_period - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders,company - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,employee - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,payment_term - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders,contact - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersContact - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,employee - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,payment_term - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders,employee - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders,payment_term - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersPaymentTerm - - value: payments,payment_term - name: PaymentsPaymentTerm - - value: payments,purchase_orders - name: PaymentsPurchaseOrders - - value: payments,purchase_orders,accounting_period - name: PaymentsPurchaseOrdersAccountingPeriod - - value: payments,purchase_orders,accounting_period,payment_term - name: PaymentsPurchaseOrdersAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes - name: PaymentsPurchaseOrdersAppliedCreditNotes - - value: payments,purchase_orders,applied_credit_notes,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,applied_vendor_credits - name: PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,company - name: PaymentsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,purchase_orders,applied_credit_notes,company,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,company,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,company,employee,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,purchase_orders,applied_credit_notes,company,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact - name: PaymentsPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,purchase_orders,applied_credit_notes,contact,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact,company - name: PaymentsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact,company,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,employee,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,employee,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: payments,purchase_orders,applied_credit_notes,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits - name: PaymentsPurchaseOrdersAppliedVendorCredits - - value: payments,purchase_orders,applied_vendor_credits,accounting_period - name: PaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,company - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,purchase_orders,applied_vendor_credits,company,accounting_period - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,company,employee - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,company,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,contact - name: PaymentsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,accounting_period - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,contact,company - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,employee - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,contact,employee - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,contact,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,employee - name: PaymentsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,purchase_orders,applied_vendor_credits,employee,accounting_period - name: PaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,employee,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,purchase_orders,company - name: PaymentsPurchaseOrdersCompany - - value: payments,purchase_orders,company,accounting_period - name: PaymentsPurchaseOrdersCompanyAccountingPeriod - - value: payments,purchase_orders,company,accounting_period,payment_term - name: PaymentsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,company,employee - name: PaymentsPurchaseOrdersCompanyEmployee - - value: payments,purchase_orders,company,employee,accounting_period - name: PaymentsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,company,employee,accounting_period,payment_term - name: PaymentsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,company,employee,payment_term - name: PaymentsPurchaseOrdersCompanyEmployeePaymentTerm - - value: payments,purchase_orders,company,payment_term - name: PaymentsPurchaseOrdersCompanyPaymentTerm - - value: payments,purchase_orders,contact - name: PaymentsPurchaseOrdersContact - - value: payments,purchase_orders,contact,accounting_period - name: PaymentsPurchaseOrdersContactAccountingPeriod - - value: payments,purchase_orders,contact,accounting_period,payment_term - name: PaymentsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,purchase_orders,contact,company - name: PaymentsPurchaseOrdersContactCompany - - value: payments,purchase_orders,contact,company,accounting_period - name: PaymentsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,purchase_orders,contact,company,accounting_period,payment_term - name: PaymentsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,contact,company,employee - name: PaymentsPurchaseOrdersContactCompanyEmployee - - value: payments,purchase_orders,contact,company,employee,accounting_period - name: PaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,contact,company,employee,payment_term - name: PaymentsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: payments,purchase_orders,contact,company,payment_term - name: PaymentsPurchaseOrdersContactCompanyPaymentTerm - - value: payments,purchase_orders,contact,employee - name: PaymentsPurchaseOrdersContactEmployee - - value: payments,purchase_orders,contact,employee,accounting_period - name: PaymentsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,contact,employee,accounting_period,payment_term - name: PaymentsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,contact,employee,payment_term - name: PaymentsPurchaseOrdersContactEmployeePaymentTerm - - value: payments,purchase_orders,contact,payment_term - name: PaymentsPurchaseOrdersContactPaymentTerm - - value: payments,purchase_orders,employee - name: PaymentsPurchaseOrdersEmployee - - value: payments,purchase_orders,employee,accounting_period - name: PaymentsPurchaseOrdersEmployeeAccountingPeriod - - value: payments,purchase_orders,employee,accounting_period,payment_term - name: PaymentsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,employee,payment_term - name: PaymentsPurchaseOrdersEmployeePaymentTerm - - value: payments,purchase_orders,payment_term - name: PaymentsPurchaseOrdersPaymentTerm - - value: payments,tracking_categories - name: PaymentsTrackingCategories - - value: payments,tracking_categories,accounting_period - name: PaymentsTrackingCategoriesAccountingPeriod - - value: payments,tracking_categories,accounting_period,payment_term - name: PaymentsTrackingCategoriesAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_credit_notes - name: PaymentsTrackingCategoriesAppliedCreditNotes - - value: payments,tracking_categories,applied_credit_notes,accounting_period - name: PaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits - name: PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,company - name: PaymentsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - payments,tracking_categories,applied_credit_notes,company,accounting_period - name: PaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,company,employee - name: PaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,company,employee,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,tracking_categories,applied_credit_notes,company,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,contact - name: PaymentsTrackingCategoriesAppliedCreditNotesContact - - value: >- - payments,tracking_categories,applied_credit_notes,contact,accounting_period - name: PaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,contact,company - name: PaymentsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,employee - name: PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,contact,employee - name: PaymentsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,tracking_categories,applied_credit_notes,contact,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,employee - name: PaymentsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,employee,accounting_period - name: PaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,employee,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: payments,tracking_categories,applied_credit_notes,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits - name: PaymentsTrackingCategoriesAppliedVendorCredits - - value: payments,tracking_categories,applied_vendor_credits,accounting_period - name: PaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,company - name: PaymentsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - payments,tracking_categories,applied_vendor_credits,company,accounting_period - name: PaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,company,employee - name: PaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,company,payment_term - name: PaymentsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,contact - name: PaymentsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,accounting_period - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,contact,company - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,employee - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,contact,employee - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,payment_term - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,employee - name: PaymentsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - payments,tracking_categories,applied_vendor_credits,employee,accounting_period - name: PaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,employee,payment_term - name: PaymentsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,payment_term - name: PaymentsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: payments,tracking_categories,company - name: PaymentsTrackingCategoriesCompany - - value: payments,tracking_categories,company,accounting_period - name: PaymentsTrackingCategoriesCompanyAccountingPeriod - - value: payments,tracking_categories,company,accounting_period,payment_term - name: PaymentsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,company,employee - name: PaymentsTrackingCategoriesCompanyEmployee - - value: payments,tracking_categories,company,employee,accounting_period - name: PaymentsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,company,employee,accounting_period,payment_term - name: PaymentsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,company,employee,payment_term - name: PaymentsTrackingCategoriesCompanyEmployeePaymentTerm - - value: payments,tracking_categories,company,payment_term - name: PaymentsTrackingCategoriesCompanyPaymentTerm - - value: payments,tracking_categories,contact - name: PaymentsTrackingCategoriesContact - - value: payments,tracking_categories,contact,accounting_period - name: PaymentsTrackingCategoriesContactAccountingPeriod - - value: payments,tracking_categories,contact,accounting_period,payment_term - name: PaymentsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: payments,tracking_categories,contact,company - name: PaymentsTrackingCategoriesContactCompany - - value: payments,tracking_categories,contact,company,accounting_period - name: PaymentsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,contact,company,accounting_period,payment_term - name: PaymentsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,contact,company,employee - name: PaymentsTrackingCategoriesContactCompanyEmployee - - value: >- - payments,tracking_categories,contact,company,employee,accounting_period - name: PaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,contact,company,employee,payment_term - name: PaymentsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: payments,tracking_categories,contact,company,payment_term - name: PaymentsTrackingCategoriesContactCompanyPaymentTerm - - value: payments,tracking_categories,contact,employee - name: PaymentsTrackingCategoriesContactEmployee - - value: payments,tracking_categories,contact,employee,accounting_period - name: PaymentsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,contact,employee,accounting_period,payment_term - name: PaymentsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,contact,employee,payment_term - name: PaymentsTrackingCategoriesContactEmployeePaymentTerm - - value: payments,tracking_categories,contact,payment_term - name: PaymentsTrackingCategoriesContactPaymentTerm - - value: payments,tracking_categories,employee - name: PaymentsTrackingCategoriesEmployee - - value: payments,tracking_categories,employee,accounting_period - name: PaymentsTrackingCategoriesEmployeeAccountingPeriod - - value: payments,tracking_categories,employee,accounting_period,payment_term - name: PaymentsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,employee,payment_term - name: PaymentsTrackingCategoriesEmployeePaymentTerm - - value: payments,tracking_categories,payment_term - name: PaymentsTrackingCategoriesPaymentTerm - - value: payments,tracking_categories,purchase_orders - name: PaymentsTrackingCategoriesPurchaseOrders - - value: payments,tracking_categories,purchase_orders,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,accounting_period,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,applied_credit_notes - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,employee - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: payments,tracking_categories,purchase_orders,applied_vendor_credits - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,tracking_categories,purchase_orders,company - name: PaymentsTrackingCategoriesPurchaseOrdersCompany - - value: payments,tracking_categories,purchase_orders,company,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,company,employee - name: PaymentsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,company,employee,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: payments,tracking_categories,purchase_orders,company,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: payments,tracking_categories,purchase_orders,contact - name: PaymentsTrackingCategoriesPurchaseOrdersContact - - value: payments,tracking_categories,purchase_orders,contact,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,contact,company - name: PaymentsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - payments,tracking_categories,purchase_orders,contact,company,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,contact,company,employee - name: PaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,contact,company,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: payments,tracking_categories,purchase_orders,contact,employee - name: PaymentsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - payments,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,contact,employee,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: payments,tracking_categories,purchase_orders,contact,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: payments,tracking_categories,purchase_orders,employee - name: PaymentsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - payments,tracking_categories,purchase_orders,employee,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,employee,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: payments,tracking_categories,purchase_orders,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersPaymentTerm - - purchase_orders - - value: purchase_orders,accounting_period - name: PurchaseOrdersAccountingPeriod - - value: purchase_orders,accounting_period,payment_term - name: PurchaseOrdersAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes - name: PurchaseOrdersAppliedCreditNotes - - value: purchase_orders,applied_credit_notes,accounting_period - name: PurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: purchase_orders,applied_credit_notes,accounting_period,payment_term - name: PurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,applied_vendor_credits - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: purchase_orders,applied_credit_notes,company - name: PurchaseOrdersAppliedCreditNotesCompany - - value: purchase_orders,applied_credit_notes,company,accounting_period - name: PurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: PurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,company,employee - name: PurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - purchase_orders,applied_credit_notes,company,employee,accounting_period - name: PurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,company,employee,payment_term - name: PurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: purchase_orders,applied_credit_notes,company,payment_term - name: PurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: purchase_orders,applied_credit_notes,contact - name: PurchaseOrdersAppliedCreditNotesContact - - value: purchase_orders,applied_credit_notes,contact,accounting_period - name: PurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: PurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,contact,company - name: PurchaseOrdersAppliedCreditNotesContactCompany - - value: purchase_orders,applied_credit_notes,contact,company,accounting_period - name: PurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,contact,company,employee - name: PurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: PurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: PurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: purchase_orders,applied_credit_notes,contact,company,payment_term - name: PurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: purchase_orders,applied_credit_notes,contact,employee - name: PurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: PurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,contact,employee,payment_term - name: PurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: purchase_orders,applied_credit_notes,contact,payment_term - name: PurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: purchase_orders,applied_credit_notes,employee - name: PurchaseOrdersAppliedCreditNotesEmployee - - value: purchase_orders,applied_credit_notes,employee,accounting_period - name: PurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: PurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,employee,payment_term - name: PurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: purchase_orders,applied_credit_notes,payment_term - name: PurchaseOrdersAppliedCreditNotesPaymentTerm - - value: purchase_orders,applied_vendor_credits - name: PurchaseOrdersAppliedVendorCredits - - value: purchase_orders,applied_vendor_credits,accounting_period - name: PurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: PurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,company - name: PurchaseOrdersAppliedVendorCreditsCompany - - value: purchase_orders,applied_vendor_credits,company,accounting_period - name: PurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: PurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,company,employee - name: PurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: PurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,company,employee,payment_term - name: PurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: purchase_orders,applied_vendor_credits,company,payment_term - name: PurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact - name: PurchaseOrdersAppliedVendorCreditsContact - - value: purchase_orders,applied_vendor_credits,contact,accounting_period - name: PurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,company - name: PurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: PurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,company,employee - name: PurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,company,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,employee - name: PurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: PurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: purchase_orders,applied_vendor_credits,employee - name: PurchaseOrdersAppliedVendorCreditsEmployee - - value: purchase_orders,applied_vendor_credits,employee,accounting_period - name: PurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: PurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,employee,payment_term - name: PurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: purchase_orders,applied_vendor_credits,payment_term - name: PurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: purchase_orders,company - name: PurchaseOrdersCompany - - value: purchase_orders,company,accounting_period - name: PurchaseOrdersCompanyAccountingPeriod - - value: purchase_orders,company,accounting_period,payment_term - name: PurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,company,employee - name: PurchaseOrdersCompanyEmployee - - value: purchase_orders,company,employee,accounting_period - name: PurchaseOrdersCompanyEmployeeAccountingPeriod - - value: purchase_orders,company,employee,accounting_period,payment_term - name: PurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,company,employee,payment_term - name: PurchaseOrdersCompanyEmployeePaymentTerm - - value: purchase_orders,company,payment_term - name: PurchaseOrdersCompanyPaymentTerm - - value: purchase_orders,contact - name: PurchaseOrdersContact - - value: purchase_orders,contact,accounting_period - name: PurchaseOrdersContactAccountingPeriod - - value: purchase_orders,contact,accounting_period,payment_term - name: PurchaseOrdersContactAccountingPeriodPaymentTerm - - value: purchase_orders,contact,company - name: PurchaseOrdersContactCompany - - value: purchase_orders,contact,company,accounting_period - name: PurchaseOrdersContactCompanyAccountingPeriod - - value: purchase_orders,contact,company,accounting_period,payment_term - name: PurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,contact,company,employee - name: PurchaseOrdersContactCompanyEmployee - - value: purchase_orders,contact,company,employee,accounting_period - name: PurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,contact,company,employee,accounting_period,payment_term - name: PurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,contact,company,employee,payment_term - name: PurchaseOrdersContactCompanyEmployeePaymentTerm - - value: purchase_orders,contact,company,payment_term - name: PurchaseOrdersContactCompanyPaymentTerm - - value: purchase_orders,contact,employee - name: PurchaseOrdersContactEmployee - - value: purchase_orders,contact,employee,accounting_period - name: PurchaseOrdersContactEmployeeAccountingPeriod - - value: purchase_orders,contact,employee,accounting_period,payment_term - name: PurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,contact,employee,payment_term - name: PurchaseOrdersContactEmployeePaymentTerm - - value: purchase_orders,contact,payment_term - name: PurchaseOrdersContactPaymentTerm - - value: purchase_orders,employee - name: PurchaseOrdersEmployee - - value: purchase_orders,employee,accounting_period - name: PurchaseOrdersEmployeeAccountingPeriod - - value: purchase_orders,employee,accounting_period,payment_term - name: PurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,employee,payment_term - name: PurchaseOrdersEmployeePaymentTerm - - value: purchase_orders,payment_term - name: PurchaseOrdersPaymentTerm - - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,accounting_period,payment_term - name: TrackingCategoriesAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes - name: TrackingCategoriesAppliedCreditNotes - - value: tracking_categories,applied_credit_notes,accounting_period - name: TrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,accounting_period,payment_term - name: TrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,applied_vendor_credits - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: tracking_categories,applied_credit_notes,company - name: TrackingCategoriesAppliedCreditNotesCompany - - value: tracking_categories,applied_credit_notes,company,accounting_period - name: TrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: TrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,company,employee - name: TrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - tracking_categories,applied_credit_notes,company,employee,accounting_period - name: TrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,company,employee,payment_term - name: TrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: tracking_categories,applied_credit_notes,company,payment_term - name: TrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: tracking_categories,applied_credit_notes,contact - name: TrackingCategoriesAppliedCreditNotesContact - - value: tracking_categories,applied_credit_notes,contact,accounting_period - name: TrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: TrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,contact,company - name: TrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - tracking_categories,applied_credit_notes,contact,company,accounting_period - name: TrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,contact,company,employee - name: TrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: TrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: tracking_categories,applied_credit_notes,contact,company,payment_term - name: TrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: tracking_categories,applied_credit_notes,contact,employee - name: TrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: TrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,contact,employee,payment_term - name: TrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: tracking_categories,applied_credit_notes,contact,payment_term - name: TrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: tracking_categories,applied_credit_notes,employee - name: TrackingCategoriesAppliedCreditNotesEmployee - - value: tracking_categories,applied_credit_notes,employee,accounting_period - name: TrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,employee,payment_term - name: TrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: tracking_categories,applied_credit_notes,payment_term - name: TrackingCategoriesAppliedCreditNotesPaymentTerm - - value: tracking_categories,applied_vendor_credits - name: TrackingCategoriesAppliedVendorCredits - - value: tracking_categories,applied_vendor_credits,accounting_period - name: TrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: TrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,company - name: TrackingCategoriesAppliedVendorCreditsCompany - - value: tracking_categories,applied_vendor_credits,company,accounting_period - name: TrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,company,employee - name: TrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: TrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_vendor_credits,company,employee,payment_term - name: TrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: tracking_categories,applied_vendor_credits,company,payment_term - name: TrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: tracking_categories,applied_vendor_credits,contact - name: TrackingCategoriesAppliedVendorCreditsContact - - value: tracking_categories,applied_vendor_credits,contact,accounting_period - name: TrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,contact,company - name: TrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: TrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,contact,company,employee - name: TrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - TrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,applied_vendor_credits,contact,company,payment_term - name: TrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: tracking_categories,applied_vendor_credits,contact,employee - name: TrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: TrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: TrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: tracking_categories,applied_vendor_credits,contact,payment_term - name: TrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: tracking_categories,applied_vendor_credits,employee - name: TrackingCategoriesAppliedVendorCreditsEmployee - - value: tracking_categories,applied_vendor_credits,employee,accounting_period - name: TrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,employee,payment_term - name: TrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: tracking_categories,applied_vendor_credits,payment_term - name: TrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,company,accounting_period,payment_term - name: TrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,company,employee - name: TrackingCategoriesCompanyEmployee - - value: tracking_categories,company,employee,accounting_period - name: TrackingCategoriesCompanyEmployeeAccountingPeriod - - value: tracking_categories,company,employee,accounting_period,payment_term - name: TrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,company,employee,payment_term - name: TrackingCategoriesCompanyEmployeePaymentTerm - - value: tracking_categories,company,payment_term - name: TrackingCategoriesCompanyPaymentTerm - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod - - value: tracking_categories,contact,accounting_period,payment_term - name: TrackingCategoriesContactAccountingPeriodPaymentTerm - - value: tracking_categories,contact,company - name: TrackingCategoriesContactCompany - - value: tracking_categories,contact,company,accounting_period - name: TrackingCategoriesContactCompanyAccountingPeriod - - value: tracking_categories,contact,company,accounting_period,payment_term - name: TrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,contact,company,employee - name: TrackingCategoriesContactCompanyEmployee - - value: tracking_categories,contact,company,employee,accounting_period - name: TrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,contact,company,employee,accounting_period,payment_term - name: TrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,contact,company,employee,payment_term - name: TrackingCategoriesContactCompanyEmployeePaymentTerm - - value: tracking_categories,contact,company,payment_term - name: TrackingCategoriesContactCompanyPaymentTerm - - value: tracking_categories,contact,employee - name: TrackingCategoriesContactEmployee - - value: tracking_categories,contact,employee,accounting_period - name: TrackingCategoriesContactEmployeeAccountingPeriod - - value: tracking_categories,contact,employee,accounting_period,payment_term - name: TrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,contact,employee,payment_term - name: TrackingCategoriesContactEmployeePaymentTerm - - value: tracking_categories,contact,payment_term - name: TrackingCategoriesContactPaymentTerm - - value: tracking_categories,employee - name: TrackingCategoriesEmployee - - value: tracking_categories,employee,accounting_period - name: TrackingCategoriesEmployeeAccountingPeriod - - value: tracking_categories,employee,accounting_period,payment_term - name: TrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,employee,payment_term - name: TrackingCategoriesEmployeePaymentTerm - - value: tracking_categories,payment_term - name: TrackingCategoriesPaymentTerm - - value: tracking_categories,purchase_orders - name: TrackingCategoriesPurchaseOrders - - value: tracking_categories,purchase_orders,accounting_period - name: TrackingCategoriesPurchaseOrdersAccountingPeriod - - value: tracking_categories,purchase_orders,accounting_period,payment_term - name: TrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes,company - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes,contact - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes,employee - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: tracking_categories,purchase_orders,applied_vendor_credits - name: TrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,applied_vendor_credits,company - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: tracking_categories,purchase_orders,applied_vendor_credits,contact - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: tracking_categories,purchase_orders,applied_vendor_credits,employee - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: tracking_categories,purchase_orders,company - name: TrackingCategoriesPurchaseOrdersCompany - - value: tracking_categories,purchase_orders,company,accounting_period - name: TrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,company,accounting_period,payment_term - name: TrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,company,employee - name: TrackingCategoriesPurchaseOrdersCompanyEmployee - - value: tracking_categories,purchase_orders,company,employee,accounting_period - name: TrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,company,employee,payment_term - name: TrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: tracking_categories,purchase_orders,company,payment_term - name: TrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: tracking_categories,purchase_orders,contact - name: TrackingCategoriesPurchaseOrdersContact - - value: tracking_categories,purchase_orders,contact,accounting_period - name: TrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: TrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,contact,company - name: TrackingCategoriesPurchaseOrdersContactCompany - - value: tracking_categories,purchase_orders,contact,company,accounting_period - name: TrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,contact,company,employee - name: TrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: TrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,contact,company,employee,payment_term - name: TrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: tracking_categories,purchase_orders,contact,company,payment_term - name: TrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: tracking_categories,purchase_orders,contact,employee - name: TrackingCategoriesPurchaseOrdersContactEmployee - - value: tracking_categories,purchase_orders,contact,employee,accounting_period - name: TrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,contact,employee,payment_term - name: TrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: tracking_categories,purchase_orders,contact,payment_term - name: TrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: tracking_categories,purchase_orders,employee - name: TrackingCategoriesPurchaseOrdersEmployee - - value: tracking_categories,purchase_orders,employee,accounting_period - name: TrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: TrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,employee,payment_term - name: TrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: tracking_categories,purchase_orders,payment_term - name: TrackingCategoriesPurchaseOrdersPaymentTerm - source: - openapi: openapi/openapi.yml - InvoicesListRequestStatus: - enum: - - DRAFT - - OPEN - - PAID - - PARTIALLY_PAID - - SUBMITTED - - VOID - source: - openapi: openapi/openapi.yml - InvoicesListRequestType: - enum: - - ACCOUNTS_PAYABLE - - ACCOUNTS_RECEIVABLE - source: - openapi: openapi/openapi.yml - InvoicesRetrieveRequestExpand: - enum: - - accounting_period - - value: accounting_period,payment_term - name: AccountingPeriodPaymentTerm - - applied_credit_notes - - value: applied_credit_notes,accounting_period - name: AppliedCreditNotesAccountingPeriod - - value: applied_credit_notes,accounting_period,payment_term - name: AppliedCreditNotesAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits - name: AppliedCreditNotesAppliedVendorCredits - - value: applied_credit_notes,applied_vendor_credits,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: AppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,company - name: AppliedCreditNotesAppliedVendorCreditsCompany - - value: applied_credit_notes,applied_vendor_credits,company,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,company,employee - name: AppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: AppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: applied_credit_notes,applied_vendor_credits,company,payment_term - name: AppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact - name: AppliedCreditNotesAppliedVendorCreditsContact - - value: applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact,company - name: AppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact,company,employee - name: AppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: AppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact,employee - name: AppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: AppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: applied_credit_notes,applied_vendor_credits,contact,payment_term - name: AppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,employee - name: AppliedCreditNotesAppliedVendorCreditsEmployee - - value: applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: AppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,applied_vendor_credits,employee,payment_term - name: AppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: applied_credit_notes,applied_vendor_credits,payment_term - name: AppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_credit_notes,company - name: AppliedCreditNotesCompany - - value: applied_credit_notes,company,accounting_period - name: AppliedCreditNotesCompanyAccountingPeriod - - value: applied_credit_notes,company,accounting_period,payment_term - name: AppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: applied_credit_notes,company,employee - name: AppliedCreditNotesCompanyEmployee - - value: applied_credit_notes,company,employee,accounting_period - name: AppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: applied_credit_notes,company,employee,accounting_period,payment_term - name: AppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,company,employee,payment_term - name: AppliedCreditNotesCompanyEmployeePaymentTerm - - value: applied_credit_notes,company,payment_term - name: AppliedCreditNotesCompanyPaymentTerm - - value: applied_credit_notes,contact - name: AppliedCreditNotesContact - - value: applied_credit_notes,contact,accounting_period - name: AppliedCreditNotesContactAccountingPeriod - - value: applied_credit_notes,contact,accounting_period,payment_term - name: AppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: applied_credit_notes,contact,company - name: AppliedCreditNotesContactCompany - - value: applied_credit_notes,contact,company,accounting_period - name: AppliedCreditNotesContactCompanyAccountingPeriod - - value: applied_credit_notes,contact,company,accounting_period,payment_term - name: AppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: applied_credit_notes,contact,company,employee - name: AppliedCreditNotesContactCompanyEmployee - - value: applied_credit_notes,contact,company,employee,accounting_period - name: AppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: AppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,contact,company,employee,payment_term - name: AppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: applied_credit_notes,contact,company,payment_term - name: AppliedCreditNotesContactCompanyPaymentTerm - - value: applied_credit_notes,contact,employee - name: AppliedCreditNotesContactEmployee - - value: applied_credit_notes,contact,employee,accounting_period - name: AppliedCreditNotesContactEmployeeAccountingPeriod - - value: applied_credit_notes,contact,employee,accounting_period,payment_term - name: AppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,contact,employee,payment_term - name: AppliedCreditNotesContactEmployeePaymentTerm - - value: applied_credit_notes,contact,payment_term - name: AppliedCreditNotesContactPaymentTerm - - value: applied_credit_notes,employee - name: AppliedCreditNotesEmployee - - value: applied_credit_notes,employee,accounting_period - name: AppliedCreditNotesEmployeeAccountingPeriod - - value: applied_credit_notes,employee,accounting_period,payment_term - name: AppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: applied_credit_notes,employee,payment_term - name: AppliedCreditNotesEmployeePaymentTerm - - value: applied_credit_notes,payment_term - name: AppliedCreditNotesPaymentTerm - - applied_payments - - value: applied_payments,accounting_period - name: AppliedPaymentsAccountingPeriod - - value: applied_payments,accounting_period,payment_term - name: AppliedPaymentsAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes - name: AppliedPaymentsAppliedCreditNotes - - value: applied_payments,applied_credit_notes,accounting_period - name: AppliedPaymentsAppliedCreditNotesAccountingPeriod - - value: applied_payments,applied_credit_notes,accounting_period,payment_term - name: AppliedPaymentsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,applied_vendor_credits - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,applied_vendor_credits,company - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,employee - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,applied_credit_notes,applied_vendor_credits,contact - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,applied_credit_notes,applied_vendor_credits,employee - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,applied_credit_notes,applied_vendor_credits,payment_term - name: AppliedPaymentsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_payments,applied_credit_notes,company - name: AppliedPaymentsAppliedCreditNotesCompany - - value: applied_payments,applied_credit_notes,company,accounting_period - name: AppliedPaymentsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,company,accounting_period,payment_term - name: AppliedPaymentsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,company,employee - name: AppliedPaymentsAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,applied_credit_notes,company,employee,accounting_period - name: AppliedPaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,company,employee,payment_term - name: AppliedPaymentsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: applied_payments,applied_credit_notes,company,payment_term - name: AppliedPaymentsAppliedCreditNotesCompanyPaymentTerm - - value: applied_payments,applied_credit_notes,contact - name: AppliedPaymentsAppliedCreditNotesContact - - value: applied_payments,applied_credit_notes,contact,accounting_period - name: AppliedPaymentsAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,contact,accounting_period,payment_term - name: AppliedPaymentsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,contact,company - name: AppliedPaymentsAppliedCreditNotesContactCompany - - value: >- - applied_payments,applied_credit_notes,contact,company,accounting_period - name: AppliedPaymentsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,contact,company,employee - name: AppliedPaymentsAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_credit_notes,contact,company,employee,payment_term - name: AppliedPaymentsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: applied_payments,applied_credit_notes,contact,company,payment_term - name: AppliedPaymentsAppliedCreditNotesContactCompanyPaymentTerm - - value: applied_payments,applied_credit_notes,contact,employee - name: AppliedPaymentsAppliedCreditNotesContactEmployee - - value: >- - applied_payments,applied_credit_notes,contact,employee,accounting_period - name: AppliedPaymentsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,contact,employee,payment_term - name: AppliedPaymentsAppliedCreditNotesContactEmployeePaymentTerm - - value: applied_payments,applied_credit_notes,contact,payment_term - name: AppliedPaymentsAppliedCreditNotesContactPaymentTerm - - value: applied_payments,applied_credit_notes,employee - name: AppliedPaymentsAppliedCreditNotesEmployee - - value: applied_payments,applied_credit_notes,employee,accounting_period - name: AppliedPaymentsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,applied_credit_notes,employee,accounting_period,payment_term - name: AppliedPaymentsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_credit_notes,employee,payment_term - name: AppliedPaymentsAppliedCreditNotesEmployeePaymentTerm - - value: applied_payments,applied_credit_notes,payment_term - name: AppliedPaymentsAppliedCreditNotesPaymentTerm - - value: applied_payments,applied_vendor_credits - name: AppliedPaymentsAppliedVendorCredits - - value: applied_payments,applied_vendor_credits,accounting_period - name: AppliedPaymentsAppliedVendorCreditsAccountingPeriod - - value: applied_payments,applied_vendor_credits,accounting_period,payment_term - name: AppliedPaymentsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,company - name: AppliedPaymentsAppliedVendorCreditsCompany - - value: applied_payments,applied_vendor_credits,company,accounting_period - name: AppliedPaymentsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,company,accounting_period,payment_term - name: AppliedPaymentsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,company,employee - name: AppliedPaymentsAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,applied_vendor_credits,company,employee,accounting_period - name: AppliedPaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,company,employee,payment_term - name: AppliedPaymentsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: applied_payments,applied_vendor_credits,company,payment_term - name: AppliedPaymentsAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,applied_vendor_credits,contact - name: AppliedPaymentsAppliedVendorCreditsContact - - value: applied_payments,applied_vendor_credits,contact,accounting_period - name: AppliedPaymentsAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,contact,accounting_period,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,contact,company - name: AppliedPaymentsAppliedVendorCreditsContactCompany - - value: >- - applied_payments,applied_vendor_credits,contact,company,accounting_period - name: AppliedPaymentsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,contact,company,employee - name: AppliedPaymentsAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,applied_vendor_credits,contact,company,employee,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: applied_payments,applied_vendor_credits,contact,company,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactCompanyPaymentTerm - - value: applied_payments,applied_vendor_credits,contact,employee - name: AppliedPaymentsAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,applied_vendor_credits,contact,employee,accounting_period - name: AppliedPaymentsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,contact,employee,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactEmployeePaymentTerm - - value: applied_payments,applied_vendor_credits,contact,payment_term - name: AppliedPaymentsAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,applied_vendor_credits,employee - name: AppliedPaymentsAppliedVendorCreditsEmployee - - value: applied_payments,applied_vendor_credits,employee,accounting_period - name: AppliedPaymentsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,applied_vendor_credits,employee,accounting_period,payment_term - name: AppliedPaymentsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,applied_vendor_credits,employee,payment_term - name: AppliedPaymentsAppliedVendorCreditsEmployeePaymentTerm - - value: applied_payments,applied_vendor_credits,payment_term - name: AppliedPaymentsAppliedVendorCreditsPaymentTerm - - value: applied_payments,company - name: AppliedPaymentsCompany - - value: applied_payments,company,accounting_period - name: AppliedPaymentsCompanyAccountingPeriod - - value: applied_payments,company,accounting_period,payment_term - name: AppliedPaymentsCompanyAccountingPeriodPaymentTerm - - value: applied_payments,company,employee - name: AppliedPaymentsCompanyEmployee - - value: applied_payments,company,employee,accounting_period - name: AppliedPaymentsCompanyEmployeeAccountingPeriod - - value: applied_payments,company,employee,accounting_period,payment_term - name: AppliedPaymentsCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,company,employee,payment_term - name: AppliedPaymentsCompanyEmployeePaymentTerm - - value: applied_payments,company,payment_term - name: AppliedPaymentsCompanyPaymentTerm - - value: applied_payments,contact - name: AppliedPaymentsContact - - value: applied_payments,contact,accounting_period - name: AppliedPaymentsContactAccountingPeriod - - value: applied_payments,contact,accounting_period,payment_term - name: AppliedPaymentsContactAccountingPeriodPaymentTerm - - value: applied_payments,contact,company - name: AppliedPaymentsContactCompany - - value: applied_payments,contact,company,accounting_period - name: AppliedPaymentsContactCompanyAccountingPeriod - - value: applied_payments,contact,company,accounting_period,payment_term - name: AppliedPaymentsContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,contact,company,employee - name: AppliedPaymentsContactCompanyEmployee - - value: applied_payments,contact,company,employee,accounting_period - name: AppliedPaymentsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,contact,company,employee,accounting_period,payment_term - name: AppliedPaymentsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,contact,company,employee,payment_term - name: AppliedPaymentsContactCompanyEmployeePaymentTerm - - value: applied_payments,contact,company,payment_term - name: AppliedPaymentsContactCompanyPaymentTerm - - value: applied_payments,contact,employee - name: AppliedPaymentsContactEmployee - - value: applied_payments,contact,employee,accounting_period - name: AppliedPaymentsContactEmployeeAccountingPeriod - - value: applied_payments,contact,employee,accounting_period,payment_term - name: AppliedPaymentsContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,contact,employee,payment_term - name: AppliedPaymentsContactEmployeePaymentTerm - - value: applied_payments,contact,payment_term - name: AppliedPaymentsContactPaymentTerm - - value: applied_payments,employee - name: AppliedPaymentsEmployee - - value: applied_payments,employee,accounting_period - name: AppliedPaymentsEmployeeAccountingPeriod - - value: applied_payments,employee,accounting_period,payment_term - name: AppliedPaymentsEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,employee,payment_term - name: AppliedPaymentsEmployeePaymentTerm - - value: applied_payments,line_items - name: AppliedPaymentsLineItems - - value: applied_payments,line_items,accounting_period - name: AppliedPaymentsLineItemsAccountingPeriod - - value: applied_payments,line_items,accounting_period,payment_term - name: AppliedPaymentsLineItemsAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_credit_notes - name: AppliedPaymentsLineItemsAppliedCreditNotes - - value: applied_payments,line_items,applied_credit_notes,accounting_period - name: AppliedPaymentsLineItemsAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,accounting_period,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits - name: AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company - name: AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact - name: AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,company - name: AppliedPaymentsLineItemsAppliedCreditNotesCompany - - value: >- - applied_payments,line_items,applied_credit_notes,company,accounting_period - name: AppliedPaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,company,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,company,employee,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: applied_payments,line_items,applied_credit_notes,company,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesCompanyPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,contact - name: AppliedPaymentsLineItemsAppliedCreditNotesContact - - value: >- - applied_payments,line_items,applied_credit_notes,contact,accounting_period - name: AppliedPaymentsLineItemsAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,contact,company - name: AppliedPaymentsLineItemsAppliedCreditNotesContactCompany - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,contact,company,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesContactCompanyPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,contact,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesContactEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_credit_notes,contact,employee,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesContactEmployeePaymentTerm - - value: applied_payments,line_items,applied_credit_notes,contact,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesContactPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,employee - name: AppliedPaymentsLineItemsAppliedCreditNotesEmployee - - value: >- - applied_payments,line_items,applied_credit_notes,employee,accounting_period - name: AppliedPaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_credit_notes,employee,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesEmployeePaymentTerm - - value: applied_payments,line_items,applied_credit_notes,payment_term - name: AppliedPaymentsLineItemsAppliedCreditNotesPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits - name: AppliedPaymentsLineItemsAppliedVendorCredits - - value: applied_payments,line_items,applied_vendor_credits,accounting_period - name: AppliedPaymentsLineItemsAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,company - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,applied_vendor_credits,company,accounting_period - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,company,employee - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,company,employee,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,company,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,contact - name: AppliedPaymentsLineItemsAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,accounting_period - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,contact,company - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,employee - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,company,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,contact,employee - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,employee,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,contact,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,employee - name: AppliedPaymentsLineItemsAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,applied_vendor_credits,employee,accounting_period - name: AppliedPaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,applied_vendor_credits,employee,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsEmployeePaymentTerm - - value: applied_payments,line_items,applied_vendor_credits,payment_term - name: AppliedPaymentsLineItemsAppliedVendorCreditsPaymentTerm - - value: applied_payments,line_items,company - name: AppliedPaymentsLineItemsCompany - - value: applied_payments,line_items,company,accounting_period - name: AppliedPaymentsLineItemsCompanyAccountingPeriod - - value: applied_payments,line_items,company,accounting_period,payment_term - name: AppliedPaymentsLineItemsCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,company,employee - name: AppliedPaymentsLineItemsCompanyEmployee - - value: applied_payments,line_items,company,employee,accounting_period - name: AppliedPaymentsLineItemsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,company,employee,accounting_period,payment_term - name: AppliedPaymentsLineItemsCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,company,employee,payment_term - name: AppliedPaymentsLineItemsCompanyEmployeePaymentTerm - - value: applied_payments,line_items,company,payment_term - name: AppliedPaymentsLineItemsCompanyPaymentTerm - - value: applied_payments,line_items,contact - name: AppliedPaymentsLineItemsContact - - value: applied_payments,line_items,contact,accounting_period - name: AppliedPaymentsLineItemsContactAccountingPeriod - - value: applied_payments,line_items,contact,accounting_period,payment_term - name: AppliedPaymentsLineItemsContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,contact,company - name: AppliedPaymentsLineItemsContactCompany - - value: applied_payments,line_items,contact,company,accounting_period - name: AppliedPaymentsLineItemsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,contact,company,accounting_period,payment_term - name: AppliedPaymentsLineItemsContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,contact,company,employee - name: AppliedPaymentsLineItemsContactCompanyEmployee - - value: applied_payments,line_items,contact,company,employee,accounting_period - name: AppliedPaymentsLineItemsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,contact,company,employee,payment_term - name: AppliedPaymentsLineItemsContactCompanyEmployeePaymentTerm - - value: applied_payments,line_items,contact,company,payment_term - name: AppliedPaymentsLineItemsContactCompanyPaymentTerm - - value: applied_payments,line_items,contact,employee - name: AppliedPaymentsLineItemsContactEmployee - - value: applied_payments,line_items,contact,employee,accounting_period - name: AppliedPaymentsLineItemsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,contact,employee,accounting_period,payment_term - name: AppliedPaymentsLineItemsContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,contact,employee,payment_term - name: AppliedPaymentsLineItemsContactEmployeePaymentTerm - - value: applied_payments,line_items,contact,payment_term - name: AppliedPaymentsLineItemsContactPaymentTerm - - value: applied_payments,line_items,employee - name: AppliedPaymentsLineItemsEmployee - - value: applied_payments,line_items,employee,accounting_period - name: AppliedPaymentsLineItemsEmployeeAccountingPeriod - - value: applied_payments,line_items,employee,accounting_period,payment_term - name: AppliedPaymentsLineItemsEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,employee,payment_term - name: AppliedPaymentsLineItemsEmployeePaymentTerm - - value: applied_payments,line_items,payment_term - name: AppliedPaymentsLineItemsPaymentTerm - - value: applied_payments,line_items,purchase_orders - name: AppliedPaymentsLineItemsPurchaseOrders - - value: applied_payments,line_items,purchase_orders,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,accounting_period,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,applied_credit_notes - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotes - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContact - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,employee - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_credit_notes,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: applied_payments,line_items,purchase_orders,applied_vendor_credits - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCredits - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,employee - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,applied_vendor_credits,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: applied_payments,line_items,purchase_orders,company - name: AppliedPaymentsLineItemsPurchaseOrdersCompany - - value: applied_payments,line_items,purchase_orders,company,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,company,employee - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,company,employee,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,company,employee,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeePaymentTerm - - value: applied_payments,line_items,purchase_orders,company,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersCompanyPaymentTerm - - value: applied_payments,line_items,purchase_orders,contact - name: AppliedPaymentsLineItemsPurchaseOrdersContact - - value: applied_payments,line_items,purchase_orders,contact,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersContactAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,contact,company - name: AppliedPaymentsLineItemsPurchaseOrdersContactCompany - - value: >- - applied_payments,line_items,purchase_orders,contact,company,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,contact,company,employee - name: AppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployee - - value: >- - applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,contact,company,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersContactCompanyPaymentTerm - - value: applied_payments,line_items,purchase_orders,contact,employee - name: AppliedPaymentsLineItemsPurchaseOrdersContactEmployee - - value: >- - applied_payments,line_items,purchase_orders,contact,employee,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,purchase_orders,contact,employee,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersContactEmployeePaymentTerm - - value: applied_payments,line_items,purchase_orders,contact,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersContactPaymentTerm - - value: applied_payments,line_items,purchase_orders,employee - name: AppliedPaymentsLineItemsPurchaseOrdersEmployee - - value: applied_payments,line_items,purchase_orders,employee,accounting_period - name: AppliedPaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,purchase_orders,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,purchase_orders,employee,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersEmployeePaymentTerm - - value: applied_payments,line_items,purchase_orders,payment_term - name: AppliedPaymentsLineItemsPurchaseOrdersPaymentTerm - - value: applied_payments,line_items,tracking_categories - name: AppliedPaymentsLineItemsTrackingCategories - - value: applied_payments,line_items,tracking_categories,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,accounting_period,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: applied_payments,line_items,tracking_categories,applied_credit_notes - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotes - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContact - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,employee - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_credit_notes,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: applied_payments,line_items,tracking_categories,applied_vendor_credits - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCredits - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,employee - name: AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: applied_payments,line_items,tracking_categories,company - name: AppliedPaymentsLineItemsTrackingCategoriesCompany - - value: >- - applied_payments,line_items,tracking_categories,company,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,line_items,tracking_categories,company,employee - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,company,employee,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeePaymentTerm - - value: applied_payments,line_items,tracking_categories,company,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesCompanyPaymentTerm - - value: applied_payments,line_items,tracking_categories,contact - name: AppliedPaymentsLineItemsTrackingCategoriesContact - - value: >- - applied_payments,line_items,tracking_categories,contact,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: applied_payments,line_items,tracking_categories,contact,company - name: AppliedPaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - applied_payments,line_items,tracking_categories,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,contact,company,employee - name: AppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,contact,company,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesContactCompanyPaymentTerm - - value: applied_payments,line_items,tracking_categories,contact,employee - name: AppliedPaymentsLineItemsTrackingCategoriesContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,contact,employee,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesContactEmployeePaymentTerm - - value: applied_payments,line_items,tracking_categories,contact,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesContactPaymentTerm - - value: applied_payments,line_items,tracking_categories,employee - name: AppliedPaymentsLineItemsTrackingCategoriesEmployee - - value: >- - applied_payments,line_items,tracking_categories,employee,accounting_period - name: AppliedPaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,line_items,tracking_categories,employee,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesEmployeePaymentTerm - - value: applied_payments,line_items,tracking_categories,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesPaymentTerm - - value: applied_payments,line_items,tracking_categories,purchase_orders - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrders - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContact - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,employee - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,contact,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,employee - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,employee,payment_term - name: >- - AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: >- - applied_payments,line_items,tracking_categories,purchase_orders,payment_term - name: AppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersPaymentTerm - - value: applied_payments,payment_term - name: AppliedPaymentsPaymentTerm - - value: applied_payments,purchase_orders - name: AppliedPaymentsPurchaseOrders - - value: applied_payments,purchase_orders,accounting_period - name: AppliedPaymentsPurchaseOrdersAccountingPeriod - - value: applied_payments,purchase_orders,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotes - - value: >- - applied_payments,purchase_orders,applied_credit_notes,accounting_period - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,company - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,accounting_period - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,company,employee - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,company,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,contact - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContact - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,contact,company - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,employee - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,contact,employee - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,contact,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,employee - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_credit_notes,employee,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: applied_payments,purchase_orders,applied_credit_notes,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits - name: AppliedPaymentsPurchaseOrdersAppliedVendorCredits - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,accounting_period - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits,company - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,employee - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,company,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits,contact - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,employee - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,contact,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits,employee - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,purchase_orders,applied_vendor_credits,employee,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: applied_payments,purchase_orders,applied_vendor_credits,payment_term - name: AppliedPaymentsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: applied_payments,purchase_orders,company - name: AppliedPaymentsPurchaseOrdersCompany - - value: applied_payments,purchase_orders,company,accounting_period - name: AppliedPaymentsPurchaseOrdersCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,company,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,company,employee - name: AppliedPaymentsPurchaseOrdersCompanyEmployee - - value: applied_payments,purchase_orders,company,employee,accounting_period - name: AppliedPaymentsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,company,employee,payment_term - name: AppliedPaymentsPurchaseOrdersCompanyEmployeePaymentTerm - - value: applied_payments,purchase_orders,company,payment_term - name: AppliedPaymentsPurchaseOrdersCompanyPaymentTerm - - value: applied_payments,purchase_orders,contact - name: AppliedPaymentsPurchaseOrdersContact - - value: applied_payments,purchase_orders,contact,accounting_period - name: AppliedPaymentsPurchaseOrdersContactAccountingPeriod - - value: >- - applied_payments,purchase_orders,contact,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,contact,company - name: AppliedPaymentsPurchaseOrdersContactCompany - - value: applied_payments,purchase_orders,contact,company,accounting_period - name: AppliedPaymentsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - applied_payments,purchase_orders,contact,company,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,contact,company,employee - name: AppliedPaymentsPurchaseOrdersContactCompanyEmployee - - value: >- - applied_payments,purchase_orders,contact,company,employee,accounting_period - name: AppliedPaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,contact,company,employee,payment_term - name: AppliedPaymentsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: applied_payments,purchase_orders,contact,company,payment_term - name: AppliedPaymentsPurchaseOrdersContactCompanyPaymentTerm - - value: applied_payments,purchase_orders,contact,employee - name: AppliedPaymentsPurchaseOrdersContactEmployee - - value: applied_payments,purchase_orders,contact,employee,accounting_period - name: AppliedPaymentsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,contact,employee,payment_term - name: AppliedPaymentsPurchaseOrdersContactEmployeePaymentTerm - - value: applied_payments,purchase_orders,contact,payment_term - name: AppliedPaymentsPurchaseOrdersContactPaymentTerm - - value: applied_payments,purchase_orders,employee - name: AppliedPaymentsPurchaseOrdersEmployee - - value: applied_payments,purchase_orders,employee,accounting_period - name: AppliedPaymentsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - applied_payments,purchase_orders,employee,accounting_period,payment_term - name: AppliedPaymentsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,purchase_orders,employee,payment_term - name: AppliedPaymentsPurchaseOrdersEmployeePaymentTerm - - value: applied_payments,purchase_orders,payment_term - name: AppliedPaymentsPurchaseOrdersPaymentTerm - - value: applied_payments,tracking_categories - name: AppliedPaymentsTrackingCategories - - value: applied_payments,tracking_categories,accounting_period - name: AppliedPaymentsTrackingCategoriesAccountingPeriod - - value: applied_payments,tracking_categories,accounting_period,payment_term - name: AppliedPaymentsTrackingCategoriesAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotes - - value: >- - applied_payments,tracking_categories,applied_credit_notes,accounting_period - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes,company - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,employee - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,company,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes,contact - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesContact - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,employee - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,contact,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes,employee - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_credit_notes,employee,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: applied_payments,tracking_categories,applied_credit_notes,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: applied_payments,tracking_categories,applied_vendor_credits - name: AppliedPaymentsTrackingCategoriesAppliedVendorCredits - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,accounting_period - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,applied_vendor_credits,company - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,employee - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: applied_payments,tracking_categories,applied_vendor_credits,contact - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,employee - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: applied_payments,tracking_categories,applied_vendor_credits,employee - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,applied_vendor_credits,payment_term - name: AppliedPaymentsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: applied_payments,tracking_categories,company - name: AppliedPaymentsTrackingCategoriesCompany - - value: applied_payments,tracking_categories,company,accounting_period - name: AppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,company,accounting_period,payment_term - name: AppliedPaymentsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,company,employee - name: AppliedPaymentsTrackingCategoriesCompanyEmployee - - value: >- - applied_payments,tracking_categories,company,employee,accounting_period - name: AppliedPaymentsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,company,employee,payment_term - name: AppliedPaymentsTrackingCategoriesCompanyEmployeePaymentTerm - - value: applied_payments,tracking_categories,company,payment_term - name: AppliedPaymentsTrackingCategoriesCompanyPaymentTerm - - value: applied_payments,tracking_categories,contact - name: AppliedPaymentsTrackingCategoriesContact - - value: applied_payments,tracking_categories,contact,accounting_period - name: AppliedPaymentsTrackingCategoriesContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,contact,accounting_period,payment_term - name: AppliedPaymentsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,contact,company - name: AppliedPaymentsTrackingCategoriesContactCompany - - value: applied_payments,tracking_categories,contact,company,accounting_period - name: AppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,contact,company,employee - name: AppliedPaymentsTrackingCategoriesContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,contact,company,employee,payment_term - name: AppliedPaymentsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: applied_payments,tracking_categories,contact,company,payment_term - name: AppliedPaymentsTrackingCategoriesContactCompanyPaymentTerm - - value: applied_payments,tracking_categories,contact,employee - name: AppliedPaymentsTrackingCategoriesContactEmployee - - value: >- - applied_payments,tracking_categories,contact,employee,accounting_period - name: AppliedPaymentsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,contact,employee,payment_term - name: AppliedPaymentsTrackingCategoriesContactEmployeePaymentTerm - - value: applied_payments,tracking_categories,contact,payment_term - name: AppliedPaymentsTrackingCategoriesContactPaymentTerm - - value: applied_payments,tracking_categories,employee - name: AppliedPaymentsTrackingCategoriesEmployee - - value: applied_payments,tracking_categories,employee,accounting_period - name: AppliedPaymentsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,employee,accounting_period,payment_term - name: AppliedPaymentsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,employee,payment_term - name: AppliedPaymentsTrackingCategoriesEmployeePaymentTerm - - value: applied_payments,tracking_categories,payment_term - name: AppliedPaymentsTrackingCategoriesPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders - name: AppliedPaymentsTrackingCategoriesPurchaseOrders - - value: applied_payments,tracking_categories,purchase_orders,accounting_period - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,company - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,company,accounting_period - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,company,employee - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,company,payment_term - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,contact - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContact - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,accounting_period - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,contact,company - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,employee - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,contact,employee - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,contact,payment_term - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,employee - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - applied_payments,tracking_categories,purchase_orders,employee,accounting_period - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - applied_payments,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - AppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - applied_payments,tracking_categories,purchase_orders,employee,payment_term - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: applied_payments,tracking_categories,purchase_orders,payment_term - name: AppliedPaymentsTrackingCategoriesPurchaseOrdersPaymentTerm - - applied_vendor_credits - - value: applied_vendor_credits,accounting_period - name: AppliedVendorCreditsAccountingPeriod - - value: applied_vendor_credits,accounting_period,payment_term - name: AppliedVendorCreditsAccountingPeriodPaymentTerm - - value: applied_vendor_credits,company - name: AppliedVendorCreditsCompany - - value: applied_vendor_credits,company,accounting_period - name: AppliedVendorCreditsCompanyAccountingPeriod - - value: applied_vendor_credits,company,accounting_period,payment_term - name: AppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: applied_vendor_credits,company,employee - name: AppliedVendorCreditsCompanyEmployee - - value: applied_vendor_credits,company,employee,accounting_period - name: AppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: applied_vendor_credits,company,employee,accounting_period,payment_term - name: AppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_vendor_credits,company,employee,payment_term - name: AppliedVendorCreditsCompanyEmployeePaymentTerm - - value: applied_vendor_credits,company,payment_term - name: AppliedVendorCreditsCompanyPaymentTerm - - value: applied_vendor_credits,contact - name: AppliedVendorCreditsContact - - value: applied_vendor_credits,contact,accounting_period - name: AppliedVendorCreditsContactAccountingPeriod - - value: applied_vendor_credits,contact,accounting_period,payment_term - name: AppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: applied_vendor_credits,contact,company - name: AppliedVendorCreditsContactCompany - - value: applied_vendor_credits,contact,company,accounting_period - name: AppliedVendorCreditsContactCompanyAccountingPeriod - - value: applied_vendor_credits,contact,company,accounting_period,payment_term - name: AppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: applied_vendor_credits,contact,company,employee - name: AppliedVendorCreditsContactCompanyEmployee - - value: applied_vendor_credits,contact,company,employee,accounting_period - name: AppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: AppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: applied_vendor_credits,contact,company,employee,payment_term - name: AppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: applied_vendor_credits,contact,company,payment_term - name: AppliedVendorCreditsContactCompanyPaymentTerm - - value: applied_vendor_credits,contact,employee - name: AppliedVendorCreditsContactEmployee - - value: applied_vendor_credits,contact,employee,accounting_period - name: AppliedVendorCreditsContactEmployeeAccountingPeriod - - value: applied_vendor_credits,contact,employee,accounting_period,payment_term - name: AppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: applied_vendor_credits,contact,employee,payment_term - name: AppliedVendorCreditsContactEmployeePaymentTerm - - value: applied_vendor_credits,contact,payment_term - name: AppliedVendorCreditsContactPaymentTerm - - value: applied_vendor_credits,employee - name: AppliedVendorCreditsEmployee - - value: applied_vendor_credits,employee,accounting_period - name: AppliedVendorCreditsEmployeeAccountingPeriod - - value: applied_vendor_credits,employee,accounting_period,payment_term - name: AppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: applied_vendor_credits,employee,payment_term - name: AppliedVendorCreditsEmployeePaymentTerm - - value: applied_vendor_credits,payment_term - name: AppliedVendorCreditsPaymentTerm - - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - value: company,accounting_period,payment_term - name: CompanyAccountingPeriodPaymentTerm - - value: company,employee - name: CompanyEmployee - - value: company,employee,accounting_period - name: CompanyEmployeeAccountingPeriod - - value: company,employee,accounting_period,payment_term - name: CompanyEmployeeAccountingPeriodPaymentTerm - - value: company,employee,payment_term - name: CompanyEmployeePaymentTerm - - value: company,payment_term - name: CompanyPaymentTerm - - contact - - value: contact,accounting_period - name: ContactAccountingPeriod - - value: contact,accounting_period,payment_term - name: ContactAccountingPeriodPaymentTerm - - value: contact,company - name: ContactCompany - - value: contact,company,accounting_period - name: ContactCompanyAccountingPeriod - - value: contact,company,accounting_period,payment_term - name: ContactCompanyAccountingPeriodPaymentTerm - - value: contact,company,employee - name: ContactCompanyEmployee - - value: contact,company,employee,accounting_period - name: ContactCompanyEmployeeAccountingPeriod - - value: contact,company,employee,accounting_period,payment_term - name: ContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: contact,company,employee,payment_term - name: ContactCompanyEmployeePaymentTerm - - value: contact,company,payment_term - name: ContactCompanyPaymentTerm - - value: contact,employee - name: ContactEmployee - - value: contact,employee,accounting_period - name: ContactEmployeeAccountingPeriod - - value: contact,employee,accounting_period,payment_term - name: ContactEmployeeAccountingPeriodPaymentTerm - - value: contact,employee,payment_term - name: ContactEmployeePaymentTerm - - value: contact,payment_term - name: ContactPaymentTerm - - employee - - value: employee,accounting_period - name: EmployeeAccountingPeriod - - value: employee,accounting_period,payment_term - name: EmployeeAccountingPeriodPaymentTerm - - value: employee,payment_term - name: EmployeePaymentTerm - - line_items - - value: line_items,accounting_period - name: LineItemsAccountingPeriod - - value: line_items,accounting_period,payment_term - name: LineItemsAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes - name: LineItemsAppliedCreditNotes - - value: line_items,applied_credit_notes,accounting_period - name: LineItemsAppliedCreditNotesAccountingPeriod - - value: line_items,applied_credit_notes,accounting_period,payment_term - name: LineItemsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits - name: LineItemsAppliedCreditNotesAppliedVendorCredits - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,accounting_period - name: LineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,company - name: LineItemsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,employee - name: LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,company,payment_term - name: LineItemsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,contact - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,contact,company - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,employee - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: LineItemsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,employee - name: LineItemsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: LineItemsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: line_items,applied_credit_notes,applied_vendor_credits,payment_term - name: LineItemsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: line_items,applied_credit_notes,company - name: LineItemsAppliedCreditNotesCompany - - value: line_items,applied_credit_notes,company,accounting_period - name: LineItemsAppliedCreditNotesCompanyAccountingPeriod - - value: line_items,applied_credit_notes,company,accounting_period,payment_term - name: LineItemsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,company,employee - name: LineItemsAppliedCreditNotesCompanyEmployee - - value: line_items,applied_credit_notes,company,employee,accounting_period - name: LineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,company,employee,accounting_period,payment_term - name: LineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,company,employee,payment_term - name: LineItemsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: line_items,applied_credit_notes,company,payment_term - name: LineItemsAppliedCreditNotesCompanyPaymentTerm - - value: line_items,applied_credit_notes,contact - name: LineItemsAppliedCreditNotesContact - - value: line_items,applied_credit_notes,contact,accounting_period - name: LineItemsAppliedCreditNotesContactAccountingPeriod - - value: line_items,applied_credit_notes,contact,accounting_period,payment_term - name: LineItemsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,contact,company - name: LineItemsAppliedCreditNotesContactCompany - - value: line_items,applied_credit_notes,contact,company,accounting_period - name: LineItemsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - line_items,applied_credit_notes,contact,company,accounting_period,payment_term - name: LineItemsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,contact,company,employee - name: LineItemsAppliedCreditNotesContactCompanyEmployee - - value: >- - line_items,applied_credit_notes,contact,company,employee,accounting_period - name: LineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,contact,company,employee,payment_term - name: LineItemsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: line_items,applied_credit_notes,contact,company,payment_term - name: LineItemsAppliedCreditNotesContactCompanyPaymentTerm - - value: line_items,applied_credit_notes,contact,employee - name: LineItemsAppliedCreditNotesContactEmployee - - value: line_items,applied_credit_notes,contact,employee,accounting_period - name: LineItemsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,contact,employee,accounting_period,payment_term - name: LineItemsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,contact,employee,payment_term - name: LineItemsAppliedCreditNotesContactEmployeePaymentTerm - - value: line_items,applied_credit_notes,contact,payment_term - name: LineItemsAppliedCreditNotesContactPaymentTerm - - value: line_items,applied_credit_notes,employee - name: LineItemsAppliedCreditNotesEmployee - - value: line_items,applied_credit_notes,employee,accounting_period - name: LineItemsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - line_items,applied_credit_notes,employee,accounting_period,payment_term - name: LineItemsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_credit_notes,employee,payment_term - name: LineItemsAppliedCreditNotesEmployeePaymentTerm - - value: line_items,applied_credit_notes,payment_term - name: LineItemsAppliedCreditNotesPaymentTerm - - value: line_items,applied_vendor_credits - name: LineItemsAppliedVendorCredits - - value: line_items,applied_vendor_credits,accounting_period - name: LineItemsAppliedVendorCreditsAccountingPeriod - - value: line_items,applied_vendor_credits,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,company - name: LineItemsAppliedVendorCreditsCompany - - value: line_items,applied_vendor_credits,company,accounting_period - name: LineItemsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,applied_vendor_credits,company,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,company,employee - name: LineItemsAppliedVendorCreditsCompanyEmployee - - value: line_items,applied_vendor_credits,company,employee,accounting_period - name: LineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,company,employee,payment_term - name: LineItemsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: line_items,applied_vendor_credits,company,payment_term - name: LineItemsAppliedVendorCreditsCompanyPaymentTerm - - value: line_items,applied_vendor_credits,contact - name: LineItemsAppliedVendorCreditsContact - - value: line_items,applied_vendor_credits,contact,accounting_period - name: LineItemsAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,applied_vendor_credits,contact,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,contact,company - name: LineItemsAppliedVendorCreditsContactCompany - - value: line_items,applied_vendor_credits,contact,company,accounting_period - name: LineItemsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,applied_vendor_credits,contact,company,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,contact,company,employee - name: LineItemsAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,applied_vendor_credits,contact,company,employee,accounting_period - name: LineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,applied_vendor_credits,contact,company,employee,payment_term - name: LineItemsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: line_items,applied_vendor_credits,contact,company,payment_term - name: LineItemsAppliedVendorCreditsContactCompanyPaymentTerm - - value: line_items,applied_vendor_credits,contact,employee - name: LineItemsAppliedVendorCreditsContactEmployee - - value: line_items,applied_vendor_credits,contact,employee,accounting_period - name: LineItemsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,contact,employee,payment_term - name: LineItemsAppliedVendorCreditsContactEmployeePaymentTerm - - value: line_items,applied_vendor_credits,contact,payment_term - name: LineItemsAppliedVendorCreditsContactPaymentTerm - - value: line_items,applied_vendor_credits,employee - name: LineItemsAppliedVendorCreditsEmployee - - value: line_items,applied_vendor_credits,employee,accounting_period - name: LineItemsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,applied_vendor_credits,employee,accounting_period,payment_term - name: LineItemsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: line_items,applied_vendor_credits,employee,payment_term - name: LineItemsAppliedVendorCreditsEmployeePaymentTerm - - value: line_items,applied_vendor_credits,payment_term - name: LineItemsAppliedVendorCreditsPaymentTerm - - value: line_items,company - name: LineItemsCompany - - value: line_items,company,accounting_period - name: LineItemsCompanyAccountingPeriod - - value: line_items,company,accounting_period,payment_term - name: LineItemsCompanyAccountingPeriodPaymentTerm - - value: line_items,company,employee - name: LineItemsCompanyEmployee - - value: line_items,company,employee,accounting_period - name: LineItemsCompanyEmployeeAccountingPeriod - - value: line_items,company,employee,accounting_period,payment_term - name: LineItemsCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,company,employee,payment_term - name: LineItemsCompanyEmployeePaymentTerm - - value: line_items,company,payment_term - name: LineItemsCompanyPaymentTerm - - value: line_items,contact - name: LineItemsContact - - value: line_items,contact,accounting_period - name: LineItemsContactAccountingPeriod - - value: line_items,contact,accounting_period,payment_term - name: LineItemsContactAccountingPeriodPaymentTerm - - value: line_items,contact,company - name: LineItemsContactCompany - - value: line_items,contact,company,accounting_period - name: LineItemsContactCompanyAccountingPeriod - - value: line_items,contact,company,accounting_period,payment_term - name: LineItemsContactCompanyAccountingPeriodPaymentTerm - - value: line_items,contact,company,employee - name: LineItemsContactCompanyEmployee - - value: line_items,contact,company,employee,accounting_period - name: LineItemsContactCompanyEmployeeAccountingPeriod - - value: line_items,contact,company,employee,accounting_period,payment_term - name: LineItemsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,contact,company,employee,payment_term - name: LineItemsContactCompanyEmployeePaymentTerm - - value: line_items,contact,company,payment_term - name: LineItemsContactCompanyPaymentTerm - - value: line_items,contact,employee - name: LineItemsContactEmployee - - value: line_items,contact,employee,accounting_period - name: LineItemsContactEmployeeAccountingPeriod - - value: line_items,contact,employee,accounting_period,payment_term - name: LineItemsContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,contact,employee,payment_term - name: LineItemsContactEmployeePaymentTerm - - value: line_items,contact,payment_term - name: LineItemsContactPaymentTerm - - value: line_items,employee - name: LineItemsEmployee - - value: line_items,employee,accounting_period - name: LineItemsEmployeeAccountingPeriod - - value: line_items,employee,accounting_period,payment_term - name: LineItemsEmployeeAccountingPeriodPaymentTerm - - value: line_items,employee,payment_term - name: LineItemsEmployeePaymentTerm - - value: line_items,payment_term - name: LineItemsPaymentTerm - - value: line_items,purchase_orders - name: LineItemsPurchaseOrders - - value: line_items,purchase_orders,accounting_period - name: LineItemsPurchaseOrdersAccountingPeriod - - value: line_items,purchase_orders,accounting_period,payment_term - name: LineItemsPurchaseOrdersAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes - name: LineItemsPurchaseOrdersAppliedCreditNotes - - value: line_items,purchase_orders,applied_credit_notes,accounting_period - name: LineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,applied_vendor_credits - name: LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,company - name: LineItemsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - line_items,purchase_orders,applied_credit_notes,company,accounting_period - name: LineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,company,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,company,employee,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,company,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,contact - name: LineItemsPurchaseOrdersAppliedCreditNotesContact - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,accounting_period - name: LineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,contact,company - name: LineItemsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,company,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,contact,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,contact,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,employee - name: LineItemsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - line_items,purchase_orders,applied_credit_notes,employee,accounting_period - name: LineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,employee,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: line_items,purchase_orders,applied_credit_notes,payment_term - name: LineItemsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits - name: LineItemsPurchaseOrdersAppliedVendorCredits - - value: line_items,purchase_orders,applied_vendor_credits,accounting_period - name: LineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,company - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,accounting_period - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,company,employee - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,company,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,contact - name: LineItemsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,accounting_period - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,contact,company - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,employee - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,contact,employee - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,contact,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,employee - name: LineItemsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - line_items,purchase_orders,applied_vendor_credits,employee,accounting_period - name: LineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,purchase_orders,applied_vendor_credits,employee,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: line_items,purchase_orders,applied_vendor_credits,payment_term - name: LineItemsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: line_items,purchase_orders,company - name: LineItemsPurchaseOrdersCompany - - value: line_items,purchase_orders,company,accounting_period - name: LineItemsPurchaseOrdersCompanyAccountingPeriod - - value: line_items,purchase_orders,company,accounting_period,payment_term - name: LineItemsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,company,employee - name: LineItemsPurchaseOrdersCompanyEmployee - - value: line_items,purchase_orders,company,employee,accounting_period - name: LineItemsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,company,employee,accounting_period,payment_term - name: LineItemsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,company,employee,payment_term - name: LineItemsPurchaseOrdersCompanyEmployeePaymentTerm - - value: line_items,purchase_orders,company,payment_term - name: LineItemsPurchaseOrdersCompanyPaymentTerm - - value: line_items,purchase_orders,contact - name: LineItemsPurchaseOrdersContact - - value: line_items,purchase_orders,contact,accounting_period - name: LineItemsPurchaseOrdersContactAccountingPeriod - - value: line_items,purchase_orders,contact,accounting_period,payment_term - name: LineItemsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,contact,company - name: LineItemsPurchaseOrdersContactCompany - - value: line_items,purchase_orders,contact,company,accounting_period - name: LineItemsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - line_items,purchase_orders,contact,company,accounting_period,payment_term - name: LineItemsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,contact,company,employee - name: LineItemsPurchaseOrdersContactCompanyEmployee - - value: line_items,purchase_orders,contact,company,employee,accounting_period - name: LineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,contact,company,employee,payment_term - name: LineItemsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: line_items,purchase_orders,contact,company,payment_term - name: LineItemsPurchaseOrdersContactCompanyPaymentTerm - - value: line_items,purchase_orders,contact,employee - name: LineItemsPurchaseOrdersContactEmployee - - value: line_items,purchase_orders,contact,employee,accounting_period - name: LineItemsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - line_items,purchase_orders,contact,employee,accounting_period,payment_term - name: LineItemsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,contact,employee,payment_term - name: LineItemsPurchaseOrdersContactEmployeePaymentTerm - - value: line_items,purchase_orders,contact,payment_term - name: LineItemsPurchaseOrdersContactPaymentTerm - - value: line_items,purchase_orders,employee - name: LineItemsPurchaseOrdersEmployee - - value: line_items,purchase_orders,employee,accounting_period - name: LineItemsPurchaseOrdersEmployeeAccountingPeriod - - value: line_items,purchase_orders,employee,accounting_period,payment_term - name: LineItemsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: line_items,purchase_orders,employee,payment_term - name: LineItemsPurchaseOrdersEmployeePaymentTerm - - value: line_items,purchase_orders,payment_term - name: LineItemsPurchaseOrdersPaymentTerm - - value: line_items,tracking_categories - name: LineItemsTrackingCategories - - value: line_items,tracking_categories,accounting_period - name: LineItemsTrackingCategoriesAccountingPeriod - - value: line_items,tracking_categories,accounting_period,payment_term - name: LineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes - name: LineItemsTrackingCategoriesAppliedCreditNotes - - value: line_items,tracking_categories,applied_credit_notes,accounting_period - name: LineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits - name: LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,company - name: LineItemsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - line_items,tracking_categories,applied_credit_notes,company,accounting_period - name: LineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,company,employee - name: LineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,company,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,contact - name: LineItemsTrackingCategoriesAppliedCreditNotesContact - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,accounting_period - name: LineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,contact,company - name: LineItemsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,employee - name: LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,company,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,contact,employee - name: LineItemsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,contact,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,employee - name: LineItemsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - line_items,tracking_categories,applied_credit_notes,employee,accounting_period - name: LineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_credit_notes,employee,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: line_items,tracking_categories,applied_credit_notes,payment_term - name: LineItemsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits - name: LineItemsTrackingCategoriesAppliedVendorCredits - - value: >- - line_items,tracking_categories,applied_vendor_credits,accounting_period - name: LineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,company - name: LineItemsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,accounting_period - name: LineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,company,employee - name: LineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,company,payment_term - name: LineItemsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,contact - name: LineItemsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,accounting_period - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,contact,company - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,employee - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,contact,employee - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,contact,payment_term - name: LineItemsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,employee - name: LineItemsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - line_items,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,applied_vendor_credits,employee,payment_term - name: LineItemsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: line_items,tracking_categories,applied_vendor_credits,payment_term - name: LineItemsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: line_items,tracking_categories,company - name: LineItemsTrackingCategoriesCompany - - value: line_items,tracking_categories,company,accounting_period - name: LineItemsTrackingCategoriesCompanyAccountingPeriod - - value: line_items,tracking_categories,company,accounting_period,payment_term - name: LineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,company,employee - name: LineItemsTrackingCategoriesCompanyEmployee - - value: line_items,tracking_categories,company,employee,accounting_period - name: LineItemsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,company,employee,accounting_period,payment_term - name: LineItemsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,company,employee,payment_term - name: LineItemsTrackingCategoriesCompanyEmployeePaymentTerm - - value: line_items,tracking_categories,company,payment_term - name: LineItemsTrackingCategoriesCompanyPaymentTerm - - value: line_items,tracking_categories,contact - name: LineItemsTrackingCategoriesContact - - value: line_items,tracking_categories,contact,accounting_period - name: LineItemsTrackingCategoriesContactAccountingPeriod - - value: line_items,tracking_categories,contact,accounting_period,payment_term - name: LineItemsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,contact,company - name: LineItemsTrackingCategoriesContactCompany - - value: line_items,tracking_categories,contact,company,accounting_period - name: LineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,contact,company,accounting_period,payment_term - name: LineItemsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,contact,company,employee - name: LineItemsTrackingCategoriesContactCompanyEmployee - - value: >- - line_items,tracking_categories,contact,company,employee,accounting_period - name: LineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,contact,company,employee,payment_term - name: LineItemsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: line_items,tracking_categories,contact,company,payment_term - name: LineItemsTrackingCategoriesContactCompanyPaymentTerm - - value: line_items,tracking_categories,contact,employee - name: LineItemsTrackingCategoriesContactEmployee - - value: line_items,tracking_categories,contact,employee,accounting_period - name: LineItemsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,contact,employee,accounting_period,payment_term - name: LineItemsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,contact,employee,payment_term - name: LineItemsTrackingCategoriesContactEmployeePaymentTerm - - value: line_items,tracking_categories,contact,payment_term - name: LineItemsTrackingCategoriesContactPaymentTerm - - value: line_items,tracking_categories,employee - name: LineItemsTrackingCategoriesEmployee - - value: line_items,tracking_categories,employee,accounting_period - name: LineItemsTrackingCategoriesEmployeeAccountingPeriod - - value: line_items,tracking_categories,employee,accounting_period,payment_term - name: LineItemsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,employee,payment_term - name: LineItemsTrackingCategoriesEmployeePaymentTerm - - value: line_items,tracking_categories,payment_term - name: LineItemsTrackingCategoriesPaymentTerm - - value: line_items,tracking_categories,purchase_orders - name: LineItemsTrackingCategoriesPurchaseOrders - - value: line_items,tracking_categories,purchase_orders,accounting_period - name: LineItemsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,accounting_period,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,purchase_orders,applied_credit_notes - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,employee - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: line_items,tracking_categories,purchase_orders,applied_vendor_credits - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: line_items,tracking_categories,purchase_orders,company - name: LineItemsTrackingCategoriesPurchaseOrdersCompany - - value: >- - line_items,tracking_categories,purchase_orders,company,accounting_period - name: LineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,purchase_orders,company,employee - name: LineItemsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,company,employee,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: line_items,tracking_categories,purchase_orders,company,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: line_items,tracking_categories,purchase_orders,contact - name: LineItemsTrackingCategoriesPurchaseOrdersContact - - value: >- - line_items,tracking_categories,purchase_orders,contact,accounting_period - name: LineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,purchase_orders,contact,company - name: LineItemsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,employee - name: LineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,contact,company,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: line_items,tracking_categories,purchase_orders,contact,employee - name: LineItemsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - line_items,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,purchase_orders,contact,employee,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: line_items,tracking_categories,purchase_orders,contact,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: line_items,tracking_categories,purchase_orders,employee - name: LineItemsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - line_items,tracking_categories,purchase_orders,employee,accounting_period - name: LineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - line_items,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,purchase_orders,employee,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: line_items,tracking_categories,purchase_orders,payment_term - name: LineItemsTrackingCategoriesPurchaseOrdersPaymentTerm - - payment_term - - payments - - value: payments,accounting_period - name: PaymentsAccountingPeriod - - value: payments,accounting_period,payment_term - name: PaymentsAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes - name: PaymentsAppliedCreditNotes - - value: payments,applied_credit_notes,accounting_period - name: PaymentsAppliedCreditNotesAccountingPeriod - - value: payments,applied_credit_notes,accounting_period,payment_term - name: PaymentsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits - name: PaymentsAppliedCreditNotesAppliedVendorCredits - - value: payments,applied_credit_notes,applied_vendor_credits,accounting_period - name: PaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,company - name: PaymentsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,company,employee - name: PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,company,payment_term - name: PaymentsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,contact - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,contact,company - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,contact,employee - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: PaymentsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,employee - name: PaymentsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: PaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: PaymentsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: payments,applied_credit_notes,applied_vendor_credits,payment_term - name: PaymentsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,applied_credit_notes,company - name: PaymentsAppliedCreditNotesCompany - - value: payments,applied_credit_notes,company,accounting_period - name: PaymentsAppliedCreditNotesCompanyAccountingPeriod - - value: payments,applied_credit_notes,company,accounting_period,payment_term - name: PaymentsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,company,employee - name: PaymentsAppliedCreditNotesCompanyEmployee - - value: payments,applied_credit_notes,company,employee,accounting_period - name: PaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,company,employee,accounting_period,payment_term - name: PaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,company,employee,payment_term - name: PaymentsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,applied_credit_notes,company,payment_term - name: PaymentsAppliedCreditNotesCompanyPaymentTerm - - value: payments,applied_credit_notes,contact - name: PaymentsAppliedCreditNotesContact - - value: payments,applied_credit_notes,contact,accounting_period - name: PaymentsAppliedCreditNotesContactAccountingPeriod - - value: payments,applied_credit_notes,contact,accounting_period,payment_term - name: PaymentsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,contact,company - name: PaymentsAppliedCreditNotesContactCompany - - value: payments,applied_credit_notes,contact,company,accounting_period - name: PaymentsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_credit_notes,contact,company,accounting_period,payment_term - name: PaymentsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,contact,company,employee - name: PaymentsAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_credit_notes,contact,company,employee,accounting_period - name: PaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,contact,company,employee,payment_term - name: PaymentsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: payments,applied_credit_notes,contact,company,payment_term - name: PaymentsAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,applied_credit_notes,contact,employee - name: PaymentsAppliedCreditNotesContactEmployee - - value: payments,applied_credit_notes,contact,employee,accounting_period - name: PaymentsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_credit_notes,contact,employee,accounting_period,payment_term - name: PaymentsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,contact,employee,payment_term - name: PaymentsAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,applied_credit_notes,contact,payment_term - name: PaymentsAppliedCreditNotesContactPaymentTerm - - value: payments,applied_credit_notes,employee - name: PaymentsAppliedCreditNotesEmployee - - value: payments,applied_credit_notes,employee,accounting_period - name: PaymentsAppliedCreditNotesEmployeeAccountingPeriod - - value: payments,applied_credit_notes,employee,accounting_period,payment_term - name: PaymentsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_credit_notes,employee,payment_term - name: PaymentsAppliedCreditNotesEmployeePaymentTerm - - value: payments,applied_credit_notes,payment_term - name: PaymentsAppliedCreditNotesPaymentTerm - - value: payments,applied_payments - name: PaymentsAppliedPayments - - value: payments,applied_payments,accounting_period - name: PaymentsAppliedPaymentsAccountingPeriod - - value: payments,applied_payments,accounting_period,payment_term - name: PaymentsAppliedPaymentsAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes - name: PaymentsAppliedPaymentsAppliedCreditNotes - - value: payments,applied_payments,applied_credit_notes,accounting_period - name: PaymentsAppliedPaymentsAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,accounting_period,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes,applied_vendor_credits - name: PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company - name: PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,applied_credit_notes,company - name: PaymentsAppliedPaymentsAppliedCreditNotesCompany - - value: >- - payments,applied_payments,applied_credit_notes,company,accounting_period - name: PaymentsAppliedPaymentsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes,company,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,company,employee,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,applied_payments,applied_credit_notes,company,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesCompanyPaymentTerm - - value: payments,applied_payments,applied_credit_notes,contact - name: PaymentsAppliedPaymentsAppliedCreditNotesContact - - value: >- - payments,applied_payments,applied_credit_notes,contact,accounting_period - name: PaymentsAppliedPaymentsAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes,contact,company - name: PaymentsAppliedPaymentsAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,contact,company,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,applied_payments,applied_credit_notes,contact,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_credit_notes,contact,employee,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,applied_payments,applied_credit_notes,contact,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesContactPaymentTerm - - value: payments,applied_payments,applied_credit_notes,employee - name: PaymentsAppliedPaymentsAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,applied_credit_notes,employee,accounting_period - name: PaymentsAppliedPaymentsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_credit_notes,employee,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesEmployeePaymentTerm - - value: payments,applied_payments,applied_credit_notes,payment_term - name: PaymentsAppliedPaymentsAppliedCreditNotesPaymentTerm - - value: payments,applied_payments,applied_vendor_credits - name: PaymentsAppliedPaymentsAppliedVendorCredits - - value: payments,applied_payments,applied_vendor_credits,accounting_period - name: PaymentsAppliedPaymentsAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,accounting_period,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,company - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,applied_vendor_credits,company,accounting_period - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,company,employee - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,company,employee,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: payments,applied_payments,applied_vendor_credits,company,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsCompanyPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsAppliedVendorCreditsContact - - value: >- - payments,applied_payments,applied_vendor_credits,contact,accounting_period - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,contact,company - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,employee - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,contact,company,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,contact,employee - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,applied_vendor_credits,contact,employee,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactEmployeePaymentTerm - - value: payments,applied_payments,applied_vendor_credits,contact,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsContactPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,applied_vendor_credits,employee,accounting_period - name: PaymentsAppliedPaymentsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,applied_vendor_credits,employee,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsEmployeePaymentTerm - - value: payments,applied_payments,applied_vendor_credits,payment_term - name: PaymentsAppliedPaymentsAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,company - name: PaymentsAppliedPaymentsCompany - - value: payments,applied_payments,company,accounting_period - name: PaymentsAppliedPaymentsCompanyAccountingPeriod - - value: payments,applied_payments,company,accounting_period,payment_term - name: PaymentsAppliedPaymentsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,company,employee - name: PaymentsAppliedPaymentsCompanyEmployee - - value: payments,applied_payments,company,employee,accounting_period - name: PaymentsAppliedPaymentsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,company,employee,accounting_period,payment_term - name: PaymentsAppliedPaymentsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,company,employee,payment_term - name: PaymentsAppliedPaymentsCompanyEmployeePaymentTerm - - value: payments,applied_payments,company,payment_term - name: PaymentsAppliedPaymentsCompanyPaymentTerm - - value: payments,applied_payments,contact - name: PaymentsAppliedPaymentsContact - - value: payments,applied_payments,contact,accounting_period - name: PaymentsAppliedPaymentsContactAccountingPeriod - - value: payments,applied_payments,contact,accounting_period,payment_term - name: PaymentsAppliedPaymentsContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,contact,company - name: PaymentsAppliedPaymentsContactCompany - - value: payments,applied_payments,contact,company,accounting_period - name: PaymentsAppliedPaymentsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,contact,company,accounting_period,payment_term - name: PaymentsAppliedPaymentsContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,contact,company,employee - name: PaymentsAppliedPaymentsContactCompanyEmployee - - value: payments,applied_payments,contact,company,employee,accounting_period - name: PaymentsAppliedPaymentsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,contact,company,employee,payment_term - name: PaymentsAppliedPaymentsContactCompanyEmployeePaymentTerm - - value: payments,applied_payments,contact,company,payment_term - name: PaymentsAppliedPaymentsContactCompanyPaymentTerm - - value: payments,applied_payments,contact,employee - name: PaymentsAppliedPaymentsContactEmployee - - value: payments,applied_payments,contact,employee,accounting_period - name: PaymentsAppliedPaymentsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,contact,employee,accounting_period,payment_term - name: PaymentsAppliedPaymentsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,contact,employee,payment_term - name: PaymentsAppliedPaymentsContactEmployeePaymentTerm - - value: payments,applied_payments,contact,payment_term - name: PaymentsAppliedPaymentsContactPaymentTerm - - value: payments,applied_payments,employee - name: PaymentsAppliedPaymentsEmployee - - value: payments,applied_payments,employee,accounting_period - name: PaymentsAppliedPaymentsEmployeeAccountingPeriod - - value: payments,applied_payments,employee,accounting_period,payment_term - name: PaymentsAppliedPaymentsEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,employee,payment_term - name: PaymentsAppliedPaymentsEmployeePaymentTerm - - value: payments,applied_payments,line_items - name: PaymentsAppliedPaymentsLineItems - - value: payments,applied_payments,line_items,accounting_period - name: PaymentsAppliedPaymentsLineItemsAccountingPeriod - - value: payments,applied_payments,line_items,accounting_period,payment_term - name: PaymentsAppliedPaymentsLineItemsAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotes - - value: >- - payments,applied_payments,line_items,applied_credit_notes,accounting_period - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes,company - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompany - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,employee - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,company,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesCompanyPaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes,contact - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContact - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,employee - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesContactPaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes,employee - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,line_items,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_credit_notes,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesEmployeePaymentTerm - - value: payments,applied_payments,line_items,applied_credit_notes,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedCreditNotesPaymentTerm - - value: payments,applied_payments,line_items,applied_vendor_credits - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,accounting_period - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,applied_vendor_credits,company - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,employee - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,company,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsCompanyPaymentTerm - - value: payments,applied_payments,line_items,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,employee - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsContactPaymentTerm - - value: payments,applied_payments,line_items,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,applied_vendor_credits,payment_term - name: PaymentsAppliedPaymentsLineItemsAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,line_items,company - name: PaymentsAppliedPaymentsLineItemsCompany - - value: payments,applied_payments,line_items,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,company,accounting_period,payment_term - name: PaymentsAppliedPaymentsLineItemsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,company,employee - name: PaymentsAppliedPaymentsLineItemsCompanyEmployee - - value: >- - payments,applied_payments,line_items,company,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,company,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsCompanyEmployeePaymentTerm - - value: payments,applied_payments,line_items,company,payment_term - name: PaymentsAppliedPaymentsLineItemsCompanyPaymentTerm - - value: payments,applied_payments,line_items,contact - name: PaymentsAppliedPaymentsLineItemsContact - - value: payments,applied_payments,line_items,contact,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,contact,accounting_period,payment_term - name: PaymentsAppliedPaymentsLineItemsContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,contact,company - name: PaymentsAppliedPaymentsLineItemsContactCompany - - value: payments,applied_payments,line_items,contact,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,contact,company,employee - name: PaymentsAppliedPaymentsLineItemsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,contact,company,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,contact,company,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsContactCompanyEmployeePaymentTerm - - value: payments,applied_payments,line_items,contact,company,payment_term - name: PaymentsAppliedPaymentsLineItemsContactCompanyPaymentTerm - - value: payments,applied_payments,line_items,contact,employee - name: PaymentsAppliedPaymentsLineItemsContactEmployee - - value: >- - payments,applied_payments,line_items,contact,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,contact,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsContactEmployeePaymentTerm - - value: payments,applied_payments,line_items,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsContactPaymentTerm - - value: payments,applied_payments,line_items,employee - name: PaymentsAppliedPaymentsLineItemsEmployee - - value: payments,applied_payments,line_items,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,employee,accounting_period,payment_term - name: PaymentsAppliedPaymentsLineItemsEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsEmployeePaymentTerm - - value: payments,applied_payments,line_items,payment_term - name: PaymentsAppliedPaymentsLineItemsPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders - name: PaymentsAppliedPaymentsLineItemsPurchaseOrders - - value: payments,applied_payments,line_items,purchase_orders,accounting_period - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotes - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_credit_notes,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,company - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,company,accounting_period - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,company,employee - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,company,payment_term - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersCompanyPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,contact - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContact - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,accounting_period - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,contact,company - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompany - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,employee - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactCompanyPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,contact,employee - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersContactPaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,employee - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersEmployee - - value: >- - payments,applied_payments,line_items,purchase_orders,employee,accounting_period - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,purchase_orders,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersEmployeePaymentTerm - - value: payments,applied_payments,line_items,purchase_orders,payment_term - name: PaymentsAppliedPaymentsLineItemsPurchaseOrdersPaymentTerm - - value: payments,applied_payments,line_items,tracking_categories - name: PaymentsAppliedPaymentsLineItemsTrackingCategories - - value: >- - payments,applied_payments,line_items,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotes - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContact - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_credit_notes,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,line_items,tracking_categories,company - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,company,employee - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,company,payment_term - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesCompanyPaymentTerm - - value: payments,applied_payments,line_items,tracking_categories,contact - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContact - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,employee - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,contact,payment_term - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesContactPaymentTerm - - value: payments,applied_payments,line_items,tracking_categories,employee - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,employee,payment_term - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesEmployeePaymentTerm - - value: payments,applied_payments,line_items,tracking_categories,payment_term - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders - name: PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrders - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContact - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,employee - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,employee,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: >- - payments,applied_payments,line_items,tracking_categories,purchase_orders,payment_term - name: >- - PaymentsAppliedPaymentsLineItemsTrackingCategoriesPurchaseOrdersPaymentTerm - - value: payments,applied_payments,payment_term - name: PaymentsAppliedPaymentsPaymentTerm - - value: payments,applied_payments,purchase_orders - name: PaymentsAppliedPaymentsPurchaseOrders - - value: payments,applied_payments,purchase_orders,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,accounting_period,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,applied_credit_notes - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotes - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,purchase_orders,applied_credit_notes,company - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,employee - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: payments,applied_payments,purchase_orders,applied_credit_notes,contact - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,employee - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_credit_notes,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: payments,applied_payments,purchase_orders,applied_vendor_credits - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCredits - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,purchase_orders,applied_vendor_credits,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,purchase_orders,company - name: PaymentsAppliedPaymentsPurchaseOrdersCompany - - value: payments,applied_payments,purchase_orders,company,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,company,employee - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,company,employee,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,company,employee,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyEmployeePaymentTerm - - value: payments,applied_payments,purchase_orders,company,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersCompanyPaymentTerm - - value: payments,applied_payments,purchase_orders,contact - name: PaymentsAppliedPaymentsPurchaseOrdersContact - - value: payments,applied_payments,purchase_orders,contact,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersContactAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,contact,company - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompany - - value: >- - payments,applied_payments,purchase_orders,contact,company,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,contact,company,employee - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompanyEmployee - - value: >- - payments,applied_payments,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,contact,company,employee,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: payments,applied_payments,purchase_orders,contact,company,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersContactCompanyPaymentTerm - - value: payments,applied_payments,purchase_orders,contact,employee - name: PaymentsAppliedPaymentsPurchaseOrdersContactEmployee - - value: >- - payments,applied_payments,purchase_orders,contact,employee,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,purchase_orders,contact,employee,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersContactEmployeePaymentTerm - - value: payments,applied_payments,purchase_orders,contact,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersContactPaymentTerm - - value: payments,applied_payments,purchase_orders,employee - name: PaymentsAppliedPaymentsPurchaseOrdersEmployee - - value: payments,applied_payments,purchase_orders,employee,accounting_period - name: PaymentsAppliedPaymentsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,applied_payments,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,purchase_orders,employee,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersEmployeePaymentTerm - - value: payments,applied_payments,purchase_orders,payment_term - name: PaymentsAppliedPaymentsPurchaseOrdersPaymentTerm - - value: payments,applied_payments,tracking_categories - name: PaymentsAppliedPaymentsTrackingCategories - - value: payments,applied_payments,tracking_categories,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,accounting_period,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,applied_credit_notes - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotes - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContact - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,employee - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_credit_notes,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: payments,applied_payments,tracking_categories,applied_vendor_credits - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCredits - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,employee - name: PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,tracking_categories,company - name: PaymentsAppliedPaymentsTrackingCategoriesCompany - - value: >- - payments,applied_payments,tracking_categories,company,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,company,employee - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,company,employee,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyEmployeePaymentTerm - - value: payments,applied_payments,tracking_categories,company,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesCompanyPaymentTerm - - value: payments,applied_payments,tracking_categories,contact - name: PaymentsAppliedPaymentsTrackingCategoriesContact - - value: >- - payments,applied_payments,tracking_categories,contact,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,contact,company - name: PaymentsAppliedPaymentsTrackingCategoriesContactCompany - - value: >- - payments,applied_payments,tracking_categories,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,contact,company,employee - name: PaymentsAppliedPaymentsTrackingCategoriesContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,contact,company,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesContactCompanyPaymentTerm - - value: payments,applied_payments,tracking_categories,contact,employee - name: PaymentsAppliedPaymentsTrackingCategoriesContactEmployee - - value: >- - payments,applied_payments,tracking_categories,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,contact,employee,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesContactEmployeePaymentTerm - - value: payments,applied_payments,tracking_categories,contact,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesContactPaymentTerm - - value: payments,applied_payments,tracking_categories,employee - name: PaymentsAppliedPaymentsTrackingCategoriesEmployee - - value: >- - payments,applied_payments,tracking_categories,employee,accounting_period - name: PaymentsAppliedPaymentsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_payments,tracking_categories,employee,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesEmployeePaymentTerm - - value: payments,applied_payments,tracking_categories,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesPaymentTerm - - value: payments,applied_payments,tracking_categories,purchase_orders - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrders - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,applied_payments,tracking_categories,purchase_orders,company - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,employee - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: payments,applied_payments,tracking_categories,purchase_orders,contact - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContact - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,employee - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,contact,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: payments,applied_payments,tracking_categories,purchase_orders,employee - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,employee,accounting_period - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,employee,payment_term - name: >- - PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: >- - payments,applied_payments,tracking_categories,purchase_orders,payment_term - name: PaymentsAppliedPaymentsTrackingCategoriesPurchaseOrdersPaymentTerm - - value: payments,applied_vendor_credits - name: PaymentsAppliedVendorCredits - - value: payments,applied_vendor_credits,accounting_period - name: PaymentsAppliedVendorCreditsAccountingPeriod - - value: payments,applied_vendor_credits,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,company - name: PaymentsAppliedVendorCreditsCompany - - value: payments,applied_vendor_credits,company,accounting_period - name: PaymentsAppliedVendorCreditsCompanyAccountingPeriod - - value: payments,applied_vendor_credits,company,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,company,employee - name: PaymentsAppliedVendorCreditsCompanyEmployee - - value: payments,applied_vendor_credits,company,employee,accounting_period - name: PaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_vendor_credits,company,employee,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,company,employee,payment_term - name: PaymentsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: payments,applied_vendor_credits,company,payment_term - name: PaymentsAppliedVendorCreditsCompanyPaymentTerm - - value: payments,applied_vendor_credits,contact - name: PaymentsAppliedVendorCreditsContact - - value: payments,applied_vendor_credits,contact,accounting_period - name: PaymentsAppliedVendorCreditsContactAccountingPeriod - - value: payments,applied_vendor_credits,contact,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,contact,company - name: PaymentsAppliedVendorCreditsContactCompany - - value: payments,applied_vendor_credits,contact,company,accounting_period - name: PaymentsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,applied_vendor_credits,contact,company,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,contact,company,employee - name: PaymentsAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,applied_vendor_credits,contact,company,employee,accounting_period - name: PaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,contact,company,employee,payment_term - name: PaymentsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: payments,applied_vendor_credits,contact,company,payment_term - name: PaymentsAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,applied_vendor_credits,contact,employee - name: PaymentsAppliedVendorCreditsContactEmployee - - value: payments,applied_vendor_credits,contact,employee,accounting_period - name: PaymentsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,contact,employee,payment_term - name: PaymentsAppliedVendorCreditsContactEmployeePaymentTerm - - value: payments,applied_vendor_credits,contact,payment_term - name: PaymentsAppliedVendorCreditsContactPaymentTerm - - value: payments,applied_vendor_credits,employee - name: PaymentsAppliedVendorCreditsEmployee - - value: payments,applied_vendor_credits,employee,accounting_period - name: PaymentsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,applied_vendor_credits,employee,accounting_period,payment_term - name: PaymentsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: payments,applied_vendor_credits,employee,payment_term - name: PaymentsAppliedVendorCreditsEmployeePaymentTerm - - value: payments,applied_vendor_credits,payment_term - name: PaymentsAppliedVendorCreditsPaymentTerm - - value: payments,company - name: PaymentsCompany - - value: payments,company,accounting_period - name: PaymentsCompanyAccountingPeriod - - value: payments,company,accounting_period,payment_term - name: PaymentsCompanyAccountingPeriodPaymentTerm - - value: payments,company,employee - name: PaymentsCompanyEmployee - - value: payments,company,employee,accounting_period - name: PaymentsCompanyEmployeeAccountingPeriod - - value: payments,company,employee,accounting_period,payment_term - name: PaymentsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,company,employee,payment_term - name: PaymentsCompanyEmployeePaymentTerm - - value: payments,company,payment_term - name: PaymentsCompanyPaymentTerm - - value: payments,contact - name: PaymentsContact - - value: payments,contact,accounting_period - name: PaymentsContactAccountingPeriod - - value: payments,contact,accounting_period,payment_term - name: PaymentsContactAccountingPeriodPaymentTerm - - value: payments,contact,company - name: PaymentsContactCompany - - value: payments,contact,company,accounting_period - name: PaymentsContactCompanyAccountingPeriod - - value: payments,contact,company,accounting_period,payment_term - name: PaymentsContactCompanyAccountingPeriodPaymentTerm - - value: payments,contact,company,employee - name: PaymentsContactCompanyEmployee - - value: payments,contact,company,employee,accounting_period - name: PaymentsContactCompanyEmployeeAccountingPeriod - - value: payments,contact,company,employee,accounting_period,payment_term - name: PaymentsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,contact,company,employee,payment_term - name: PaymentsContactCompanyEmployeePaymentTerm - - value: payments,contact,company,payment_term - name: PaymentsContactCompanyPaymentTerm - - value: payments,contact,employee - name: PaymentsContactEmployee - - value: payments,contact,employee,accounting_period - name: PaymentsContactEmployeeAccountingPeriod - - value: payments,contact,employee,accounting_period,payment_term - name: PaymentsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,contact,employee,payment_term - name: PaymentsContactEmployeePaymentTerm - - value: payments,contact,payment_term - name: PaymentsContactPaymentTerm - - value: payments,employee - name: PaymentsEmployee - - value: payments,employee,accounting_period - name: PaymentsEmployeeAccountingPeriod - - value: payments,employee,accounting_period,payment_term - name: PaymentsEmployeeAccountingPeriodPaymentTerm - - value: payments,employee,payment_term - name: PaymentsEmployeePaymentTerm - - value: payments,line_items - name: PaymentsLineItems - - value: payments,line_items,accounting_period - name: PaymentsLineItemsAccountingPeriod - - value: payments,line_items,accounting_period,payment_term - name: PaymentsLineItemsAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes - name: PaymentsLineItemsAppliedCreditNotes - - value: payments,line_items,applied_credit_notes,accounting_period - name: PaymentsLineItemsAppliedCreditNotesAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,accounting_period,payment_term - name: PaymentsLineItemsAppliedCreditNotesAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,applied_vendor_credits - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,employee - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,applied_credit_notes,applied_vendor_credits,payment_term - name: PaymentsLineItemsAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,line_items,applied_credit_notes,company - name: PaymentsLineItemsAppliedCreditNotesCompany - - value: payments,line_items,applied_credit_notes,company,accounting_period - name: PaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,company,accounting_period,payment_term - name: PaymentsLineItemsAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,company,employee - name: PaymentsLineItemsAppliedCreditNotesCompanyEmployee - - value: >- - payments,line_items,applied_credit_notes,company,employee,accounting_period - name: PaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,company,employee,payment_term - name: PaymentsLineItemsAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,line_items,applied_credit_notes,company,payment_term - name: PaymentsLineItemsAppliedCreditNotesCompanyPaymentTerm - - value: payments,line_items,applied_credit_notes,contact - name: PaymentsLineItemsAppliedCreditNotesContact - - value: payments,line_items,applied_credit_notes,contact,accounting_period - name: PaymentsLineItemsAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,contact,accounting_period,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,contact,company - name: PaymentsLineItemsAppliedCreditNotesContactCompany - - value: >- - payments,line_items,applied_credit_notes,contact,company,accounting_period - name: PaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,contact,company,employee - name: PaymentsLineItemsAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,line_items,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_credit_notes,contact,company,employee,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: payments,line_items,applied_credit_notes,contact,company,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,line_items,applied_credit_notes,contact,employee - name: PaymentsLineItemsAppliedCreditNotesContactEmployee - - value: >- - payments,line_items,applied_credit_notes,contact,employee,accounting_period - name: PaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,contact,employee,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,line_items,applied_credit_notes,contact,payment_term - name: PaymentsLineItemsAppliedCreditNotesContactPaymentTerm - - value: payments,line_items,applied_credit_notes,employee - name: PaymentsLineItemsAppliedCreditNotesEmployee - - value: payments,line_items,applied_credit_notes,employee,accounting_period - name: PaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_credit_notes,employee,accounting_period,payment_term - name: PaymentsLineItemsAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,applied_credit_notes,employee,payment_term - name: PaymentsLineItemsAppliedCreditNotesEmployeePaymentTerm - - value: payments,line_items,applied_credit_notes,payment_term - name: PaymentsLineItemsAppliedCreditNotesPaymentTerm - - value: payments,line_items,applied_vendor_credits - name: PaymentsLineItemsAppliedVendorCredits - - value: payments,line_items,applied_vendor_credits,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,accounting_period,payment_term - name: PaymentsLineItemsAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,company - name: PaymentsLineItemsAppliedVendorCreditsCompany - - value: payments,line_items,applied_vendor_credits,company,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,company,employee - name: PaymentsLineItemsAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,applied_vendor_credits,company,employee,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_vendor_credits,company,employee,payment_term - name: PaymentsLineItemsAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: payments,line_items,applied_vendor_credits,company,payment_term - name: PaymentsLineItemsAppliedVendorCreditsCompanyPaymentTerm - - value: payments,line_items,applied_vendor_credits,contact - name: PaymentsLineItemsAppliedVendorCreditsContact - - value: payments,line_items,applied_vendor_credits,contact,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,contact,company - name: PaymentsLineItemsAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,applied_vendor_credits,contact,company,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,contact,company,employee - name: PaymentsLineItemsAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_vendor_credits,contact,company,employee,payment_term - name: PaymentsLineItemsAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,applied_vendor_credits,contact,company,payment_term - name: PaymentsLineItemsAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,line_items,applied_vendor_credits,contact,employee - name: PaymentsLineItemsAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,applied_vendor_credits,contact,employee,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,applied_vendor_credits,contact,employee,payment_term - name: PaymentsLineItemsAppliedVendorCreditsContactEmployeePaymentTerm - - value: payments,line_items,applied_vendor_credits,contact,payment_term - name: PaymentsLineItemsAppliedVendorCreditsContactPaymentTerm - - value: payments,line_items,applied_vendor_credits,employee - name: PaymentsLineItemsAppliedVendorCreditsEmployee - - value: payments,line_items,applied_vendor_credits,employee,accounting_period - name: PaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,applied_vendor_credits,employee,payment_term - name: PaymentsLineItemsAppliedVendorCreditsEmployeePaymentTerm - - value: payments,line_items,applied_vendor_credits,payment_term - name: PaymentsLineItemsAppliedVendorCreditsPaymentTerm - - value: payments,line_items,company - name: PaymentsLineItemsCompany - - value: payments,line_items,company,accounting_period - name: PaymentsLineItemsCompanyAccountingPeriod - - value: payments,line_items,company,accounting_period,payment_term - name: PaymentsLineItemsCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,company,employee - name: PaymentsLineItemsCompanyEmployee - - value: payments,line_items,company,employee,accounting_period - name: PaymentsLineItemsCompanyEmployeeAccountingPeriod - - value: payments,line_items,company,employee,accounting_period,payment_term - name: PaymentsLineItemsCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,company,employee,payment_term - name: PaymentsLineItemsCompanyEmployeePaymentTerm - - value: payments,line_items,company,payment_term - name: PaymentsLineItemsCompanyPaymentTerm - - value: payments,line_items,contact - name: PaymentsLineItemsContact - - value: payments,line_items,contact,accounting_period - name: PaymentsLineItemsContactAccountingPeriod - - value: payments,line_items,contact,accounting_period,payment_term - name: PaymentsLineItemsContactAccountingPeriodPaymentTerm - - value: payments,line_items,contact,company - name: PaymentsLineItemsContactCompany - - value: payments,line_items,contact,company,accounting_period - name: PaymentsLineItemsContactCompanyAccountingPeriod - - value: payments,line_items,contact,company,accounting_period,payment_term - name: PaymentsLineItemsContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,contact,company,employee - name: PaymentsLineItemsContactCompanyEmployee - - value: payments,line_items,contact,company,employee,accounting_period - name: PaymentsLineItemsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,contact,company,employee,accounting_period,payment_term - name: PaymentsLineItemsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,contact,company,employee,payment_term - name: PaymentsLineItemsContactCompanyEmployeePaymentTerm - - value: payments,line_items,contact,company,payment_term - name: PaymentsLineItemsContactCompanyPaymentTerm - - value: payments,line_items,contact,employee - name: PaymentsLineItemsContactEmployee - - value: payments,line_items,contact,employee,accounting_period - name: PaymentsLineItemsContactEmployeeAccountingPeriod - - value: payments,line_items,contact,employee,accounting_period,payment_term - name: PaymentsLineItemsContactEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,contact,employee,payment_term - name: PaymentsLineItemsContactEmployeePaymentTerm - - value: payments,line_items,contact,payment_term - name: PaymentsLineItemsContactPaymentTerm - - value: payments,line_items,employee - name: PaymentsLineItemsEmployee - - value: payments,line_items,employee,accounting_period - name: PaymentsLineItemsEmployeeAccountingPeriod - - value: payments,line_items,employee,accounting_period,payment_term - name: PaymentsLineItemsEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,employee,payment_term - name: PaymentsLineItemsEmployeePaymentTerm - - value: payments,line_items,payment_term - name: PaymentsLineItemsPaymentTerm - - value: payments,line_items,purchase_orders - name: PaymentsLineItemsPurchaseOrders - - value: payments,line_items,purchase_orders,accounting_period - name: PaymentsLineItemsPurchaseOrdersAccountingPeriod - - value: payments,line_items,purchase_orders,accounting_period,payment_term - name: PaymentsLineItemsPurchaseOrdersAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotes - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,accounting_period - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes,company - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,employee - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,company,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes,contact - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,employee - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,contact,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes,employee - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_credit_notes,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: payments,line_items,purchase_orders,applied_credit_notes,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: payments,line_items,purchase_orders,applied_vendor_credits - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCredits - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,accounting_period - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,applied_vendor_credits,company - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,employee - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,company,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: payments,line_items,purchase_orders,applied_vendor_credits,contact - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,employee - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,contact,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: payments,line_items,purchase_orders,applied_vendor_credits,employee - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,purchase_orders,applied_vendor_credits,payment_term - name: PaymentsLineItemsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,line_items,purchase_orders,company - name: PaymentsLineItemsPurchaseOrdersCompany - - value: payments,line_items,purchase_orders,company,accounting_period - name: PaymentsLineItemsPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,company,accounting_period,payment_term - name: PaymentsLineItemsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,company,employee - name: PaymentsLineItemsPurchaseOrdersCompanyEmployee - - value: payments,line_items,purchase_orders,company,employee,accounting_period - name: PaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,company,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersCompanyEmployeePaymentTerm - - value: payments,line_items,purchase_orders,company,payment_term - name: PaymentsLineItemsPurchaseOrdersCompanyPaymentTerm - - value: payments,line_items,purchase_orders,contact - name: PaymentsLineItemsPurchaseOrdersContact - - value: payments,line_items,purchase_orders,contact,accounting_period - name: PaymentsLineItemsPurchaseOrdersContactAccountingPeriod - - value: >- - payments,line_items,purchase_orders,contact,accounting_period,payment_term - name: PaymentsLineItemsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,contact,company - name: PaymentsLineItemsPurchaseOrdersContactCompany - - value: payments,line_items,purchase_orders,contact,company,accounting_period - name: PaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,line_items,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,contact,company,employee - name: PaymentsLineItemsPurchaseOrdersContactCompanyEmployee - - value: >- - payments,line_items,purchase_orders,contact,company,employee,accounting_period - name: PaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,purchase_orders,contact,company,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: payments,line_items,purchase_orders,contact,company,payment_term - name: PaymentsLineItemsPurchaseOrdersContactCompanyPaymentTerm - - value: payments,line_items,purchase_orders,contact,employee - name: PaymentsLineItemsPurchaseOrdersContactEmployee - - value: payments,line_items,purchase_orders,contact,employee,accounting_period - name: PaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,contact,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersContactEmployeePaymentTerm - - value: payments,line_items,purchase_orders,contact,payment_term - name: PaymentsLineItemsPurchaseOrdersContactPaymentTerm - - value: payments,line_items,purchase_orders,employee - name: PaymentsLineItemsPurchaseOrdersEmployee - - value: payments,line_items,purchase_orders,employee,accounting_period - name: PaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,line_items,purchase_orders,employee,accounting_period,payment_term - name: PaymentsLineItemsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,purchase_orders,employee,payment_term - name: PaymentsLineItemsPurchaseOrdersEmployeePaymentTerm - - value: payments,line_items,purchase_orders,payment_term - name: PaymentsLineItemsPurchaseOrdersPaymentTerm - - value: payments,line_items,tracking_categories - name: PaymentsLineItemsTrackingCategories - - value: payments,line_items,tracking_categories,accounting_period - name: PaymentsLineItemsTrackingCategoriesAccountingPeriod - - value: payments,line_items,tracking_categories,accounting_period,payment_term - name: PaymentsLineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,applied_credit_notes - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotes - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,accounting_period - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,line_items,tracking_categories,applied_credit_notes,company - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,employee - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: payments,line_items,tracking_categories,applied_credit_notes,contact - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContact - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,employee - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: payments,line_items,tracking_categories,applied_credit_notes,employee - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_credit_notes,payment_term - name: PaymentsLineItemsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: payments,line_items,tracking_categories,applied_vendor_credits - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCredits - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,applied_vendor_credits,company - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,employee - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: payments,line_items,tracking_categories,applied_vendor_credits,contact - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,employee - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,employee - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,applied_vendor_credits,payment_term - name: PaymentsLineItemsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: payments,line_items,tracking_categories,company - name: PaymentsLineItemsTrackingCategoriesCompany - - value: payments,line_items,tracking_categories,company,accounting_period - name: PaymentsLineItemsTrackingCategoriesCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,company,accounting_period,payment_term - name: PaymentsLineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,company,employee - name: PaymentsLineItemsTrackingCategoriesCompanyEmployee - - value: >- - payments,line_items,tracking_categories,company,employee,accounting_period - name: PaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,company,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesCompanyEmployeePaymentTerm - - value: payments,line_items,tracking_categories,company,payment_term - name: PaymentsLineItemsTrackingCategoriesCompanyPaymentTerm - - value: payments,line_items,tracking_categories,contact - name: PaymentsLineItemsTrackingCategoriesContact - - value: payments,line_items,tracking_categories,contact,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,contact,accounting_period,payment_term - name: PaymentsLineItemsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,contact,company - name: PaymentsLineItemsTrackingCategoriesContactCompany - - value: >- - payments,line_items,tracking_categories,contact,company,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,contact,company,employee - name: PaymentsLineItemsTrackingCategoriesContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,contact,company,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: payments,line_items,tracking_categories,contact,company,payment_term - name: PaymentsLineItemsTrackingCategoriesContactCompanyPaymentTerm - - value: payments,line_items,tracking_categories,contact,employee - name: PaymentsLineItemsTrackingCategoriesContactEmployee - - value: >- - payments,line_items,tracking_categories,contact,employee,accounting_period - name: PaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,contact,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesContactEmployeePaymentTerm - - value: payments,line_items,tracking_categories,contact,payment_term - name: PaymentsLineItemsTrackingCategoriesContactPaymentTerm - - value: payments,line_items,tracking_categories,employee - name: PaymentsLineItemsTrackingCategoriesEmployee - - value: payments,line_items,tracking_categories,employee,accounting_period - name: PaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,employee,accounting_period,payment_term - name: PaymentsLineItemsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: payments,line_items,tracking_categories,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesEmployeePaymentTerm - - value: payments,line_items,tracking_categories,payment_term - name: PaymentsLineItemsTrackingCategoriesPaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders - name: PaymentsLineItemsTrackingCategoriesPurchaseOrders - - value: >- - payments,line_items,tracking_categories,purchase_orders,accounting_period - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders,company - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,employee - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,company,payment_term - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders,contact - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersContact - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,employee - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,company,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,employee - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,employee,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,contact,payment_term - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders,employee - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - payments,line_items,tracking_categories,purchase_orders,employee,accounting_period - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,line_items,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,line_items,tracking_categories,purchase_orders,employee,payment_term - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: payments,line_items,tracking_categories,purchase_orders,payment_term - name: PaymentsLineItemsTrackingCategoriesPurchaseOrdersPaymentTerm - - value: payments,payment_term - name: PaymentsPaymentTerm - - value: payments,purchase_orders - name: PaymentsPurchaseOrders - - value: payments,purchase_orders,accounting_period - name: PaymentsPurchaseOrdersAccountingPeriod - - value: payments,purchase_orders,accounting_period,payment_term - name: PaymentsPurchaseOrdersAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes - name: PaymentsPurchaseOrdersAppliedCreditNotes - - value: payments,purchase_orders,applied_credit_notes,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,applied_vendor_credits - name: PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,company - name: PaymentsPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,purchase_orders,applied_credit_notes,company,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,company,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,company,employee,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,purchase_orders,applied_credit_notes,company,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact - name: PaymentsPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,purchase_orders,applied_credit_notes,contact,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact,company - name: PaymentsPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact,company,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,contact,company,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,purchase_orders,applied_credit_notes,contact,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,employee - name: PaymentsPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,purchase_orders,applied_credit_notes,employee,accounting_period - name: PaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_credit_notes,employee,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: payments,purchase_orders,applied_credit_notes,payment_term - name: PaymentsPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits - name: PaymentsPurchaseOrdersAppliedVendorCredits - - value: payments,purchase_orders,applied_vendor_credits,accounting_period - name: PaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,company - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,purchase_orders,applied_vendor_credits,company,accounting_period - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,company,employee - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,company,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,contact - name: PaymentsPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,accounting_period - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,contact,company - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,employee - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,contact,employee - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,contact,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,employee - name: PaymentsPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,purchase_orders,applied_vendor_credits,employee,accounting_period - name: PaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,employee,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: payments,purchase_orders,applied_vendor_credits,payment_term - name: PaymentsPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,purchase_orders,company - name: PaymentsPurchaseOrdersCompany - - value: payments,purchase_orders,company,accounting_period - name: PaymentsPurchaseOrdersCompanyAccountingPeriod - - value: payments,purchase_orders,company,accounting_period,payment_term - name: PaymentsPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,company,employee - name: PaymentsPurchaseOrdersCompanyEmployee - - value: payments,purchase_orders,company,employee,accounting_period - name: PaymentsPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,company,employee,accounting_period,payment_term - name: PaymentsPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,company,employee,payment_term - name: PaymentsPurchaseOrdersCompanyEmployeePaymentTerm - - value: payments,purchase_orders,company,payment_term - name: PaymentsPurchaseOrdersCompanyPaymentTerm - - value: payments,purchase_orders,contact - name: PaymentsPurchaseOrdersContact - - value: payments,purchase_orders,contact,accounting_period - name: PaymentsPurchaseOrdersContactAccountingPeriod - - value: payments,purchase_orders,contact,accounting_period,payment_term - name: PaymentsPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,purchase_orders,contact,company - name: PaymentsPurchaseOrdersContactCompany - - value: payments,purchase_orders,contact,company,accounting_period - name: PaymentsPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,purchase_orders,contact,company,accounting_period,payment_term - name: PaymentsPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: payments,purchase_orders,contact,company,employee - name: PaymentsPurchaseOrdersContactCompanyEmployee - - value: payments,purchase_orders,contact,company,employee,accounting_period - name: PaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,contact,company,employee,payment_term - name: PaymentsPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: payments,purchase_orders,contact,company,payment_term - name: PaymentsPurchaseOrdersContactCompanyPaymentTerm - - value: payments,purchase_orders,contact,employee - name: PaymentsPurchaseOrdersContactEmployee - - value: payments,purchase_orders,contact,employee,accounting_period - name: PaymentsPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,purchase_orders,contact,employee,accounting_period,payment_term - name: PaymentsPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,contact,employee,payment_term - name: PaymentsPurchaseOrdersContactEmployeePaymentTerm - - value: payments,purchase_orders,contact,payment_term - name: PaymentsPurchaseOrdersContactPaymentTerm - - value: payments,purchase_orders,employee - name: PaymentsPurchaseOrdersEmployee - - value: payments,purchase_orders,employee,accounting_period - name: PaymentsPurchaseOrdersEmployeeAccountingPeriod - - value: payments,purchase_orders,employee,accounting_period,payment_term - name: PaymentsPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: payments,purchase_orders,employee,payment_term - name: PaymentsPurchaseOrdersEmployeePaymentTerm - - value: payments,purchase_orders,payment_term - name: PaymentsPurchaseOrdersPaymentTerm - - value: payments,tracking_categories - name: PaymentsTrackingCategories - - value: payments,tracking_categories,accounting_period - name: PaymentsTrackingCategoriesAccountingPeriod - - value: payments,tracking_categories,accounting_period,payment_term - name: PaymentsTrackingCategoriesAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_credit_notes - name: PaymentsTrackingCategoriesAppliedCreditNotes - - value: payments,tracking_categories,applied_credit_notes,accounting_period - name: PaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits - name: PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,company - name: PaymentsTrackingCategoriesAppliedCreditNotesCompany - - value: >- - payments,tracking_categories,applied_credit_notes,company,accounting_period - name: PaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,company,employee - name: PaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,company,employee,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: payments,tracking_categories,applied_credit_notes,company,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,contact - name: PaymentsTrackingCategoriesAppliedCreditNotesContact - - value: >- - payments,tracking_categories,applied_credit_notes,contact,accounting_period - name: PaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,contact,company - name: PaymentsTrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,employee - name: PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,contact,company,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,contact,employee - name: PaymentsTrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,contact,employee,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: payments,tracking_categories,applied_credit_notes,contact,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: payments,tracking_categories,applied_credit_notes,employee - name: PaymentsTrackingCategoriesAppliedCreditNotesEmployee - - value: >- - payments,tracking_categories,applied_credit_notes,employee,accounting_period - name: PaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_credit_notes,employee,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: payments,tracking_categories,applied_credit_notes,payment_term - name: PaymentsTrackingCategoriesAppliedCreditNotesPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits - name: PaymentsTrackingCategoriesAppliedVendorCredits - - value: payments,tracking_categories,applied_vendor_credits,accounting_period - name: PaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,company - name: PaymentsTrackingCategoriesAppliedVendorCreditsCompany - - value: >- - payments,tracking_categories,applied_vendor_credits,company,accounting_period - name: PaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,company,employee - name: PaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,company,payment_term - name: PaymentsTrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,contact - name: PaymentsTrackingCategoriesAppliedVendorCreditsContact - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,accounting_period - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,contact,company - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,employee - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,contact,employee - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,contact,payment_term - name: PaymentsTrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,employee - name: PaymentsTrackingCategoriesAppliedVendorCreditsEmployee - - value: >- - payments,tracking_categories,applied_vendor_credits,employee,accounting_period - name: PaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,applied_vendor_credits,employee,payment_term - name: PaymentsTrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: payments,tracking_categories,applied_vendor_credits,payment_term - name: PaymentsTrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: payments,tracking_categories,company - name: PaymentsTrackingCategoriesCompany - - value: payments,tracking_categories,company,accounting_period - name: PaymentsTrackingCategoriesCompanyAccountingPeriod - - value: payments,tracking_categories,company,accounting_period,payment_term - name: PaymentsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,company,employee - name: PaymentsTrackingCategoriesCompanyEmployee - - value: payments,tracking_categories,company,employee,accounting_period - name: PaymentsTrackingCategoriesCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,company,employee,accounting_period,payment_term - name: PaymentsTrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,company,employee,payment_term - name: PaymentsTrackingCategoriesCompanyEmployeePaymentTerm - - value: payments,tracking_categories,company,payment_term - name: PaymentsTrackingCategoriesCompanyPaymentTerm - - value: payments,tracking_categories,contact - name: PaymentsTrackingCategoriesContact - - value: payments,tracking_categories,contact,accounting_period - name: PaymentsTrackingCategoriesContactAccountingPeriod - - value: payments,tracking_categories,contact,accounting_period,payment_term - name: PaymentsTrackingCategoriesContactAccountingPeriodPaymentTerm - - value: payments,tracking_categories,contact,company - name: PaymentsTrackingCategoriesContactCompany - - value: payments,tracking_categories,contact,company,accounting_period - name: PaymentsTrackingCategoriesContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,contact,company,accounting_period,payment_term - name: PaymentsTrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,contact,company,employee - name: PaymentsTrackingCategoriesContactCompanyEmployee - - value: >- - payments,tracking_categories,contact,company,employee,accounting_period - name: PaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,contact,company,employee,payment_term - name: PaymentsTrackingCategoriesContactCompanyEmployeePaymentTerm - - value: payments,tracking_categories,contact,company,payment_term - name: PaymentsTrackingCategoriesContactCompanyPaymentTerm - - value: payments,tracking_categories,contact,employee - name: PaymentsTrackingCategoriesContactEmployee - - value: payments,tracking_categories,contact,employee,accounting_period - name: PaymentsTrackingCategoriesContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,contact,employee,accounting_period,payment_term - name: PaymentsTrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,contact,employee,payment_term - name: PaymentsTrackingCategoriesContactEmployeePaymentTerm - - value: payments,tracking_categories,contact,payment_term - name: PaymentsTrackingCategoriesContactPaymentTerm - - value: payments,tracking_categories,employee - name: PaymentsTrackingCategoriesEmployee - - value: payments,tracking_categories,employee,accounting_period - name: PaymentsTrackingCategoriesEmployeeAccountingPeriod - - value: payments,tracking_categories,employee,accounting_period,payment_term - name: PaymentsTrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,employee,payment_term - name: PaymentsTrackingCategoriesEmployeePaymentTerm - - value: payments,tracking_categories,payment_term - name: PaymentsTrackingCategoriesPaymentTerm - - value: payments,tracking_categories,purchase_orders - name: PaymentsTrackingCategoriesPurchaseOrders - - value: payments,tracking_categories,purchase_orders,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,accounting_period,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,applied_credit_notes - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,employee - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: payments,tracking_categories,purchase_orders,applied_vendor_credits - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,employee - name: PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: payments,tracking_categories,purchase_orders,company - name: PaymentsTrackingCategoriesPurchaseOrdersCompany - - value: payments,tracking_categories,purchase_orders,company,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,company,employee - name: PaymentsTrackingCategoriesPurchaseOrdersCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,company,employee,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: payments,tracking_categories,purchase_orders,company,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: payments,tracking_categories,purchase_orders,contact - name: PaymentsTrackingCategoriesPurchaseOrdersContact - - value: payments,tracking_categories,purchase_orders,contact,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,contact,company - name: PaymentsTrackingCategoriesPurchaseOrdersContactCompany - - value: >- - payments,tracking_categories,purchase_orders,contact,company,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,contact,company,employee - name: PaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,contact,company,employee,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,contact,company,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: payments,tracking_categories,purchase_orders,contact,employee - name: PaymentsTrackingCategoriesPurchaseOrdersContactEmployee - - value: >- - payments,tracking_categories,purchase_orders,contact,employee,accounting_period - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: >- - payments,tracking_categories,purchase_orders,contact,employee,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: payments,tracking_categories,purchase_orders,contact,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: payments,tracking_categories,purchase_orders,employee - name: PaymentsTrackingCategoriesPurchaseOrdersEmployee - - value: >- - payments,tracking_categories,purchase_orders,employee,accounting_period - name: PaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - payments,tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: >- - PaymentsTrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: payments,tracking_categories,purchase_orders,employee,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: payments,tracking_categories,purchase_orders,payment_term - name: PaymentsTrackingCategoriesPurchaseOrdersPaymentTerm - - purchase_orders - - value: purchase_orders,accounting_period - name: PurchaseOrdersAccountingPeriod - - value: purchase_orders,accounting_period,payment_term - name: PurchaseOrdersAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes - name: PurchaseOrdersAppliedCreditNotes - - value: purchase_orders,applied_credit_notes,accounting_period - name: PurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: purchase_orders,applied_credit_notes,accounting_period,payment_term - name: PurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,applied_vendor_credits - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: PurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: purchase_orders,applied_credit_notes,company - name: PurchaseOrdersAppliedCreditNotesCompany - - value: purchase_orders,applied_credit_notes,company,accounting_period - name: PurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: PurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,company,employee - name: PurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - purchase_orders,applied_credit_notes,company,employee,accounting_period - name: PurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,company,employee,payment_term - name: PurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: purchase_orders,applied_credit_notes,company,payment_term - name: PurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: purchase_orders,applied_credit_notes,contact - name: PurchaseOrdersAppliedCreditNotesContact - - value: purchase_orders,applied_credit_notes,contact,accounting_period - name: PurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: PurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,contact,company - name: PurchaseOrdersAppliedCreditNotesContactCompany - - value: purchase_orders,applied_credit_notes,contact,company,accounting_period - name: PurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,contact,company,employee - name: PurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: PurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: PurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: purchase_orders,applied_credit_notes,contact,company,payment_term - name: PurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: purchase_orders,applied_credit_notes,contact,employee - name: PurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: PurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,contact,employee,payment_term - name: PurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: purchase_orders,applied_credit_notes,contact,payment_term - name: PurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: purchase_orders,applied_credit_notes,employee - name: PurchaseOrdersAppliedCreditNotesEmployee - - value: purchase_orders,applied_credit_notes,employee,accounting_period - name: PurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: PurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_credit_notes,employee,payment_term - name: PurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: purchase_orders,applied_credit_notes,payment_term - name: PurchaseOrdersAppliedCreditNotesPaymentTerm - - value: purchase_orders,applied_vendor_credits - name: PurchaseOrdersAppliedVendorCredits - - value: purchase_orders,applied_vendor_credits,accounting_period - name: PurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: PurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,company - name: PurchaseOrdersAppliedVendorCreditsCompany - - value: purchase_orders,applied_vendor_credits,company,accounting_period - name: PurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: PurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,company,employee - name: PurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: PurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,company,employee,payment_term - name: PurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: purchase_orders,applied_vendor_credits,company,payment_term - name: PurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact - name: PurchaseOrdersAppliedVendorCreditsContact - - value: purchase_orders,applied_vendor_credits,contact,accounting_period - name: PurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,company - name: PurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: PurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,company,employee - name: PurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - PurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,company,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,employee - name: PurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: PurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - PurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: purchase_orders,applied_vendor_credits,contact,payment_term - name: PurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: purchase_orders,applied_vendor_credits,employee - name: PurchaseOrdersAppliedVendorCreditsEmployee - - value: purchase_orders,applied_vendor_credits,employee,accounting_period - name: PurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: PurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,applied_vendor_credits,employee,payment_term - name: PurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: purchase_orders,applied_vendor_credits,payment_term - name: PurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: purchase_orders,company - name: PurchaseOrdersCompany - - value: purchase_orders,company,accounting_period - name: PurchaseOrdersCompanyAccountingPeriod - - value: purchase_orders,company,accounting_period,payment_term - name: PurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,company,employee - name: PurchaseOrdersCompanyEmployee - - value: purchase_orders,company,employee,accounting_period - name: PurchaseOrdersCompanyEmployeeAccountingPeriod - - value: purchase_orders,company,employee,accounting_period,payment_term - name: PurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,company,employee,payment_term - name: PurchaseOrdersCompanyEmployeePaymentTerm - - value: purchase_orders,company,payment_term - name: PurchaseOrdersCompanyPaymentTerm - - value: purchase_orders,contact - name: PurchaseOrdersContact - - value: purchase_orders,contact,accounting_period - name: PurchaseOrdersContactAccountingPeriod - - value: purchase_orders,contact,accounting_period,payment_term - name: PurchaseOrdersContactAccountingPeriodPaymentTerm - - value: purchase_orders,contact,company - name: PurchaseOrdersContactCompany - - value: purchase_orders,contact,company,accounting_period - name: PurchaseOrdersContactCompanyAccountingPeriod - - value: purchase_orders,contact,company,accounting_period,payment_term - name: PurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: purchase_orders,contact,company,employee - name: PurchaseOrdersContactCompanyEmployee - - value: purchase_orders,contact,company,employee,accounting_period - name: PurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - purchase_orders,contact,company,employee,accounting_period,payment_term - name: PurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,contact,company,employee,payment_term - name: PurchaseOrdersContactCompanyEmployeePaymentTerm - - value: purchase_orders,contact,company,payment_term - name: PurchaseOrdersContactCompanyPaymentTerm - - value: purchase_orders,contact,employee - name: PurchaseOrdersContactEmployee - - value: purchase_orders,contact,employee,accounting_period - name: PurchaseOrdersContactEmployeeAccountingPeriod - - value: purchase_orders,contact,employee,accounting_period,payment_term - name: PurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,contact,employee,payment_term - name: PurchaseOrdersContactEmployeePaymentTerm - - value: purchase_orders,contact,payment_term - name: PurchaseOrdersContactPaymentTerm - - value: purchase_orders,employee - name: PurchaseOrdersEmployee - - value: purchase_orders,employee,accounting_period - name: PurchaseOrdersEmployeeAccountingPeriod - - value: purchase_orders,employee,accounting_period,payment_term - name: PurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: purchase_orders,employee,payment_term - name: PurchaseOrdersEmployeePaymentTerm - - value: purchase_orders,payment_term - name: PurchaseOrdersPaymentTerm - - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,accounting_period,payment_term - name: TrackingCategoriesAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes - name: TrackingCategoriesAppliedCreditNotes - - value: tracking_categories,applied_credit_notes,accounting_period - name: TrackingCategoriesAppliedCreditNotesAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,accounting_period,payment_term - name: TrackingCategoriesAppliedCreditNotesAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,applied_vendor_credits - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCredits - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,employee - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - tracking_categories,applied_credit_notes,applied_vendor_credits,payment_term - name: TrackingCategoriesAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: tracking_categories,applied_credit_notes,company - name: TrackingCategoriesAppliedCreditNotesCompany - - value: tracking_categories,applied_credit_notes,company,accounting_period - name: TrackingCategoriesAppliedCreditNotesCompanyAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,company,accounting_period,payment_term - name: TrackingCategoriesAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,company,employee - name: TrackingCategoriesAppliedCreditNotesCompanyEmployee - - value: >- - tracking_categories,applied_credit_notes,company,employee,accounting_period - name: TrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,company,employee,payment_term - name: TrackingCategoriesAppliedCreditNotesCompanyEmployeePaymentTerm - - value: tracking_categories,applied_credit_notes,company,payment_term - name: TrackingCategoriesAppliedCreditNotesCompanyPaymentTerm - - value: tracking_categories,applied_credit_notes,contact - name: TrackingCategoriesAppliedCreditNotesContact - - value: tracking_categories,applied_credit_notes,contact,accounting_period - name: TrackingCategoriesAppliedCreditNotesContactAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,contact,accounting_period,payment_term - name: TrackingCategoriesAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,contact,company - name: TrackingCategoriesAppliedCreditNotesContactCompany - - value: >- - tracking_categories,applied_credit_notes,contact,company,accounting_period - name: TrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,contact,company,employee - name: TrackingCategoriesAppliedCreditNotesContactCompanyEmployee - - value: >- - tracking_categories,applied_credit_notes,contact,company,employee,accounting_period - name: >- - TrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_credit_notes,contact,company,employee,payment_term - name: TrackingCategoriesAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: tracking_categories,applied_credit_notes,contact,company,payment_term - name: TrackingCategoriesAppliedCreditNotesContactCompanyPaymentTerm - - value: tracking_categories,applied_credit_notes,contact,employee - name: TrackingCategoriesAppliedCreditNotesContactEmployee - - value: >- - tracking_categories,applied_credit_notes,contact,employee,accounting_period - name: TrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,contact,employee,payment_term - name: TrackingCategoriesAppliedCreditNotesContactEmployeePaymentTerm - - value: tracking_categories,applied_credit_notes,contact,payment_term - name: TrackingCategoriesAppliedCreditNotesContactPaymentTerm - - value: tracking_categories,applied_credit_notes,employee - name: TrackingCategoriesAppliedCreditNotesEmployee - - value: tracking_categories,applied_credit_notes,employee,accounting_period - name: TrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_credit_notes,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,applied_credit_notes,employee,payment_term - name: TrackingCategoriesAppliedCreditNotesEmployeePaymentTerm - - value: tracking_categories,applied_credit_notes,payment_term - name: TrackingCategoriesAppliedCreditNotesPaymentTerm - - value: tracking_categories,applied_vendor_credits - name: TrackingCategoriesAppliedVendorCredits - - value: tracking_categories,applied_vendor_credits,accounting_period - name: TrackingCategoriesAppliedVendorCreditsAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,accounting_period,payment_term - name: TrackingCategoriesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,company - name: TrackingCategoriesAppliedVendorCreditsCompany - - value: tracking_categories,applied_vendor_credits,company,accounting_period - name: TrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,company,employee - name: TrackingCategoriesAppliedVendorCreditsCompanyEmployee - - value: >- - tracking_categories,applied_vendor_credits,company,employee,accounting_period - name: TrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_vendor_credits,company,employee,payment_term - name: TrackingCategoriesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: tracking_categories,applied_vendor_credits,company,payment_term - name: TrackingCategoriesAppliedVendorCreditsCompanyPaymentTerm - - value: tracking_categories,applied_vendor_credits,contact - name: TrackingCategoriesAppliedVendorCreditsContact - - value: tracking_categories,applied_vendor_credits,contact,accounting_period - name: TrackingCategoriesAppliedVendorCreditsContactAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,contact,company - name: TrackingCategoriesAppliedVendorCreditsContactCompany - - value: >- - tracking_categories,applied_vendor_credits,contact,company,accounting_period - name: TrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,contact,company,employee - name: TrackingCategoriesAppliedVendorCreditsContactCompanyEmployee - - value: >- - tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - TrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_vendor_credits,contact,company,employee,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,applied_vendor_credits,contact,company,payment_term - name: TrackingCategoriesAppliedVendorCreditsContactCompanyPaymentTerm - - value: tracking_categories,applied_vendor_credits,contact,employee - name: TrackingCategoriesAppliedVendorCreditsContactEmployee - - value: >- - tracking_categories,applied_vendor_credits,contact,employee,accounting_period - name: TrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,applied_vendor_credits,contact,employee,payment_term - name: TrackingCategoriesAppliedVendorCreditsContactEmployeePaymentTerm - - value: tracking_categories,applied_vendor_credits,contact,payment_term - name: TrackingCategoriesAppliedVendorCreditsContactPaymentTerm - - value: tracking_categories,applied_vendor_credits,employee - name: TrackingCategoriesAppliedVendorCreditsEmployee - - value: tracking_categories,applied_vendor_credits,employee,accounting_period - name: TrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - tracking_categories,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - TrackingCategoriesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,applied_vendor_credits,employee,payment_term - name: TrackingCategoriesAppliedVendorCreditsEmployeePaymentTerm - - value: tracking_categories,applied_vendor_credits,payment_term - name: TrackingCategoriesAppliedVendorCreditsPaymentTerm - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,company,accounting_period,payment_term - name: TrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,company,employee - name: TrackingCategoriesCompanyEmployee - - value: tracking_categories,company,employee,accounting_period - name: TrackingCategoriesCompanyEmployeeAccountingPeriod - - value: tracking_categories,company,employee,accounting_period,payment_term - name: TrackingCategoriesCompanyEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,company,employee,payment_term - name: TrackingCategoriesCompanyEmployeePaymentTerm - - value: tracking_categories,company,payment_term - name: TrackingCategoriesCompanyPaymentTerm - - value: tracking_categories,contact - name: TrackingCategoriesContact - - value: tracking_categories,contact,accounting_period - name: TrackingCategoriesContactAccountingPeriod - - value: tracking_categories,contact,accounting_period,payment_term - name: TrackingCategoriesContactAccountingPeriodPaymentTerm - - value: tracking_categories,contact,company - name: TrackingCategoriesContactCompany - - value: tracking_categories,contact,company,accounting_period - name: TrackingCategoriesContactCompanyAccountingPeriod - - value: tracking_categories,contact,company,accounting_period,payment_term - name: TrackingCategoriesContactCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,contact,company,employee - name: TrackingCategoriesContactCompanyEmployee - - value: tracking_categories,contact,company,employee,accounting_period - name: TrackingCategoriesContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,contact,company,employee,accounting_period,payment_term - name: TrackingCategoriesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,contact,company,employee,payment_term - name: TrackingCategoriesContactCompanyEmployeePaymentTerm - - value: tracking_categories,contact,company,payment_term - name: TrackingCategoriesContactCompanyPaymentTerm - - value: tracking_categories,contact,employee - name: TrackingCategoriesContactEmployee - - value: tracking_categories,contact,employee,accounting_period - name: TrackingCategoriesContactEmployeeAccountingPeriod - - value: tracking_categories,contact,employee,accounting_period,payment_term - name: TrackingCategoriesContactEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,contact,employee,payment_term - name: TrackingCategoriesContactEmployeePaymentTerm - - value: tracking_categories,contact,payment_term - name: TrackingCategoriesContactPaymentTerm - - value: tracking_categories,employee - name: TrackingCategoriesEmployee - - value: tracking_categories,employee,accounting_period - name: TrackingCategoriesEmployeeAccountingPeriod - - value: tracking_categories,employee,accounting_period,payment_term - name: TrackingCategoriesEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,employee,payment_term - name: TrackingCategoriesEmployeePaymentTerm - - value: tracking_categories,payment_term - name: TrackingCategoriesPaymentTerm - - value: tracking_categories,purchase_orders - name: TrackingCategoriesPurchaseOrders - - value: tracking_categories,purchase_orders,accounting_period - name: TrackingCategoriesPurchaseOrdersAccountingPeriod - - value: tracking_categories,purchase_orders,accounting_period,payment_term - name: TrackingCategoriesPurchaseOrdersAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotes - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,accounting_period - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCredits - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompany - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsCompanyPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContact - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompany - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsContactPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesAppliedVendorCreditsPaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes,company - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompany - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,employee - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,company,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesCompanyPaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes,contact - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesContact - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompany - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,company,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactCompanyPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,employee - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,contact,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesContactPaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes,employee - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployee - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_credit_notes,employee,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesEmployeePaymentTerm - - value: tracking_categories,purchase_orders,applied_credit_notes,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedCreditNotesPaymentTerm - - value: tracking_categories,purchase_orders,applied_vendor_credits - name: TrackingCategoriesPurchaseOrdersAppliedVendorCredits - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,accounting_period - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,applied_vendor_credits,company - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompany - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,employee - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,company,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsCompanyPaymentTerm - - value: tracking_categories,purchase_orders,applied_vendor_credits,contact - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContact - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompany - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployee - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,company,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactCompanyPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,employee - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployee - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,contact,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsContactPaymentTerm - - value: tracking_categories,purchase_orders,applied_vendor_credits,employee - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployee - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,employee,payment_term - name: >- - TrackingCategoriesPurchaseOrdersAppliedVendorCreditsEmployeePaymentTerm - - value: >- - tracking_categories,purchase_orders,applied_vendor_credits,payment_term - name: TrackingCategoriesPurchaseOrdersAppliedVendorCreditsPaymentTerm - - value: tracking_categories,purchase_orders,company - name: TrackingCategoriesPurchaseOrdersCompany - - value: tracking_categories,purchase_orders,company,accounting_period - name: TrackingCategoriesPurchaseOrdersCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,company,accounting_period,payment_term - name: TrackingCategoriesPurchaseOrdersCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,company,employee - name: TrackingCategoriesPurchaseOrdersCompanyEmployee - - value: tracking_categories,purchase_orders,company,employee,accounting_period - name: TrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersCompanyEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,company,employee,payment_term - name: TrackingCategoriesPurchaseOrdersCompanyEmployeePaymentTerm - - value: tracking_categories,purchase_orders,company,payment_term - name: TrackingCategoriesPurchaseOrdersCompanyPaymentTerm - - value: tracking_categories,purchase_orders,contact - name: TrackingCategoriesPurchaseOrdersContact - - value: tracking_categories,purchase_orders,contact,accounting_period - name: TrackingCategoriesPurchaseOrdersContactAccountingPeriod - - value: >- - tracking_categories,purchase_orders,contact,accounting_period,payment_term - name: TrackingCategoriesPurchaseOrdersContactAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,contact,company - name: TrackingCategoriesPurchaseOrdersContactCompany - - value: tracking_categories,purchase_orders,contact,company,accounting_period - name: TrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriod - - value: >- - tracking_categories,purchase_orders,contact,company,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersContactCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,contact,company,employee - name: TrackingCategoriesPurchaseOrdersContactCompanyEmployee - - value: >- - tracking_categories,purchase_orders,contact,company,employee,accounting_period - name: TrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,contact,company,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersContactCompanyEmployeeAccountingPeriodPaymentTerm - - value: >- - tracking_categories,purchase_orders,contact,company,employee,payment_term - name: TrackingCategoriesPurchaseOrdersContactCompanyEmployeePaymentTerm - - value: tracking_categories,purchase_orders,contact,company,payment_term - name: TrackingCategoriesPurchaseOrdersContactCompanyPaymentTerm - - value: tracking_categories,purchase_orders,contact,employee - name: TrackingCategoriesPurchaseOrdersContactEmployee - - value: tracking_categories,purchase_orders,contact,employee,accounting_period - name: TrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,contact,employee,accounting_period,payment_term - name: >- - TrackingCategoriesPurchaseOrdersContactEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,contact,employee,payment_term - name: TrackingCategoriesPurchaseOrdersContactEmployeePaymentTerm - - value: tracking_categories,purchase_orders,contact,payment_term - name: TrackingCategoriesPurchaseOrdersContactPaymentTerm - - value: tracking_categories,purchase_orders,employee - name: TrackingCategoriesPurchaseOrdersEmployee - - value: tracking_categories,purchase_orders,employee,accounting_period - name: TrackingCategoriesPurchaseOrdersEmployeeAccountingPeriod - - value: >- - tracking_categories,purchase_orders,employee,accounting_period,payment_term - name: TrackingCategoriesPurchaseOrdersEmployeeAccountingPeriodPaymentTerm - - value: tracking_categories,purchase_orders,employee,payment_term - name: TrackingCategoriesPurchaseOrdersEmployeePaymentTerm - - value: tracking_categories,purchase_orders,payment_term - name: TrackingCategoriesPurchaseOrdersPaymentTerm - source: - openapi: openapi/openapi.yml -imports: - root: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/invoices - method: GET - auth: true - docs: Returns a list of `Invoice` objects. - source: - openapi: openapi/openapi.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 - 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: root.PaginatedInvoiceList - status-code: 200 - examples: - - headers: {} - 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: true - 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: openapi/openapi.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: root.InvoiceRequest - content-type: application/json - response: - docs: '' - type: root.InvoiceResponse - status-code: 201 - examples: - - headers: {} - 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: true - docs: Returns an `Invoice` object with the given `id`. - source: - openapi: openapi/openapi.yml - path-parameters: - id: string - request: - name: InvoicesRetrieveRequest - query-parameters: - expand: - type: optional - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - include_remote_data: - type: optional - docs: >- - Whether to include the original data Merge fetched from the - third-party to produce these models. - include_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: root.Invoice - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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_category: tracking_category - 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: true - docs: Updates an `Invoice` object with the given `id`. - source: - openapi: openapi/openapi.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: root.InvoiceRequest - content-type: application/json - response: - docs: '' - type: root.InvoiceResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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: true - docs: Returns a list of `RemoteFieldClass` objects. - source: - openapi: openapi/openapi.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: root.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - headers: {} - 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: true - docs: Returns metadata for `Invoice` PATCHs. - source: - openapi: openapi/openapi.yml - path-parameters: - id: string - response: - docs: '' - type: root.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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: true - docs: Returns metadata for `Invoice` POSTs. - source: - openapi: openapi/openapi.yml - response: - docs: '' - type: root.MetaResponse - status-code: 200 - examples: - - headers: {} - 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: true - docs: Returns a list of `RemoteFieldClass` objects. - source: - openapi: openapi/openapi.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: root.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - headers: {} - 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: openapi/openapi.yml diff --git a/.mock/definition/accounting/purchaseOrders.yml b/.mock/definition/accounting/purchaseOrders.yml deleted file mode 100644 index e015763..0000000 --- a/.mock/definition/accounting/purchaseOrders.yml +++ /dev/null @@ -1,1289 +0,0 @@ -types: - PurchaseOrdersListRequestExpand: - enum: - - accounting_period - - value: accounting_period,payment_term - name: AccountingPeriodPaymentTerm - - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - value: company,accounting_period,payment_term - name: CompanyAccountingPeriodPaymentTerm - - value: company,payment_term - name: CompanyPaymentTerm - - delivery_address - - value: delivery_address,accounting_period - name: DeliveryAddressAccountingPeriod - - value: delivery_address,accounting_period,payment_term - name: DeliveryAddressAccountingPeriodPaymentTerm - - value: delivery_address,company - name: DeliveryAddressCompany - - value: delivery_address,company,accounting_period - name: DeliveryAddressCompanyAccountingPeriod - - value: delivery_address,company,accounting_period,payment_term - name: DeliveryAddressCompanyAccountingPeriodPaymentTerm - - value: delivery_address,company,payment_term - name: DeliveryAddressCompanyPaymentTerm - - value: delivery_address,payment_term - name: DeliveryAddressPaymentTerm - - value: delivery_address,vendor - name: DeliveryAddressVendor - - value: delivery_address,vendor,accounting_period - name: DeliveryAddressVendorAccountingPeriod - - value: delivery_address,vendor,accounting_period,payment_term - name: DeliveryAddressVendorAccountingPeriodPaymentTerm - - value: delivery_address,vendor,company - name: DeliveryAddressVendorCompany - - value: delivery_address,vendor,company,accounting_period - name: DeliveryAddressVendorCompanyAccountingPeriod - - value: delivery_address,vendor,company,accounting_period,payment_term - name: DeliveryAddressVendorCompanyAccountingPeriodPaymentTerm - - value: delivery_address,vendor,company,payment_term - name: DeliveryAddressVendorCompanyPaymentTerm - - value: delivery_address,vendor,payment_term - name: DeliveryAddressVendorPaymentTerm - - line_items - - value: line_items,accounting_period - name: LineItemsAccountingPeriod - - value: line_items,accounting_period,payment_term - name: LineItemsAccountingPeriodPaymentTerm - - value: line_items,company - name: LineItemsCompany - - value: line_items,company,accounting_period - name: LineItemsCompanyAccountingPeriod - - value: line_items,company,accounting_period,payment_term - name: LineItemsCompanyAccountingPeriodPaymentTerm - - value: line_items,company,payment_term - name: LineItemsCompanyPaymentTerm - - value: line_items,delivery_address - name: LineItemsDeliveryAddress - - value: line_items,delivery_address,accounting_period - name: LineItemsDeliveryAddressAccountingPeriod - - value: line_items,delivery_address,accounting_period,payment_term - name: LineItemsDeliveryAddressAccountingPeriodPaymentTerm - - value: line_items,delivery_address,company - name: LineItemsDeliveryAddressCompany - - value: line_items,delivery_address,company,accounting_period - name: LineItemsDeliveryAddressCompanyAccountingPeriod - - value: line_items,delivery_address,company,accounting_period,payment_term - name: LineItemsDeliveryAddressCompanyAccountingPeriodPaymentTerm - - value: line_items,delivery_address,company,payment_term - name: LineItemsDeliveryAddressCompanyPaymentTerm - - value: line_items,delivery_address,payment_term - name: LineItemsDeliveryAddressPaymentTerm - - value: line_items,delivery_address,vendor - name: LineItemsDeliveryAddressVendor - - value: line_items,delivery_address,vendor,accounting_period - name: LineItemsDeliveryAddressVendorAccountingPeriod - - value: line_items,delivery_address,vendor,accounting_period,payment_term - name: LineItemsDeliveryAddressVendorAccountingPeriodPaymentTerm - - value: line_items,delivery_address,vendor,company - name: LineItemsDeliveryAddressVendorCompany - - value: line_items,delivery_address,vendor,company,accounting_period - name: LineItemsDeliveryAddressVendorCompanyAccountingPeriod - - value: >- - line_items,delivery_address,vendor,company,accounting_period,payment_term - name: LineItemsDeliveryAddressVendorCompanyAccountingPeriodPaymentTerm - - value: line_items,delivery_address,vendor,company,payment_term - name: LineItemsDeliveryAddressVendorCompanyPaymentTerm - - value: line_items,delivery_address,vendor,payment_term - name: LineItemsDeliveryAddressVendorPaymentTerm - - value: line_items,payment_term - name: LineItemsPaymentTerm - - value: line_items,tracking_categories - name: LineItemsTrackingCategories - - value: line_items,tracking_categories,accounting_period - name: LineItemsTrackingCategoriesAccountingPeriod - - value: line_items,tracking_categories,accounting_period,payment_term - name: LineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,company - name: LineItemsTrackingCategoriesCompany - - value: line_items,tracking_categories,company,accounting_period - name: LineItemsTrackingCategoriesCompanyAccountingPeriod - - value: line_items,tracking_categories,company,accounting_period,payment_term - name: LineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,company,payment_term - name: LineItemsTrackingCategoriesCompanyPaymentTerm - - value: line_items,tracking_categories,delivery_address - name: LineItemsTrackingCategoriesDeliveryAddress - - value: line_items,tracking_categories,delivery_address,accounting_period - name: LineItemsTrackingCategoriesDeliveryAddressAccountingPeriod - - value: >- - line_items,tracking_categories,delivery_address,accounting_period,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,delivery_address,company - name: LineItemsTrackingCategoriesDeliveryAddressCompany - - value: >- - line_items,tracking_categories,delivery_address,company,accounting_period - name: LineItemsTrackingCategoriesDeliveryAddressCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,delivery_address,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesDeliveryAddressCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,delivery_address,company,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressCompanyPaymentTerm - - value: line_items,tracking_categories,delivery_address,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressPaymentTerm - - value: line_items,tracking_categories,delivery_address,vendor - name: LineItemsTrackingCategoriesDeliveryAddressVendor - - value: >- - line_items,tracking_categories,delivery_address,vendor,accounting_period - name: LineItemsTrackingCategoriesDeliveryAddressVendorAccountingPeriod - - value: >- - line_items,tracking_categories,delivery_address,vendor,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesDeliveryAddressVendorAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,delivery_address,vendor,company - name: LineItemsTrackingCategoriesDeliveryAddressVendorCompany - - value: >- - line_items,tracking_categories,delivery_address,vendor,company,accounting_period - name: >- - LineItemsTrackingCategoriesDeliveryAddressVendorCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,delivery_address,vendor,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesDeliveryAddressVendorCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,delivery_address,vendor,company,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressVendorCompanyPaymentTerm - - value: line_items,tracking_categories,delivery_address,vendor,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressVendorPaymentTerm - - value: line_items,tracking_categories,payment_term - name: LineItemsTrackingCategoriesPaymentTerm - - value: line_items,tracking_categories,vendor - name: LineItemsTrackingCategoriesVendor - - value: line_items,tracking_categories,vendor,accounting_period - name: LineItemsTrackingCategoriesVendorAccountingPeriod - - value: line_items,tracking_categories,vendor,accounting_period,payment_term - name: LineItemsTrackingCategoriesVendorAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,vendor,company - name: LineItemsTrackingCategoriesVendorCompany - - value: line_items,tracking_categories,vendor,company,accounting_period - name: LineItemsTrackingCategoriesVendorCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,vendor,company,accounting_period,payment_term - name: LineItemsTrackingCategoriesVendorCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,vendor,company,payment_term - name: LineItemsTrackingCategoriesVendorCompanyPaymentTerm - - value: line_items,tracking_categories,vendor,payment_term - name: LineItemsTrackingCategoriesVendorPaymentTerm - - value: line_items,vendor - name: LineItemsVendor - - value: line_items,vendor,accounting_period - name: LineItemsVendorAccountingPeriod - - value: line_items,vendor,accounting_period,payment_term - name: LineItemsVendorAccountingPeriodPaymentTerm - - value: line_items,vendor,company - name: LineItemsVendorCompany - - value: line_items,vendor,company,accounting_period - name: LineItemsVendorCompanyAccountingPeriod - - value: line_items,vendor,company,accounting_period,payment_term - name: LineItemsVendorCompanyAccountingPeriodPaymentTerm - - value: line_items,vendor,company,payment_term - name: LineItemsVendorCompanyPaymentTerm - - value: line_items,vendor,payment_term - name: LineItemsVendorPaymentTerm - - payment_term - - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,accounting_period,payment_term - name: TrackingCategoriesAccountingPeriodPaymentTerm - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,company,accounting_period,payment_term - name: TrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,company,payment_term - name: TrackingCategoriesCompanyPaymentTerm - - value: tracking_categories,delivery_address - name: TrackingCategoriesDeliveryAddress - - value: tracking_categories,delivery_address,accounting_period - name: TrackingCategoriesDeliveryAddressAccountingPeriod - - value: tracking_categories,delivery_address,accounting_period,payment_term - name: TrackingCategoriesDeliveryAddressAccountingPeriodPaymentTerm - - value: tracking_categories,delivery_address,company - name: TrackingCategoriesDeliveryAddressCompany - - value: tracking_categories,delivery_address,company,accounting_period - name: TrackingCategoriesDeliveryAddressCompanyAccountingPeriod - - value: >- - tracking_categories,delivery_address,company,accounting_period,payment_term - name: TrackingCategoriesDeliveryAddressCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,delivery_address,company,payment_term - name: TrackingCategoriesDeliveryAddressCompanyPaymentTerm - - value: tracking_categories,delivery_address,payment_term - name: TrackingCategoriesDeliveryAddressPaymentTerm - - value: tracking_categories,delivery_address,vendor - name: TrackingCategoriesDeliveryAddressVendor - - value: tracking_categories,delivery_address,vendor,accounting_period - name: TrackingCategoriesDeliveryAddressVendorAccountingPeriod - - value: >- - tracking_categories,delivery_address,vendor,accounting_period,payment_term - name: TrackingCategoriesDeliveryAddressVendorAccountingPeriodPaymentTerm - - value: tracking_categories,delivery_address,vendor,company - name: TrackingCategoriesDeliveryAddressVendorCompany - - value: tracking_categories,delivery_address,vendor,company,accounting_period - name: TrackingCategoriesDeliveryAddressVendorCompanyAccountingPeriod - - value: >- - tracking_categories,delivery_address,vendor,company,accounting_period,payment_term - name: >- - TrackingCategoriesDeliveryAddressVendorCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,delivery_address,vendor,company,payment_term - name: TrackingCategoriesDeliveryAddressVendorCompanyPaymentTerm - - value: tracking_categories,delivery_address,vendor,payment_term - name: TrackingCategoriesDeliveryAddressVendorPaymentTerm - - value: tracking_categories,payment_term - name: TrackingCategoriesPaymentTerm - - value: tracking_categories,vendor - name: TrackingCategoriesVendor - - value: tracking_categories,vendor,accounting_period - name: TrackingCategoriesVendorAccountingPeriod - - value: tracking_categories,vendor,accounting_period,payment_term - name: TrackingCategoriesVendorAccountingPeriodPaymentTerm - - value: tracking_categories,vendor,company - name: TrackingCategoriesVendorCompany - - value: tracking_categories,vendor,company,accounting_period - name: TrackingCategoriesVendorCompanyAccountingPeriod - - value: tracking_categories,vendor,company,accounting_period,payment_term - name: TrackingCategoriesVendorCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,vendor,company,payment_term - name: TrackingCategoriesVendorCompanyPaymentTerm - - value: tracking_categories,vendor,payment_term - name: TrackingCategoriesVendorPaymentTerm - - vendor - - value: vendor,accounting_period - name: VendorAccountingPeriod - - value: vendor,accounting_period,payment_term - name: VendorAccountingPeriodPaymentTerm - - value: vendor,company - name: VendorCompany - - value: vendor,company,accounting_period - name: VendorCompanyAccountingPeriod - - value: vendor,company,accounting_period,payment_term - name: VendorCompanyAccountingPeriodPaymentTerm - - value: vendor,company,payment_term - name: VendorCompanyPaymentTerm - - value: vendor,payment_term - name: VendorPaymentTerm - source: - openapi: openapi/openapi.yml - PurchaseOrdersRetrieveRequestExpand: - enum: - - accounting_period - - value: accounting_period,payment_term - name: AccountingPeriodPaymentTerm - - company - - value: company,accounting_period - name: CompanyAccountingPeriod - - value: company,accounting_period,payment_term - name: CompanyAccountingPeriodPaymentTerm - - value: company,payment_term - name: CompanyPaymentTerm - - delivery_address - - value: delivery_address,accounting_period - name: DeliveryAddressAccountingPeriod - - value: delivery_address,accounting_period,payment_term - name: DeliveryAddressAccountingPeriodPaymentTerm - - value: delivery_address,company - name: DeliveryAddressCompany - - value: delivery_address,company,accounting_period - name: DeliveryAddressCompanyAccountingPeriod - - value: delivery_address,company,accounting_period,payment_term - name: DeliveryAddressCompanyAccountingPeriodPaymentTerm - - value: delivery_address,company,payment_term - name: DeliveryAddressCompanyPaymentTerm - - value: delivery_address,payment_term - name: DeliveryAddressPaymentTerm - - value: delivery_address,vendor - name: DeliveryAddressVendor - - value: delivery_address,vendor,accounting_period - name: DeliveryAddressVendorAccountingPeriod - - value: delivery_address,vendor,accounting_period,payment_term - name: DeliveryAddressVendorAccountingPeriodPaymentTerm - - value: delivery_address,vendor,company - name: DeliveryAddressVendorCompany - - value: delivery_address,vendor,company,accounting_period - name: DeliveryAddressVendorCompanyAccountingPeriod - - value: delivery_address,vendor,company,accounting_period,payment_term - name: DeliveryAddressVendorCompanyAccountingPeriodPaymentTerm - - value: delivery_address,vendor,company,payment_term - name: DeliveryAddressVendorCompanyPaymentTerm - - value: delivery_address,vendor,payment_term - name: DeliveryAddressVendorPaymentTerm - - line_items - - value: line_items,accounting_period - name: LineItemsAccountingPeriod - - value: line_items,accounting_period,payment_term - name: LineItemsAccountingPeriodPaymentTerm - - value: line_items,company - name: LineItemsCompany - - value: line_items,company,accounting_period - name: LineItemsCompanyAccountingPeriod - - value: line_items,company,accounting_period,payment_term - name: LineItemsCompanyAccountingPeriodPaymentTerm - - value: line_items,company,payment_term - name: LineItemsCompanyPaymentTerm - - value: line_items,delivery_address - name: LineItemsDeliveryAddress - - value: line_items,delivery_address,accounting_period - name: LineItemsDeliveryAddressAccountingPeriod - - value: line_items,delivery_address,accounting_period,payment_term - name: LineItemsDeliveryAddressAccountingPeriodPaymentTerm - - value: line_items,delivery_address,company - name: LineItemsDeliveryAddressCompany - - value: line_items,delivery_address,company,accounting_period - name: LineItemsDeliveryAddressCompanyAccountingPeriod - - value: line_items,delivery_address,company,accounting_period,payment_term - name: LineItemsDeliveryAddressCompanyAccountingPeriodPaymentTerm - - value: line_items,delivery_address,company,payment_term - name: LineItemsDeliveryAddressCompanyPaymentTerm - - value: line_items,delivery_address,payment_term - name: LineItemsDeliveryAddressPaymentTerm - - value: line_items,delivery_address,vendor - name: LineItemsDeliveryAddressVendor - - value: line_items,delivery_address,vendor,accounting_period - name: LineItemsDeliveryAddressVendorAccountingPeriod - - value: line_items,delivery_address,vendor,accounting_period,payment_term - name: LineItemsDeliveryAddressVendorAccountingPeriodPaymentTerm - - value: line_items,delivery_address,vendor,company - name: LineItemsDeliveryAddressVendorCompany - - value: line_items,delivery_address,vendor,company,accounting_period - name: LineItemsDeliveryAddressVendorCompanyAccountingPeriod - - value: >- - line_items,delivery_address,vendor,company,accounting_period,payment_term - name: LineItemsDeliveryAddressVendorCompanyAccountingPeriodPaymentTerm - - value: line_items,delivery_address,vendor,company,payment_term - name: LineItemsDeliveryAddressVendorCompanyPaymentTerm - - value: line_items,delivery_address,vendor,payment_term - name: LineItemsDeliveryAddressVendorPaymentTerm - - value: line_items,payment_term - name: LineItemsPaymentTerm - - value: line_items,tracking_categories - name: LineItemsTrackingCategories - - value: line_items,tracking_categories,accounting_period - name: LineItemsTrackingCategoriesAccountingPeriod - - value: line_items,tracking_categories,accounting_period,payment_term - name: LineItemsTrackingCategoriesAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,company - name: LineItemsTrackingCategoriesCompany - - value: line_items,tracking_categories,company,accounting_period - name: LineItemsTrackingCategoriesCompanyAccountingPeriod - - value: line_items,tracking_categories,company,accounting_period,payment_term - name: LineItemsTrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,company,payment_term - name: LineItemsTrackingCategoriesCompanyPaymentTerm - - value: line_items,tracking_categories,delivery_address - name: LineItemsTrackingCategoriesDeliveryAddress - - value: line_items,tracking_categories,delivery_address,accounting_period - name: LineItemsTrackingCategoriesDeliveryAddressAccountingPeriod - - value: >- - line_items,tracking_categories,delivery_address,accounting_period,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,delivery_address,company - name: LineItemsTrackingCategoriesDeliveryAddressCompany - - value: >- - line_items,tracking_categories,delivery_address,company,accounting_period - name: LineItemsTrackingCategoriesDeliveryAddressCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,delivery_address,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesDeliveryAddressCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,delivery_address,company,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressCompanyPaymentTerm - - value: line_items,tracking_categories,delivery_address,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressPaymentTerm - - value: line_items,tracking_categories,delivery_address,vendor - name: LineItemsTrackingCategoriesDeliveryAddressVendor - - value: >- - line_items,tracking_categories,delivery_address,vendor,accounting_period - name: LineItemsTrackingCategoriesDeliveryAddressVendorAccountingPeriod - - value: >- - line_items,tracking_categories,delivery_address,vendor,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesDeliveryAddressVendorAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,delivery_address,vendor,company - name: LineItemsTrackingCategoriesDeliveryAddressVendorCompany - - value: >- - line_items,tracking_categories,delivery_address,vendor,company,accounting_period - name: >- - LineItemsTrackingCategoriesDeliveryAddressVendorCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,delivery_address,vendor,company,accounting_period,payment_term - name: >- - LineItemsTrackingCategoriesDeliveryAddressVendorCompanyAccountingPeriodPaymentTerm - - value: >- - line_items,tracking_categories,delivery_address,vendor,company,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressVendorCompanyPaymentTerm - - value: line_items,tracking_categories,delivery_address,vendor,payment_term - name: LineItemsTrackingCategoriesDeliveryAddressVendorPaymentTerm - - value: line_items,tracking_categories,payment_term - name: LineItemsTrackingCategoriesPaymentTerm - - value: line_items,tracking_categories,vendor - name: LineItemsTrackingCategoriesVendor - - value: line_items,tracking_categories,vendor,accounting_period - name: LineItemsTrackingCategoriesVendorAccountingPeriod - - value: line_items,tracking_categories,vendor,accounting_period,payment_term - name: LineItemsTrackingCategoriesVendorAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,vendor,company - name: LineItemsTrackingCategoriesVendorCompany - - value: line_items,tracking_categories,vendor,company,accounting_period - name: LineItemsTrackingCategoriesVendorCompanyAccountingPeriod - - value: >- - line_items,tracking_categories,vendor,company,accounting_period,payment_term - name: LineItemsTrackingCategoriesVendorCompanyAccountingPeriodPaymentTerm - - value: line_items,tracking_categories,vendor,company,payment_term - name: LineItemsTrackingCategoriesVendorCompanyPaymentTerm - - value: line_items,tracking_categories,vendor,payment_term - name: LineItemsTrackingCategoriesVendorPaymentTerm - - value: line_items,vendor - name: LineItemsVendor - - value: line_items,vendor,accounting_period - name: LineItemsVendorAccountingPeriod - - value: line_items,vendor,accounting_period,payment_term - name: LineItemsVendorAccountingPeriodPaymentTerm - - value: line_items,vendor,company - name: LineItemsVendorCompany - - value: line_items,vendor,company,accounting_period - name: LineItemsVendorCompanyAccountingPeriod - - value: line_items,vendor,company,accounting_period,payment_term - name: LineItemsVendorCompanyAccountingPeriodPaymentTerm - - value: line_items,vendor,company,payment_term - name: LineItemsVendorCompanyPaymentTerm - - value: line_items,vendor,payment_term - name: LineItemsVendorPaymentTerm - - payment_term - - tracking_categories - - value: tracking_categories,accounting_period - name: TrackingCategoriesAccountingPeriod - - value: tracking_categories,accounting_period,payment_term - name: TrackingCategoriesAccountingPeriodPaymentTerm - - value: tracking_categories,company - name: TrackingCategoriesCompany - - value: tracking_categories,company,accounting_period - name: TrackingCategoriesCompanyAccountingPeriod - - value: tracking_categories,company,accounting_period,payment_term - name: TrackingCategoriesCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,company,payment_term - name: TrackingCategoriesCompanyPaymentTerm - - value: tracking_categories,delivery_address - name: TrackingCategoriesDeliveryAddress - - value: tracking_categories,delivery_address,accounting_period - name: TrackingCategoriesDeliveryAddressAccountingPeriod - - value: tracking_categories,delivery_address,accounting_period,payment_term - name: TrackingCategoriesDeliveryAddressAccountingPeriodPaymentTerm - - value: tracking_categories,delivery_address,company - name: TrackingCategoriesDeliveryAddressCompany - - value: tracking_categories,delivery_address,company,accounting_period - name: TrackingCategoriesDeliveryAddressCompanyAccountingPeriod - - value: >- - tracking_categories,delivery_address,company,accounting_period,payment_term - name: TrackingCategoriesDeliveryAddressCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,delivery_address,company,payment_term - name: TrackingCategoriesDeliveryAddressCompanyPaymentTerm - - value: tracking_categories,delivery_address,payment_term - name: TrackingCategoriesDeliveryAddressPaymentTerm - - value: tracking_categories,delivery_address,vendor - name: TrackingCategoriesDeliveryAddressVendor - - value: tracking_categories,delivery_address,vendor,accounting_period - name: TrackingCategoriesDeliveryAddressVendorAccountingPeriod - - value: >- - tracking_categories,delivery_address,vendor,accounting_period,payment_term - name: TrackingCategoriesDeliveryAddressVendorAccountingPeriodPaymentTerm - - value: tracking_categories,delivery_address,vendor,company - name: TrackingCategoriesDeliveryAddressVendorCompany - - value: tracking_categories,delivery_address,vendor,company,accounting_period - name: TrackingCategoriesDeliveryAddressVendorCompanyAccountingPeriod - - value: >- - tracking_categories,delivery_address,vendor,company,accounting_period,payment_term - name: >- - TrackingCategoriesDeliveryAddressVendorCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,delivery_address,vendor,company,payment_term - name: TrackingCategoriesDeliveryAddressVendorCompanyPaymentTerm - - value: tracking_categories,delivery_address,vendor,payment_term - name: TrackingCategoriesDeliveryAddressVendorPaymentTerm - - value: tracking_categories,payment_term - name: TrackingCategoriesPaymentTerm - - value: tracking_categories,vendor - name: TrackingCategoriesVendor - - value: tracking_categories,vendor,accounting_period - name: TrackingCategoriesVendorAccountingPeriod - - value: tracking_categories,vendor,accounting_period,payment_term - name: TrackingCategoriesVendorAccountingPeriodPaymentTerm - - value: tracking_categories,vendor,company - name: TrackingCategoriesVendorCompany - - value: tracking_categories,vendor,company,accounting_period - name: TrackingCategoriesVendorCompanyAccountingPeriod - - value: tracking_categories,vendor,company,accounting_period,payment_term - name: TrackingCategoriesVendorCompanyAccountingPeriodPaymentTerm - - value: tracking_categories,vendor,company,payment_term - name: TrackingCategoriesVendorCompanyPaymentTerm - - value: tracking_categories,vendor,payment_term - name: TrackingCategoriesVendorPaymentTerm - - vendor - - value: vendor,accounting_period - name: VendorAccountingPeriod - - value: vendor,accounting_period,payment_term - name: VendorAccountingPeriodPaymentTerm - - value: vendor,company - name: VendorCompany - - value: vendor,company,accounting_period - name: VendorCompanyAccountingPeriod - - value: vendor,company,accounting_period,payment_term - name: VendorCompanyAccountingPeriodPaymentTerm - - value: vendor,company,payment_term - name: VendorCompanyPaymentTerm - - value: vendor,payment_term - name: VendorPaymentTerm - source: - openapi: openapi/openapi.yml -imports: - root: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/purchase-orders - method: GET - auth: true - docs: Returns a list of `PurchaseOrder` objects. - source: - openapi: openapi/openapi.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 - 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: root.PaginatedPurchaseOrderList - status-code: 200 - examples: - - headers: {} - 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: true - docs: Creates a `PurchaseOrder` object with the given values. - source: - openapi: openapi/openapi.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: root.PurchaseOrderRequest - content-type: application/json - response: - docs: '' - type: root.PurchaseOrderResponse - status-code: 201 - examples: - - headers: {} - 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: true - docs: Returns a `PurchaseOrder` object with the given `id`. - source: - openapi: openapi/openapi.yml - path-parameters: - id: string - request: - name: PurchaseOrdersRetrieveRequest - query-parameters: - expand: - type: optional - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - include_remote_data: - type: optional - docs: >- - Whether to include the original data Merge fetched from the - third-party to produce these models. - include_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: root.PurchaseOrder - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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_category: tracking_category - 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_category: tracking_category - 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: true - docs: Returns a list of `RemoteFieldClass` objects. - source: - openapi: openapi/openapi.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: root.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - headers: {} - 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: true - docs: Returns metadata for `PurchaseOrder` POSTs. - source: - openapi: openapi/openapi.yml - response: - docs: '' - type: root.MetaResponse - status-code: 200 - examples: - - headers: {} - 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: true - docs: Returns a list of `RemoteFieldClass` objects. - source: - openapi: openapi/openapi.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: root.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - headers: {} - 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: openapi/openapi.yml diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml index 6e83d15..062482b 100644 --- a/.mock/definition/api.yml +++ b/.mock/definition/api.yml @@ -1,20 +1,21 @@ name: api error-discrimination: strategy: status-code -display-name: Merge -default-environment: Production +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 - ProductionEu: https://api-eu.merge.dev/api -auth: BearerAuthScheme +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 -headers: - X-Account-Token: - type: optional - docs: Token identifying the end user. - name: accountToken +auth: BearerAuthScheme diff --git a/.mock/definition/ats/applications.yml b/.mock/definition/ats/applications.yml deleted file mode 100644 index 4a5822f..0000000 --- a/.mock/definition/ats/applications.yml +++ /dev/null @@ -1,1903 +0,0 @@ -types: - ApplicationsListRequestExpand: - enum: - - candidate - - value: candidate,credited_to - name: CandidateCreditedTo - - value: candidate,credited_to,current_stage - name: CandidateCreditedToCurrentStage - - value: candidate,credited_to,current_stage,reject_reason - name: CandidateCreditedToCurrentStageRejectReason - - value: candidate,credited_to,reject_reason - name: CandidateCreditedToRejectReason - - value: candidate,current_stage - name: CandidateCurrentStage - - value: candidate,current_stage,reject_reason - name: CandidateCurrentStageRejectReason - - value: candidate,job - name: CandidateJob - - value: candidate,job,credited_to - name: CandidateJobCreditedTo - - value: candidate,job,credited_to,current_stage - name: CandidateJobCreditedToCurrentStage - - value: candidate,job,credited_to,current_stage,reject_reason - name: CandidateJobCreditedToCurrentStageRejectReason - - value: candidate,job,credited_to,reject_reason - name: CandidateJobCreditedToRejectReason - - value: candidate,job,current_stage - name: CandidateJobCurrentStage - - value: candidate,job,current_stage,reject_reason - name: CandidateJobCurrentStageRejectReason - - value: candidate,job,reject_reason - name: CandidateJobRejectReason - - value: candidate,reject_reason - name: CandidateRejectReason - - credited_to - - value: credited_to,current_stage - name: CreditedToCurrentStage - - value: credited_to,current_stage,reject_reason - name: CreditedToCurrentStageRejectReason - - value: credited_to,reject_reason - name: CreditedToRejectReason - - current_stage - - value: current_stage,reject_reason - name: CurrentStageRejectReason - - job - - value: job,credited_to - name: JobCreditedTo - - value: job,credited_to,current_stage - name: JobCreditedToCurrentStage - - value: job,credited_to,current_stage,reject_reason - name: JobCreditedToCurrentStageRejectReason - - value: job,credited_to,reject_reason - name: JobCreditedToRejectReason - - value: job,current_stage - name: JobCurrentStage - - value: job,current_stage,reject_reason - name: JobCurrentStageRejectReason - - value: job,reject_reason - name: JobRejectReason - - offers - - value: offers,candidate - name: OffersCandidate - - value: offers,candidate,credited_to - name: OffersCandidateCreditedTo - - value: offers,candidate,credited_to,current_stage - name: OffersCandidateCreditedToCurrentStage - - value: offers,candidate,credited_to,current_stage,reject_reason - name: OffersCandidateCreditedToCurrentStageRejectReason - - value: offers,candidate,credited_to,reject_reason - name: OffersCandidateCreditedToRejectReason - - value: offers,candidate,current_stage - name: OffersCandidateCurrentStage - - value: offers,candidate,current_stage,reject_reason - name: OffersCandidateCurrentStageRejectReason - - value: offers,candidate,job - name: OffersCandidateJob - - value: offers,candidate,job,credited_to - name: OffersCandidateJobCreditedTo - - value: offers,candidate,job,credited_to,current_stage - name: OffersCandidateJobCreditedToCurrentStage - - value: offers,candidate,job,credited_to,current_stage,reject_reason - name: OffersCandidateJobCreditedToCurrentStageRejectReason - - value: offers,candidate,job,credited_to,reject_reason - name: OffersCandidateJobCreditedToRejectReason - - value: offers,candidate,job,current_stage - name: OffersCandidateJobCurrentStage - - value: offers,candidate,job,current_stage,reject_reason - name: OffersCandidateJobCurrentStageRejectReason - - value: offers,candidate,job,reject_reason - name: OffersCandidateJobRejectReason - - value: offers,candidate,reject_reason - name: OffersCandidateRejectReason - - value: offers,credited_to - name: OffersCreditedTo - - value: offers,credited_to,current_stage - name: OffersCreditedToCurrentStage - - value: offers,credited_to,current_stage,reject_reason - name: OffersCreditedToCurrentStageRejectReason - - value: offers,credited_to,reject_reason - name: OffersCreditedToRejectReason - - value: offers,current_stage - name: OffersCurrentStage - - value: offers,current_stage,reject_reason - name: OffersCurrentStageRejectReason - - value: offers,job - name: OffersJob - - value: offers,job,credited_to - name: OffersJobCreditedTo - - value: offers,job,credited_to,current_stage - name: OffersJobCreditedToCurrentStage - - value: offers,job,credited_to,current_stage,reject_reason - name: OffersJobCreditedToCurrentStageRejectReason - - value: offers,job,credited_to,reject_reason - name: OffersJobCreditedToRejectReason - - value: offers,job,current_stage - name: OffersJobCurrentStage - - value: offers,job,current_stage,reject_reason - name: OffersJobCurrentStageRejectReason - - value: offers,job,reject_reason - name: OffersJobRejectReason - - value: offers,reject_reason - name: OffersRejectReason - - value: offers,screening_question_answers - name: OffersScreeningQuestionAnswers - - value: offers,screening_question_answers,candidate - name: OffersScreeningQuestionAnswersCandidate - - value: offers,screening_question_answers,candidate,credited_to - name: OffersScreeningQuestionAnswersCandidateCreditedTo - - value: offers,screening_question_answers,candidate,credited_to,current_stage - name: OffersScreeningQuestionAnswersCandidateCreditedToCurrentStage - - value: >- - offers,screening_question_answers,candidate,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersCandidateCreditedToCurrentStageRejectReason - - value: offers,screening_question_answers,candidate,credited_to,reject_reason - name: OffersScreeningQuestionAnswersCandidateCreditedToRejectReason - - value: offers,screening_question_answers,candidate,current_stage - name: OffersScreeningQuestionAnswersCandidateCurrentStage - - value: >- - offers,screening_question_answers,candidate,current_stage,reject_reason - name: OffersScreeningQuestionAnswersCandidateCurrentStageRejectReason - - value: offers,screening_question_answers,candidate,job - name: OffersScreeningQuestionAnswersCandidateJob - - value: offers,screening_question_answers,candidate,job,credited_to - name: OffersScreeningQuestionAnswersCandidateJobCreditedTo - - value: >- - offers,screening_question_answers,candidate,job,credited_to,current_stage - name: OffersScreeningQuestionAnswersCandidateJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers,candidate,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersCandidateJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,candidate,job,credited_to,reject_reason - name: OffersScreeningQuestionAnswersCandidateJobCreditedToRejectReason - - value: offers,screening_question_answers,candidate,job,current_stage - name: OffersScreeningQuestionAnswersCandidateJobCurrentStage - - value: >- - offers,screening_question_answers,candidate,job,current_stage,reject_reason - name: OffersScreeningQuestionAnswersCandidateJobCurrentStageRejectReason - - value: offers,screening_question_answers,candidate,job,reject_reason - name: OffersScreeningQuestionAnswersCandidateJobRejectReason - - value: offers,screening_question_answers,candidate,reject_reason - name: OffersScreeningQuestionAnswersCandidateRejectReason - - value: offers,screening_question_answers,credited_to - name: OffersScreeningQuestionAnswersCreditedTo - - value: offers,screening_question_answers,credited_to,current_stage - name: OffersScreeningQuestionAnswersCreditedToCurrentStage - - value: >- - offers,screening_question_answers,credited_to,current_stage,reject_reason - name: OffersScreeningQuestionAnswersCreditedToCurrentStageRejectReason - - value: offers,screening_question_answers,credited_to,reject_reason - name: OffersScreeningQuestionAnswersCreditedToRejectReason - - value: offers,screening_question_answers,current_stage - name: OffersScreeningQuestionAnswersCurrentStage - - value: offers,screening_question_answers,current_stage,reject_reason - name: OffersScreeningQuestionAnswersCurrentStageRejectReason - - value: offers,screening_question_answers,job - name: OffersScreeningQuestionAnswersJob - - value: offers,screening_question_answers,job,credited_to - name: OffersScreeningQuestionAnswersJobCreditedTo - - value: offers,screening_question_answers,job,credited_to,current_stage - name: OffersScreeningQuestionAnswersJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers,job,credited_to,current_stage,reject_reason - name: OffersScreeningQuestionAnswersJobCreditedToCurrentStageRejectReason - - value: offers,screening_question_answers,job,credited_to,reject_reason - name: OffersScreeningQuestionAnswersJobCreditedToRejectReason - - value: offers,screening_question_answers,job,current_stage - name: OffersScreeningQuestionAnswersJobCurrentStage - - value: offers,screening_question_answers,job,current_stage,reject_reason - name: OffersScreeningQuestionAnswersJobCurrentStageRejectReason - - value: offers,screening_question_answers,job,reject_reason - name: OffersScreeningQuestionAnswersJobRejectReason - - value: offers,screening_question_answers,reject_reason - name: OffersScreeningQuestionAnswersRejectReason - - value: offers,screening_question_answers,screening_question_answers.question - name: OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestion - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidate - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,credited_to - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedTo - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJob - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedTo - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,credited_to - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedTo - - value: >- - offers,screening_question_answers,screening_question_answers.question,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,job - name: OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJob - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,credited_to - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedTo - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionRejectReason - - value: offers,screening_question_answers.question - name: OffersScreeningQuestionAnswersQuestion - - value: offers,screening_question_answers.question,candidate - name: OffersScreeningQuestionAnswersQuestionCandidate - - value: offers,screening_question_answers.question,candidate,credited_to - name: OffersScreeningQuestionAnswersQuestionCandidateCreditedTo - - value: >- - offers,screening_question_answers.question,candidate,credited_to,current_stage - name: OffersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStage - - value: >- - offers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers.question,candidate,credited_to,reject_reason - name: OffersScreeningQuestionAnswersQuestionCandidateCreditedToRejectReason - - value: offers,screening_question_answers.question,candidate,current_stage - name: OffersScreeningQuestionAnswersQuestionCandidateCurrentStage - - value: >- - offers,screening_question_answers.question,candidate,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateCurrentStageRejectReason - - value: offers,screening_question_answers.question,candidate,job - name: OffersScreeningQuestionAnswersQuestionCandidateJob - - value: offers,screening_question_answers.question,candidate,job,credited_to - name: OffersScreeningQuestionAnswersQuestionCandidateJobCreditedTo - - value: >- - offers,screening_question_answers.question,candidate,job,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers.question,candidate,job,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateJobCreditedToRejectReason - - value: offers,screening_question_answers.question,candidate,job,current_stage - name: OffersScreeningQuestionAnswersQuestionCandidateJobCurrentStage - - value: >- - offers,screening_question_answers.question,candidate,job,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateJobCurrentStageRejectReason - - value: offers,screening_question_answers.question,candidate,job,reject_reason - name: OffersScreeningQuestionAnswersQuestionCandidateJobRejectReason - - value: offers,screening_question_answers.question,candidate,reject_reason - name: OffersScreeningQuestionAnswersQuestionCandidateRejectReason - - value: offers,screening_question_answers.question,credited_to - name: OffersScreeningQuestionAnswersQuestionCreditedTo - - value: offers,screening_question_answers.question,credited_to,current_stage - name: OffersScreeningQuestionAnswersQuestionCreditedToCurrentStage - - value: >- - offers,screening_question_answers.question,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCreditedToCurrentStageRejectReason - - value: offers,screening_question_answers.question,credited_to,reject_reason - name: OffersScreeningQuestionAnswersQuestionCreditedToRejectReason - - value: offers,screening_question_answers.question,current_stage - name: OffersScreeningQuestionAnswersQuestionCurrentStage - - value: offers,screening_question_answers.question,current_stage,reject_reason - name: OffersScreeningQuestionAnswersQuestionCurrentStageRejectReason - - value: offers,screening_question_answers.question,job - name: OffersScreeningQuestionAnswersQuestionJob - - value: offers,screening_question_answers.question,job,credited_to - name: OffersScreeningQuestionAnswersQuestionJobCreditedTo - - value: >- - offers,screening_question_answers.question,job,credited_to,current_stage - name: OffersScreeningQuestionAnswersQuestionJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers.question,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers.question,job,credited_to,reject_reason - name: OffersScreeningQuestionAnswersQuestionJobCreditedToRejectReason - - value: offers,screening_question_answers.question,job,current_stage - name: OffersScreeningQuestionAnswersQuestionJobCurrentStage - - value: >- - offers,screening_question_answers.question,job,current_stage,reject_reason - name: OffersScreeningQuestionAnswersQuestionJobCurrentStageRejectReason - - value: offers,screening_question_answers.question,job,reject_reason - name: OffersScreeningQuestionAnswersQuestionJobRejectReason - - value: offers,screening_question_answers.question,reject_reason - name: OffersScreeningQuestionAnswersQuestionRejectReason - - reject_reason - - screening_question_answers - - value: screening_question_answers,candidate - name: ScreeningQuestionAnswersCandidate - - value: screening_question_answers,candidate,credited_to - name: ScreeningQuestionAnswersCandidateCreditedTo - - value: screening_question_answers,candidate,credited_to,current_stage - name: ScreeningQuestionAnswersCandidateCreditedToCurrentStage - - value: >- - screening_question_answers,candidate,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersCandidateCreditedToCurrentStageRejectReason - - value: screening_question_answers,candidate,credited_to,reject_reason - name: ScreeningQuestionAnswersCandidateCreditedToRejectReason - - value: screening_question_answers,candidate,current_stage - name: ScreeningQuestionAnswersCandidateCurrentStage - - value: screening_question_answers,candidate,current_stage,reject_reason - name: ScreeningQuestionAnswersCandidateCurrentStageRejectReason - - value: screening_question_answers,candidate,job - name: ScreeningQuestionAnswersCandidateJob - - value: screening_question_answers,candidate,job,credited_to - name: ScreeningQuestionAnswersCandidateJobCreditedTo - - value: screening_question_answers,candidate,job,credited_to,current_stage - name: ScreeningQuestionAnswersCandidateJobCreditedToCurrentStage - - value: >- - screening_question_answers,candidate,job,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersCandidateJobCreditedToCurrentStageRejectReason - - value: screening_question_answers,candidate,job,credited_to,reject_reason - name: ScreeningQuestionAnswersCandidateJobCreditedToRejectReason - - value: screening_question_answers,candidate,job,current_stage - name: ScreeningQuestionAnswersCandidateJobCurrentStage - - value: screening_question_answers,candidate,job,current_stage,reject_reason - name: ScreeningQuestionAnswersCandidateJobCurrentStageRejectReason - - value: screening_question_answers,candidate,job,reject_reason - name: ScreeningQuestionAnswersCandidateJobRejectReason - - value: screening_question_answers,candidate,reject_reason - name: ScreeningQuestionAnswersCandidateRejectReason - - value: screening_question_answers,credited_to - name: ScreeningQuestionAnswersCreditedTo - - value: screening_question_answers,credited_to,current_stage - name: ScreeningQuestionAnswersCreditedToCurrentStage - - value: screening_question_answers,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersCreditedToCurrentStageRejectReason - - value: screening_question_answers,credited_to,reject_reason - name: ScreeningQuestionAnswersCreditedToRejectReason - - value: screening_question_answers,current_stage - name: ScreeningQuestionAnswersCurrentStage - - value: screening_question_answers,current_stage,reject_reason - name: ScreeningQuestionAnswersCurrentStageRejectReason - - value: screening_question_answers,job - name: ScreeningQuestionAnswersJob - - value: screening_question_answers,job,credited_to - name: ScreeningQuestionAnswersJobCreditedTo - - value: screening_question_answers,job,credited_to,current_stage - name: ScreeningQuestionAnswersJobCreditedToCurrentStage - - value: screening_question_answers,job,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersJobCreditedToCurrentStageRejectReason - - value: screening_question_answers,job,credited_to,reject_reason - name: ScreeningQuestionAnswersJobCreditedToRejectReason - - value: screening_question_answers,job,current_stage - name: ScreeningQuestionAnswersJobCurrentStage - - value: screening_question_answers,job,current_stage,reject_reason - name: ScreeningQuestionAnswersJobCurrentStageRejectReason - - value: screening_question_answers,job,reject_reason - name: ScreeningQuestionAnswersJobRejectReason - - value: screening_question_answers,reject_reason - name: ScreeningQuestionAnswersRejectReason - - value: screening_question_answers,screening_question_answers.question - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestion - - value: >- - screening_question_answers,screening_question_answers.question,candidate - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidate - - value: >- - screening_question_answers,screening_question_answers.question,candidate,credited_to - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedTo - - value: >- - screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,credited_to,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,candidate,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJob - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,credited_to - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedTo - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,credited_to,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,credited_to - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedTo - - value: >- - screening_question_answers,screening_question_answers.question,credited_to,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,credited_to,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,current_stage - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCurrentStageRejectReason - - value: screening_question_answers,screening_question_answers.question,job - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJob - - value: >- - screening_question_answers,screening_question_answers.question,job,credited_to - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedTo - - value: >- - screening_question_answers,screening_question_answers.question,job,credited_to,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,job,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,job,credited_to,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,job,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,job,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,job,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,reject_reason - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionRejectReason - - value: screening_question_answers.question - name: ScreeningQuestionAnswersQuestion - - value: screening_question_answers.question,candidate - name: ScreeningQuestionAnswersQuestionCandidate - - value: screening_question_answers.question,candidate,credited_to - name: ScreeningQuestionAnswersQuestionCandidateCreditedTo - - value: >- - screening_question_answers.question,candidate,credited_to,current_stage - name: ScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStage - - value: >- - screening_question_answers.question,candidate,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers.question,candidate,credited_to,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateCreditedToRejectReason - - value: screening_question_answers.question,candidate,current_stage - name: ScreeningQuestionAnswersQuestionCandidateCurrentStage - - value: >- - screening_question_answers.question,candidate,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateCurrentStageRejectReason - - value: screening_question_answers.question,candidate,job - name: ScreeningQuestionAnswersQuestionCandidateJob - - value: screening_question_answers.question,candidate,job,credited_to - name: ScreeningQuestionAnswersQuestionCandidateJobCreditedTo - - value: >- - screening_question_answers.question,candidate,job,credited_to,current_stage - name: ScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStage - - value: >- - screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers.question,candidate,job,credited_to,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateJobCreditedToRejectReason - - value: screening_question_answers.question,candidate,job,current_stage - name: ScreeningQuestionAnswersQuestionCandidateJobCurrentStage - - value: >- - screening_question_answers.question,candidate,job,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateJobCurrentStageRejectReason - - value: screening_question_answers.question,candidate,job,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateJobRejectReason - - value: screening_question_answers.question,candidate,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateRejectReason - - value: screening_question_answers.question,credited_to - name: ScreeningQuestionAnswersQuestionCreditedTo - - value: screening_question_answers.question,credited_to,current_stage - name: ScreeningQuestionAnswersQuestionCreditedToCurrentStage - - value: >- - screening_question_answers.question,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionCreditedToCurrentStageRejectReason - - value: screening_question_answers.question,credited_to,reject_reason - name: ScreeningQuestionAnswersQuestionCreditedToRejectReason - - value: screening_question_answers.question,current_stage - name: ScreeningQuestionAnswersQuestionCurrentStage - - value: screening_question_answers.question,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionCurrentStageRejectReason - - value: screening_question_answers.question,job - name: ScreeningQuestionAnswersQuestionJob - - value: screening_question_answers.question,job,credited_to - name: ScreeningQuestionAnswersQuestionJobCreditedTo - - value: screening_question_answers.question,job,credited_to,current_stage - name: ScreeningQuestionAnswersQuestionJobCreditedToCurrentStage - - value: >- - screening_question_answers.question,job,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionJobCreditedToCurrentStageRejectReason - - value: screening_question_answers.question,job,credited_to,reject_reason - name: ScreeningQuestionAnswersQuestionJobCreditedToRejectReason - - value: screening_question_answers.question,job,current_stage - name: ScreeningQuestionAnswersQuestionJobCurrentStage - - value: screening_question_answers.question,job,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionJobCurrentStageRejectReason - - value: screening_question_answers.question,job,reject_reason - name: ScreeningQuestionAnswersQuestionJobRejectReason - - value: screening_question_answers.question,reject_reason - name: ScreeningQuestionAnswersQuestionRejectReason - source: - openapi: openapi/openapi.yml - ApplicationsRetrieveRequestExpand: - enum: - - candidate - - value: candidate,credited_to - name: CandidateCreditedTo - - value: candidate,credited_to,current_stage - name: CandidateCreditedToCurrentStage - - value: candidate,credited_to,current_stage,reject_reason - name: CandidateCreditedToCurrentStageRejectReason - - value: candidate,credited_to,reject_reason - name: CandidateCreditedToRejectReason - - value: candidate,current_stage - name: CandidateCurrentStage - - value: candidate,current_stage,reject_reason - name: CandidateCurrentStageRejectReason - - value: candidate,job - name: CandidateJob - - value: candidate,job,credited_to - name: CandidateJobCreditedTo - - value: candidate,job,credited_to,current_stage - name: CandidateJobCreditedToCurrentStage - - value: candidate,job,credited_to,current_stage,reject_reason - name: CandidateJobCreditedToCurrentStageRejectReason - - value: candidate,job,credited_to,reject_reason - name: CandidateJobCreditedToRejectReason - - value: candidate,job,current_stage - name: CandidateJobCurrentStage - - value: candidate,job,current_stage,reject_reason - name: CandidateJobCurrentStageRejectReason - - value: candidate,job,reject_reason - name: CandidateJobRejectReason - - value: candidate,reject_reason - name: CandidateRejectReason - - credited_to - - value: credited_to,current_stage - name: CreditedToCurrentStage - - value: credited_to,current_stage,reject_reason - name: CreditedToCurrentStageRejectReason - - value: credited_to,reject_reason - name: CreditedToRejectReason - - current_stage - - value: current_stage,reject_reason - name: CurrentStageRejectReason - - job - - value: job,credited_to - name: JobCreditedTo - - value: job,credited_to,current_stage - name: JobCreditedToCurrentStage - - value: job,credited_to,current_stage,reject_reason - name: JobCreditedToCurrentStageRejectReason - - value: job,credited_to,reject_reason - name: JobCreditedToRejectReason - - value: job,current_stage - name: JobCurrentStage - - value: job,current_stage,reject_reason - name: JobCurrentStageRejectReason - - value: job,reject_reason - name: JobRejectReason - - offers - - value: offers,candidate - name: OffersCandidate - - value: offers,candidate,credited_to - name: OffersCandidateCreditedTo - - value: offers,candidate,credited_to,current_stage - name: OffersCandidateCreditedToCurrentStage - - value: offers,candidate,credited_to,current_stage,reject_reason - name: OffersCandidateCreditedToCurrentStageRejectReason - - value: offers,candidate,credited_to,reject_reason - name: OffersCandidateCreditedToRejectReason - - value: offers,candidate,current_stage - name: OffersCandidateCurrentStage - - value: offers,candidate,current_stage,reject_reason - name: OffersCandidateCurrentStageRejectReason - - value: offers,candidate,job - name: OffersCandidateJob - - value: offers,candidate,job,credited_to - name: OffersCandidateJobCreditedTo - - value: offers,candidate,job,credited_to,current_stage - name: OffersCandidateJobCreditedToCurrentStage - - value: offers,candidate,job,credited_to,current_stage,reject_reason - name: OffersCandidateJobCreditedToCurrentStageRejectReason - - value: offers,candidate,job,credited_to,reject_reason - name: OffersCandidateJobCreditedToRejectReason - - value: offers,candidate,job,current_stage - name: OffersCandidateJobCurrentStage - - value: offers,candidate,job,current_stage,reject_reason - name: OffersCandidateJobCurrentStageRejectReason - - value: offers,candidate,job,reject_reason - name: OffersCandidateJobRejectReason - - value: offers,candidate,reject_reason - name: OffersCandidateRejectReason - - value: offers,credited_to - name: OffersCreditedTo - - value: offers,credited_to,current_stage - name: OffersCreditedToCurrentStage - - value: offers,credited_to,current_stage,reject_reason - name: OffersCreditedToCurrentStageRejectReason - - value: offers,credited_to,reject_reason - name: OffersCreditedToRejectReason - - value: offers,current_stage - name: OffersCurrentStage - - value: offers,current_stage,reject_reason - name: OffersCurrentStageRejectReason - - value: offers,job - name: OffersJob - - value: offers,job,credited_to - name: OffersJobCreditedTo - - value: offers,job,credited_to,current_stage - name: OffersJobCreditedToCurrentStage - - value: offers,job,credited_to,current_stage,reject_reason - name: OffersJobCreditedToCurrentStageRejectReason - - value: offers,job,credited_to,reject_reason - name: OffersJobCreditedToRejectReason - - value: offers,job,current_stage - name: OffersJobCurrentStage - - value: offers,job,current_stage,reject_reason - name: OffersJobCurrentStageRejectReason - - value: offers,job,reject_reason - name: OffersJobRejectReason - - value: offers,reject_reason - name: OffersRejectReason - - value: offers,screening_question_answers - name: OffersScreeningQuestionAnswers - - value: offers,screening_question_answers,candidate - name: OffersScreeningQuestionAnswersCandidate - - value: offers,screening_question_answers,candidate,credited_to - name: OffersScreeningQuestionAnswersCandidateCreditedTo - - value: offers,screening_question_answers,candidate,credited_to,current_stage - name: OffersScreeningQuestionAnswersCandidateCreditedToCurrentStage - - value: >- - offers,screening_question_answers,candidate,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersCandidateCreditedToCurrentStageRejectReason - - value: offers,screening_question_answers,candidate,credited_to,reject_reason - name: OffersScreeningQuestionAnswersCandidateCreditedToRejectReason - - value: offers,screening_question_answers,candidate,current_stage - name: OffersScreeningQuestionAnswersCandidateCurrentStage - - value: >- - offers,screening_question_answers,candidate,current_stage,reject_reason - name: OffersScreeningQuestionAnswersCandidateCurrentStageRejectReason - - value: offers,screening_question_answers,candidate,job - name: OffersScreeningQuestionAnswersCandidateJob - - value: offers,screening_question_answers,candidate,job,credited_to - name: OffersScreeningQuestionAnswersCandidateJobCreditedTo - - value: >- - offers,screening_question_answers,candidate,job,credited_to,current_stage - name: OffersScreeningQuestionAnswersCandidateJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers,candidate,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersCandidateJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,candidate,job,credited_to,reject_reason - name: OffersScreeningQuestionAnswersCandidateJobCreditedToRejectReason - - value: offers,screening_question_answers,candidate,job,current_stage - name: OffersScreeningQuestionAnswersCandidateJobCurrentStage - - value: >- - offers,screening_question_answers,candidate,job,current_stage,reject_reason - name: OffersScreeningQuestionAnswersCandidateJobCurrentStageRejectReason - - value: offers,screening_question_answers,candidate,job,reject_reason - name: OffersScreeningQuestionAnswersCandidateJobRejectReason - - value: offers,screening_question_answers,candidate,reject_reason - name: OffersScreeningQuestionAnswersCandidateRejectReason - - value: offers,screening_question_answers,credited_to - name: OffersScreeningQuestionAnswersCreditedTo - - value: offers,screening_question_answers,credited_to,current_stage - name: OffersScreeningQuestionAnswersCreditedToCurrentStage - - value: >- - offers,screening_question_answers,credited_to,current_stage,reject_reason - name: OffersScreeningQuestionAnswersCreditedToCurrentStageRejectReason - - value: offers,screening_question_answers,credited_to,reject_reason - name: OffersScreeningQuestionAnswersCreditedToRejectReason - - value: offers,screening_question_answers,current_stage - name: OffersScreeningQuestionAnswersCurrentStage - - value: offers,screening_question_answers,current_stage,reject_reason - name: OffersScreeningQuestionAnswersCurrentStageRejectReason - - value: offers,screening_question_answers,job - name: OffersScreeningQuestionAnswersJob - - value: offers,screening_question_answers,job,credited_to - name: OffersScreeningQuestionAnswersJobCreditedTo - - value: offers,screening_question_answers,job,credited_to,current_stage - name: OffersScreeningQuestionAnswersJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers,job,credited_to,current_stage,reject_reason - name: OffersScreeningQuestionAnswersJobCreditedToCurrentStageRejectReason - - value: offers,screening_question_answers,job,credited_to,reject_reason - name: OffersScreeningQuestionAnswersJobCreditedToRejectReason - - value: offers,screening_question_answers,job,current_stage - name: OffersScreeningQuestionAnswersJobCurrentStage - - value: offers,screening_question_answers,job,current_stage,reject_reason - name: OffersScreeningQuestionAnswersJobCurrentStageRejectReason - - value: offers,screening_question_answers,job,reject_reason - name: OffersScreeningQuestionAnswersJobRejectReason - - value: offers,screening_question_answers,reject_reason - name: OffersScreeningQuestionAnswersRejectReason - - value: offers,screening_question_answers,screening_question_answers.question - name: OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestion - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidate - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,credited_to - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedTo - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJob - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedTo - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,job,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,candidate,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,credited_to - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedTo - - value: >- - offers,screening_question_answers,screening_question_answers.question,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,job - name: OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJob - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,credited_to - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedTo - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,current_stage - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCurrentStage - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCurrentStageRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,job,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobRejectReason - - value: >- - offers,screening_question_answers,screening_question_answers.question,reject_reason - name: >- - OffersScreeningQuestionAnswersScreeningQuestionAnswersQuestionRejectReason - - value: offers,screening_question_answers.question - name: OffersScreeningQuestionAnswersQuestion - - value: offers,screening_question_answers.question,candidate - name: OffersScreeningQuestionAnswersQuestionCandidate - - value: offers,screening_question_answers.question,candidate,credited_to - name: OffersScreeningQuestionAnswersQuestionCandidateCreditedTo - - value: >- - offers,screening_question_answers.question,candidate,credited_to,current_stage - name: OffersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStage - - value: >- - offers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers.question,candidate,credited_to,reject_reason - name: OffersScreeningQuestionAnswersQuestionCandidateCreditedToRejectReason - - value: offers,screening_question_answers.question,candidate,current_stage - name: OffersScreeningQuestionAnswersQuestionCandidateCurrentStage - - value: >- - offers,screening_question_answers.question,candidate,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateCurrentStageRejectReason - - value: offers,screening_question_answers.question,candidate,job - name: OffersScreeningQuestionAnswersQuestionCandidateJob - - value: offers,screening_question_answers.question,candidate,job,credited_to - name: OffersScreeningQuestionAnswersQuestionCandidateJobCreditedTo - - value: >- - offers,screening_question_answers.question,candidate,job,credited_to,current_stage - name: >- - OffersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers.question,candidate,job,credited_to,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateJobCreditedToRejectReason - - value: offers,screening_question_answers.question,candidate,job,current_stage - name: OffersScreeningQuestionAnswersQuestionCandidateJobCurrentStage - - value: >- - offers,screening_question_answers.question,candidate,job,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCandidateJobCurrentStageRejectReason - - value: offers,screening_question_answers.question,candidate,job,reject_reason - name: OffersScreeningQuestionAnswersQuestionCandidateJobRejectReason - - value: offers,screening_question_answers.question,candidate,reject_reason - name: OffersScreeningQuestionAnswersQuestionCandidateRejectReason - - value: offers,screening_question_answers.question,credited_to - name: OffersScreeningQuestionAnswersQuestionCreditedTo - - value: offers,screening_question_answers.question,credited_to,current_stage - name: OffersScreeningQuestionAnswersQuestionCreditedToCurrentStage - - value: >- - offers,screening_question_answers.question,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionCreditedToCurrentStageRejectReason - - value: offers,screening_question_answers.question,credited_to,reject_reason - name: OffersScreeningQuestionAnswersQuestionCreditedToRejectReason - - value: offers,screening_question_answers.question,current_stage - name: OffersScreeningQuestionAnswersQuestionCurrentStage - - value: offers,screening_question_answers.question,current_stage,reject_reason - name: OffersScreeningQuestionAnswersQuestionCurrentStageRejectReason - - value: offers,screening_question_answers.question,job - name: OffersScreeningQuestionAnswersQuestionJob - - value: offers,screening_question_answers.question,job,credited_to - name: OffersScreeningQuestionAnswersQuestionJobCreditedTo - - value: >- - offers,screening_question_answers.question,job,credited_to,current_stage - name: OffersScreeningQuestionAnswersQuestionJobCreditedToCurrentStage - - value: >- - offers,screening_question_answers.question,job,credited_to,current_stage,reject_reason - name: >- - OffersScreeningQuestionAnswersQuestionJobCreditedToCurrentStageRejectReason - - value: >- - offers,screening_question_answers.question,job,credited_to,reject_reason - name: OffersScreeningQuestionAnswersQuestionJobCreditedToRejectReason - - value: offers,screening_question_answers.question,job,current_stage - name: OffersScreeningQuestionAnswersQuestionJobCurrentStage - - value: >- - offers,screening_question_answers.question,job,current_stage,reject_reason - name: OffersScreeningQuestionAnswersQuestionJobCurrentStageRejectReason - - value: offers,screening_question_answers.question,job,reject_reason - name: OffersScreeningQuestionAnswersQuestionJobRejectReason - - value: offers,screening_question_answers.question,reject_reason - name: OffersScreeningQuestionAnswersQuestionRejectReason - - reject_reason - - screening_question_answers - - value: screening_question_answers,candidate - name: ScreeningQuestionAnswersCandidate - - value: screening_question_answers,candidate,credited_to - name: ScreeningQuestionAnswersCandidateCreditedTo - - value: screening_question_answers,candidate,credited_to,current_stage - name: ScreeningQuestionAnswersCandidateCreditedToCurrentStage - - value: >- - screening_question_answers,candidate,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersCandidateCreditedToCurrentStageRejectReason - - value: screening_question_answers,candidate,credited_to,reject_reason - name: ScreeningQuestionAnswersCandidateCreditedToRejectReason - - value: screening_question_answers,candidate,current_stage - name: ScreeningQuestionAnswersCandidateCurrentStage - - value: screening_question_answers,candidate,current_stage,reject_reason - name: ScreeningQuestionAnswersCandidateCurrentStageRejectReason - - value: screening_question_answers,candidate,job - name: ScreeningQuestionAnswersCandidateJob - - value: screening_question_answers,candidate,job,credited_to - name: ScreeningQuestionAnswersCandidateJobCreditedTo - - value: screening_question_answers,candidate,job,credited_to,current_stage - name: ScreeningQuestionAnswersCandidateJobCreditedToCurrentStage - - value: >- - screening_question_answers,candidate,job,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersCandidateJobCreditedToCurrentStageRejectReason - - value: screening_question_answers,candidate,job,credited_to,reject_reason - name: ScreeningQuestionAnswersCandidateJobCreditedToRejectReason - - value: screening_question_answers,candidate,job,current_stage - name: ScreeningQuestionAnswersCandidateJobCurrentStage - - value: screening_question_answers,candidate,job,current_stage,reject_reason - name: ScreeningQuestionAnswersCandidateJobCurrentStageRejectReason - - value: screening_question_answers,candidate,job,reject_reason - name: ScreeningQuestionAnswersCandidateJobRejectReason - - value: screening_question_answers,candidate,reject_reason - name: ScreeningQuestionAnswersCandidateRejectReason - - value: screening_question_answers,credited_to - name: ScreeningQuestionAnswersCreditedTo - - value: screening_question_answers,credited_to,current_stage - name: ScreeningQuestionAnswersCreditedToCurrentStage - - value: screening_question_answers,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersCreditedToCurrentStageRejectReason - - value: screening_question_answers,credited_to,reject_reason - name: ScreeningQuestionAnswersCreditedToRejectReason - - value: screening_question_answers,current_stage - name: ScreeningQuestionAnswersCurrentStage - - value: screening_question_answers,current_stage,reject_reason - name: ScreeningQuestionAnswersCurrentStageRejectReason - - value: screening_question_answers,job - name: ScreeningQuestionAnswersJob - - value: screening_question_answers,job,credited_to - name: ScreeningQuestionAnswersJobCreditedTo - - value: screening_question_answers,job,credited_to,current_stage - name: ScreeningQuestionAnswersJobCreditedToCurrentStage - - value: screening_question_answers,job,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersJobCreditedToCurrentStageRejectReason - - value: screening_question_answers,job,credited_to,reject_reason - name: ScreeningQuestionAnswersJobCreditedToRejectReason - - value: screening_question_answers,job,current_stage - name: ScreeningQuestionAnswersJobCurrentStage - - value: screening_question_answers,job,current_stage,reject_reason - name: ScreeningQuestionAnswersJobCurrentStageRejectReason - - value: screening_question_answers,job,reject_reason - name: ScreeningQuestionAnswersJobRejectReason - - value: screening_question_answers,reject_reason - name: ScreeningQuestionAnswersRejectReason - - value: screening_question_answers,screening_question_answers.question - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestion - - value: >- - screening_question_answers,screening_question_answers.question,candidate - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidate - - value: >- - screening_question_answers,screening_question_answers.question,candidate,credited_to - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedTo - - value: >- - screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,credited_to,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCreditedToRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,candidate,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJob - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,credited_to - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedTo - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,credited_to,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCreditedToRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,job,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateJobRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,candidate,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCandidateRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,credited_to - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedTo - - value: >- - screening_question_answers,screening_question_answers.question,credited_to,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,credited_to,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCreditedToRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,current_stage - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionCurrentStageRejectReason - - value: screening_question_answers,screening_question_answers.question,job - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJob - - value: >- - screening_question_answers,screening_question_answers.question,job,credited_to - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedTo - - value: >- - screening_question_answers,screening_question_answers.question,job,credited_to,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,job,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,job,credited_to,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCreditedToRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,job,current_stage - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCurrentStage - - value: >- - screening_question_answers,screening_question_answers.question,job,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobCurrentStageRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,job,reject_reason - name: >- - ScreeningQuestionAnswersScreeningQuestionAnswersQuestionJobRejectReason - - value: >- - screening_question_answers,screening_question_answers.question,reject_reason - name: ScreeningQuestionAnswersScreeningQuestionAnswersQuestionRejectReason - - value: screening_question_answers.question - name: ScreeningQuestionAnswersQuestion - - value: screening_question_answers.question,candidate - name: ScreeningQuestionAnswersQuestionCandidate - - value: screening_question_answers.question,candidate,credited_to - name: ScreeningQuestionAnswersQuestionCandidateCreditedTo - - value: >- - screening_question_answers.question,candidate,credited_to,current_stage - name: ScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStage - - value: >- - screening_question_answers.question,candidate,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersQuestionCandidateCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers.question,candidate,credited_to,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateCreditedToRejectReason - - value: screening_question_answers.question,candidate,current_stage - name: ScreeningQuestionAnswersQuestionCandidateCurrentStage - - value: >- - screening_question_answers.question,candidate,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateCurrentStageRejectReason - - value: screening_question_answers.question,candidate,job - name: ScreeningQuestionAnswersQuestionCandidateJob - - value: screening_question_answers.question,candidate,job,credited_to - name: ScreeningQuestionAnswersQuestionCandidateJobCreditedTo - - value: >- - screening_question_answers.question,candidate,job,credited_to,current_stage - name: ScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStage - - value: >- - screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - name: >- - ScreeningQuestionAnswersQuestionCandidateJobCreditedToCurrentStageRejectReason - - value: >- - screening_question_answers.question,candidate,job,credited_to,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateJobCreditedToRejectReason - - value: screening_question_answers.question,candidate,job,current_stage - name: ScreeningQuestionAnswersQuestionCandidateJobCurrentStage - - value: >- - screening_question_answers.question,candidate,job,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateJobCurrentStageRejectReason - - value: screening_question_answers.question,candidate,job,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateJobRejectReason - - value: screening_question_answers.question,candidate,reject_reason - name: ScreeningQuestionAnswersQuestionCandidateRejectReason - - value: screening_question_answers.question,credited_to - name: ScreeningQuestionAnswersQuestionCreditedTo - - value: screening_question_answers.question,credited_to,current_stage - name: ScreeningQuestionAnswersQuestionCreditedToCurrentStage - - value: >- - screening_question_answers.question,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionCreditedToCurrentStageRejectReason - - value: screening_question_answers.question,credited_to,reject_reason - name: ScreeningQuestionAnswersQuestionCreditedToRejectReason - - value: screening_question_answers.question,current_stage - name: ScreeningQuestionAnswersQuestionCurrentStage - - value: screening_question_answers.question,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionCurrentStageRejectReason - - value: screening_question_answers.question,job - name: ScreeningQuestionAnswersQuestionJob - - value: screening_question_answers.question,job,credited_to - name: ScreeningQuestionAnswersQuestionJobCreditedTo - - value: screening_question_answers.question,job,credited_to,current_stage - name: ScreeningQuestionAnswersQuestionJobCreditedToCurrentStage - - value: >- - screening_question_answers.question,job,credited_to,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionJobCreditedToCurrentStageRejectReason - - value: screening_question_answers.question,job,credited_to,reject_reason - name: ScreeningQuestionAnswersQuestionJobCreditedToRejectReason - - value: screening_question_answers.question,job,current_stage - name: ScreeningQuestionAnswersQuestionJobCurrentStage - - value: screening_question_answers.question,job,current_stage,reject_reason - name: ScreeningQuestionAnswersQuestionJobCurrentStageRejectReason - - value: screening_question_answers.question,job,reject_reason - name: ScreeningQuestionAnswersQuestionJobRejectReason - - value: screening_question_answers.question,reject_reason - name: ScreeningQuestionAnswersQuestionRejectReason - source: - openapi: openapi/openapi.yml -imports: - root: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/applications - method: GET - auth: true - docs: Returns a list of `Application` objects. - source: - openapi: openapi/openapi.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 - 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: root.PaginatedApplicationList - status-code: 200 - examples: - - headers: {} - 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: true - 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: openapi/openapi.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: root.ApplicationRequest - remote_user_id: string - content-type: application/json - response: - docs: '' - type: root.ApplicationResponse - status-code: 201 - examples: - - headers: {} - 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: true - docs: Returns an `Application` object with the given `id`. - source: - openapi: openapi/openapi.yml - path-parameters: - id: string - request: - name: ApplicationsRetrieveRequest - query-parameters: - expand: - type: optional - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - include_remote_data: - type: optional - docs: >- - Whether to include the original data Merge fetched from the - third-party to produce these models. - include_shell_data: - type: optional - docs: >- - Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - response: - docs: '' - type: root.Application - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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: true - docs: Updates the `current_stage` field of an `Application` object - source: - openapi: openapi/openapi.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: root.ApplicationResponse - status-code: 201 - examples: - - path-parameters: - id: id - headers: {} - 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: true - docs: Returns metadata for `Application` POSTs. - source: - openapi: openapi/openapi.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: root.MetaResponse - status-code: 200 - examples: - - headers: {} - 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: openapi/openapi.yml diff --git a/.mock/definition/hris/employees.yml b/.mock/definition/hris/employees.yml deleted file mode 100644 index cfbca08..0000000 --- a/.mock/definition/hris/employees.yml +++ /dev/null @@ -1,1779 +0,0 @@ -types: - EmployeesListRequestEmploymentStatus: - enum: - - ACTIVE - - INACTIVE - - PENDING - source: - openapi: openapi/openapi.yml - EmployeesListRequestExpand: - enum: - - company - - value: company,pay_group - name: CompanyPayGroup - - employments - - value: employments,company - name: EmploymentsCompany - - value: employments,company,pay_group - name: EmploymentsCompanyPayGroup - - value: employments,groups - name: EmploymentsGroups - - value: employments,groups,company - name: EmploymentsGroupsCompany - - value: employments,groups,company,pay_group - name: EmploymentsGroupsCompanyPayGroup - - value: employments,groups,home_location - name: EmploymentsGroupsHomeLocation - - value: employments,groups,home_location,company - name: EmploymentsGroupsHomeLocationCompany - - value: employments,groups,home_location,company,pay_group - name: EmploymentsGroupsHomeLocationCompanyPayGroup - - value: employments,groups,home_location,manager - name: EmploymentsGroupsHomeLocationManager - - value: employments,groups,home_location,manager,company - name: EmploymentsGroupsHomeLocationManagerCompany - - value: employments,groups,home_location,manager,company,pay_group - name: EmploymentsGroupsHomeLocationManagerCompanyPayGroup - - value: employments,groups,home_location,manager,pay_group - name: EmploymentsGroupsHomeLocationManagerPayGroup - - value: employments,groups,home_location,manager,team - name: EmploymentsGroupsHomeLocationManagerTeam - - value: employments,groups,home_location,manager,team,company - name: EmploymentsGroupsHomeLocationManagerTeamCompany - - value: employments,groups,home_location,manager,team,company,pay_group - name: EmploymentsGroupsHomeLocationManagerTeamCompanyPayGroup - - value: employments,groups,home_location,manager,team,pay_group - name: EmploymentsGroupsHomeLocationManagerTeamPayGroup - - value: employments,groups,home_location,pay_group - name: EmploymentsGroupsHomeLocationPayGroup - - value: employments,groups,home_location,team - name: EmploymentsGroupsHomeLocationTeam - - value: employments,groups,home_location,team,company - name: EmploymentsGroupsHomeLocationTeamCompany - - value: employments,groups,home_location,team,company,pay_group - name: EmploymentsGroupsHomeLocationTeamCompanyPayGroup - - value: employments,groups,home_location,team,pay_group - name: EmploymentsGroupsHomeLocationTeamPayGroup - - value: employments,groups,home_location,work_location - name: EmploymentsGroupsHomeLocationWorkLocation - - value: employments,groups,home_location,work_location,company - name: EmploymentsGroupsHomeLocationWorkLocationCompany - - value: employments,groups,home_location,work_location,company,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationCompanyPayGroup - - value: employments,groups,home_location,work_location,manager - name: EmploymentsGroupsHomeLocationWorkLocationManager - - value: employments,groups,home_location,work_location,manager,company - name: EmploymentsGroupsHomeLocationWorkLocationManagerCompany - - value: >- - employments,groups,home_location,work_location,manager,company,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationManagerCompanyPayGroup - - value: employments,groups,home_location,work_location,manager,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationManagerPayGroup - - value: employments,groups,home_location,work_location,manager,team - name: EmploymentsGroupsHomeLocationWorkLocationManagerTeam - - value: employments,groups,home_location,work_location,manager,team,company - name: EmploymentsGroupsHomeLocationWorkLocationManagerTeamCompany - - value: >- - employments,groups,home_location,work_location,manager,team,company,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationManagerTeamCompanyPayGroup - - value: employments,groups,home_location,work_location,manager,team,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationManagerTeamPayGroup - - value: employments,groups,home_location,work_location,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationPayGroup - - value: employments,groups,home_location,work_location,team - name: EmploymentsGroupsHomeLocationWorkLocationTeam - - value: employments,groups,home_location,work_location,team,company - name: EmploymentsGroupsHomeLocationWorkLocationTeamCompany - - value: employments,groups,home_location,work_location,team,company,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationTeamCompanyPayGroup - - value: employments,groups,home_location,work_location,team,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationTeamPayGroup - - value: employments,groups,manager - name: EmploymentsGroupsManager - - value: employments,groups,manager,company - name: EmploymentsGroupsManagerCompany - - value: employments,groups,manager,company,pay_group - name: EmploymentsGroupsManagerCompanyPayGroup - - value: employments,groups,manager,pay_group - name: EmploymentsGroupsManagerPayGroup - - value: employments,groups,manager,team - name: EmploymentsGroupsManagerTeam - - value: employments,groups,manager,team,company - name: EmploymentsGroupsManagerTeamCompany - - value: employments,groups,manager,team,company,pay_group - name: EmploymentsGroupsManagerTeamCompanyPayGroup - - value: employments,groups,manager,team,pay_group - name: EmploymentsGroupsManagerTeamPayGroup - - value: employments,groups,pay_group - name: EmploymentsGroupsPayGroup - - value: employments,groups,team - name: EmploymentsGroupsTeam - - value: employments,groups,team,company - name: EmploymentsGroupsTeamCompany - - value: employments,groups,team,company,pay_group - name: EmploymentsGroupsTeamCompanyPayGroup - - value: employments,groups,team,pay_group - name: EmploymentsGroupsTeamPayGroup - - value: employments,groups,work_location - name: EmploymentsGroupsWorkLocation - - value: employments,groups,work_location,company - name: EmploymentsGroupsWorkLocationCompany - - value: employments,groups,work_location,company,pay_group - name: EmploymentsGroupsWorkLocationCompanyPayGroup - - value: employments,groups,work_location,manager - name: EmploymentsGroupsWorkLocationManager - - value: employments,groups,work_location,manager,company - name: EmploymentsGroupsWorkLocationManagerCompany - - value: employments,groups,work_location,manager,company,pay_group - name: EmploymentsGroupsWorkLocationManagerCompanyPayGroup - - value: employments,groups,work_location,manager,pay_group - name: EmploymentsGroupsWorkLocationManagerPayGroup - - value: employments,groups,work_location,manager,team - name: EmploymentsGroupsWorkLocationManagerTeam - - value: employments,groups,work_location,manager,team,company - name: EmploymentsGroupsWorkLocationManagerTeamCompany - - value: employments,groups,work_location,manager,team,company,pay_group - name: EmploymentsGroupsWorkLocationManagerTeamCompanyPayGroup - - value: employments,groups,work_location,manager,team,pay_group - name: EmploymentsGroupsWorkLocationManagerTeamPayGroup - - value: employments,groups,work_location,pay_group - name: EmploymentsGroupsWorkLocationPayGroup - - value: employments,groups,work_location,team - name: EmploymentsGroupsWorkLocationTeam - - value: employments,groups,work_location,team,company - name: EmploymentsGroupsWorkLocationTeamCompany - - value: employments,groups,work_location,team,company,pay_group - name: EmploymentsGroupsWorkLocationTeamCompanyPayGroup - - value: employments,groups,work_location,team,pay_group - name: EmploymentsGroupsWorkLocationTeamPayGroup - - value: employments,home_location - name: EmploymentsHomeLocation - - value: employments,home_location,company - name: EmploymentsHomeLocationCompany - - value: employments,home_location,company,pay_group - name: EmploymentsHomeLocationCompanyPayGroup - - value: employments,home_location,manager - name: EmploymentsHomeLocationManager - - value: employments,home_location,manager,company - name: EmploymentsHomeLocationManagerCompany - - value: employments,home_location,manager,company,pay_group - name: EmploymentsHomeLocationManagerCompanyPayGroup - - value: employments,home_location,manager,pay_group - name: EmploymentsHomeLocationManagerPayGroup - - value: employments,home_location,manager,team - name: EmploymentsHomeLocationManagerTeam - - value: employments,home_location,manager,team,company - name: EmploymentsHomeLocationManagerTeamCompany - - value: employments,home_location,manager,team,company,pay_group - name: EmploymentsHomeLocationManagerTeamCompanyPayGroup - - value: employments,home_location,manager,team,pay_group - name: EmploymentsHomeLocationManagerTeamPayGroup - - value: employments,home_location,pay_group - name: EmploymentsHomeLocationPayGroup - - value: employments,home_location,team - name: EmploymentsHomeLocationTeam - - value: employments,home_location,team,company - name: EmploymentsHomeLocationTeamCompany - - value: employments,home_location,team,company,pay_group - name: EmploymentsHomeLocationTeamCompanyPayGroup - - value: employments,home_location,team,pay_group - name: EmploymentsHomeLocationTeamPayGroup - - value: employments,home_location,work_location - name: EmploymentsHomeLocationWorkLocation - - value: employments,home_location,work_location,company - name: EmploymentsHomeLocationWorkLocationCompany - - value: employments,home_location,work_location,company,pay_group - name: EmploymentsHomeLocationWorkLocationCompanyPayGroup - - value: employments,home_location,work_location,manager - name: EmploymentsHomeLocationWorkLocationManager - - value: employments,home_location,work_location,manager,company - name: EmploymentsHomeLocationWorkLocationManagerCompany - - value: employments,home_location,work_location,manager,company,pay_group - name: EmploymentsHomeLocationWorkLocationManagerCompanyPayGroup - - value: employments,home_location,work_location,manager,pay_group - name: EmploymentsHomeLocationWorkLocationManagerPayGroup - - value: employments,home_location,work_location,manager,team - name: EmploymentsHomeLocationWorkLocationManagerTeam - - value: employments,home_location,work_location,manager,team,company - name: EmploymentsHomeLocationWorkLocationManagerTeamCompany - - value: employments,home_location,work_location,manager,team,company,pay_group - name: EmploymentsHomeLocationWorkLocationManagerTeamCompanyPayGroup - - value: employments,home_location,work_location,manager,team,pay_group - name: EmploymentsHomeLocationWorkLocationManagerTeamPayGroup - - value: employments,home_location,work_location,pay_group - name: EmploymentsHomeLocationWorkLocationPayGroup - - value: employments,home_location,work_location,team - name: EmploymentsHomeLocationWorkLocationTeam - - value: employments,home_location,work_location,team,company - name: EmploymentsHomeLocationWorkLocationTeamCompany - - value: employments,home_location,work_location,team,company,pay_group - name: EmploymentsHomeLocationWorkLocationTeamCompanyPayGroup - - value: employments,home_location,work_location,team,pay_group - name: EmploymentsHomeLocationWorkLocationTeamPayGroup - - value: employments,manager - name: EmploymentsManager - - value: employments,manager,company - name: EmploymentsManagerCompany - - value: employments,manager,company,pay_group - name: EmploymentsManagerCompanyPayGroup - - value: employments,manager,pay_group - name: EmploymentsManagerPayGroup - - value: employments,manager,team - name: EmploymentsManagerTeam - - value: employments,manager,team,company - name: EmploymentsManagerTeamCompany - - value: employments,manager,team,company,pay_group - name: EmploymentsManagerTeamCompanyPayGroup - - value: employments,manager,team,pay_group - name: EmploymentsManagerTeamPayGroup - - value: employments,pay_group - name: EmploymentsPayGroup - - value: employments,team - name: EmploymentsTeam - - value: employments,team,company - name: EmploymentsTeamCompany - - value: employments,team,company,pay_group - name: EmploymentsTeamCompanyPayGroup - - value: employments,team,pay_group - name: EmploymentsTeamPayGroup - - value: employments,work_location - name: EmploymentsWorkLocation - - value: employments,work_location,company - name: EmploymentsWorkLocationCompany - - value: employments,work_location,company,pay_group - name: EmploymentsWorkLocationCompanyPayGroup - - value: employments,work_location,manager - name: EmploymentsWorkLocationManager - - value: employments,work_location,manager,company - name: EmploymentsWorkLocationManagerCompany - - value: employments,work_location,manager,company,pay_group - name: EmploymentsWorkLocationManagerCompanyPayGroup - - value: employments,work_location,manager,pay_group - name: EmploymentsWorkLocationManagerPayGroup - - value: employments,work_location,manager,team - name: EmploymentsWorkLocationManagerTeam - - value: employments,work_location,manager,team,company - name: EmploymentsWorkLocationManagerTeamCompany - - value: employments,work_location,manager,team,company,pay_group - name: EmploymentsWorkLocationManagerTeamCompanyPayGroup - - value: employments,work_location,manager,team,pay_group - name: EmploymentsWorkLocationManagerTeamPayGroup - - value: employments,work_location,pay_group - name: EmploymentsWorkLocationPayGroup - - value: employments,work_location,team - name: EmploymentsWorkLocationTeam - - value: employments,work_location,team,company - name: EmploymentsWorkLocationTeamCompany - - value: employments,work_location,team,company,pay_group - name: EmploymentsWorkLocationTeamCompanyPayGroup - - value: employments,work_location,team,pay_group - name: EmploymentsWorkLocationTeamPayGroup - - groups - - value: groups,company - name: GroupsCompany - - value: groups,company,pay_group - name: GroupsCompanyPayGroup - - value: groups,home_location - name: GroupsHomeLocation - - value: groups,home_location,company - name: GroupsHomeLocationCompany - - value: groups,home_location,company,pay_group - name: GroupsHomeLocationCompanyPayGroup - - value: groups,home_location,manager - name: GroupsHomeLocationManager - - value: groups,home_location,manager,company - name: GroupsHomeLocationManagerCompany - - value: groups,home_location,manager,company,pay_group - name: GroupsHomeLocationManagerCompanyPayGroup - - value: groups,home_location,manager,pay_group - name: GroupsHomeLocationManagerPayGroup - - value: groups,home_location,manager,team - name: GroupsHomeLocationManagerTeam - - value: groups,home_location,manager,team,company - name: GroupsHomeLocationManagerTeamCompany - - value: groups,home_location,manager,team,company,pay_group - name: GroupsHomeLocationManagerTeamCompanyPayGroup - - value: groups,home_location,manager,team,pay_group - name: GroupsHomeLocationManagerTeamPayGroup - - value: groups,home_location,pay_group - name: GroupsHomeLocationPayGroup - - value: groups,home_location,team - name: GroupsHomeLocationTeam - - value: groups,home_location,team,company - name: GroupsHomeLocationTeamCompany - - value: groups,home_location,team,company,pay_group - name: GroupsHomeLocationTeamCompanyPayGroup - - value: groups,home_location,team,pay_group - name: GroupsHomeLocationTeamPayGroup - - value: groups,home_location,work_location - name: GroupsHomeLocationWorkLocation - - value: groups,home_location,work_location,company - name: GroupsHomeLocationWorkLocationCompany - - value: groups,home_location,work_location,company,pay_group - name: GroupsHomeLocationWorkLocationCompanyPayGroup - - value: groups,home_location,work_location,manager - name: GroupsHomeLocationWorkLocationManager - - value: groups,home_location,work_location,manager,company - name: GroupsHomeLocationWorkLocationManagerCompany - - value: groups,home_location,work_location,manager,company,pay_group - name: GroupsHomeLocationWorkLocationManagerCompanyPayGroup - - value: groups,home_location,work_location,manager,pay_group - name: GroupsHomeLocationWorkLocationManagerPayGroup - - value: groups,home_location,work_location,manager,team - name: GroupsHomeLocationWorkLocationManagerTeam - - value: groups,home_location,work_location,manager,team,company - name: GroupsHomeLocationWorkLocationManagerTeamCompany - - value: groups,home_location,work_location,manager,team,company,pay_group - name: GroupsHomeLocationWorkLocationManagerTeamCompanyPayGroup - - value: groups,home_location,work_location,manager,team,pay_group - name: GroupsHomeLocationWorkLocationManagerTeamPayGroup - - value: groups,home_location,work_location,pay_group - name: GroupsHomeLocationWorkLocationPayGroup - - value: groups,home_location,work_location,team - name: GroupsHomeLocationWorkLocationTeam - - value: groups,home_location,work_location,team,company - name: GroupsHomeLocationWorkLocationTeamCompany - - value: groups,home_location,work_location,team,company,pay_group - name: GroupsHomeLocationWorkLocationTeamCompanyPayGroup - - value: groups,home_location,work_location,team,pay_group - name: GroupsHomeLocationWorkLocationTeamPayGroup - - value: groups,manager - name: GroupsManager - - value: groups,manager,company - name: GroupsManagerCompany - - value: groups,manager,company,pay_group - name: GroupsManagerCompanyPayGroup - - value: groups,manager,pay_group - name: GroupsManagerPayGroup - - value: groups,manager,team - name: GroupsManagerTeam - - value: groups,manager,team,company - name: GroupsManagerTeamCompany - - value: groups,manager,team,company,pay_group - name: GroupsManagerTeamCompanyPayGroup - - value: groups,manager,team,pay_group - name: GroupsManagerTeamPayGroup - - value: groups,pay_group - name: GroupsPayGroup - - value: groups,team - name: GroupsTeam - - value: groups,team,company - name: GroupsTeamCompany - - value: groups,team,company,pay_group - name: GroupsTeamCompanyPayGroup - - value: groups,team,pay_group - name: GroupsTeamPayGroup - - value: groups,work_location - name: GroupsWorkLocation - - value: groups,work_location,company - name: GroupsWorkLocationCompany - - value: groups,work_location,company,pay_group - name: GroupsWorkLocationCompanyPayGroup - - value: groups,work_location,manager - name: GroupsWorkLocationManager - - value: groups,work_location,manager,company - name: GroupsWorkLocationManagerCompany - - value: groups,work_location,manager,company,pay_group - name: GroupsWorkLocationManagerCompanyPayGroup - - value: groups,work_location,manager,pay_group - name: GroupsWorkLocationManagerPayGroup - - value: groups,work_location,manager,team - name: GroupsWorkLocationManagerTeam - - value: groups,work_location,manager,team,company - name: GroupsWorkLocationManagerTeamCompany - - value: groups,work_location,manager,team,company,pay_group - name: GroupsWorkLocationManagerTeamCompanyPayGroup - - value: groups,work_location,manager,team,pay_group - name: GroupsWorkLocationManagerTeamPayGroup - - value: groups,work_location,pay_group - name: GroupsWorkLocationPayGroup - - value: groups,work_location,team - name: GroupsWorkLocationTeam - - value: groups,work_location,team,company - name: GroupsWorkLocationTeamCompany - - value: groups,work_location,team,company,pay_group - name: GroupsWorkLocationTeamCompanyPayGroup - - value: groups,work_location,team,pay_group - name: GroupsWorkLocationTeamPayGroup - - home_location - - value: home_location,company - name: HomeLocationCompany - - value: home_location,company,pay_group - name: HomeLocationCompanyPayGroup - - value: home_location,manager - name: HomeLocationManager - - value: home_location,manager,company - name: HomeLocationManagerCompany - - value: home_location,manager,company,pay_group - name: HomeLocationManagerCompanyPayGroup - - value: home_location,manager,pay_group - name: HomeLocationManagerPayGroup - - value: home_location,manager,team - name: HomeLocationManagerTeam - - value: home_location,manager,team,company - name: HomeLocationManagerTeamCompany - - value: home_location,manager,team,company,pay_group - name: HomeLocationManagerTeamCompanyPayGroup - - value: home_location,manager,team,pay_group - name: HomeLocationManagerTeamPayGroup - - value: home_location,pay_group - name: HomeLocationPayGroup - - value: home_location,team - name: HomeLocationTeam - - value: home_location,team,company - name: HomeLocationTeamCompany - - value: home_location,team,company,pay_group - name: HomeLocationTeamCompanyPayGroup - - value: home_location,team,pay_group - name: HomeLocationTeamPayGroup - - value: home_location,work_location - name: HomeLocationWorkLocation - - value: home_location,work_location,company - name: HomeLocationWorkLocationCompany - - value: home_location,work_location,company,pay_group - name: HomeLocationWorkLocationCompanyPayGroup - - value: home_location,work_location,manager - name: HomeLocationWorkLocationManager - - value: home_location,work_location,manager,company - name: HomeLocationWorkLocationManagerCompany - - value: home_location,work_location,manager,company,pay_group - name: HomeLocationWorkLocationManagerCompanyPayGroup - - value: home_location,work_location,manager,pay_group - name: HomeLocationWorkLocationManagerPayGroup - - value: home_location,work_location,manager,team - name: HomeLocationWorkLocationManagerTeam - - value: home_location,work_location,manager,team,company - name: HomeLocationWorkLocationManagerTeamCompany - - value: home_location,work_location,manager,team,company,pay_group - name: HomeLocationWorkLocationManagerTeamCompanyPayGroup - - value: home_location,work_location,manager,team,pay_group - name: HomeLocationWorkLocationManagerTeamPayGroup - - value: home_location,work_location,pay_group - name: HomeLocationWorkLocationPayGroup - - value: home_location,work_location,team - name: HomeLocationWorkLocationTeam - - value: home_location,work_location,team,company - name: HomeLocationWorkLocationTeamCompany - - value: home_location,work_location,team,company,pay_group - name: HomeLocationWorkLocationTeamCompanyPayGroup - - value: home_location,work_location,team,pay_group - name: HomeLocationWorkLocationTeamPayGroup - - manager - - value: manager,company - name: ManagerCompany - - value: manager,company,pay_group - name: ManagerCompanyPayGroup - - value: manager,pay_group - name: ManagerPayGroup - - value: manager,team - name: ManagerTeam - - value: manager,team,company - name: ManagerTeamCompany - - value: manager,team,company,pay_group - name: ManagerTeamCompanyPayGroup - - value: manager,team,pay_group - name: ManagerTeamPayGroup - - pay_group - - team - - value: team,company - name: TeamCompany - - value: team,company,pay_group - name: TeamCompanyPayGroup - - value: team,pay_group - name: TeamPayGroup - - work_location - - value: work_location,company - name: WorkLocationCompany - - value: work_location,company,pay_group - name: WorkLocationCompanyPayGroup - - value: work_location,manager - name: WorkLocationManager - - value: work_location,manager,company - name: WorkLocationManagerCompany - - value: work_location,manager,company,pay_group - name: WorkLocationManagerCompanyPayGroup - - value: work_location,manager,pay_group - name: WorkLocationManagerPayGroup - - value: work_location,manager,team - name: WorkLocationManagerTeam - - value: work_location,manager,team,company - name: WorkLocationManagerTeamCompany - - value: work_location,manager,team,company,pay_group - name: WorkLocationManagerTeamCompanyPayGroup - - value: work_location,manager,team,pay_group - name: WorkLocationManagerTeamPayGroup - - value: work_location,pay_group - name: WorkLocationPayGroup - - value: work_location,team - name: WorkLocationTeam - - value: work_location,team,company - name: WorkLocationTeamCompany - - value: work_location,team,company,pay_group - name: WorkLocationTeamCompanyPayGroup - - value: work_location,team,pay_group - name: WorkLocationTeamPayGroup - source: - openapi: openapi/openapi.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: openapi/openapi.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: openapi/openapi.yml - EmployeesRetrieveRequestExpand: - enum: - - company - - value: company,pay_group - name: CompanyPayGroup - - employments - - value: employments,company - name: EmploymentsCompany - - value: employments,company,pay_group - name: EmploymentsCompanyPayGroup - - value: employments,groups - name: EmploymentsGroups - - value: employments,groups,company - name: EmploymentsGroupsCompany - - value: employments,groups,company,pay_group - name: EmploymentsGroupsCompanyPayGroup - - value: employments,groups,home_location - name: EmploymentsGroupsHomeLocation - - value: employments,groups,home_location,company - name: EmploymentsGroupsHomeLocationCompany - - value: employments,groups,home_location,company,pay_group - name: EmploymentsGroupsHomeLocationCompanyPayGroup - - value: employments,groups,home_location,manager - name: EmploymentsGroupsHomeLocationManager - - value: employments,groups,home_location,manager,company - name: EmploymentsGroupsHomeLocationManagerCompany - - value: employments,groups,home_location,manager,company,pay_group - name: EmploymentsGroupsHomeLocationManagerCompanyPayGroup - - value: employments,groups,home_location,manager,pay_group - name: EmploymentsGroupsHomeLocationManagerPayGroup - - value: employments,groups,home_location,manager,team - name: EmploymentsGroupsHomeLocationManagerTeam - - value: employments,groups,home_location,manager,team,company - name: EmploymentsGroupsHomeLocationManagerTeamCompany - - value: employments,groups,home_location,manager,team,company,pay_group - name: EmploymentsGroupsHomeLocationManagerTeamCompanyPayGroup - - value: employments,groups,home_location,manager,team,pay_group - name: EmploymentsGroupsHomeLocationManagerTeamPayGroup - - value: employments,groups,home_location,pay_group - name: EmploymentsGroupsHomeLocationPayGroup - - value: employments,groups,home_location,team - name: EmploymentsGroupsHomeLocationTeam - - value: employments,groups,home_location,team,company - name: EmploymentsGroupsHomeLocationTeamCompany - - value: employments,groups,home_location,team,company,pay_group - name: EmploymentsGroupsHomeLocationTeamCompanyPayGroup - - value: employments,groups,home_location,team,pay_group - name: EmploymentsGroupsHomeLocationTeamPayGroup - - value: employments,groups,home_location,work_location - name: EmploymentsGroupsHomeLocationWorkLocation - - value: employments,groups,home_location,work_location,company - name: EmploymentsGroupsHomeLocationWorkLocationCompany - - value: employments,groups,home_location,work_location,company,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationCompanyPayGroup - - value: employments,groups,home_location,work_location,manager - name: EmploymentsGroupsHomeLocationWorkLocationManager - - value: employments,groups,home_location,work_location,manager,company - name: EmploymentsGroupsHomeLocationWorkLocationManagerCompany - - value: >- - employments,groups,home_location,work_location,manager,company,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationManagerCompanyPayGroup - - value: employments,groups,home_location,work_location,manager,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationManagerPayGroup - - value: employments,groups,home_location,work_location,manager,team - name: EmploymentsGroupsHomeLocationWorkLocationManagerTeam - - value: employments,groups,home_location,work_location,manager,team,company - name: EmploymentsGroupsHomeLocationWorkLocationManagerTeamCompany - - value: >- - employments,groups,home_location,work_location,manager,team,company,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationManagerTeamCompanyPayGroup - - value: employments,groups,home_location,work_location,manager,team,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationManagerTeamPayGroup - - value: employments,groups,home_location,work_location,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationPayGroup - - value: employments,groups,home_location,work_location,team - name: EmploymentsGroupsHomeLocationWorkLocationTeam - - value: employments,groups,home_location,work_location,team,company - name: EmploymentsGroupsHomeLocationWorkLocationTeamCompany - - value: employments,groups,home_location,work_location,team,company,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationTeamCompanyPayGroup - - value: employments,groups,home_location,work_location,team,pay_group - name: EmploymentsGroupsHomeLocationWorkLocationTeamPayGroup - - value: employments,groups,manager - name: EmploymentsGroupsManager - - value: employments,groups,manager,company - name: EmploymentsGroupsManagerCompany - - value: employments,groups,manager,company,pay_group - name: EmploymentsGroupsManagerCompanyPayGroup - - value: employments,groups,manager,pay_group - name: EmploymentsGroupsManagerPayGroup - - value: employments,groups,manager,team - name: EmploymentsGroupsManagerTeam - - value: employments,groups,manager,team,company - name: EmploymentsGroupsManagerTeamCompany - - value: employments,groups,manager,team,company,pay_group - name: EmploymentsGroupsManagerTeamCompanyPayGroup - - value: employments,groups,manager,team,pay_group - name: EmploymentsGroupsManagerTeamPayGroup - - value: employments,groups,pay_group - name: EmploymentsGroupsPayGroup - - value: employments,groups,team - name: EmploymentsGroupsTeam - - value: employments,groups,team,company - name: EmploymentsGroupsTeamCompany - - value: employments,groups,team,company,pay_group - name: EmploymentsGroupsTeamCompanyPayGroup - - value: employments,groups,team,pay_group - name: EmploymentsGroupsTeamPayGroup - - value: employments,groups,work_location - name: EmploymentsGroupsWorkLocation - - value: employments,groups,work_location,company - name: EmploymentsGroupsWorkLocationCompany - - value: employments,groups,work_location,company,pay_group - name: EmploymentsGroupsWorkLocationCompanyPayGroup - - value: employments,groups,work_location,manager - name: EmploymentsGroupsWorkLocationManager - - value: employments,groups,work_location,manager,company - name: EmploymentsGroupsWorkLocationManagerCompany - - value: employments,groups,work_location,manager,company,pay_group - name: EmploymentsGroupsWorkLocationManagerCompanyPayGroup - - value: employments,groups,work_location,manager,pay_group - name: EmploymentsGroupsWorkLocationManagerPayGroup - - value: employments,groups,work_location,manager,team - name: EmploymentsGroupsWorkLocationManagerTeam - - value: employments,groups,work_location,manager,team,company - name: EmploymentsGroupsWorkLocationManagerTeamCompany - - value: employments,groups,work_location,manager,team,company,pay_group - name: EmploymentsGroupsWorkLocationManagerTeamCompanyPayGroup - - value: employments,groups,work_location,manager,team,pay_group - name: EmploymentsGroupsWorkLocationManagerTeamPayGroup - - value: employments,groups,work_location,pay_group - name: EmploymentsGroupsWorkLocationPayGroup - - value: employments,groups,work_location,team - name: EmploymentsGroupsWorkLocationTeam - - value: employments,groups,work_location,team,company - name: EmploymentsGroupsWorkLocationTeamCompany - - value: employments,groups,work_location,team,company,pay_group - name: EmploymentsGroupsWorkLocationTeamCompanyPayGroup - - value: employments,groups,work_location,team,pay_group - name: EmploymentsGroupsWorkLocationTeamPayGroup - - value: employments,home_location - name: EmploymentsHomeLocation - - value: employments,home_location,company - name: EmploymentsHomeLocationCompany - - value: employments,home_location,company,pay_group - name: EmploymentsHomeLocationCompanyPayGroup - - value: employments,home_location,manager - name: EmploymentsHomeLocationManager - - value: employments,home_location,manager,company - name: EmploymentsHomeLocationManagerCompany - - value: employments,home_location,manager,company,pay_group - name: EmploymentsHomeLocationManagerCompanyPayGroup - - value: employments,home_location,manager,pay_group - name: EmploymentsHomeLocationManagerPayGroup - - value: employments,home_location,manager,team - name: EmploymentsHomeLocationManagerTeam - - value: employments,home_location,manager,team,company - name: EmploymentsHomeLocationManagerTeamCompany - - value: employments,home_location,manager,team,company,pay_group - name: EmploymentsHomeLocationManagerTeamCompanyPayGroup - - value: employments,home_location,manager,team,pay_group - name: EmploymentsHomeLocationManagerTeamPayGroup - - value: employments,home_location,pay_group - name: EmploymentsHomeLocationPayGroup - - value: employments,home_location,team - name: EmploymentsHomeLocationTeam - - value: employments,home_location,team,company - name: EmploymentsHomeLocationTeamCompany - - value: employments,home_location,team,company,pay_group - name: EmploymentsHomeLocationTeamCompanyPayGroup - - value: employments,home_location,team,pay_group - name: EmploymentsHomeLocationTeamPayGroup - - value: employments,home_location,work_location - name: EmploymentsHomeLocationWorkLocation - - value: employments,home_location,work_location,company - name: EmploymentsHomeLocationWorkLocationCompany - - value: employments,home_location,work_location,company,pay_group - name: EmploymentsHomeLocationWorkLocationCompanyPayGroup - - value: employments,home_location,work_location,manager - name: EmploymentsHomeLocationWorkLocationManager - - value: employments,home_location,work_location,manager,company - name: EmploymentsHomeLocationWorkLocationManagerCompany - - value: employments,home_location,work_location,manager,company,pay_group - name: EmploymentsHomeLocationWorkLocationManagerCompanyPayGroup - - value: employments,home_location,work_location,manager,pay_group - name: EmploymentsHomeLocationWorkLocationManagerPayGroup - - value: employments,home_location,work_location,manager,team - name: EmploymentsHomeLocationWorkLocationManagerTeam - - value: employments,home_location,work_location,manager,team,company - name: EmploymentsHomeLocationWorkLocationManagerTeamCompany - - value: employments,home_location,work_location,manager,team,company,pay_group - name: EmploymentsHomeLocationWorkLocationManagerTeamCompanyPayGroup - - value: employments,home_location,work_location,manager,team,pay_group - name: EmploymentsHomeLocationWorkLocationManagerTeamPayGroup - - value: employments,home_location,work_location,pay_group - name: EmploymentsHomeLocationWorkLocationPayGroup - - value: employments,home_location,work_location,team - name: EmploymentsHomeLocationWorkLocationTeam - - value: employments,home_location,work_location,team,company - name: EmploymentsHomeLocationWorkLocationTeamCompany - - value: employments,home_location,work_location,team,company,pay_group - name: EmploymentsHomeLocationWorkLocationTeamCompanyPayGroup - - value: employments,home_location,work_location,team,pay_group - name: EmploymentsHomeLocationWorkLocationTeamPayGroup - - value: employments,manager - name: EmploymentsManager - - value: employments,manager,company - name: EmploymentsManagerCompany - - value: employments,manager,company,pay_group - name: EmploymentsManagerCompanyPayGroup - - value: employments,manager,pay_group - name: EmploymentsManagerPayGroup - - value: employments,manager,team - name: EmploymentsManagerTeam - - value: employments,manager,team,company - name: EmploymentsManagerTeamCompany - - value: employments,manager,team,company,pay_group - name: EmploymentsManagerTeamCompanyPayGroup - - value: employments,manager,team,pay_group - name: EmploymentsManagerTeamPayGroup - - value: employments,pay_group - name: EmploymentsPayGroup - - value: employments,team - name: EmploymentsTeam - - value: employments,team,company - name: EmploymentsTeamCompany - - value: employments,team,company,pay_group - name: EmploymentsTeamCompanyPayGroup - - value: employments,team,pay_group - name: EmploymentsTeamPayGroup - - value: employments,work_location - name: EmploymentsWorkLocation - - value: employments,work_location,company - name: EmploymentsWorkLocationCompany - - value: employments,work_location,company,pay_group - name: EmploymentsWorkLocationCompanyPayGroup - - value: employments,work_location,manager - name: EmploymentsWorkLocationManager - - value: employments,work_location,manager,company - name: EmploymentsWorkLocationManagerCompany - - value: employments,work_location,manager,company,pay_group - name: EmploymentsWorkLocationManagerCompanyPayGroup - - value: employments,work_location,manager,pay_group - name: EmploymentsWorkLocationManagerPayGroup - - value: employments,work_location,manager,team - name: EmploymentsWorkLocationManagerTeam - - value: employments,work_location,manager,team,company - name: EmploymentsWorkLocationManagerTeamCompany - - value: employments,work_location,manager,team,company,pay_group - name: EmploymentsWorkLocationManagerTeamCompanyPayGroup - - value: employments,work_location,manager,team,pay_group - name: EmploymentsWorkLocationManagerTeamPayGroup - - value: employments,work_location,pay_group - name: EmploymentsWorkLocationPayGroup - - value: employments,work_location,team - name: EmploymentsWorkLocationTeam - - value: employments,work_location,team,company - name: EmploymentsWorkLocationTeamCompany - - value: employments,work_location,team,company,pay_group - name: EmploymentsWorkLocationTeamCompanyPayGroup - - value: employments,work_location,team,pay_group - name: EmploymentsWorkLocationTeamPayGroup - - groups - - value: groups,company - name: GroupsCompany - - value: groups,company,pay_group - name: GroupsCompanyPayGroup - - value: groups,home_location - name: GroupsHomeLocation - - value: groups,home_location,company - name: GroupsHomeLocationCompany - - value: groups,home_location,company,pay_group - name: GroupsHomeLocationCompanyPayGroup - - value: groups,home_location,manager - name: GroupsHomeLocationManager - - value: groups,home_location,manager,company - name: GroupsHomeLocationManagerCompany - - value: groups,home_location,manager,company,pay_group - name: GroupsHomeLocationManagerCompanyPayGroup - - value: groups,home_location,manager,pay_group - name: GroupsHomeLocationManagerPayGroup - - value: groups,home_location,manager,team - name: GroupsHomeLocationManagerTeam - - value: groups,home_location,manager,team,company - name: GroupsHomeLocationManagerTeamCompany - - value: groups,home_location,manager,team,company,pay_group - name: GroupsHomeLocationManagerTeamCompanyPayGroup - - value: groups,home_location,manager,team,pay_group - name: GroupsHomeLocationManagerTeamPayGroup - - value: groups,home_location,pay_group - name: GroupsHomeLocationPayGroup - - value: groups,home_location,team - name: GroupsHomeLocationTeam - - value: groups,home_location,team,company - name: GroupsHomeLocationTeamCompany - - value: groups,home_location,team,company,pay_group - name: GroupsHomeLocationTeamCompanyPayGroup - - value: groups,home_location,team,pay_group - name: GroupsHomeLocationTeamPayGroup - - value: groups,home_location,work_location - name: GroupsHomeLocationWorkLocation - - value: groups,home_location,work_location,company - name: GroupsHomeLocationWorkLocationCompany - - value: groups,home_location,work_location,company,pay_group - name: GroupsHomeLocationWorkLocationCompanyPayGroup - - value: groups,home_location,work_location,manager - name: GroupsHomeLocationWorkLocationManager - - value: groups,home_location,work_location,manager,company - name: GroupsHomeLocationWorkLocationManagerCompany - - value: groups,home_location,work_location,manager,company,pay_group - name: GroupsHomeLocationWorkLocationManagerCompanyPayGroup - - value: groups,home_location,work_location,manager,pay_group - name: GroupsHomeLocationWorkLocationManagerPayGroup - - value: groups,home_location,work_location,manager,team - name: GroupsHomeLocationWorkLocationManagerTeam - - value: groups,home_location,work_location,manager,team,company - name: GroupsHomeLocationWorkLocationManagerTeamCompany - - value: groups,home_location,work_location,manager,team,company,pay_group - name: GroupsHomeLocationWorkLocationManagerTeamCompanyPayGroup - - value: groups,home_location,work_location,manager,team,pay_group - name: GroupsHomeLocationWorkLocationManagerTeamPayGroup - - value: groups,home_location,work_location,pay_group - name: GroupsHomeLocationWorkLocationPayGroup - - value: groups,home_location,work_location,team - name: GroupsHomeLocationWorkLocationTeam - - value: groups,home_location,work_location,team,company - name: GroupsHomeLocationWorkLocationTeamCompany - - value: groups,home_location,work_location,team,company,pay_group - name: GroupsHomeLocationWorkLocationTeamCompanyPayGroup - - value: groups,home_location,work_location,team,pay_group - name: GroupsHomeLocationWorkLocationTeamPayGroup - - value: groups,manager - name: GroupsManager - - value: groups,manager,company - name: GroupsManagerCompany - - value: groups,manager,company,pay_group - name: GroupsManagerCompanyPayGroup - - value: groups,manager,pay_group - name: GroupsManagerPayGroup - - value: groups,manager,team - name: GroupsManagerTeam - - value: groups,manager,team,company - name: GroupsManagerTeamCompany - - value: groups,manager,team,company,pay_group - name: GroupsManagerTeamCompanyPayGroup - - value: groups,manager,team,pay_group - name: GroupsManagerTeamPayGroup - - value: groups,pay_group - name: GroupsPayGroup - - value: groups,team - name: GroupsTeam - - value: groups,team,company - name: GroupsTeamCompany - - value: groups,team,company,pay_group - name: GroupsTeamCompanyPayGroup - - value: groups,team,pay_group - name: GroupsTeamPayGroup - - value: groups,work_location - name: GroupsWorkLocation - - value: groups,work_location,company - name: GroupsWorkLocationCompany - - value: groups,work_location,company,pay_group - name: GroupsWorkLocationCompanyPayGroup - - value: groups,work_location,manager - name: GroupsWorkLocationManager - - value: groups,work_location,manager,company - name: GroupsWorkLocationManagerCompany - - value: groups,work_location,manager,company,pay_group - name: GroupsWorkLocationManagerCompanyPayGroup - - value: groups,work_location,manager,pay_group - name: GroupsWorkLocationManagerPayGroup - - value: groups,work_location,manager,team - name: GroupsWorkLocationManagerTeam - - value: groups,work_location,manager,team,company - name: GroupsWorkLocationManagerTeamCompany - - value: groups,work_location,manager,team,company,pay_group - name: GroupsWorkLocationManagerTeamCompanyPayGroup - - value: groups,work_location,manager,team,pay_group - name: GroupsWorkLocationManagerTeamPayGroup - - value: groups,work_location,pay_group - name: GroupsWorkLocationPayGroup - - value: groups,work_location,team - name: GroupsWorkLocationTeam - - value: groups,work_location,team,company - name: GroupsWorkLocationTeamCompany - - value: groups,work_location,team,company,pay_group - name: GroupsWorkLocationTeamCompanyPayGroup - - value: groups,work_location,team,pay_group - name: GroupsWorkLocationTeamPayGroup - - home_location - - value: home_location,company - name: HomeLocationCompany - - value: home_location,company,pay_group - name: HomeLocationCompanyPayGroup - - value: home_location,manager - name: HomeLocationManager - - value: home_location,manager,company - name: HomeLocationManagerCompany - - value: home_location,manager,company,pay_group - name: HomeLocationManagerCompanyPayGroup - - value: home_location,manager,pay_group - name: HomeLocationManagerPayGroup - - value: home_location,manager,team - name: HomeLocationManagerTeam - - value: home_location,manager,team,company - name: HomeLocationManagerTeamCompany - - value: home_location,manager,team,company,pay_group - name: HomeLocationManagerTeamCompanyPayGroup - - value: home_location,manager,team,pay_group - name: HomeLocationManagerTeamPayGroup - - value: home_location,pay_group - name: HomeLocationPayGroup - - value: home_location,team - name: HomeLocationTeam - - value: home_location,team,company - name: HomeLocationTeamCompany - - value: home_location,team,company,pay_group - name: HomeLocationTeamCompanyPayGroup - - value: home_location,team,pay_group - name: HomeLocationTeamPayGroup - - value: home_location,work_location - name: HomeLocationWorkLocation - - value: home_location,work_location,company - name: HomeLocationWorkLocationCompany - - value: home_location,work_location,company,pay_group - name: HomeLocationWorkLocationCompanyPayGroup - - value: home_location,work_location,manager - name: HomeLocationWorkLocationManager - - value: home_location,work_location,manager,company - name: HomeLocationWorkLocationManagerCompany - - value: home_location,work_location,manager,company,pay_group - name: HomeLocationWorkLocationManagerCompanyPayGroup - - value: home_location,work_location,manager,pay_group - name: HomeLocationWorkLocationManagerPayGroup - - value: home_location,work_location,manager,team - name: HomeLocationWorkLocationManagerTeam - - value: home_location,work_location,manager,team,company - name: HomeLocationWorkLocationManagerTeamCompany - - value: home_location,work_location,manager,team,company,pay_group - name: HomeLocationWorkLocationManagerTeamCompanyPayGroup - - value: home_location,work_location,manager,team,pay_group - name: HomeLocationWorkLocationManagerTeamPayGroup - - value: home_location,work_location,pay_group - name: HomeLocationWorkLocationPayGroup - - value: home_location,work_location,team - name: HomeLocationWorkLocationTeam - - value: home_location,work_location,team,company - name: HomeLocationWorkLocationTeamCompany - - value: home_location,work_location,team,company,pay_group - name: HomeLocationWorkLocationTeamCompanyPayGroup - - value: home_location,work_location,team,pay_group - name: HomeLocationWorkLocationTeamPayGroup - - manager - - value: manager,company - name: ManagerCompany - - value: manager,company,pay_group - name: ManagerCompanyPayGroup - - value: manager,pay_group - name: ManagerPayGroup - - value: manager,team - name: ManagerTeam - - value: manager,team,company - name: ManagerTeamCompany - - value: manager,team,company,pay_group - name: ManagerTeamCompanyPayGroup - - value: manager,team,pay_group - name: ManagerTeamPayGroup - - pay_group - - team - - value: team,company - name: TeamCompany - - value: team,company,pay_group - name: TeamCompanyPayGroup - - value: team,pay_group - name: TeamPayGroup - - work_location - - value: work_location,company - name: WorkLocationCompany - - value: work_location,company,pay_group - name: WorkLocationCompanyPayGroup - - value: work_location,manager - name: WorkLocationManager - - value: work_location,manager,company - name: WorkLocationManagerCompany - - value: work_location,manager,company,pay_group - name: WorkLocationManagerCompanyPayGroup - - value: work_location,manager,pay_group - name: WorkLocationManagerPayGroup - - value: work_location,manager,team - name: WorkLocationManagerTeam - - value: work_location,manager,team,company - name: WorkLocationManagerTeamCompany - - value: work_location,manager,team,company,pay_group - name: WorkLocationManagerTeamCompanyPayGroup - - value: work_location,manager,team,pay_group - name: WorkLocationManagerTeamPayGroup - - value: work_location,pay_group - name: WorkLocationPayGroup - - value: work_location,team - name: WorkLocationTeam - - value: work_location,team,company - name: WorkLocationTeamCompany - - value: work_location,team,company,pay_group - name: WorkLocationTeamCompanyPayGroup - - value: work_location,team,pay_group - name: WorkLocationTeamPayGroup - source: - openapi: openapi/openapi.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: openapi/openapi.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: openapi/openapi.yml -imports: - root: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/employees - method: GET - auth: true - docs: Returns a list of `Employee` objects. - source: - openapi: openapi/openapi.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 - 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: root.PaginatedEmployeeList - status-code: 200 - examples: - - headers: {} - 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 - team: team - 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' - hire_date: '2020-10-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: true - docs: Creates an `Employee` object with the given values. - source: - openapi: openapi/openapi.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: root.EmployeeRequest - content-type: application/json - response: - docs: '' - type: root.EmployeeResponse - status-code: 201 - examples: - - headers: {} - 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 - team: team - 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' - hire_date: '2020-10-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: true - docs: Returns an `Employee` object with the given `id`. - source: - openapi: openapi/openapi.yml - path-parameters: - id: string - request: - name: EmployeesRetrieveRequest - query-parameters: - expand: - type: optional - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - include_remote_data: - type: optional - docs: >- - Whether to include the original data Merge fetched from the - third-party to produce these models. - include_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: root.Employee - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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 - team: team - 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' - hire_date: '2020-10-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: true - 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: openapi/openapi.yml - path-parameters: - model_id: string - request: - name: IgnoreCommonModelRequest - body: - properties: - reason: root.ReasonEnum - message: - type: optional - validation: - minLength: 1 - maxLength: 256 - content-type: application/json - examples: - - path-parameters: - model_id: model_id - headers: {} - request: - reason: GENERAL_CUSTOMER_REQUEST - metaPostRetrieve: - path: /hris/v1/employees/meta/post - method: GET - auth: true - docs: Returns metadata for `Employee` POSTs. - source: - openapi: openapi/openapi.yml - response: - docs: '' - type: root.MetaResponse - status-code: 200 - examples: - - headers: {} - 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: openapi/openapi.yml diff --git a/.mock/definition/ticketing/tickets.yml b/.mock/definition/ticketing/tickets.yml deleted file mode 100644 index aa4b669..0000000 --- a/.mock/definition/ticketing/tickets.yml +++ /dev/null @@ -1,2151 +0,0 @@ -types: - TicketsListRequestExpand: - enum: - - account - - value: account,contact - name: AccountContact - - value: account,contact,creator - name: AccountContactCreator - - value: account,contact,creator,parent_ticket - name: AccountContactCreatorParentTicket - - value: account,contact,parent_ticket - name: AccountContactParentTicket - - value: account,creator - name: AccountCreator - - value: account,creator,parent_ticket - name: AccountCreatorParentTicket - - value: account,parent_ticket - name: AccountParentTicket - - assigned_teams - - value: assigned_teams,account - name: AssignedTeamsAccount - - value: assigned_teams,account,contact - name: AssignedTeamsAccountContact - - value: assigned_teams,account,contact,creator - name: AssignedTeamsAccountContactCreator - - value: assigned_teams,account,contact,creator,parent_ticket - name: AssignedTeamsAccountContactCreatorParentTicket - - value: assigned_teams,account,contact,parent_ticket - name: AssignedTeamsAccountContactParentTicket - - value: assigned_teams,account,creator - name: AssignedTeamsAccountCreator - - value: assigned_teams,account,creator,parent_ticket - name: AssignedTeamsAccountCreatorParentTicket - - value: assigned_teams,account,parent_ticket - name: AssignedTeamsAccountParentTicket - - value: assigned_teams,contact - name: AssignedTeamsContact - - value: assigned_teams,contact,creator - name: AssignedTeamsContactCreator - - value: assigned_teams,contact,creator,parent_ticket - name: AssignedTeamsContactCreatorParentTicket - - value: assigned_teams,contact,parent_ticket - name: AssignedTeamsContactParentTicket - - value: assigned_teams,creator - name: AssignedTeamsCreator - - value: assigned_teams,creator,parent_ticket - name: AssignedTeamsCreatorParentTicket - - value: assigned_teams,parent_ticket - name: AssignedTeamsParentTicket - - assignees - - value: assignees,account - name: AssigneesAccount - - value: assignees,account,contact - name: AssigneesAccountContact - - value: assignees,account,contact,creator - name: AssigneesAccountContactCreator - - value: assignees,account,contact,creator,parent_ticket - name: AssigneesAccountContactCreatorParentTicket - - value: assignees,account,contact,parent_ticket - name: AssigneesAccountContactParentTicket - - value: assignees,account,creator - name: AssigneesAccountCreator - - value: assignees,account,creator,parent_ticket - name: AssigneesAccountCreatorParentTicket - - value: assignees,account,parent_ticket - name: AssigneesAccountParentTicket - - value: assignees,assigned_teams - name: AssigneesAssignedTeams - - value: assignees,assigned_teams,account - name: AssigneesAssignedTeamsAccount - - value: assignees,assigned_teams,account,contact - name: AssigneesAssignedTeamsAccountContact - - value: assignees,assigned_teams,account,contact,creator - name: AssigneesAssignedTeamsAccountContactCreator - - value: assignees,assigned_teams,account,contact,creator,parent_ticket - name: AssigneesAssignedTeamsAccountContactCreatorParentTicket - - value: assignees,assigned_teams,account,contact,parent_ticket - name: AssigneesAssignedTeamsAccountContactParentTicket - - value: assignees,assigned_teams,account,creator - name: AssigneesAssignedTeamsAccountCreator - - value: assignees,assigned_teams,account,creator,parent_ticket - name: AssigneesAssignedTeamsAccountCreatorParentTicket - - value: assignees,assigned_teams,account,parent_ticket - name: AssigneesAssignedTeamsAccountParentTicket - - value: assignees,assigned_teams,contact - name: AssigneesAssignedTeamsContact - - value: assignees,assigned_teams,contact,creator - name: AssigneesAssignedTeamsContactCreator - - value: assignees,assigned_teams,contact,creator,parent_ticket - name: AssigneesAssignedTeamsContactCreatorParentTicket - - value: assignees,assigned_teams,contact,parent_ticket - name: AssigneesAssignedTeamsContactParentTicket - - value: assignees,assigned_teams,creator - name: AssigneesAssignedTeamsCreator - - value: assignees,assigned_teams,creator,parent_ticket - name: AssigneesAssignedTeamsCreatorParentTicket - - value: assignees,assigned_teams,parent_ticket - name: AssigneesAssignedTeamsParentTicket - - value: assignees,collections - name: AssigneesCollections - - value: assignees,collections,account - name: AssigneesCollectionsAccount - - value: assignees,collections,account,contact - name: AssigneesCollectionsAccountContact - - value: assignees,collections,account,contact,creator - name: AssigneesCollectionsAccountContactCreator - - value: assignees,collections,account,contact,creator,parent_ticket - name: AssigneesCollectionsAccountContactCreatorParentTicket - - value: assignees,collections,account,contact,parent_ticket - name: AssigneesCollectionsAccountContactParentTicket - - value: assignees,collections,account,creator - name: AssigneesCollectionsAccountCreator - - value: assignees,collections,account,creator,parent_ticket - name: AssigneesCollectionsAccountCreatorParentTicket - - value: assignees,collections,account,parent_ticket - name: AssigneesCollectionsAccountParentTicket - - value: assignees,collections,assigned_teams - name: AssigneesCollectionsAssignedTeams - - value: assignees,collections,assigned_teams,account - name: AssigneesCollectionsAssignedTeamsAccount - - value: assignees,collections,assigned_teams,account,contact - name: AssigneesCollectionsAssignedTeamsAccountContact - - value: assignees,collections,assigned_teams,account,contact,creator - name: AssigneesCollectionsAssignedTeamsAccountContactCreator - - value: >- - assignees,collections,assigned_teams,account,contact,creator,parent_ticket - name: AssigneesCollectionsAssignedTeamsAccountContactCreatorParentTicket - - value: assignees,collections,assigned_teams,account,contact,parent_ticket - name: AssigneesCollectionsAssignedTeamsAccountContactParentTicket - - value: assignees,collections,assigned_teams,account,creator - name: AssigneesCollectionsAssignedTeamsAccountCreator - - value: assignees,collections,assigned_teams,account,creator,parent_ticket - name: AssigneesCollectionsAssignedTeamsAccountCreatorParentTicket - - value: assignees,collections,assigned_teams,account,parent_ticket - name: AssigneesCollectionsAssignedTeamsAccountParentTicket - - value: assignees,collections,assigned_teams,contact - name: AssigneesCollectionsAssignedTeamsContact - - value: assignees,collections,assigned_teams,contact,creator - name: AssigneesCollectionsAssignedTeamsContactCreator - - value: assignees,collections,assigned_teams,contact,creator,parent_ticket - name: AssigneesCollectionsAssignedTeamsContactCreatorParentTicket - - value: assignees,collections,assigned_teams,contact,parent_ticket - name: AssigneesCollectionsAssignedTeamsContactParentTicket - - value: assignees,collections,assigned_teams,creator - name: AssigneesCollectionsAssignedTeamsCreator - - value: assignees,collections,assigned_teams,creator,parent_ticket - name: AssigneesCollectionsAssignedTeamsCreatorParentTicket - - value: assignees,collections,assigned_teams,parent_ticket - name: AssigneesCollectionsAssignedTeamsParentTicket - - value: assignees,collections,contact - name: AssigneesCollectionsContact - - value: assignees,collections,contact,creator - name: AssigneesCollectionsContactCreator - - value: assignees,collections,contact,creator,parent_ticket - name: AssigneesCollectionsContactCreatorParentTicket - - value: assignees,collections,contact,parent_ticket - name: AssigneesCollectionsContactParentTicket - - value: assignees,collections,creator - name: AssigneesCollectionsCreator - - value: assignees,collections,creator,parent_ticket - name: AssigneesCollectionsCreatorParentTicket - - value: assignees,collections,parent_ticket - name: AssigneesCollectionsParentTicket - - value: assignees,contact - name: AssigneesContact - - value: assignees,contact,creator - name: AssigneesContactCreator - - value: assignees,contact,creator,parent_ticket - name: AssigneesContactCreatorParentTicket - - value: assignees,contact,parent_ticket - name: AssigneesContactParentTicket - - value: assignees,creator - name: AssigneesCreator - - value: assignees,creator,parent_ticket - name: AssigneesCreatorParentTicket - - value: assignees,parent_ticket - name: AssigneesParentTicket - - attachments - - value: attachments,account - name: AttachmentsAccount - - value: attachments,account,contact - name: AttachmentsAccountContact - - value: attachments,account,contact,creator - name: AttachmentsAccountContactCreator - - value: attachments,account,contact,creator,parent_ticket - name: AttachmentsAccountContactCreatorParentTicket - - value: attachments,account,contact,parent_ticket - name: AttachmentsAccountContactParentTicket - - value: attachments,account,creator - name: AttachmentsAccountCreator - - value: attachments,account,creator,parent_ticket - name: AttachmentsAccountCreatorParentTicket - - value: attachments,account,parent_ticket - name: AttachmentsAccountParentTicket - - value: attachments,assigned_teams - name: AttachmentsAssignedTeams - - value: attachments,assigned_teams,account - name: AttachmentsAssignedTeamsAccount - - value: attachments,assigned_teams,account,contact - name: AttachmentsAssignedTeamsAccountContact - - value: attachments,assigned_teams,account,contact,creator - name: AttachmentsAssignedTeamsAccountContactCreator - - value: attachments,assigned_teams,account,contact,creator,parent_ticket - name: AttachmentsAssignedTeamsAccountContactCreatorParentTicket - - value: attachments,assigned_teams,account,contact,parent_ticket - name: AttachmentsAssignedTeamsAccountContactParentTicket - - value: attachments,assigned_teams,account,creator - name: AttachmentsAssignedTeamsAccountCreator - - value: attachments,assigned_teams,account,creator,parent_ticket - name: AttachmentsAssignedTeamsAccountCreatorParentTicket - - value: attachments,assigned_teams,account,parent_ticket - name: AttachmentsAssignedTeamsAccountParentTicket - - value: attachments,assigned_teams,contact - name: AttachmentsAssignedTeamsContact - - value: attachments,assigned_teams,contact,creator - name: AttachmentsAssignedTeamsContactCreator - - value: attachments,assigned_teams,contact,creator,parent_ticket - name: AttachmentsAssignedTeamsContactCreatorParentTicket - - value: attachments,assigned_teams,contact,parent_ticket - name: AttachmentsAssignedTeamsContactParentTicket - - value: attachments,assigned_teams,creator - name: AttachmentsAssignedTeamsCreator - - value: attachments,assigned_teams,creator,parent_ticket - name: AttachmentsAssignedTeamsCreatorParentTicket - - value: attachments,assigned_teams,parent_ticket - name: AttachmentsAssignedTeamsParentTicket - - value: attachments,assignees - name: AttachmentsAssignees - - value: attachments,assignees,account - name: AttachmentsAssigneesAccount - - value: attachments,assignees,account,contact - name: AttachmentsAssigneesAccountContact - - value: attachments,assignees,account,contact,creator - name: AttachmentsAssigneesAccountContactCreator - - value: attachments,assignees,account,contact,creator,parent_ticket - name: AttachmentsAssigneesAccountContactCreatorParentTicket - - value: attachments,assignees,account,contact,parent_ticket - name: AttachmentsAssigneesAccountContactParentTicket - - value: attachments,assignees,account,creator - name: AttachmentsAssigneesAccountCreator - - value: attachments,assignees,account,creator,parent_ticket - name: AttachmentsAssigneesAccountCreatorParentTicket - - value: attachments,assignees,account,parent_ticket - name: AttachmentsAssigneesAccountParentTicket - - value: attachments,assignees,assigned_teams - name: AttachmentsAssigneesAssignedTeams - - value: attachments,assignees,assigned_teams,account - name: AttachmentsAssigneesAssignedTeamsAccount - - value: attachments,assignees,assigned_teams,account,contact - name: AttachmentsAssigneesAssignedTeamsAccountContact - - value: attachments,assignees,assigned_teams,account,contact,creator - name: AttachmentsAssigneesAssignedTeamsAccountContactCreator - - value: >- - attachments,assignees,assigned_teams,account,contact,creator,parent_ticket - name: AttachmentsAssigneesAssignedTeamsAccountContactCreatorParentTicket - - value: attachments,assignees,assigned_teams,account,contact,parent_ticket - name: AttachmentsAssigneesAssignedTeamsAccountContactParentTicket - - value: attachments,assignees,assigned_teams,account,creator - name: AttachmentsAssigneesAssignedTeamsAccountCreator - - value: attachments,assignees,assigned_teams,account,creator,parent_ticket - name: AttachmentsAssigneesAssignedTeamsAccountCreatorParentTicket - - value: attachments,assignees,assigned_teams,account,parent_ticket - name: AttachmentsAssigneesAssignedTeamsAccountParentTicket - - value: attachments,assignees,assigned_teams,contact - name: AttachmentsAssigneesAssignedTeamsContact - - value: attachments,assignees,assigned_teams,contact,creator - name: AttachmentsAssigneesAssignedTeamsContactCreator - - value: attachments,assignees,assigned_teams,contact,creator,parent_ticket - name: AttachmentsAssigneesAssignedTeamsContactCreatorParentTicket - - value: attachments,assignees,assigned_teams,contact,parent_ticket - name: AttachmentsAssigneesAssignedTeamsContactParentTicket - - value: attachments,assignees,assigned_teams,creator - name: AttachmentsAssigneesAssignedTeamsCreator - - value: attachments,assignees,assigned_teams,creator,parent_ticket - name: AttachmentsAssigneesAssignedTeamsCreatorParentTicket - - value: attachments,assignees,assigned_teams,parent_ticket - name: AttachmentsAssigneesAssignedTeamsParentTicket - - value: attachments,assignees,collections - name: AttachmentsAssigneesCollections - - value: attachments,assignees,collections,account - name: AttachmentsAssigneesCollectionsAccount - - value: attachments,assignees,collections,account,contact - name: AttachmentsAssigneesCollectionsAccountContact - - value: attachments,assignees,collections,account,contact,creator - name: AttachmentsAssigneesCollectionsAccountContactCreator - - value: >- - attachments,assignees,collections,account,contact,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAccountContactCreatorParentTicket - - value: attachments,assignees,collections,account,contact,parent_ticket - name: AttachmentsAssigneesCollectionsAccountContactParentTicket - - value: attachments,assignees,collections,account,creator - name: AttachmentsAssigneesCollectionsAccountCreator - - value: attachments,assignees,collections,account,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAccountCreatorParentTicket - - value: attachments,assignees,collections,account,parent_ticket - name: AttachmentsAssigneesCollectionsAccountParentTicket - - value: attachments,assignees,collections,assigned_teams - name: AttachmentsAssigneesCollectionsAssignedTeams - - value: attachments,assignees,collections,assigned_teams,account - name: AttachmentsAssigneesCollectionsAssignedTeamsAccount - - value: attachments,assignees,collections,assigned_teams,account,contact - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountContact - - value: >- - attachments,assignees,collections,assigned_teams,account,contact,creator - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountContactCreator - - value: >- - attachments,assignees,collections,assigned_teams,account,contact,creator,parent_ticket - name: >- - AttachmentsAssigneesCollectionsAssignedTeamsAccountContactCreatorParentTicket - - value: >- - attachments,assignees,collections,assigned_teams,account,contact,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountContactParentTicket - - value: attachments,assignees,collections,assigned_teams,account,creator - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountCreator - - value: >- - attachments,assignees,collections,assigned_teams,account,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountCreatorParentTicket - - value: attachments,assignees,collections,assigned_teams,account,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountParentTicket - - value: attachments,assignees,collections,assigned_teams,contact - name: AttachmentsAssigneesCollectionsAssignedTeamsContact - - value: attachments,assignees,collections,assigned_teams,contact,creator - name: AttachmentsAssigneesCollectionsAssignedTeamsContactCreator - - value: >- - attachments,assignees,collections,assigned_teams,contact,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsContactCreatorParentTicket - - value: attachments,assignees,collections,assigned_teams,contact,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsContactParentTicket - - value: attachments,assignees,collections,assigned_teams,creator - name: AttachmentsAssigneesCollectionsAssignedTeamsCreator - - value: attachments,assignees,collections,assigned_teams,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsCreatorParentTicket - - value: attachments,assignees,collections,assigned_teams,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsParentTicket - - value: attachments,assignees,collections,contact - name: AttachmentsAssigneesCollectionsContact - - value: attachments,assignees,collections,contact,creator - name: AttachmentsAssigneesCollectionsContactCreator - - value: attachments,assignees,collections,contact,creator,parent_ticket - name: AttachmentsAssigneesCollectionsContactCreatorParentTicket - - value: attachments,assignees,collections,contact,parent_ticket - name: AttachmentsAssigneesCollectionsContactParentTicket - - value: attachments,assignees,collections,creator - name: AttachmentsAssigneesCollectionsCreator - - value: attachments,assignees,collections,creator,parent_ticket - name: AttachmentsAssigneesCollectionsCreatorParentTicket - - value: attachments,assignees,collections,parent_ticket - name: AttachmentsAssigneesCollectionsParentTicket - - value: attachments,assignees,contact - name: AttachmentsAssigneesContact - - value: attachments,assignees,contact,creator - name: AttachmentsAssigneesContactCreator - - value: attachments,assignees,contact,creator,parent_ticket - name: AttachmentsAssigneesContactCreatorParentTicket - - value: attachments,assignees,contact,parent_ticket - name: AttachmentsAssigneesContactParentTicket - - value: attachments,assignees,creator - name: AttachmentsAssigneesCreator - - value: attachments,assignees,creator,parent_ticket - name: AttachmentsAssigneesCreatorParentTicket - - value: attachments,assignees,parent_ticket - name: AttachmentsAssigneesParentTicket - - value: attachments,collections - name: AttachmentsCollections - - value: attachments,collections,account - name: AttachmentsCollectionsAccount - - value: attachments,collections,account,contact - name: AttachmentsCollectionsAccountContact - - value: attachments,collections,account,contact,creator - name: AttachmentsCollectionsAccountContactCreator - - value: attachments,collections,account,contact,creator,parent_ticket - name: AttachmentsCollectionsAccountContactCreatorParentTicket - - value: attachments,collections,account,contact,parent_ticket - name: AttachmentsCollectionsAccountContactParentTicket - - value: attachments,collections,account,creator - name: AttachmentsCollectionsAccountCreator - - value: attachments,collections,account,creator,parent_ticket - name: AttachmentsCollectionsAccountCreatorParentTicket - - value: attachments,collections,account,parent_ticket - name: AttachmentsCollectionsAccountParentTicket - - value: attachments,collections,assigned_teams - name: AttachmentsCollectionsAssignedTeams - - value: attachments,collections,assigned_teams,account - name: AttachmentsCollectionsAssignedTeamsAccount - - value: attachments,collections,assigned_teams,account,contact - name: AttachmentsCollectionsAssignedTeamsAccountContact - - value: attachments,collections,assigned_teams,account,contact,creator - name: AttachmentsCollectionsAssignedTeamsAccountContactCreator - - value: >- - attachments,collections,assigned_teams,account,contact,creator,parent_ticket - name: AttachmentsCollectionsAssignedTeamsAccountContactCreatorParentTicket - - value: attachments,collections,assigned_teams,account,contact,parent_ticket - name: AttachmentsCollectionsAssignedTeamsAccountContactParentTicket - - value: attachments,collections,assigned_teams,account,creator - name: AttachmentsCollectionsAssignedTeamsAccountCreator - - value: attachments,collections,assigned_teams,account,creator,parent_ticket - name: AttachmentsCollectionsAssignedTeamsAccountCreatorParentTicket - - value: attachments,collections,assigned_teams,account,parent_ticket - name: AttachmentsCollectionsAssignedTeamsAccountParentTicket - - value: attachments,collections,assigned_teams,contact - name: AttachmentsCollectionsAssignedTeamsContact - - value: attachments,collections,assigned_teams,contact,creator - name: AttachmentsCollectionsAssignedTeamsContactCreator - - value: attachments,collections,assigned_teams,contact,creator,parent_ticket - name: AttachmentsCollectionsAssignedTeamsContactCreatorParentTicket - - value: attachments,collections,assigned_teams,contact,parent_ticket - name: AttachmentsCollectionsAssignedTeamsContactParentTicket - - value: attachments,collections,assigned_teams,creator - name: AttachmentsCollectionsAssignedTeamsCreator - - value: attachments,collections,assigned_teams,creator,parent_ticket - name: AttachmentsCollectionsAssignedTeamsCreatorParentTicket - - value: attachments,collections,assigned_teams,parent_ticket - name: AttachmentsCollectionsAssignedTeamsParentTicket - - value: attachments,collections,contact - name: AttachmentsCollectionsContact - - value: attachments,collections,contact,creator - name: AttachmentsCollectionsContactCreator - - value: attachments,collections,contact,creator,parent_ticket - name: AttachmentsCollectionsContactCreatorParentTicket - - value: attachments,collections,contact,parent_ticket - name: AttachmentsCollectionsContactParentTicket - - value: attachments,collections,creator - name: AttachmentsCollectionsCreator - - value: attachments,collections,creator,parent_ticket - name: AttachmentsCollectionsCreatorParentTicket - - value: attachments,collections,parent_ticket - name: AttachmentsCollectionsParentTicket - - value: attachments,contact - name: AttachmentsContact - - value: attachments,contact,creator - name: AttachmentsContactCreator - - value: attachments,contact,creator,parent_ticket - name: AttachmentsContactCreatorParentTicket - - value: attachments,contact,parent_ticket - name: AttachmentsContactParentTicket - - value: attachments,creator - name: AttachmentsCreator - - value: attachments,creator,parent_ticket - name: AttachmentsCreatorParentTicket - - value: attachments,parent_ticket - name: AttachmentsParentTicket - - collections - - value: collections,account - name: CollectionsAccount - - value: collections,account,contact - name: CollectionsAccountContact - - value: collections,account,contact,creator - name: CollectionsAccountContactCreator - - value: collections,account,contact,creator,parent_ticket - name: CollectionsAccountContactCreatorParentTicket - - value: collections,account,contact,parent_ticket - name: CollectionsAccountContactParentTicket - - value: collections,account,creator - name: CollectionsAccountCreator - - value: collections,account,creator,parent_ticket - name: CollectionsAccountCreatorParentTicket - - value: collections,account,parent_ticket - name: CollectionsAccountParentTicket - - value: collections,assigned_teams - name: CollectionsAssignedTeams - - value: collections,assigned_teams,account - name: CollectionsAssignedTeamsAccount - - value: collections,assigned_teams,account,contact - name: CollectionsAssignedTeamsAccountContact - - value: collections,assigned_teams,account,contact,creator - name: CollectionsAssignedTeamsAccountContactCreator - - value: collections,assigned_teams,account,contact,creator,parent_ticket - name: CollectionsAssignedTeamsAccountContactCreatorParentTicket - - value: collections,assigned_teams,account,contact,parent_ticket - name: CollectionsAssignedTeamsAccountContactParentTicket - - value: collections,assigned_teams,account,creator - name: CollectionsAssignedTeamsAccountCreator - - value: collections,assigned_teams,account,creator,parent_ticket - name: CollectionsAssignedTeamsAccountCreatorParentTicket - - value: collections,assigned_teams,account,parent_ticket - name: CollectionsAssignedTeamsAccountParentTicket - - value: collections,assigned_teams,contact - name: CollectionsAssignedTeamsContact - - value: collections,assigned_teams,contact,creator - name: CollectionsAssignedTeamsContactCreator - - value: collections,assigned_teams,contact,creator,parent_ticket - name: CollectionsAssignedTeamsContactCreatorParentTicket - - value: collections,assigned_teams,contact,parent_ticket - name: CollectionsAssignedTeamsContactParentTicket - - value: collections,assigned_teams,creator - name: CollectionsAssignedTeamsCreator - - value: collections,assigned_teams,creator,parent_ticket - name: CollectionsAssignedTeamsCreatorParentTicket - - value: collections,assigned_teams,parent_ticket - name: CollectionsAssignedTeamsParentTicket - - value: collections,contact - name: CollectionsContact - - value: collections,contact,creator - name: CollectionsContactCreator - - value: collections,contact,creator,parent_ticket - name: CollectionsContactCreatorParentTicket - - value: collections,contact,parent_ticket - name: CollectionsContactParentTicket - - value: collections,creator - name: CollectionsCreator - - value: collections,creator,parent_ticket - name: CollectionsCreatorParentTicket - - value: collections,parent_ticket - name: CollectionsParentTicket - - contact - - value: contact,creator - name: ContactCreator - - value: contact,creator,parent_ticket - name: ContactCreatorParentTicket - - value: contact,parent_ticket - name: ContactParentTicket - - creator - - value: creator,parent_ticket - name: CreatorParentTicket - - parent_ticket - source: - openapi: openapi/openapi.yml - TicketsListRequestPriority: - enum: - - HIGH - - LOW - - NORMAL - - URGENT - source: - openapi: openapi/openapi.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: openapi/openapi.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: openapi/openapi.yml - TicketsRetrieveRequestExpand: - enum: - - account - - value: account,contact - name: AccountContact - - value: account,contact,creator - name: AccountContactCreator - - value: account,contact,creator,parent_ticket - name: AccountContactCreatorParentTicket - - value: account,contact,parent_ticket - name: AccountContactParentTicket - - value: account,creator - name: AccountCreator - - value: account,creator,parent_ticket - name: AccountCreatorParentTicket - - value: account,parent_ticket - name: AccountParentTicket - - assigned_teams - - value: assigned_teams,account - name: AssignedTeamsAccount - - value: assigned_teams,account,contact - name: AssignedTeamsAccountContact - - value: assigned_teams,account,contact,creator - name: AssignedTeamsAccountContactCreator - - value: assigned_teams,account,contact,creator,parent_ticket - name: AssignedTeamsAccountContactCreatorParentTicket - - value: assigned_teams,account,contact,parent_ticket - name: AssignedTeamsAccountContactParentTicket - - value: assigned_teams,account,creator - name: AssignedTeamsAccountCreator - - value: assigned_teams,account,creator,parent_ticket - name: AssignedTeamsAccountCreatorParentTicket - - value: assigned_teams,account,parent_ticket - name: AssignedTeamsAccountParentTicket - - value: assigned_teams,contact - name: AssignedTeamsContact - - value: assigned_teams,contact,creator - name: AssignedTeamsContactCreator - - value: assigned_teams,contact,creator,parent_ticket - name: AssignedTeamsContactCreatorParentTicket - - value: assigned_teams,contact,parent_ticket - name: AssignedTeamsContactParentTicket - - value: assigned_teams,creator - name: AssignedTeamsCreator - - value: assigned_teams,creator,parent_ticket - name: AssignedTeamsCreatorParentTicket - - value: assigned_teams,parent_ticket - name: AssignedTeamsParentTicket - - assignees - - value: assignees,account - name: AssigneesAccount - - value: assignees,account,contact - name: AssigneesAccountContact - - value: assignees,account,contact,creator - name: AssigneesAccountContactCreator - - value: assignees,account,contact,creator,parent_ticket - name: AssigneesAccountContactCreatorParentTicket - - value: assignees,account,contact,parent_ticket - name: AssigneesAccountContactParentTicket - - value: assignees,account,creator - name: AssigneesAccountCreator - - value: assignees,account,creator,parent_ticket - name: AssigneesAccountCreatorParentTicket - - value: assignees,account,parent_ticket - name: AssigneesAccountParentTicket - - value: assignees,assigned_teams - name: AssigneesAssignedTeams - - value: assignees,assigned_teams,account - name: AssigneesAssignedTeamsAccount - - value: assignees,assigned_teams,account,contact - name: AssigneesAssignedTeamsAccountContact - - value: assignees,assigned_teams,account,contact,creator - name: AssigneesAssignedTeamsAccountContactCreator - - value: assignees,assigned_teams,account,contact,creator,parent_ticket - name: AssigneesAssignedTeamsAccountContactCreatorParentTicket - - value: assignees,assigned_teams,account,contact,parent_ticket - name: AssigneesAssignedTeamsAccountContactParentTicket - - value: assignees,assigned_teams,account,creator - name: AssigneesAssignedTeamsAccountCreator - - value: assignees,assigned_teams,account,creator,parent_ticket - name: AssigneesAssignedTeamsAccountCreatorParentTicket - - value: assignees,assigned_teams,account,parent_ticket - name: AssigneesAssignedTeamsAccountParentTicket - - value: assignees,assigned_teams,contact - name: AssigneesAssignedTeamsContact - - value: assignees,assigned_teams,contact,creator - name: AssigneesAssignedTeamsContactCreator - - value: assignees,assigned_teams,contact,creator,parent_ticket - name: AssigneesAssignedTeamsContactCreatorParentTicket - - value: assignees,assigned_teams,contact,parent_ticket - name: AssigneesAssignedTeamsContactParentTicket - - value: assignees,assigned_teams,creator - name: AssigneesAssignedTeamsCreator - - value: assignees,assigned_teams,creator,parent_ticket - name: AssigneesAssignedTeamsCreatorParentTicket - - value: assignees,assigned_teams,parent_ticket - name: AssigneesAssignedTeamsParentTicket - - value: assignees,collections - name: AssigneesCollections - - value: assignees,collections,account - name: AssigneesCollectionsAccount - - value: assignees,collections,account,contact - name: AssigneesCollectionsAccountContact - - value: assignees,collections,account,contact,creator - name: AssigneesCollectionsAccountContactCreator - - value: assignees,collections,account,contact,creator,parent_ticket - name: AssigneesCollectionsAccountContactCreatorParentTicket - - value: assignees,collections,account,contact,parent_ticket - name: AssigneesCollectionsAccountContactParentTicket - - value: assignees,collections,account,creator - name: AssigneesCollectionsAccountCreator - - value: assignees,collections,account,creator,parent_ticket - name: AssigneesCollectionsAccountCreatorParentTicket - - value: assignees,collections,account,parent_ticket - name: AssigneesCollectionsAccountParentTicket - - value: assignees,collections,assigned_teams - name: AssigneesCollectionsAssignedTeams - - value: assignees,collections,assigned_teams,account - name: AssigneesCollectionsAssignedTeamsAccount - - value: assignees,collections,assigned_teams,account,contact - name: AssigneesCollectionsAssignedTeamsAccountContact - - value: assignees,collections,assigned_teams,account,contact,creator - name: AssigneesCollectionsAssignedTeamsAccountContactCreator - - value: >- - assignees,collections,assigned_teams,account,contact,creator,parent_ticket - name: AssigneesCollectionsAssignedTeamsAccountContactCreatorParentTicket - - value: assignees,collections,assigned_teams,account,contact,parent_ticket - name: AssigneesCollectionsAssignedTeamsAccountContactParentTicket - - value: assignees,collections,assigned_teams,account,creator - name: AssigneesCollectionsAssignedTeamsAccountCreator - - value: assignees,collections,assigned_teams,account,creator,parent_ticket - name: AssigneesCollectionsAssignedTeamsAccountCreatorParentTicket - - value: assignees,collections,assigned_teams,account,parent_ticket - name: AssigneesCollectionsAssignedTeamsAccountParentTicket - - value: assignees,collections,assigned_teams,contact - name: AssigneesCollectionsAssignedTeamsContact - - value: assignees,collections,assigned_teams,contact,creator - name: AssigneesCollectionsAssignedTeamsContactCreator - - value: assignees,collections,assigned_teams,contact,creator,parent_ticket - name: AssigneesCollectionsAssignedTeamsContactCreatorParentTicket - - value: assignees,collections,assigned_teams,contact,parent_ticket - name: AssigneesCollectionsAssignedTeamsContactParentTicket - - value: assignees,collections,assigned_teams,creator - name: AssigneesCollectionsAssignedTeamsCreator - - value: assignees,collections,assigned_teams,creator,parent_ticket - name: AssigneesCollectionsAssignedTeamsCreatorParentTicket - - value: assignees,collections,assigned_teams,parent_ticket - name: AssigneesCollectionsAssignedTeamsParentTicket - - value: assignees,collections,contact - name: AssigneesCollectionsContact - - value: assignees,collections,contact,creator - name: AssigneesCollectionsContactCreator - - value: assignees,collections,contact,creator,parent_ticket - name: AssigneesCollectionsContactCreatorParentTicket - - value: assignees,collections,contact,parent_ticket - name: AssigneesCollectionsContactParentTicket - - value: assignees,collections,creator - name: AssigneesCollectionsCreator - - value: assignees,collections,creator,parent_ticket - name: AssigneesCollectionsCreatorParentTicket - - value: assignees,collections,parent_ticket - name: AssigneesCollectionsParentTicket - - value: assignees,contact - name: AssigneesContact - - value: assignees,contact,creator - name: AssigneesContactCreator - - value: assignees,contact,creator,parent_ticket - name: AssigneesContactCreatorParentTicket - - value: assignees,contact,parent_ticket - name: AssigneesContactParentTicket - - value: assignees,creator - name: AssigneesCreator - - value: assignees,creator,parent_ticket - name: AssigneesCreatorParentTicket - - value: assignees,parent_ticket - name: AssigneesParentTicket - - attachments - - value: attachments,account - name: AttachmentsAccount - - value: attachments,account,contact - name: AttachmentsAccountContact - - value: attachments,account,contact,creator - name: AttachmentsAccountContactCreator - - value: attachments,account,contact,creator,parent_ticket - name: AttachmentsAccountContactCreatorParentTicket - - value: attachments,account,contact,parent_ticket - name: AttachmentsAccountContactParentTicket - - value: attachments,account,creator - name: AttachmentsAccountCreator - - value: attachments,account,creator,parent_ticket - name: AttachmentsAccountCreatorParentTicket - - value: attachments,account,parent_ticket - name: AttachmentsAccountParentTicket - - value: attachments,assigned_teams - name: AttachmentsAssignedTeams - - value: attachments,assigned_teams,account - name: AttachmentsAssignedTeamsAccount - - value: attachments,assigned_teams,account,contact - name: AttachmentsAssignedTeamsAccountContact - - value: attachments,assigned_teams,account,contact,creator - name: AttachmentsAssignedTeamsAccountContactCreator - - value: attachments,assigned_teams,account,contact,creator,parent_ticket - name: AttachmentsAssignedTeamsAccountContactCreatorParentTicket - - value: attachments,assigned_teams,account,contact,parent_ticket - name: AttachmentsAssignedTeamsAccountContactParentTicket - - value: attachments,assigned_teams,account,creator - name: AttachmentsAssignedTeamsAccountCreator - - value: attachments,assigned_teams,account,creator,parent_ticket - name: AttachmentsAssignedTeamsAccountCreatorParentTicket - - value: attachments,assigned_teams,account,parent_ticket - name: AttachmentsAssignedTeamsAccountParentTicket - - value: attachments,assigned_teams,contact - name: AttachmentsAssignedTeamsContact - - value: attachments,assigned_teams,contact,creator - name: AttachmentsAssignedTeamsContactCreator - - value: attachments,assigned_teams,contact,creator,parent_ticket - name: AttachmentsAssignedTeamsContactCreatorParentTicket - - value: attachments,assigned_teams,contact,parent_ticket - name: AttachmentsAssignedTeamsContactParentTicket - - value: attachments,assigned_teams,creator - name: AttachmentsAssignedTeamsCreator - - value: attachments,assigned_teams,creator,parent_ticket - name: AttachmentsAssignedTeamsCreatorParentTicket - - value: attachments,assigned_teams,parent_ticket - name: AttachmentsAssignedTeamsParentTicket - - value: attachments,assignees - name: AttachmentsAssignees - - value: attachments,assignees,account - name: AttachmentsAssigneesAccount - - value: attachments,assignees,account,contact - name: AttachmentsAssigneesAccountContact - - value: attachments,assignees,account,contact,creator - name: AttachmentsAssigneesAccountContactCreator - - value: attachments,assignees,account,contact,creator,parent_ticket - name: AttachmentsAssigneesAccountContactCreatorParentTicket - - value: attachments,assignees,account,contact,parent_ticket - name: AttachmentsAssigneesAccountContactParentTicket - - value: attachments,assignees,account,creator - name: AttachmentsAssigneesAccountCreator - - value: attachments,assignees,account,creator,parent_ticket - name: AttachmentsAssigneesAccountCreatorParentTicket - - value: attachments,assignees,account,parent_ticket - name: AttachmentsAssigneesAccountParentTicket - - value: attachments,assignees,assigned_teams - name: AttachmentsAssigneesAssignedTeams - - value: attachments,assignees,assigned_teams,account - name: AttachmentsAssigneesAssignedTeamsAccount - - value: attachments,assignees,assigned_teams,account,contact - name: AttachmentsAssigneesAssignedTeamsAccountContact - - value: attachments,assignees,assigned_teams,account,contact,creator - name: AttachmentsAssigneesAssignedTeamsAccountContactCreator - - value: >- - attachments,assignees,assigned_teams,account,contact,creator,parent_ticket - name: AttachmentsAssigneesAssignedTeamsAccountContactCreatorParentTicket - - value: attachments,assignees,assigned_teams,account,contact,parent_ticket - name: AttachmentsAssigneesAssignedTeamsAccountContactParentTicket - - value: attachments,assignees,assigned_teams,account,creator - name: AttachmentsAssigneesAssignedTeamsAccountCreator - - value: attachments,assignees,assigned_teams,account,creator,parent_ticket - name: AttachmentsAssigneesAssignedTeamsAccountCreatorParentTicket - - value: attachments,assignees,assigned_teams,account,parent_ticket - name: AttachmentsAssigneesAssignedTeamsAccountParentTicket - - value: attachments,assignees,assigned_teams,contact - name: AttachmentsAssigneesAssignedTeamsContact - - value: attachments,assignees,assigned_teams,contact,creator - name: AttachmentsAssigneesAssignedTeamsContactCreator - - value: attachments,assignees,assigned_teams,contact,creator,parent_ticket - name: AttachmentsAssigneesAssignedTeamsContactCreatorParentTicket - - value: attachments,assignees,assigned_teams,contact,parent_ticket - name: AttachmentsAssigneesAssignedTeamsContactParentTicket - - value: attachments,assignees,assigned_teams,creator - name: AttachmentsAssigneesAssignedTeamsCreator - - value: attachments,assignees,assigned_teams,creator,parent_ticket - name: AttachmentsAssigneesAssignedTeamsCreatorParentTicket - - value: attachments,assignees,assigned_teams,parent_ticket - name: AttachmentsAssigneesAssignedTeamsParentTicket - - value: attachments,assignees,collections - name: AttachmentsAssigneesCollections - - value: attachments,assignees,collections,account - name: AttachmentsAssigneesCollectionsAccount - - value: attachments,assignees,collections,account,contact - name: AttachmentsAssigneesCollectionsAccountContact - - value: attachments,assignees,collections,account,contact,creator - name: AttachmentsAssigneesCollectionsAccountContactCreator - - value: >- - attachments,assignees,collections,account,contact,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAccountContactCreatorParentTicket - - value: attachments,assignees,collections,account,contact,parent_ticket - name: AttachmentsAssigneesCollectionsAccountContactParentTicket - - value: attachments,assignees,collections,account,creator - name: AttachmentsAssigneesCollectionsAccountCreator - - value: attachments,assignees,collections,account,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAccountCreatorParentTicket - - value: attachments,assignees,collections,account,parent_ticket - name: AttachmentsAssigneesCollectionsAccountParentTicket - - value: attachments,assignees,collections,assigned_teams - name: AttachmentsAssigneesCollectionsAssignedTeams - - value: attachments,assignees,collections,assigned_teams,account - name: AttachmentsAssigneesCollectionsAssignedTeamsAccount - - value: attachments,assignees,collections,assigned_teams,account,contact - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountContact - - value: >- - attachments,assignees,collections,assigned_teams,account,contact,creator - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountContactCreator - - value: >- - attachments,assignees,collections,assigned_teams,account,contact,creator,parent_ticket - name: >- - AttachmentsAssigneesCollectionsAssignedTeamsAccountContactCreatorParentTicket - - value: >- - attachments,assignees,collections,assigned_teams,account,contact,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountContactParentTicket - - value: attachments,assignees,collections,assigned_teams,account,creator - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountCreator - - value: >- - attachments,assignees,collections,assigned_teams,account,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountCreatorParentTicket - - value: attachments,assignees,collections,assigned_teams,account,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsAccountParentTicket - - value: attachments,assignees,collections,assigned_teams,contact - name: AttachmentsAssigneesCollectionsAssignedTeamsContact - - value: attachments,assignees,collections,assigned_teams,contact,creator - name: AttachmentsAssigneesCollectionsAssignedTeamsContactCreator - - value: >- - attachments,assignees,collections,assigned_teams,contact,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsContactCreatorParentTicket - - value: attachments,assignees,collections,assigned_teams,contact,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsContactParentTicket - - value: attachments,assignees,collections,assigned_teams,creator - name: AttachmentsAssigneesCollectionsAssignedTeamsCreator - - value: attachments,assignees,collections,assigned_teams,creator,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsCreatorParentTicket - - value: attachments,assignees,collections,assigned_teams,parent_ticket - name: AttachmentsAssigneesCollectionsAssignedTeamsParentTicket - - value: attachments,assignees,collections,contact - name: AttachmentsAssigneesCollectionsContact - - value: attachments,assignees,collections,contact,creator - name: AttachmentsAssigneesCollectionsContactCreator - - value: attachments,assignees,collections,contact,creator,parent_ticket - name: AttachmentsAssigneesCollectionsContactCreatorParentTicket - - value: attachments,assignees,collections,contact,parent_ticket - name: AttachmentsAssigneesCollectionsContactParentTicket - - value: attachments,assignees,collections,creator - name: AttachmentsAssigneesCollectionsCreator - - value: attachments,assignees,collections,creator,parent_ticket - name: AttachmentsAssigneesCollectionsCreatorParentTicket - - value: attachments,assignees,collections,parent_ticket - name: AttachmentsAssigneesCollectionsParentTicket - - value: attachments,assignees,contact - name: AttachmentsAssigneesContact - - value: attachments,assignees,contact,creator - name: AttachmentsAssigneesContactCreator - - value: attachments,assignees,contact,creator,parent_ticket - name: AttachmentsAssigneesContactCreatorParentTicket - - value: attachments,assignees,contact,parent_ticket - name: AttachmentsAssigneesContactParentTicket - - value: attachments,assignees,creator - name: AttachmentsAssigneesCreator - - value: attachments,assignees,creator,parent_ticket - name: AttachmentsAssigneesCreatorParentTicket - - value: attachments,assignees,parent_ticket - name: AttachmentsAssigneesParentTicket - - value: attachments,collections - name: AttachmentsCollections - - value: attachments,collections,account - name: AttachmentsCollectionsAccount - - value: attachments,collections,account,contact - name: AttachmentsCollectionsAccountContact - - value: attachments,collections,account,contact,creator - name: AttachmentsCollectionsAccountContactCreator - - value: attachments,collections,account,contact,creator,parent_ticket - name: AttachmentsCollectionsAccountContactCreatorParentTicket - - value: attachments,collections,account,contact,parent_ticket - name: AttachmentsCollectionsAccountContactParentTicket - - value: attachments,collections,account,creator - name: AttachmentsCollectionsAccountCreator - - value: attachments,collections,account,creator,parent_ticket - name: AttachmentsCollectionsAccountCreatorParentTicket - - value: attachments,collections,account,parent_ticket - name: AttachmentsCollectionsAccountParentTicket - - value: attachments,collections,assigned_teams - name: AttachmentsCollectionsAssignedTeams - - value: attachments,collections,assigned_teams,account - name: AttachmentsCollectionsAssignedTeamsAccount - - value: attachments,collections,assigned_teams,account,contact - name: AttachmentsCollectionsAssignedTeamsAccountContact - - value: attachments,collections,assigned_teams,account,contact,creator - name: AttachmentsCollectionsAssignedTeamsAccountContactCreator - - value: >- - attachments,collections,assigned_teams,account,contact,creator,parent_ticket - name: AttachmentsCollectionsAssignedTeamsAccountContactCreatorParentTicket - - value: attachments,collections,assigned_teams,account,contact,parent_ticket - name: AttachmentsCollectionsAssignedTeamsAccountContactParentTicket - - value: attachments,collections,assigned_teams,account,creator - name: AttachmentsCollectionsAssignedTeamsAccountCreator - - value: attachments,collections,assigned_teams,account,creator,parent_ticket - name: AttachmentsCollectionsAssignedTeamsAccountCreatorParentTicket - - value: attachments,collections,assigned_teams,account,parent_ticket - name: AttachmentsCollectionsAssignedTeamsAccountParentTicket - - value: attachments,collections,assigned_teams,contact - name: AttachmentsCollectionsAssignedTeamsContact - - value: attachments,collections,assigned_teams,contact,creator - name: AttachmentsCollectionsAssignedTeamsContactCreator - - value: attachments,collections,assigned_teams,contact,creator,parent_ticket - name: AttachmentsCollectionsAssignedTeamsContactCreatorParentTicket - - value: attachments,collections,assigned_teams,contact,parent_ticket - name: AttachmentsCollectionsAssignedTeamsContactParentTicket - - value: attachments,collections,assigned_teams,creator - name: AttachmentsCollectionsAssignedTeamsCreator - - value: attachments,collections,assigned_teams,creator,parent_ticket - name: AttachmentsCollectionsAssignedTeamsCreatorParentTicket - - value: attachments,collections,assigned_teams,parent_ticket - name: AttachmentsCollectionsAssignedTeamsParentTicket - - value: attachments,collections,contact - name: AttachmentsCollectionsContact - - value: attachments,collections,contact,creator - name: AttachmentsCollectionsContactCreator - - value: attachments,collections,contact,creator,parent_ticket - name: AttachmentsCollectionsContactCreatorParentTicket - - value: attachments,collections,contact,parent_ticket - name: AttachmentsCollectionsContactParentTicket - - value: attachments,collections,creator - name: AttachmentsCollectionsCreator - - value: attachments,collections,creator,parent_ticket - name: AttachmentsCollectionsCreatorParentTicket - - value: attachments,collections,parent_ticket - name: AttachmentsCollectionsParentTicket - - value: attachments,contact - name: AttachmentsContact - - value: attachments,contact,creator - name: AttachmentsContactCreator - - value: attachments,contact,creator,parent_ticket - name: AttachmentsContactCreatorParentTicket - - value: attachments,contact,parent_ticket - name: AttachmentsContactParentTicket - - value: attachments,creator - name: AttachmentsCreator - - value: attachments,creator,parent_ticket - name: AttachmentsCreatorParentTicket - - value: attachments,parent_ticket - name: AttachmentsParentTicket - - collections - - value: collections,account - name: CollectionsAccount - - value: collections,account,contact - name: CollectionsAccountContact - - value: collections,account,contact,creator - name: CollectionsAccountContactCreator - - value: collections,account,contact,creator,parent_ticket - name: CollectionsAccountContactCreatorParentTicket - - value: collections,account,contact,parent_ticket - name: CollectionsAccountContactParentTicket - - value: collections,account,creator - name: CollectionsAccountCreator - - value: collections,account,creator,parent_ticket - name: CollectionsAccountCreatorParentTicket - - value: collections,account,parent_ticket - name: CollectionsAccountParentTicket - - value: collections,assigned_teams - name: CollectionsAssignedTeams - - value: collections,assigned_teams,account - name: CollectionsAssignedTeamsAccount - - value: collections,assigned_teams,account,contact - name: CollectionsAssignedTeamsAccountContact - - value: collections,assigned_teams,account,contact,creator - name: CollectionsAssignedTeamsAccountContactCreator - - value: collections,assigned_teams,account,contact,creator,parent_ticket - name: CollectionsAssignedTeamsAccountContactCreatorParentTicket - - value: collections,assigned_teams,account,contact,parent_ticket - name: CollectionsAssignedTeamsAccountContactParentTicket - - value: collections,assigned_teams,account,creator - name: CollectionsAssignedTeamsAccountCreator - - value: collections,assigned_teams,account,creator,parent_ticket - name: CollectionsAssignedTeamsAccountCreatorParentTicket - - value: collections,assigned_teams,account,parent_ticket - name: CollectionsAssignedTeamsAccountParentTicket - - value: collections,assigned_teams,contact - name: CollectionsAssignedTeamsContact - - value: collections,assigned_teams,contact,creator - name: CollectionsAssignedTeamsContactCreator - - value: collections,assigned_teams,contact,creator,parent_ticket - name: CollectionsAssignedTeamsContactCreatorParentTicket - - value: collections,assigned_teams,contact,parent_ticket - name: CollectionsAssignedTeamsContactParentTicket - - value: collections,assigned_teams,creator - name: CollectionsAssignedTeamsCreator - - value: collections,assigned_teams,creator,parent_ticket - name: CollectionsAssignedTeamsCreatorParentTicket - - value: collections,assigned_teams,parent_ticket - name: CollectionsAssignedTeamsParentTicket - - value: collections,contact - name: CollectionsContact - - value: collections,contact,creator - name: CollectionsContactCreator - - value: collections,contact,creator,parent_ticket - name: CollectionsContactCreatorParentTicket - - value: collections,contact,parent_ticket - name: CollectionsContactParentTicket - - value: collections,creator - name: CollectionsCreator - - value: collections,creator,parent_ticket - name: CollectionsCreatorParentTicket - - value: collections,parent_ticket - name: CollectionsParentTicket - - contact - - value: contact,creator - name: ContactCreator - - value: contact,creator,parent_ticket - name: ContactCreatorParentTicket - - value: contact,parent_ticket - name: ContactParentTicket - - creator - - value: creator,parent_ticket - name: CreatorParentTicket - - parent_ticket - source: - openapi: openapi/openapi.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: openapi/openapi.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: openapi/openapi.yml - TicketsViewersListRequestExpand: - enum: - - team - - user - - value: user,team - name: UserTeam - source: - openapi: openapi/openapi.yml -imports: - root: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/tickets - method: GET - auth: true - docs: Returns a list of `Ticket` objects. - source: - openapi: openapi/openapi.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. - 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 - 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. - 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: root.PaginatedTicketList - status-code: 200 - examples: - - headers: {} - 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 - 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 - ticket_url: https://thirdpartysoftware.com/project/3/issue/1 - priority: URGENT - 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: true - docs: Creates a `Ticket` object with the given values. - source: - openapi: openapi/openapi.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: root.TicketRequest - content-type: application/json - response: - docs: '' - type: root.TicketResponse - status-code: 201 - examples: - - headers: {} - 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 - 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 - ticket_url: https://thirdpartysoftware.com/project/3/issue/1 - priority: URGENT - 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: true - docs: Returns a `Ticket` object with the given `id`. - source: - openapi: openapi/openapi.yml - path-parameters: - id: string - request: - name: TicketsRetrieveRequest - query-parameters: - expand: - type: optional - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - include_remote_data: - type: optional - docs: >- - Whether to include the original data Merge fetched from the - third-party to produce these models. - include_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: root.Ticket - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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 - 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 - ticket_url: https://thirdpartysoftware.com/project/3/issue/1 - priority: URGENT - 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: true - docs: Updates a `Ticket` object with the given `id`. - source: - openapi: openapi/openapi.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: root.PatchedTicketRequest - content-type: application/json - response: - docs: '' - type: root.TicketResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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 - 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 - ticket_url: https://thirdpartysoftware.com/project/3/issue/1 - priority: URGENT - 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: true - 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) - source: - openapi: openapi/openapi.yml - path-parameters: - ticket_id: string - request: - name: TicketsViewersListRequest - query-parameters: - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - include_deleted_data: - type: optional - docs: >- - Indicates whether or not this object has been deleted in the third - party platform. Full coverage deletion detection is a premium - add-on. Native deletion detection is offered for free with limited - coverage. [Learn - more](https://docs.merge.dev/integrations/hris/supported-features/). - include_remote_data: - type: optional - docs: >- - Whether to include the original data Merge fetched from the - third-party to produce these models. - include_shell_data: - type: optional - docs: >- - Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: root.PaginatedViewerList - status-code: 200 - examples: - - path-parameters: - ticket_id: ticket_id - headers: {} - 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: true - docs: Returns metadata for `Ticket` PATCHs. - source: - openapi: openapi/openapi.yml - path-parameters: - id: string - response: - docs: '' - type: root.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: {} - 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: true - docs: Returns metadata for `Ticket` POSTs. - source: - openapi: openapi/openapi.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: root.MetaResponse - status-code: 200 - examples: - - headers: {} - 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: true - docs: Returns a list of `RemoteFieldClass` objects. - source: - openapi: openapi/openapi.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: root.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - headers: {} - 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: openapi/openapi.yml diff --git a/.mock/fern.config.json b/.mock/fern.config.json index c4faf10..9aef8fc 100644 --- a/.mock/fern.config.json +++ b/.mock/fern.config.json @@ -1,4 +1,4 @@ { "organization" : "merge", - "version" : "0.63.28" + "version" : "0.83.0" } \ No newline at end of file diff --git a/.mock/filestorage_v3.yml b/.mock/filestorage_v3.yml new file mode 100644 index 0000000..8ccd8e8 --- /dev/null +++ b/.mock/filestorage_v3.yml @@ -0,0 +1,5574 @@ +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 new file mode 100644 index 0000000..0efa7fe --- /dev/null +++ b/.mock/hris_v3.yml @@ -0,0 +1,12079 @@ +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 new file mode 100644 index 0000000..a493d5e --- /dev/null +++ b/.mock/ticketing_v3.yml @@ -0,0 +1,8427 @@ +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/accounting/account_details.go b/accounting/account_details.go index 11c286f..0495ae2 100644 --- a/accounting/account_details.go +++ b/accounting/account_details.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountDetailsFieldId = big.NewInt(1 << 0) + accountDetailsFieldIntegration = big.NewInt(1 << 1) + accountDetailsFieldIntegrationSlug = big.NewInt(1 << 2) + accountDetailsFieldCategory = big.NewInt(1 << 3) + accountDetailsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsFieldStatus = big.NewInt(1 << 7) + accountDetailsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsFieldAccountType = big.NewInt(1 << 10) + accountDetailsFieldCompletedAt = big.NewInt(1 << 11) +) + type AccountDetails struct { Id *string `json:"id,omitempty" url:"id,omitempty"` Integration *string `json:"integration,omitempty" url:"integration,omitempty"` @@ -25,6 +41,9 @@ type AccountDetails struct { // The time at which account completes the linking flow. CompletedAt *time.Time `json:"completed_at,omitempty" url:"completed_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -117,6 +136,97 @@ func (a *AccountDetails) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetails) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetId(id *string) { + a.Id = id + a.require(accountDetailsFieldId) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegration(integration *string) { + a.Integration = integration + a.require(accountDetailsFieldIntegration) +} + +// SetIntegrationSlug sets the IntegrationSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegrationSlug(integrationSlug *string) { + a.IntegrationSlug = integrationSlug + a.require(accountDetailsFieldIntegrationSlug) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCategory(category *CategoryEnum) { + a.Category = category + a.require(accountDetailsFieldCategory) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOrganizationName(endUserOrganizationName *string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserEmailAddress(endUserEmailAddress *string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsFieldEndUserEmailAddress) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetStatus(status *string) { + a.Status = status + a.require(accountDetailsFieldStatus) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetWebhookListenerUrl(webhookListenerUrl *string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsFieldIsDuplicate) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetAccountType(accountType *string) { + a.AccountType = accountType + a.require(accountDetailsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCompletedAt(completedAt *time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsFieldCompletedAt) +} + func (a *AccountDetails) UnmarshalJSON(data []byte) error { type embed AccountDetails var unmarshaler = struct { @@ -148,7 +258,8 @@ func (a *AccountDetails) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewOptionalDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetails) String() string { diff --git a/accounting/account_token.go b/accounting/account_token.go index 54f0ed2..e3dab52 100644 --- a/accounting/account_token.go +++ b/accounting/account_token.go @@ -6,6 +6,13 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + accountTokenFieldAccountToken = big.NewInt(1 << 0) + accountTokenFieldIntegration = big.NewInt(1 << 1) + accountTokenFieldId = big.NewInt(1 << 2) ) type AccountToken struct { @@ -13,6 +20,9 @@ type AccountToken struct { Integration *AccountIntegration `json:"integration" url:"integration"` Id string `json:"id" url:"id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -42,6 +52,34 @@ func (a *AccountToken) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountToken) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetAccountToken(accountToken string) { + a.AccountToken = accountToken + a.require(accountTokenFieldAccountToken) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(accountTokenFieldIntegration) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetId(id string) { + a.Id = id + a.require(accountTokenFieldId) +} + func (a *AccountToken) UnmarshalJSON(data []byte) error { type unmarshaler AccountToken var value unmarshaler @@ -58,6 +96,17 @@ func (a *AccountToken) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountToken) MarshalJSON() ([]byte, error) { + type embed AccountToken + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountToken) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/accounting/accountdetails/accounting_account_details_test/accounting_account_details_test.go b/accounting/accountdetails/accounting_account_details_test/accounting_account_details_test.go new file mode 100644 index 0000000..ac5ef19 --- /dev/null +++ b/accounting/accountdetails/accounting_account_details_test/accounting_account_details_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_account_details_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAccountDetailsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.AccountDetails.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/account-details", nil, 1) +} diff --git a/accounting/accountdetails/client.go b/accounting/accountdetails/client.go index 11c06cd..3a9ed09 100644 --- a/accounting/accountdetails/client.go +++ b/accounting/accountdetails/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.AccountDetails, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/account-details" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.AccountDetails - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/accountdetails/raw_client.go b/accounting/accountdetails/raw_client.go new file mode 100644 index 0000000..36af211 --- /dev/null +++ b/accounting/accountdetails/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package accountdetails + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.AccountDetails], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/account-details" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.AccountDetails + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AccountDetails]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/accounting_periods.go b/accounting/accounting_periods.go index b31abc5..1eca14b 100644 --- a/accounting/accounting_periods.go +++ b/accounting/accounting_periods.go @@ -6,6 +6,15 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + accountingPeriodsListRequestFieldCursor = big.NewInt(1 << 0) + accountingPeriodsListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + accountingPeriodsListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + accountingPeriodsListRequestFieldIncludeShellData = big.NewInt(1 << 3) + accountingPeriodsListRequestFieldPageSize = big.NewInt(1 << 4) ) type AccountingPeriodsListRequest struct { @@ -19,20 +28,103 @@ type AccountingPeriodsListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AccountingPeriodsListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) } +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriodsListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(accountingPeriodsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriodsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(accountingPeriodsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriodsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(accountingPeriodsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriodsListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(accountingPeriodsListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriodsListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(accountingPeriodsListRequestFieldPageSize) +} + +var ( + accountingPeriodsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + accountingPeriodsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type AccountingPeriodsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (a *AccountingPeriodsRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriodsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(accountingPeriodsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriodsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(accountingPeriodsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedAccountingPeriodListFieldNext = big.NewInt(1 << 0) + paginatedAccountingPeriodListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountingPeriodListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountingPeriodList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AccountingPeriod `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -62,6 +154,34 @@ func (p *PaginatedAccountingPeriodList) GetExtraProperties() map[string]interfac return p.extraProperties } +func (p *PaginatedAccountingPeriodList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountingPeriodList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountingPeriodListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountingPeriodList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountingPeriodListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountingPeriodList) SetResults(results []*AccountingPeriod) { + p.Results = results + p.require(paginatedAccountingPeriodListFieldResults) +} + func (p *PaginatedAccountingPeriodList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountingPeriodList var value unmarshaler @@ -78,6 +198,17 @@ func (p *PaginatedAccountingPeriodList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAccountingPeriodList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountingPeriodList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountingPeriodList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/accountingperiods/accounting_accounting_periods_test/accounting_accounting_periods_test.go b/accounting/accountingperiods/accounting_accounting_periods_test/accounting_accounting_periods_test.go new file mode 100644 index 0000000..632c314 --- /dev/null +++ b/accounting/accountingperiods/accounting_accounting_periods_test/accounting_accounting_periods_test.go @@ -0,0 +1,127 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_accounting_periods_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAccountingPeriodsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AccountingPeriodsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.AccountingPeriods.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/accounting-periods", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} + +func TestAccountingAccountingPeriodsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AccountingPeriodsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.AccountingPeriods.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/accounting-periods/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/accountingperiods/client.go b/accounting/accountingperiods/client.go index fa31645..c6e3359 100644 --- a/accounting/accountingperiods/client.go +++ b/accounting/accountingperiods/client.go @@ -4,7 +4,6 @@ package accountingperiods import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.AccountingPeriodsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.AccountingPeriod], error) { +) (*core.Page[*string, *accounting.AccountingPeriod], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedAccountingPeriodList) *internal.PageResponse[*string, *accounting.AccountingPeriod] { + readPageResponse := func(response *accounting.PaginatedAccountingPeriodList) *core.PageResponse[*string, *accounting.AccountingPeriod] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.AccountingPeriod]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.AccountingPeriod]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.AccountingPeriodsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.AccountingPeriod, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/accounting-periods/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.AccountingPeriod - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/accountingperiods/raw_client.go b/accounting/accountingperiods/raw_client.go new file mode 100644 index 0000000..bca899b --- /dev/null +++ b/accounting/accountingperiods/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package accountingperiods + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.AccountingPeriodsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.AccountingPeriod], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/accounting-periods/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.AccountingPeriod + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AccountingPeriod]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/accounts.go b/accounting/accounts.go index 05777b0..2768dd6 100644 --- a/accounting/accounts.go +++ b/accounting/accounts.go @@ -6,22 +6,81 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + accountEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + accountEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type AccountEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *AccountRequest `json:"model,omitempty" url:"-"` -} + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AccountEndpointRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + a.IsDebugMode = isDebugMode + a.require(accountEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountEndpointRequest) SetRunAsync(runAsync *bool) { + a.RunAsync = runAsync + a.require(accountEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountEndpointRequest) SetModel(model *AccountRequest) { + a.Model = model + a.require(accountEndpointRequestFieldModel) +} + +var ( + accountsListRequestFieldAccountType = big.NewInt(1 << 0) + accountsListRequestFieldClassification = big.NewInt(1 << 1) + accountsListRequestFieldCompanyId = big.NewInt(1 << 2) + accountsListRequestFieldCreatedAfter = big.NewInt(1 << 3) + accountsListRequestFieldCreatedBefore = big.NewInt(1 << 4) + accountsListRequestFieldCursor = big.NewInt(1 << 5) + accountsListRequestFieldExpand = big.NewInt(1 << 6) + accountsListRequestFieldIncludeDeletedData = big.NewInt(1 << 7) + accountsListRequestFieldIncludeRemoteData = big.NewInt(1 << 8) + accountsListRequestFieldIncludeShellData = big.NewInt(1 << 9) + accountsListRequestFieldModifiedAfter = big.NewInt(1 << 10) + accountsListRequestFieldModifiedBefore = big.NewInt(1 << 11) + accountsListRequestFieldName = big.NewInt(1 << 12) + accountsListRequestFieldPageSize = big.NewInt(1 << 13) + accountsListRequestFieldRemoteFields = big.NewInt(1 << 14) + accountsListRequestFieldRemoteId = big.NewInt(1 << 15) + accountsListRequestFieldShowEnumOrigins = big.NewInt(1 << 16) + accountsListRequestFieldStatus = big.NewInt(1 << 17) +) type AccountsListRequest struct { // If provided, will only return accounts with the passed in enum. AccountType *string `json:"-" url:"account_type,omitempty"` // If provided, will only return accounts with this classification. - Classification *string `json:"-" url:"classification,omitempty"` + Classification *AccountsListRequestClassification `json:"-" url:"classification,omitempty"` // If provided, will only return accounts for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` // If provided, will only return objects created after this datetime. @@ -53,9 +112,153 @@ type AccountsListRequest struct { // A comma separated list 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) ShowEnumOrigins *AccountsListRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` // If provided, will only return accounts with this status. - Status *string `json:"-" url:"status,omitempty"` + Status *AccountsListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AccountsListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetAccountType(accountType *string) { + a.AccountType = accountType + a.require(accountsListRequestFieldAccountType) +} + +// SetClassification sets the Classification field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetClassification(classification *AccountsListRequestClassification) { + a.Classification = classification + a.require(accountsListRequestFieldClassification) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCompanyId(companyId *string) { + a.CompanyId = companyId + a.require(accountsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCreatedAfter(createdAfter *time.Time) { + a.CreatedAfter = createdAfter + a.require(accountsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCreatedBefore(createdBefore *time.Time) { + a.CreatedBefore = createdBefore + a.require(accountsListRequestFieldCreatedBefore) } +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(accountsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(accountsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(accountsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(accountsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(accountsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + a.ModifiedAfter = modifiedAfter + a.require(accountsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + a.ModifiedBefore = modifiedBefore + a.require(accountsListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetName(name *string) { + a.Name = name + a.require(accountsListRequestFieldName) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(accountsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetRemoteFields(remoteFields *AccountsListRequestRemoteFields) { + a.RemoteFields = remoteFields + a.require(accountsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(accountsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetShowEnumOrigins(showEnumOrigins *AccountsListRequestShowEnumOrigins) { + a.ShowEnumOrigins = showEnumOrigins + a.require(accountsListRequestFieldShowEnumOrigins) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetStatus(status *AccountsListRequestStatus) { + a.Status = status + a.require(accountsListRequestFieldStatus) +} + +var ( + accountsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + accountsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + accountsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + accountsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + accountsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type AccountsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -67,6 +270,85 @@ type AccountsRetrieveRequest struct { RemoteFields *AccountsRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *AccountsRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AccountsRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(accountsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(accountsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(accountsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetRemoteFields(remoteFields *AccountsRetrieveRequestRemoteFields) { + a.RemoteFields = remoteFields + a.require(accountsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *AccountsRetrieveRequestShowEnumOrigins) { + a.ShowEnumOrigins = showEnumOrigins + a.require(accountsRetrieveRequestFieldShowEnumOrigins) +} + +type AccountsListRequestClassification string + +const ( + AccountsListRequestClassificationEmpty AccountsListRequestClassification = "" + AccountsListRequestClassificationAsset AccountsListRequestClassification = "ASSET" + AccountsListRequestClassificationEquity AccountsListRequestClassification = "EQUITY" + AccountsListRequestClassificationExpense AccountsListRequestClassification = "EXPENSE" + AccountsListRequestClassificationLiability AccountsListRequestClassification = "LIABILITY" + AccountsListRequestClassificationRevenue AccountsListRequestClassification = "REVENUE" +) + +func NewAccountsListRequestClassificationFromString(s string) (AccountsListRequestClassification, error) { + switch s { + case "": + return AccountsListRequestClassificationEmpty, nil + case "ASSET": + return AccountsListRequestClassificationAsset, nil + case "EQUITY": + return AccountsListRequestClassificationEquity, nil + case "EXPENSE": + return AccountsListRequestClassificationExpense, nil + case "LIABILITY": + return AccountsListRequestClassificationLiability, nil + case "REVENUE": + return AccountsListRequestClassificationRevenue, nil + } + var t AccountsListRequestClassification + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AccountsListRequestClassification) Ptr() *AccountsListRequestClassification { + return &a } type AccountsListRequestRemoteFields string @@ -119,6 +401,34 @@ func (a AccountsListRequestShowEnumOrigins) Ptr() *AccountsListRequestShowEnumOr return &a } +type AccountsListRequestStatus string + +const ( + AccountsListRequestStatusEmpty AccountsListRequestStatus = "" + AccountsListRequestStatusActive AccountsListRequestStatus = "ACTIVE" + AccountsListRequestStatusInactive AccountsListRequestStatus = "INACTIVE" + AccountsListRequestStatusPending AccountsListRequestStatus = "PENDING" +) + +func NewAccountsListRequestStatusFromString(s string) (AccountsListRequestStatus, error) { + switch s { + case "": + return AccountsListRequestStatusEmpty, nil + case "ACTIVE": + return AccountsListRequestStatusActive, nil + case "INACTIVE": + return AccountsListRequestStatusInactive, nil + case "PENDING": + return AccountsListRequestStatusPending, nil + } + var t AccountsListRequestStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AccountsListRequestStatus) Ptr() *AccountsListRequestStatus { + return &a +} + type AccountsRetrieveRequestRemoteFields string const ( @@ -182,6 +492,22 @@ func (a AccountsRetrieveRequestShowEnumOrigins) Ptr() *AccountsRetrieveRequestSh // // ### Usage Example // Fetch from the `LIST Accounts` endpoint and view a company's accounts. +var ( + accountRequestFieldName = big.NewInt(1 << 0) + accountRequestFieldDescription = big.NewInt(1 << 1) + accountRequestFieldClassification = big.NewInt(1 << 2) + accountRequestFieldType = big.NewInt(1 << 3) + accountRequestFieldAccountType = big.NewInt(1 << 4) + accountRequestFieldStatus = big.NewInt(1 << 5) + accountRequestFieldCurrentBalance = big.NewInt(1 << 6) + accountRequestFieldCurrency = big.NewInt(1 << 7) + accountRequestFieldAccountNumber = big.NewInt(1 << 8) + accountRequestFieldParentAccount = big.NewInt(1 << 9) + accountRequestFieldCompany = big.NewInt(1 << 10) + accountRequestFieldIntegrationParams = big.NewInt(1 << 11) + accountRequestFieldLinkedAccountParams = big.NewInt(1 << 12) +) + type AccountRequest struct { // The account's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -539,6 +865,9 @@ type AccountRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -638,6 +967,104 @@ func (a *AccountRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetName(name *string) { + a.Name = name + a.require(accountRequestFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetDescription(description *string) { + a.Description = description + a.require(accountRequestFieldDescription) +} + +// SetClassification sets the Classification field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetClassification(classification *AccountRequestClassification) { + a.Classification = classification + a.require(accountRequestFieldClassification) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetType(type_ *string) { + a.Type = type_ + a.require(accountRequestFieldType) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetAccountType(accountType *AccountRequestAccountType) { + a.AccountType = accountType + a.require(accountRequestFieldAccountType) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetStatus(status *AccountRequestStatus) { + a.Status = status + a.require(accountRequestFieldStatus) +} + +// SetCurrentBalance sets the CurrentBalance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetCurrentBalance(currentBalance *float64) { + a.CurrentBalance = currentBalance + a.require(accountRequestFieldCurrentBalance) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetCurrency(currency *AccountRequestCurrency) { + a.Currency = currency + a.require(accountRequestFieldCurrency) +} + +// SetAccountNumber sets the AccountNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetAccountNumber(accountNumber *string) { + a.AccountNumber = accountNumber + a.require(accountRequestFieldAccountNumber) +} + +// SetParentAccount sets the ParentAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetParentAccount(parentAccount *string) { + a.ParentAccount = parentAccount + a.require(accountRequestFieldParentAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetCompany(company *string) { + a.Company = company + a.require(accountRequestFieldCompany) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(accountRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(accountRequestFieldLinkedAccountParams) +} + func (a *AccountRequest) UnmarshalJSON(data []byte) error { type unmarshaler AccountRequest var value unmarshaler @@ -654,6 +1081,17 @@ func (a *AccountRequest) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountRequest) MarshalJSON() ([]byte, error) { + type embed AccountRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountRequest) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -1249,12 +1687,22 @@ func (a *AccountRequestStatus) Accept(visitor AccountRequestStatusVisitor) error return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + accountResponseFieldModel = big.NewInt(1 << 0) + accountResponseFieldWarnings = big.NewInt(1 << 1) + accountResponseFieldErrors = big.NewInt(1 << 2) + accountResponseFieldLogs = big.NewInt(1 << 3) +) + type AccountResponse struct { Model *Account `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1291,6 +1739,41 @@ func (a *AccountResponse) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountResponse) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountResponse) SetModel(model *Account) { + a.Model = model + a.require(accountResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountResponse) SetWarnings(warnings []*WarningValidationProblem) { + a.Warnings = warnings + a.require(accountResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountResponse) SetErrors(errors []*ErrorValidationProblem) { + a.Errors = errors + a.require(accountResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountResponse) SetLogs(logs []*DebugModeLog) { + a.Logs = logs + a.require(accountResponseFieldLogs) +} + func (a *AccountResponse) UnmarshalJSON(data []byte) error { type unmarshaler AccountResponse var value unmarshaler @@ -1307,6 +1790,17 @@ func (a *AccountResponse) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountResponse) MarshalJSON() ([]byte, error) { + type embed AccountResponse + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountResponse) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -1319,11 +1813,20 @@ func (a *AccountResponse) String() string { return fmt.Sprintf("%#v", a) } +var ( + paginatedAccountListFieldNext = big.NewInt(1 << 0) + paginatedAccountListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Account `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1353,6 +1856,34 @@ func (p *PaginatedAccountList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedAccountList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountList) SetResults(results []*Account) { + p.Results = results + p.require(paginatedAccountListFieldResults) +} + func (p *PaginatedAccountList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountList var value unmarshaler @@ -1369,6 +1900,17 @@ func (p *PaginatedAccountList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAccountList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/accounts/accounting_accounts_test/accounting_accounts_test.go b/accounting/accounts/accounting_accounts_test/accounting_accounts_test.go new file mode 100644 index 0000000..1c56767 --- /dev/null +++ b/accounting/accounts/accounting_accounts_test/accounting_accounts_test.go @@ -0,0 +1,211 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AccountsListRequest{ + AccountType: merge.String( + "account_type", + ), + Classification: accounting.AccountsListRequestClassificationEmpty.Ptr(), + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: accounting.AccountsListRequestRemoteFieldsClassification.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: accounting.AccountsListRequestShowEnumOriginsClassification.Ptr(), + Status: accounting.AccountsListRequestStatusEmpty.Ptr(), + } + _, invocationErr := client.Accounting.Accounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/accounts", map[string]string{"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": ""}, 1) +} + +func TestAccountingAccountsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AccountEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.AccountRequest{}, + } + _, invocationErr := client.Accounting.Accounts.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/accounts", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingAccountsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AccountsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: accounting.AccountsRetrieveRequestRemoteFieldsClassification.Ptr(), + ShowEnumOrigins: accounting.AccountsRetrieveRequestShowEnumOriginsClassification.Ptr(), + } + _, invocationErr := client.Accounting.Accounts.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/accounts/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "classification", "show_enum_origins": "classification"}, 1) +} + +func TestAccountingAccountsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Accounts.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/accounts/meta/post", nil, 1) +} diff --git a/accounting/accounts/client.go b/accounting/accounts/client.go index da40e6a..4b42076 100644 --- a/accounting/accounts/client.go +++ b/accounting/accounts/client.go @@ -4,7 +4,6 @@ package accounts import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.AccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.Account], error) { +) (*core.Page[*string, *accounting.Account], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedAccountList) *internal.PageResponse[*string, *accounting.Account] { + readPageResponse := func(response *accounting.PaginatedAccountList) *core.PageResponse[*string, *accounting.Account] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.Account]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.Account]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.AccountEndpointRequest, opts ...option.RequestOption, ) (*accounting.AccountResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/accounts" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.AccountResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Account` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.AccountsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Account, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/accounts/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Account - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Account` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/accounts/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/accounts/raw_client.go b/accounting/accounts/raw_client.go new file mode 100644 index 0000000..8ac08aa --- /dev/null +++ b/accounting/accounts/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounts + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.AccountEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.AccountResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/accounts" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.AccountResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AccountResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.AccountsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Account], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/accounts/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Account + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Account]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/accounts/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/accounttoken/accounting_account_token_test/accounting_account_token_test.go b/accounting/accounttoken/accounting_account_token_test/accounting_account_token_test.go new file mode 100644 index 0000000..cad3dca --- /dev/null +++ b/accounting/accounttoken/accounting_account_token_test/accounting_account_token_test.go @@ -0,0 +1,80 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_account_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAccountTokenRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/account-token/public_token", nil, 1) +} diff --git a/accounting/accounttoken/client.go b/accounting/accounttoken/client.go index af67301..7b6fee9 100644 --- a/accounting/accounttoken/client.go +++ b/accounting/accounttoken/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,36 +38,13 @@ func (c *Client) Retrieve( publicToken string, opts ...option.RequestOption, ) (*accounting.AccountToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/account-token/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, publicToken, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.AccountToken - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/accounttoken/raw_client.go b/accounting/accounttoken/raw_client.go new file mode 100644 index 0000000..16e3331 --- /dev/null +++ b/accounting/accounttoken/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounttoken + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + publicToken string, + opts ...option.RequestOption, +) (*core.Response[*accounting.AccountToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/account-token/%v", + publicToken, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.AccountToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AccountToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/addresses.go b/accounting/addresses.go index 5749f9c..044399d 100644 --- a/accounting/addresses.go +++ b/accounting/addresses.go @@ -2,6 +2,17 @@ package accounting +import ( + big "math/big" +) + +var ( + addressesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + addressesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) + addressesRetrieveRequestFieldRemoteFields = big.NewInt(1 << 2) + addressesRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 3) +) + type AddressesRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -11,4 +22,42 @@ type AddressesRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AddressesRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(addressesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(addressesRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressesRetrieveRequest) SetRemoteFields(remoteFields *string) { + a.RemoteFields = remoteFields + a.require(addressesRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressesRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + a.ShowEnumOrigins = showEnumOrigins + a.require(addressesRetrieveRequestFieldShowEnumOrigins) } diff --git a/accounting/addresses/accounting_addresses_test/accounting_addresses_test.go b/accounting/addresses/accounting_addresses_test/accounting_addresses_test.go new file mode 100644 index 0000000..1acc754 --- /dev/null +++ b/accounting/addresses/accounting_addresses_test/accounting_addresses_test.go @@ -0,0 +1,91 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_addresses_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAddressesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AddressesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Addresses.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/addresses/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "type", "show_enum_origins": "type"}, 1) +} diff --git a/accounting/addresses/client.go b/accounting/addresses/client.go index 4bec58d..e4b6b3c 100644 --- a/accounting/addresses/client.go +++ b/accounting/addresses/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -38,43 +39,14 @@ func (c *Client) Retrieve( request *accounting.AddressesRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Address, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/addresses/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Address - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/addresses/raw_client.go b/accounting/addresses/raw_client.go new file mode 100644 index 0000000..4d95041 --- /dev/null +++ b/accounting/addresses/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package addresses + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.AddressesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Address], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/addresses/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Address + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Address]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/async_passthrough.go b/accounting/async_passthrough.go index e8d30b6..97c16e1 100644 --- a/accounting/async_passthrough.go +++ b/accounting/async_passthrough.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) type AsyncPassthroughRetrieveResponse struct { @@ -70,9 +71,16 @@ func (a *AsyncPassthroughRetrieveResponse) Accept(visitor AsyncPassthroughRetrie return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + asyncPassthroughRecieptFieldAsyncPassthroughReceiptId = big.NewInt(1 << 0) +) + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id" url:"async_passthrough_receipt_id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -88,6 +96,20 @@ func (a *AsyncPassthroughReciept) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AsyncPassthroughReciept) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAsyncPassthroughReceiptId sets the AsyncPassthroughReceiptId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPassthroughReciept) SetAsyncPassthroughReceiptId(asyncPassthroughReceiptId string) { + a.AsyncPassthroughReceiptId = asyncPassthroughReceiptId + a.require(asyncPassthroughRecieptFieldAsyncPassthroughReceiptId) +} + func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { type unmarshaler AsyncPassthroughReciept var value unmarshaler @@ -104,6 +126,17 @@ func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { return nil } +func (a *AsyncPassthroughReciept) MarshalJSON() ([]byte, error) { + type embed AsyncPassthroughReciept + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AsyncPassthroughReciept) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/accounting/async_tasks.go b/accounting/async_tasks.go index 4b26910..ce1d52e 100644 --- a/accounting/async_tasks.go +++ b/accounting/async_tasks.go @@ -6,12 +6,21 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + asyncPostTaskFieldStatus = big.NewInt(1 << 0) + asyncPostTaskFieldResult = big.NewInt(1 << 1) ) type AsyncPostTask struct { Status *AsyncPostTaskStatus `json:"status" url:"status"` Result *AsyncPostTaskResult `json:"result" url:"result"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -34,6 +43,27 @@ func (a *AsyncPostTask) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AsyncPostTask) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPostTask) SetStatus(status *AsyncPostTaskStatus) { + a.Status = status + a.require(asyncPostTaskFieldStatus) +} + +// SetResult sets the Result field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPostTask) SetResult(result *AsyncPostTaskResult) { + a.Result = result + a.require(asyncPostTaskFieldResult) +} + func (a *AsyncPostTask) UnmarshalJSON(data []byte) error { type unmarshaler AsyncPostTask var value unmarshaler @@ -50,6 +80,17 @@ func (a *AsyncPostTask) UnmarshalJSON(data []byte) error { return nil } +func (a *AsyncPostTask) MarshalJSON() ([]byte, error) { + type embed AsyncPostTask + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AsyncPostTask) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -62,10 +103,18 @@ func (a *AsyncPostTask) String() string { return fmt.Sprintf("%#v", a) } +var ( + asyncPostTaskResultFieldStatusCode = big.NewInt(1 << 0) + asyncPostTaskResultFieldResponse = big.NewInt(1 << 1) +) + type AsyncPostTaskResult struct { StatusCode *int `json:"status_code,omitempty" url:"status_code,omitempty"` Response map[string]interface{} `json:"response,omitempty" url:"response,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -88,6 +137,27 @@ func (a *AsyncPostTaskResult) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AsyncPostTaskResult) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetStatusCode sets the StatusCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPostTaskResult) SetStatusCode(statusCode *int) { + a.StatusCode = statusCode + a.require(asyncPostTaskResultFieldStatusCode) +} + +// SetResponse sets the Response field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPostTaskResult) SetResponse(response map[string]interface{}) { + a.Response = response + a.require(asyncPostTaskResultFieldResponse) +} + func (a *AsyncPostTaskResult) UnmarshalJSON(data []byte) error { type unmarshaler AsyncPostTaskResult var value unmarshaler @@ -104,6 +174,17 @@ func (a *AsyncPostTaskResult) UnmarshalJSON(data []byte) error { return nil } +func (a *AsyncPostTaskResult) MarshalJSON() ([]byte, error) { + type embed AsyncPostTaskResult + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AsyncPostTaskResult) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/accounting/asyncpassthrough/accounting_async_passthrough_test/accounting_async_passthrough_test.go b/accounting/asyncpassthrough/accounting_async_passthrough_test/accounting_async_passthrough_test.go new file mode 100644 index 0000000..3e2fdf6 --- /dev/null +++ b/accounting/asyncpassthrough/accounting_async_passthrough_test/accounting_async_passthrough_test.go @@ -0,0 +1,104 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_async_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAsyncPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.DataPassthroughRequest{ + Method: accounting.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Accounting.AsyncPassthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/async-passthrough", nil, 1) +} + +func TestAccountingAsyncPassthroughRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/async-passthrough/async_passthrough_receipt_id", nil, 1) +} diff --git a/accounting/asyncpassthrough/client.go b/accounting/asyncpassthrough/client.go index 87214de..4740c2a 100644 --- a/accounting/asyncpassthrough/client.go +++ b/accounting/asyncpassthrough/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,37 +38,15 @@ func (c *Client) Create( request *accounting.DataPassthroughRequest, opts ...option.RequestOption, ) (*accounting.AsyncPassthroughReciept, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/async-passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.AsyncPassthroughReciept - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Retrieves data from earlier async-passthrough POST request @@ -76,36 +55,13 @@ func (c *Client) Retrieve( asyncPassthroughReceiptId string, opts ...option.RequestOption, ) (*accounting.AsyncPassthroughRetrieveResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/async-passthrough/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, asyncPassthroughReceiptId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.AsyncPassthroughRetrieveResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/asyncpassthrough/raw_client.go b/accounting/asyncpassthrough/raw_client.go new file mode 100644 index 0000000..94160b2 --- /dev/null +++ b/accounting/asyncpassthrough/raw_client.go @@ -0,0 +1,115 @@ +// Code generated by Fern. DO NOT EDIT. + +package asyncpassthrough + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.AsyncPassthroughReciept], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/async-passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.AsyncPassthroughReciept + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AsyncPassthroughReciept]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + asyncPassthroughReceiptId string, + opts ...option.RequestOption, +) (*core.Response[*accounting.AsyncPassthroughRetrieveResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/async-passthrough/%v", + asyncPassthroughReceiptId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.AsyncPassthroughRetrieveResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AsyncPassthroughRetrieveResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/asynctasks/accounting_async_tasks_test/accounting_async_tasks_test.go b/accounting/asynctasks/accounting_async_tasks_test/accounting_async_tasks_test.go new file mode 100644 index 0000000..4f8a64b --- /dev/null +++ b/accounting/asynctasks/accounting_async_tasks_test/accounting_async_tasks_test.go @@ -0,0 +1,80 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_async_tasks_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAsyncTasksRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.AsyncTasks.Retrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/async-tasks/id", nil, 1) +} diff --git a/accounting/asynctasks/client.go b/accounting/asynctasks/client.go index c04e04c..cdb4a80 100644 --- a/accounting/asynctasks/client.go +++ b/accounting/asynctasks/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,36 +38,13 @@ func (c *Client) Retrieve( id string, opts ...option.RequestOption, ) (*accounting.AsyncPostTask, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/async-tasks/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.AsyncPostTask - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/asynctasks/raw_client.go b/accounting/asynctasks/raw_client.go new file mode 100644 index 0000000..5a038c1 --- /dev/null +++ b/accounting/asynctasks/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package asynctasks + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*accounting.AsyncPostTask], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/async-tasks/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.AsyncPostTask + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AsyncPostTask]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/attachments.go b/accounting/attachments.go index 245ee60..95e7027 100644 --- a/accounting/attachments.go +++ b/accounting/attachments.go @@ -6,17 +6,69 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountingAttachmentEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + accountingAttachmentEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + accountingAttachmentEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type AccountingAttachmentEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *AccountingAttachmentRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AccountingAttachmentEndpointRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + a.IsDebugMode = isDebugMode + a.require(accountingAttachmentEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentEndpointRequest) SetRunAsync(runAsync *bool) { + a.RunAsync = runAsync + a.require(accountingAttachmentEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentEndpointRequest) SetModel(model *AccountingAttachmentRequest) { + a.Model = model + a.require(accountingAttachmentEndpointRequestFieldModel) } +var ( + attachmentsListRequestFieldCompanyId = big.NewInt(1 << 0) + attachmentsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + attachmentsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + attachmentsListRequestFieldCursor = big.NewInt(1 << 3) + attachmentsListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + attachmentsListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + attachmentsListRequestFieldIncludeShellData = big.NewInt(1 << 6) + attachmentsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + attachmentsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + attachmentsListRequestFieldPageSize = big.NewInt(1 << 9) + attachmentsListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type AttachmentsListRequest struct { // If provided, will only return accounting attachments for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -40,13 +92,129 @@ type AttachmentsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AttachmentsListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) } +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCompanyId(companyId *string) { + a.CompanyId = companyId + a.require(attachmentsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCreatedAfter(createdAfter *time.Time) { + a.CreatedAfter = createdAfter + a.require(attachmentsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCreatedBefore(createdBefore *time.Time) { + a.CreatedBefore = createdBefore + a.require(attachmentsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(attachmentsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(attachmentsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(attachmentsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(attachmentsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + a.ModifiedAfter = modifiedAfter + a.require(attachmentsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + a.ModifiedBefore = modifiedBefore + a.require(attachmentsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(attachmentsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(attachmentsListRequestFieldRemoteId) +} + +var ( + attachmentsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + attachmentsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type AttachmentsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AttachmentsRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(attachmentsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(attachmentsRetrieveRequestFieldIncludeShellData) } // # The Accounting Attachment Object @@ -55,6 +223,19 @@ type AttachmentsRetrieveRequest struct { // // ### Usage Example // Fetch from the `LIST AccountingAttachments` endpoint and view a company's attachments. +var ( + accountingAttachmentFieldId = big.NewInt(1 << 0) + accountingAttachmentFieldRemoteId = big.NewInt(1 << 1) + accountingAttachmentFieldCreatedAt = big.NewInt(1 << 2) + accountingAttachmentFieldModifiedAt = big.NewInt(1 << 3) + accountingAttachmentFieldFileName = big.NewInt(1 << 4) + accountingAttachmentFieldFileUrl = big.NewInt(1 << 5) + accountingAttachmentFieldCompany = big.NewInt(1 << 6) + accountingAttachmentFieldRemoteWasDeleted = big.NewInt(1 << 7) + accountingAttachmentFieldFieldMappings = big.NewInt(1 << 8) + accountingAttachmentFieldRemoteData = big.NewInt(1 << 9) +) + type AccountingAttachment struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -74,6 +255,9 @@ type AccountingAttachment struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -152,6 +336,83 @@ func (a *AccountingAttachment) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountingAttachment) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetId(id *string) { + a.Id = id + a.require(accountingAttachmentFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(accountingAttachmentFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(accountingAttachmentFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(accountingAttachmentFieldModifiedAt) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetFileName(fileName *string) { + a.FileName = fileName + a.require(accountingAttachmentFieldFileName) +} + +// SetFileUrl sets the FileUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetFileUrl(fileUrl *string) { + a.FileUrl = fileUrl + a.require(accountingAttachmentFieldFileUrl) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetCompany(company *string) { + a.Company = company + a.require(accountingAttachmentFieldCompany) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetRemoteWasDeleted(remoteWasDeleted *bool) { + a.RemoteWasDeleted = remoteWasDeleted + a.require(accountingAttachmentFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetFieldMappings(fieldMappings map[string]interface{}) { + a.FieldMappings = fieldMappings + a.require(accountingAttachmentFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachment) SetRemoteData(remoteData []*RemoteData) { + a.RemoteData = remoteData + a.require(accountingAttachmentFieldRemoteData) +} + func (a *AccountingAttachment) UnmarshalJSON(data []byte) error { type embed AccountingAttachment var unmarshaler = struct { @@ -187,7 +448,8 @@ func (a *AccountingAttachment) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountingAttachment) String() string { @@ -208,6 +470,14 @@ func (a *AccountingAttachment) String() string { // // ### Usage Example // Fetch from the `LIST AccountingAttachments` endpoint and view a company's attachments. +var ( + accountingAttachmentRequestFieldFileName = big.NewInt(1 << 0) + accountingAttachmentRequestFieldFileUrl = big.NewInt(1 << 1) + accountingAttachmentRequestFieldCompany = big.NewInt(1 << 2) + accountingAttachmentRequestFieldIntegrationParams = big.NewInt(1 << 3) + accountingAttachmentRequestFieldLinkedAccountParams = big.NewInt(1 << 4) +) + type AccountingAttachmentRequest struct { // The attachment's name. FileName *string `json:"file_name,omitempty" url:"file_name,omitempty"` @@ -218,6 +488,9 @@ type AccountingAttachmentRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -261,6 +534,48 @@ func (a *AccountingAttachmentRequest) GetExtraProperties() map[string]interface{ return a.extraProperties } +func (a *AccountingAttachmentRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentRequest) SetFileName(fileName *string) { + a.FileName = fileName + a.require(accountingAttachmentRequestFieldFileName) +} + +// SetFileUrl sets the FileUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentRequest) SetFileUrl(fileUrl *string) { + a.FileUrl = fileUrl + a.require(accountingAttachmentRequestFieldFileUrl) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentRequest) SetCompany(company *string) { + a.Company = company + a.require(accountingAttachmentRequestFieldCompany) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(accountingAttachmentRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(accountingAttachmentRequestFieldLinkedAccountParams) +} + func (a *AccountingAttachmentRequest) UnmarshalJSON(data []byte) error { type unmarshaler AccountingAttachmentRequest var value unmarshaler @@ -277,6 +592,17 @@ func (a *AccountingAttachmentRequest) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountingAttachmentRequest) MarshalJSON() ([]byte, error) { + type embed AccountingAttachmentRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountingAttachmentRequest) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -289,12 +615,22 @@ func (a *AccountingAttachmentRequest) String() string { return fmt.Sprintf("%#v", a) } +var ( + accountingAttachmentResponseFieldModel = big.NewInt(1 << 0) + accountingAttachmentResponseFieldWarnings = big.NewInt(1 << 1) + accountingAttachmentResponseFieldErrors = big.NewInt(1 << 2) + accountingAttachmentResponseFieldLogs = big.NewInt(1 << 3) +) + type AccountingAttachmentResponse struct { Model *AccountingAttachment `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -331,6 +667,41 @@ func (a *AccountingAttachmentResponse) GetExtraProperties() map[string]interface return a.extraProperties } +func (a *AccountingAttachmentResponse) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentResponse) SetModel(model *AccountingAttachment) { + a.Model = model + a.require(accountingAttachmentResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentResponse) SetWarnings(warnings []*WarningValidationProblem) { + a.Warnings = warnings + a.require(accountingAttachmentResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentResponse) SetErrors(errors []*ErrorValidationProblem) { + a.Errors = errors + a.require(accountingAttachmentResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingAttachmentResponse) SetLogs(logs []*DebugModeLog) { + a.Logs = logs + a.require(accountingAttachmentResponseFieldLogs) +} + func (a *AccountingAttachmentResponse) UnmarshalJSON(data []byte) error { type unmarshaler AccountingAttachmentResponse var value unmarshaler @@ -347,6 +718,17 @@ func (a *AccountingAttachmentResponse) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountingAttachmentResponse) MarshalJSON() ([]byte, error) { + type embed AccountingAttachmentResponse + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountingAttachmentResponse) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -359,11 +741,20 @@ func (a *AccountingAttachmentResponse) String() string { return fmt.Sprintf("%#v", a) } +var ( + paginatedAccountingAttachmentListFieldNext = big.NewInt(1 << 0) + paginatedAccountingAttachmentListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountingAttachmentListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountingAttachmentList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AccountingAttachment `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -393,6 +784,34 @@ func (p *PaginatedAccountingAttachmentList) GetExtraProperties() map[string]inte return p.extraProperties } +func (p *PaginatedAccountingAttachmentList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountingAttachmentList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountingAttachmentListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountingAttachmentList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountingAttachmentListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountingAttachmentList) SetResults(results []*AccountingAttachment) { + p.Results = results + p.require(paginatedAccountingAttachmentListFieldResults) +} + func (p *PaginatedAccountingAttachmentList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountingAttachmentList var value unmarshaler @@ -409,6 +828,17 @@ func (p *PaginatedAccountingAttachmentList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAccountingAttachmentList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountingAttachmentList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountingAttachmentList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/attachments/accounting_attachments_test/accounting_attachments_test.go b/accounting/attachments/accounting_attachments_test/accounting_attachments_test.go new file mode 100644 index 0000000..807a090 --- /dev/null +++ b/accounting/attachments/accounting_attachments_test/accounting_attachments_test.go @@ -0,0 +1,199 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_attachments_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAttachmentsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AttachmentsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.Attachments.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/attachments", map[string]string{"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"}, 1) +} + +func TestAccountingAttachmentsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AccountingAttachmentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.AccountingAttachmentRequest{}, + } + _, invocationErr := client.Accounting.Attachments.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/attachments", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingAttachmentsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AttachmentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Attachments.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/attachments/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestAccountingAttachmentsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Attachments.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/attachments/meta/post", nil, 1) +} diff --git a/accounting/attachments/client.go b/accounting/attachments/client.go index d0b3db3..b80fe14 100644 --- a/accounting/attachments/client.go +++ b/accounting/attachments/client.go @@ -4,7 +4,6 @@ package attachments import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.AttachmentsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.AccountingAttachment], error) { +) (*core.Page[*string, *accounting.AccountingAttachment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedAccountingAttachmentList) *internal.PageResponse[*string, *accounting.AccountingAttachment] { + readPageResponse := func(response *accounting.PaginatedAccountingAttachmentList) *core.PageResponse[*string, *accounting.AccountingAttachment] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.AccountingAttachment]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.AccountingAttachment]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.AccountingAttachmentEndpointRequest, opts ...option.RequestOption, ) (*accounting.AccountingAttachmentResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/attachments" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.AccountingAttachmentResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `AccountingAttachment` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.AttachmentsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.AccountingAttachment, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/attachments/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.AccountingAttachment - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `AccountingAttachment` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/attachments/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/attachments/raw_client.go b/accounting/attachments/raw_client.go new file mode 100644 index 0000000..366ddb0 --- /dev/null +++ b/accounting/attachments/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package attachments + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.AccountingAttachmentEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.AccountingAttachmentResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/attachments" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.AccountingAttachmentResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AccountingAttachmentResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.AttachmentsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.AccountingAttachment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/attachments/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.AccountingAttachment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AccountingAttachment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/attachments/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/audit_trail.go b/accounting/audit_trail.go index 185ecaf..e727fb4 100644 --- a/accounting/audit_trail.go +++ b/accounting/audit_trail.go @@ -6,9 +6,19 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + auditTrailListRequestFieldCursor = big.NewInt(1 << 0) + auditTrailListRequestFieldEndDate = big.NewInt(1 << 1) + auditTrailListRequestFieldEventType = big.NewInt(1 << 2) + auditTrailListRequestFieldPageSize = big.NewInt(1 << 3) + auditTrailListRequestFieldStartDate = big.NewInt(1 << 4) + auditTrailListRequestFieldUserEmail = big.NewInt(1 << 5) +) + type AuditTrailListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -22,8 +32,71 @@ type AuditTrailListRequest struct { StartDate *string `json:"-" url:"start_date,omitempty"` // 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. UserEmail *string `json:"-" url:"user_email,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AuditTrailListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(auditTrailListRequestFieldCursor) } +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEndDate(endDate *string) { + a.EndDate = endDate + a.require(auditTrailListRequestFieldEndDate) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEventType(eventType *string) { + a.EventType = eventType + a.require(auditTrailListRequestFieldEventType) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(auditTrailListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetStartDate(startDate *string) { + a.StartDate = startDate + a.require(auditTrailListRequestFieldStartDate) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditTrailListRequestFieldUserEmail) +} + +var ( + auditLogEventFieldId = big.NewInt(1 << 0) + auditLogEventFieldUserName = big.NewInt(1 << 1) + auditLogEventFieldUserEmail = big.NewInt(1 << 2) + auditLogEventFieldRole = big.NewInt(1 << 3) + auditLogEventFieldIpAddress = big.NewInt(1 << 4) + auditLogEventFieldEventType = big.NewInt(1 << 5) + auditLogEventFieldEventDescription = big.NewInt(1 << 6) + auditLogEventFieldCreatedAt = big.NewInt(1 << 7) +) + type AuditLogEvent struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The User's full name at the time of this Event occurring. @@ -89,6 +162,9 @@ type AuditLogEvent struct { EventDescription string `json:"event_description" url:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -153,6 +229,69 @@ func (a *AuditLogEvent) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AuditLogEvent) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetId(id *string) { + a.Id = id + a.require(auditLogEventFieldId) +} + +// SetUserName sets the UserName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserName(userName *string) { + a.UserName = userName + a.require(auditLogEventFieldUserName) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditLogEventFieldUserEmail) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetRole(role *AuditLogEventRole) { + a.Role = role + a.require(auditLogEventFieldRole) +} + +// SetIpAddress sets the IpAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetIpAddress(ipAddress string) { + a.IpAddress = ipAddress + a.require(auditLogEventFieldIpAddress) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventType(eventType *AuditLogEventEventType) { + a.EventType = eventType + a.require(auditLogEventFieldEventType) +} + +// SetEventDescription sets the EventDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventDescription(eventDescription string) { + a.EventDescription = eventDescription + a.require(auditLogEventFieldEventDescription) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(auditLogEventFieldCreatedAt) +} + func (a *AuditLogEvent) UnmarshalJSON(data []byte) error { type embed AuditLogEvent var unmarshaler = struct { @@ -184,7 +323,8 @@ func (a *AuditLogEvent) MarshalJSON() ([]byte, error) { embed: embed(*a), CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AuditLogEvent) String() string { @@ -564,11 +704,20 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +var ( + paginatedAuditLogEventListFieldNext = big.NewInt(1 << 0) + paginatedAuditLogEventListFieldPrevious = big.NewInt(1 << 1) + paginatedAuditLogEventListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAuditLogEventList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AuditLogEvent `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -598,6 +747,34 @@ func (p *PaginatedAuditLogEventList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedAuditLogEventList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetNext(next *string) { + p.Next = next + p.require(paginatedAuditLogEventListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAuditLogEventListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetResults(results []*AuditLogEvent) { + p.Results = results + p.require(paginatedAuditLogEventListFieldResults) +} + func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAuditLogEventList var value unmarshaler @@ -614,6 +791,17 @@ func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAuditLogEventList) MarshalJSON() ([]byte, error) { + type embed PaginatedAuditLogEventList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAuditLogEventList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/audittrail/accounting_audit_trail_test/accounting_audit_trail_test.go b/accounting/audittrail/accounting_audit_trail_test/accounting_audit_trail_test.go new file mode 100644 index 0000000..268b259 --- /dev/null +++ b/accounting/audittrail/accounting_audit_trail_test/accounting_audit_trail_test.go @@ -0,0 +1,102 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_audit_trail_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAuditTrailListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } + _, invocationErr := client.Accounting.AuditTrail.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/audit-trail", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "end_date": "end_date", "event_type": "event_type", "page_size": "1", "start_date": "start_date", "user_email": "user_email"}, 1) +} diff --git a/accounting/audittrail/client.go b/accounting/audittrail/client.go index 7c8e4b9..6437add 100644 --- a/accounting/audittrail/client.go +++ b/accounting/audittrail/client.go @@ -4,7 +4,6 @@ package audittrail import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.AuditTrailListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.AuditLogEvent], error) { +) (*core.Page[*string, *accounting.AuditLogEvent], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedAuditLogEventList) *internal.PageResponse[*string, *accounting.AuditLogEvent] { + readPageResponse := func(response *accounting.PaginatedAuditLogEventList) *core.PageResponse[*string, *accounting.AuditLogEvent] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.AuditLogEvent]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.AuditLogEvent]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/accounting/audittrail/raw_client.go b/accounting/audittrail/raw_client.go new file mode 100644 index 0000000..cce0cac --- /dev/null +++ b/accounting/audittrail/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package audittrail + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/accounting/available_actions.go b/accounting/available_actions.go index 53bc9c2..385adeb 100644 --- a/accounting/available_actions.go +++ b/accounting/available_actions.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) // # The AvailableActions Object @@ -14,11 +15,20 @@ import ( // // ### Usage Example // Fetch all the actions available for the `Zenefits` integration. +var ( + availableActionsFieldIntegration = big.NewInt(1 << 0) + availableActionsFieldPassthroughAvailable = big.NewInt(1 << 1) + availableActionsFieldAvailableModelOperations = big.NewInt(1 << 2) +) + type AvailableActions struct { Integration *AccountIntegration `json:"integration" url:"integration"` PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +58,34 @@ func (a *AvailableActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AvailableActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(availableActionsFieldIntegration) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(availableActionsFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(availableActionsFieldAvailableModelOperations) +} + func (a *AvailableActions) UnmarshalJSON(data []byte) error { type unmarshaler AvailableActions var value unmarshaler @@ -64,6 +102,17 @@ func (a *AvailableActions) UnmarshalJSON(data []byte) error { return nil } +func (a *AvailableActions) MarshalJSON() ([]byte, error) { + type embed AvailableActions + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AvailableActions) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/accounting/availableactions/accounting_available_actions_test/accounting_available_actions_test.go b/accounting/availableactions/accounting_available_actions_test/accounting_available_actions_test.go new file mode 100644 index 0000000..86c7904 --- /dev/null +++ b/accounting/availableactions/accounting_available_actions_test/accounting_available_actions_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_available_actions_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingAvailableActionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.AvailableActions.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/available-actions", nil, 1) +} diff --git a/accounting/availableactions/client.go b/accounting/availableactions/client.go index 422eabf..9b513e2 100644 --- a/accounting/availableactions/client.go +++ b/accounting/availableactions/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.AvailableActions, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/available-actions" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.AvailableActions - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/availableactions/raw_client.go b/accounting/availableactions/raw_client.go new file mode 100644 index 0000000..af71b2a --- /dev/null +++ b/accounting/availableactions/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package availableactions + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.AvailableActions], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/available-actions" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.AvailableActions + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AvailableActions]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/balance_sheets.go b/accounting/balance_sheets.go index 01434dc..5e0ceec 100644 --- a/accounting/balance_sheets.go +++ b/accounting/balance_sheets.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + balanceSheetsListRequestFieldCompanyId = big.NewInt(1 << 0) + balanceSheetsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + balanceSheetsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + balanceSheetsListRequestFieldCursor = big.NewInt(1 << 3) + balanceSheetsListRequestFieldExpand = big.NewInt(1 << 4) + balanceSheetsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + balanceSheetsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + balanceSheetsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + balanceSheetsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + balanceSheetsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + balanceSheetsListRequestFieldPageSize = big.NewInt(1 << 10) + balanceSheetsListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type BalanceSheetsListRequest struct { // If provided, will only return balance sheets for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -34,8 +50,108 @@ type BalanceSheetsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (b *BalanceSheetsListRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetCompanyId(companyId *string) { + b.CompanyId = companyId + b.require(balanceSheetsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetCreatedAfter(createdAfter *time.Time) { + b.CreatedAfter = createdAfter + b.require(balanceSheetsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetCreatedBefore(createdBefore *time.Time) { + b.CreatedBefore = createdBefore + b.require(balanceSheetsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetCursor(cursor *string) { + b.Cursor = cursor + b.require(balanceSheetsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetExpand(expand []*string) { + b.Expand = expand + b.require(balanceSheetsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + b.IncludeDeletedData = includeDeletedData + b.require(balanceSheetsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(balanceSheetsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(balanceSheetsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + b.ModifiedAfter = modifiedAfter + b.require(balanceSheetsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + b.ModifiedBefore = modifiedBefore + b.require(balanceSheetsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetPageSize(pageSize *int) { + b.PageSize = pageSize + b.require(balanceSheetsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsListRequest) SetRemoteId(remoteId *string) { + b.RemoteId = remoteId + b.require(balanceSheetsListRequestFieldRemoteId) +} + +var ( + balanceSheetsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + balanceSheetsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + balanceSheetsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type BalanceSheetsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -43,6 +159,37 @@ type BalanceSheetsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BalanceSheetsRetrieveRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsRetrieveRequest) SetExpand(expand []*string) { + b.Expand = expand + b.require(balanceSheetsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(balanceSheetsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheetsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(balanceSheetsRetrieveRequestFieldIncludeShellData) } // # The BalanceSheet Object @@ -51,6 +198,25 @@ type BalanceSheetsRetrieveRequest struct { // // ### Usage Example // Fetch from the `LIST BalanceSheets` endpoint and view a company's balance sheets. +var ( + balanceSheetFieldId = big.NewInt(1 << 0) + balanceSheetFieldRemoteId = big.NewInt(1 << 1) + balanceSheetFieldCreatedAt = big.NewInt(1 << 2) + balanceSheetFieldModifiedAt = big.NewInt(1 << 3) + balanceSheetFieldName = big.NewInt(1 << 4) + balanceSheetFieldCurrency = big.NewInt(1 << 5) + balanceSheetFieldCompany = big.NewInt(1 << 6) + balanceSheetFieldDate = big.NewInt(1 << 7) + balanceSheetFieldNetAssets = big.NewInt(1 << 8) + balanceSheetFieldAssets = big.NewInt(1 << 9) + balanceSheetFieldLiabilities = big.NewInt(1 << 10) + balanceSheetFieldEquity = big.NewInt(1 << 11) + balanceSheetFieldRemoteGeneratedAt = big.NewInt(1 << 12) + balanceSheetFieldRemoteWasDeleted = big.NewInt(1 << 13) + balanceSheetFieldFieldMappings = big.NewInt(1 << 14) + balanceSheetFieldRemoteData = big.NewInt(1 << 15) +) + type BalanceSheet struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -386,6 +552,9 @@ type BalanceSheet struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -506,6 +675,125 @@ func (b *BalanceSheet) GetExtraProperties() map[string]interface{} { return b.extraProperties } +func (b *BalanceSheet) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetId(id *string) { + b.Id = id + b.require(balanceSheetFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetRemoteId(remoteId *string) { + b.RemoteId = remoteId + b.require(balanceSheetFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetCreatedAt(createdAt *time.Time) { + b.CreatedAt = createdAt + b.require(balanceSheetFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetModifiedAt(modifiedAt *time.Time) { + b.ModifiedAt = modifiedAt + b.require(balanceSheetFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetName(name *string) { + b.Name = name + b.require(balanceSheetFieldName) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetCurrency(currency *BalanceSheetCurrency) { + b.Currency = currency + b.require(balanceSheetFieldCurrency) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetCompany(company *BalanceSheetCompany) { + b.Company = company + b.require(balanceSheetFieldCompany) +} + +// SetDate sets the Date field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetDate(date *time.Time) { + b.Date = date + b.require(balanceSheetFieldDate) +} + +// SetNetAssets sets the NetAssets field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetNetAssets(netAssets *float64) { + b.NetAssets = netAssets + b.require(balanceSheetFieldNetAssets) +} + +// SetAssets sets the Assets field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetAssets(assets []*ReportItem) { + b.Assets = assets + b.require(balanceSheetFieldAssets) +} + +// SetLiabilities sets the Liabilities field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetLiabilities(liabilities []*ReportItem) { + b.Liabilities = liabilities + b.require(balanceSheetFieldLiabilities) +} + +// SetEquity sets the Equity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetEquity(equity []*ReportItem) { + b.Equity = equity + b.require(balanceSheetFieldEquity) +} + +// SetRemoteGeneratedAt sets the RemoteGeneratedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetRemoteGeneratedAt(remoteGeneratedAt *time.Time) { + b.RemoteGeneratedAt = remoteGeneratedAt + b.require(balanceSheetFieldRemoteGeneratedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetRemoteWasDeleted(remoteWasDeleted *bool) { + b.RemoteWasDeleted = remoteWasDeleted + b.require(balanceSheetFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetFieldMappings(fieldMappings map[string]interface{}) { + b.FieldMappings = fieldMappings + b.require(balanceSheetFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BalanceSheet) SetRemoteData(remoteData []*RemoteData) { + b.RemoteData = remoteData + b.require(balanceSheetFieldRemoteData) +} + func (b *BalanceSheet) UnmarshalJSON(data []byte) error { type embed BalanceSheet var unmarshaler = struct { @@ -549,7 +837,8 @@ func (b *BalanceSheet) MarshalJSON() ([]byte, error) { Date: internal.NewOptionalDateTime(b.Date), RemoteGeneratedAt: internal.NewOptionalDateTime(b.RemoteGeneratedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) } func (b *BalanceSheet) String() string { @@ -997,11 +1286,20 @@ func (b *BalanceSheetCurrency) Accept(visitor BalanceSheetCurrencyVisitor) error return fmt.Errorf("type %T does not include a non-empty union type", b) } +var ( + paginatedBalanceSheetListFieldNext = big.NewInt(1 << 0) + paginatedBalanceSheetListFieldPrevious = big.NewInt(1 << 1) + paginatedBalanceSheetListFieldResults = big.NewInt(1 << 2) +) + type PaginatedBalanceSheetList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*BalanceSheet `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1031,6 +1329,34 @@ func (p *PaginatedBalanceSheetList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedBalanceSheetList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBalanceSheetList) SetNext(next *string) { + p.Next = next + p.require(paginatedBalanceSheetListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBalanceSheetList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedBalanceSheetListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBalanceSheetList) SetResults(results []*BalanceSheet) { + p.Results = results + p.require(paginatedBalanceSheetListFieldResults) +} + func (p *PaginatedBalanceSheetList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedBalanceSheetList var value unmarshaler @@ -1047,6 +1373,17 @@ func (p *PaginatedBalanceSheetList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedBalanceSheetList) MarshalJSON() ([]byte, error) { + type embed PaginatedBalanceSheetList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedBalanceSheetList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/balancesheets/accounting_balance_sheets_test/accounting_balance_sheets_test.go b/accounting/balancesheets/accounting_balance_sheets_test/accounting_balance_sheets_test.go new file mode 100644 index 0000000..e42d9f0 --- /dev/null +++ b/accounting/balancesheets/accounting_balance_sheets_test/accounting_balance_sheets_test.go @@ -0,0 +1,153 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_balance_sheets_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingBalanceSheetsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.BalanceSheetsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.BalanceSheets.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/balance-sheets", map[string]string{"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"}, 1) +} + +func TestAccountingBalanceSheetsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.BalanceSheetsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.BalanceSheets.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/balance-sheets/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/balancesheets/client.go b/accounting/balancesheets/client.go index 469eb59..a75e64f 100644 --- a/accounting/balancesheets/client.go +++ b/accounting/balancesheets/client.go @@ -4,7 +4,6 @@ package balancesheets import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.BalanceSheetsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.BalanceSheet], error) { +) (*core.Page[*string, *accounting.BalanceSheet], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedBalanceSheetList) *internal.PageResponse[*string, *accounting.BalanceSheet] { + readPageResponse := func(response *accounting.PaginatedBalanceSheetList) *core.PageResponse[*string, *accounting.BalanceSheet] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.BalanceSheet]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.BalanceSheet]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.BalanceSheetsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.BalanceSheet, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/balance-sheets/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.BalanceSheet - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/balancesheets/raw_client.go b/accounting/balancesheets/raw_client.go new file mode 100644 index 0000000..d67582c --- /dev/null +++ b/accounting/balancesheets/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package balancesheets + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.BalanceSheetsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.BalanceSheet], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/balance-sheets/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.BalanceSheet + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.BalanceSheet]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/bank_feed_accounts.go b/accounting/bank_feed_accounts.go index b3b4bab..c03b7b1 100644 --- a/accounting/bank_feed_accounts.go +++ b/accounting/bank_feed_accounts.go @@ -6,17 +6,63 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + bankFeedAccountEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + bankFeedAccountEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + bankFeedAccountEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type BankFeedAccountEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *BankFeedAccountRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BankFeedAccountEndpointRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + b.IsDebugMode = isDebugMode + b.require(bankFeedAccountEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountEndpointRequest) SetRunAsync(runAsync *bool) { + b.RunAsync = runAsync + b.require(bankFeedAccountEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountEndpointRequest) SetModel(model *BankFeedAccountRequest) { + b.Model = model + b.require(bankFeedAccountEndpointRequestFieldModel) +} + +var ( + bankFeedAccountsListRequestFieldCursor = big.NewInt(1 << 0) + bankFeedAccountsListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + bankFeedAccountsListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + bankFeedAccountsListRequestFieldIncludeShellData = big.NewInt(1 << 3) + bankFeedAccountsListRequestFieldPageSize = big.NewInt(1 << 4) +) + type BankFeedAccountsListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -28,13 +74,87 @@ type BankFeedAccountsListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BankFeedAccountsListRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountsListRequest) SetCursor(cursor *string) { + b.Cursor = cursor + b.require(bankFeedAccountsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + b.IncludeDeletedData = includeDeletedData + b.require(bankFeedAccountsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(bankFeedAccountsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountsListRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(bankFeedAccountsListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountsListRequest) SetPageSize(pageSize *int) { + b.PageSize = pageSize + b.require(bankFeedAccountsListRequestFieldPageSize) } +var ( + bankFeedAccountsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + bankFeedAccountsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type BankFeedAccountsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BankFeedAccountsRetrieveRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(bankFeedAccountsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(bankFeedAccountsRetrieveRequestFieldIncludeShellData) } // # The BankFeedAccount Object @@ -43,6 +163,21 @@ type BankFeedAccountsRetrieveRequest struct { // // ### Usage Example // Fetch from the `GET BankFeedAccount` endpoint to view details of a bank feed account. +var ( + bankFeedAccountRequestFieldSourceAccountId = big.NewInt(1 << 0) + bankFeedAccountRequestFieldTargetAccountId = big.NewInt(1 << 1) + bankFeedAccountRequestFieldSourceAccountName = big.NewInt(1 << 2) + bankFeedAccountRequestFieldSourceAccountNumber = big.NewInt(1 << 3) + bankFeedAccountRequestFieldTargetAccountName = big.NewInt(1 << 4) + bankFeedAccountRequestFieldCurrency = big.NewInt(1 << 5) + bankFeedAccountRequestFieldFeedStatus = big.NewInt(1 << 6) + bankFeedAccountRequestFieldFeedStartDate = big.NewInt(1 << 7) + bankFeedAccountRequestFieldSourceAccountBalance = big.NewInt(1 << 8) + bankFeedAccountRequestFieldAccountType = big.NewInt(1 << 9) + bankFeedAccountRequestFieldIntegrationParams = big.NewInt(1 << 10) + bankFeedAccountRequestFieldLinkedAccountParams = big.NewInt(1 << 11) +) + type BankFeedAccountRequest struct { // The unique identifier of the source account from our customer’s platform. SourceAccountId *string `json:"source_account_id,omitempty" url:"source_account_id,omitempty"` @@ -380,6 +515,9 @@ type BankFeedAccountRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -472,6 +610,97 @@ func (b *BankFeedAccountRequest) GetExtraProperties() map[string]interface{} { return b.extraProperties } +func (b *BankFeedAccountRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetSourceAccountId sets the SourceAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetSourceAccountId(sourceAccountId *string) { + b.SourceAccountId = sourceAccountId + b.require(bankFeedAccountRequestFieldSourceAccountId) +} + +// SetTargetAccountId sets the TargetAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetTargetAccountId(targetAccountId *string) { + b.TargetAccountId = targetAccountId + b.require(bankFeedAccountRequestFieldTargetAccountId) +} + +// SetSourceAccountName sets the SourceAccountName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetSourceAccountName(sourceAccountName *string) { + b.SourceAccountName = sourceAccountName + b.require(bankFeedAccountRequestFieldSourceAccountName) +} + +// SetSourceAccountNumber sets the SourceAccountNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetSourceAccountNumber(sourceAccountNumber *string) { + b.SourceAccountNumber = sourceAccountNumber + b.require(bankFeedAccountRequestFieldSourceAccountNumber) +} + +// SetTargetAccountName sets the TargetAccountName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetTargetAccountName(targetAccountName *string) { + b.TargetAccountName = targetAccountName + b.require(bankFeedAccountRequestFieldTargetAccountName) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetCurrency(currency *BankFeedAccountRequestCurrency) { + b.Currency = currency + b.require(bankFeedAccountRequestFieldCurrency) +} + +// SetFeedStatus sets the FeedStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetFeedStatus(feedStatus *BankFeedAccountRequestFeedStatus) { + b.FeedStatus = feedStatus + b.require(bankFeedAccountRequestFieldFeedStatus) +} + +// SetFeedStartDate sets the FeedStartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetFeedStartDate(feedStartDate *time.Time) { + b.FeedStartDate = feedStartDate + b.require(bankFeedAccountRequestFieldFeedStartDate) +} + +// SetSourceAccountBalance sets the SourceAccountBalance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetSourceAccountBalance(sourceAccountBalance *float64) { + b.SourceAccountBalance = sourceAccountBalance + b.require(bankFeedAccountRequestFieldSourceAccountBalance) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetAccountType(accountType *BankFeedAccountRequestAccountType) { + b.AccountType = accountType + b.require(bankFeedAccountRequestFieldAccountType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + b.IntegrationParams = integrationParams + b.require(bankFeedAccountRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + b.LinkedAccountParams = linkedAccountParams + b.require(bankFeedAccountRequestFieldLinkedAccountParams) +} + func (b *BankFeedAccountRequest) UnmarshalJSON(data []byte) error { type embed BankFeedAccountRequest var unmarshaler = struct { @@ -503,7 +732,8 @@ func (b *BankFeedAccountRequest) MarshalJSON() ([]byte, error) { embed: embed(*b), FeedStartDate: internal.NewOptionalDateTime(b.FeedStartDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) } func (b *BankFeedAccountRequest) String() string { @@ -1020,12 +1250,22 @@ func (b *BankFeedAccountRequestFeedStatus) Accept(visitor BankFeedAccountRequest return fmt.Errorf("type %T does not include a non-empty union type", b) } +var ( + bankFeedAccountResponseFieldModel = big.NewInt(1 << 0) + bankFeedAccountResponseFieldWarnings = big.NewInt(1 << 1) + bankFeedAccountResponseFieldErrors = big.NewInt(1 << 2) + bankFeedAccountResponseFieldLogs = big.NewInt(1 << 3) +) + type BankFeedAccountResponse struct { Model *BankFeedAccount `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1062,6 +1302,41 @@ func (b *BankFeedAccountResponse) GetExtraProperties() map[string]interface{} { return b.extraProperties } +func (b *BankFeedAccountResponse) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountResponse) SetModel(model *BankFeedAccount) { + b.Model = model + b.require(bankFeedAccountResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountResponse) SetWarnings(warnings []*WarningValidationProblem) { + b.Warnings = warnings + b.require(bankFeedAccountResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountResponse) SetErrors(errors []*ErrorValidationProblem) { + b.Errors = errors + b.require(bankFeedAccountResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccountResponse) SetLogs(logs []*DebugModeLog) { + b.Logs = logs + b.require(bankFeedAccountResponseFieldLogs) +} + func (b *BankFeedAccountResponse) UnmarshalJSON(data []byte) error { type unmarshaler BankFeedAccountResponse var value unmarshaler @@ -1078,6 +1353,17 @@ func (b *BankFeedAccountResponse) UnmarshalJSON(data []byte) error { return nil } +func (b *BankFeedAccountResponse) MarshalJSON() ([]byte, error) { + type embed BankFeedAccountResponse + var marshaler = struct { + embed + }{ + embed: embed(*b), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (b *BankFeedAccountResponse) String() string { if len(b.rawJSON) > 0 { if value, err := internal.StringifyJSON(b.rawJSON); err == nil { @@ -1090,11 +1376,20 @@ func (b *BankFeedAccountResponse) String() string { return fmt.Sprintf("%#v", b) } +var ( + paginatedBankFeedAccountListFieldNext = big.NewInt(1 << 0) + paginatedBankFeedAccountListFieldPrevious = big.NewInt(1 << 1) + paginatedBankFeedAccountListFieldResults = big.NewInt(1 << 2) +) + type PaginatedBankFeedAccountList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*BankFeedAccount `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1124,6 +1419,34 @@ func (p *PaginatedBankFeedAccountList) GetExtraProperties() map[string]interface return p.extraProperties } +func (p *PaginatedBankFeedAccountList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBankFeedAccountList) SetNext(next *string) { + p.Next = next + p.require(paginatedBankFeedAccountListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBankFeedAccountList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedBankFeedAccountListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBankFeedAccountList) SetResults(results []*BankFeedAccount) { + p.Results = results + p.require(paginatedBankFeedAccountListFieldResults) +} + func (p *PaginatedBankFeedAccountList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedBankFeedAccountList var value unmarshaler @@ -1140,6 +1463,17 @@ func (p *PaginatedBankFeedAccountList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedBankFeedAccountList) MarshalJSON() ([]byte, error) { + type embed PaginatedBankFeedAccountList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedBankFeedAccountList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/bank_feed_transactions.go b/accounting/bank_feed_transactions.go index ec43a2f..3edf01d 100644 --- a/accounting/bank_feed_transactions.go +++ b/accounting/bank_feed_transactions.go @@ -6,17 +6,70 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + bankFeedTransactionEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + bankFeedTransactionEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + bankFeedTransactionEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type BankFeedTransactionEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *BankFeedTransactionRequestRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BankFeedTransactionEndpointRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + b.IsDebugMode = isDebugMode + b.require(bankFeedTransactionEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionEndpointRequest) SetRunAsync(runAsync *bool) { + b.RunAsync = runAsync + b.require(bankFeedTransactionEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionEndpointRequest) SetModel(model *BankFeedTransactionRequestRequest) { + b.Model = model + b.require(bankFeedTransactionEndpointRequestFieldModel) +} + +var ( + bankFeedTransactionsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + bankFeedTransactionsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + bankFeedTransactionsListRequestFieldCursor = big.NewInt(1 << 2) + bankFeedTransactionsListRequestFieldExpand = big.NewInt(1 << 3) + bankFeedTransactionsListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + bankFeedTransactionsListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + bankFeedTransactionsListRequestFieldIncludeShellData = big.NewInt(1 << 6) + bankFeedTransactionsListRequestFieldIsProcessed = big.NewInt(1 << 7) + bankFeedTransactionsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + bankFeedTransactionsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + bankFeedTransactionsListRequestFieldPageSize = big.NewInt(1 << 10) + bankFeedTransactionsListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type BankFeedTransactionsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -42,8 +95,108 @@ type BankFeedTransactionsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BankFeedTransactionsListRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetCreatedAfter(createdAfter *time.Time) { + b.CreatedAfter = createdAfter + b.require(bankFeedTransactionsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetCreatedBefore(createdBefore *time.Time) { + b.CreatedBefore = createdBefore + b.require(bankFeedTransactionsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetCursor(cursor *string) { + b.Cursor = cursor + b.require(bankFeedTransactionsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetExpand(expand []*string) { + b.Expand = expand + b.require(bankFeedTransactionsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + b.IncludeDeletedData = includeDeletedData + b.require(bankFeedTransactionsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(bankFeedTransactionsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(bankFeedTransactionsListRequestFieldIncludeShellData) +} + +// SetIsProcessed sets the IsProcessed field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetIsProcessed(isProcessed *bool) { + b.IsProcessed = isProcessed + b.require(bankFeedTransactionsListRequestFieldIsProcessed) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + b.ModifiedAfter = modifiedAfter + b.require(bankFeedTransactionsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + b.ModifiedBefore = modifiedBefore + b.require(bankFeedTransactionsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetPageSize(pageSize *int) { + b.PageSize = pageSize + b.require(bankFeedTransactionsListRequestFieldPageSize) } +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsListRequest) SetRemoteId(remoteId *string) { + b.RemoteId = remoteId + b.require(bankFeedTransactionsListRequestFieldRemoteId) +} + +var ( + bankFeedTransactionsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + bankFeedTransactionsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + bankFeedTransactionsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type BankFeedTransactionsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -51,6 +204,37 @@ type BankFeedTransactionsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BankFeedTransactionsRetrieveRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsRetrieveRequest) SetExpand(expand []*string) { + b.Expand = expand + b.require(bankFeedTransactionsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(bankFeedTransactionsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(bankFeedTransactionsRetrieveRequestFieldIncludeShellData) } // # The BankFeedTransaction Object @@ -59,6 +243,24 @@ type BankFeedTransactionsRetrieveRequest struct { // // ### Usage Example // Fetch from the `GET BankFeedTransaction` endpoint to view details of a transaction associated with a bank feed account. +var ( + bankFeedTransactionFieldId = big.NewInt(1 << 0) + bankFeedTransactionFieldRemoteId = big.NewInt(1 << 1) + bankFeedTransactionFieldCreatedAt = big.NewInt(1 << 2) + bankFeedTransactionFieldModifiedAt = big.NewInt(1 << 3) + bankFeedTransactionFieldBankFeedAccount = big.NewInt(1 << 4) + bankFeedTransactionFieldTransactionDate = big.NewInt(1 << 5) + bankFeedTransactionFieldPostedDate = big.NewInt(1 << 6) + bankFeedTransactionFieldAmount = big.NewInt(1 << 7) + bankFeedTransactionFieldDescription = big.NewInt(1 << 8) + bankFeedTransactionFieldTransactionType = big.NewInt(1 << 9) + bankFeedTransactionFieldPayee = big.NewInt(1 << 10) + bankFeedTransactionFieldCreditOrDebit = big.NewInt(1 << 11) + bankFeedTransactionFieldSourceTransactionId = big.NewInt(1 << 12) + bankFeedTransactionFieldRemoteWasDeleted = big.NewInt(1 << 13) + bankFeedTransactionFieldIsProcessed = big.NewInt(1 << 14) +) + type BankFeedTransaction struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -93,6 +295,9 @@ type BankFeedTransaction struct { // 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. IsProcessed *bool `json:"is_processed,omitempty" url:"is_processed,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -206,6 +411,118 @@ func (b *BankFeedTransaction) GetExtraProperties() map[string]interface{} { return b.extraProperties } +func (b *BankFeedTransaction) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetId(id *string) { + b.Id = id + b.require(bankFeedTransactionFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetRemoteId(remoteId *string) { + b.RemoteId = remoteId + b.require(bankFeedTransactionFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetCreatedAt(createdAt *time.Time) { + b.CreatedAt = createdAt + b.require(bankFeedTransactionFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetModifiedAt(modifiedAt *time.Time) { + b.ModifiedAt = modifiedAt + b.require(bankFeedTransactionFieldModifiedAt) +} + +// SetBankFeedAccount sets the BankFeedAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetBankFeedAccount(bankFeedAccount *BankFeedTransactionBankFeedAccount) { + b.BankFeedAccount = bankFeedAccount + b.require(bankFeedTransactionFieldBankFeedAccount) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetTransactionDate(transactionDate *time.Time) { + b.TransactionDate = transactionDate + b.require(bankFeedTransactionFieldTransactionDate) +} + +// SetPostedDate sets the PostedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetPostedDate(postedDate *time.Time) { + b.PostedDate = postedDate + b.require(bankFeedTransactionFieldPostedDate) +} + +// SetAmount sets the Amount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetAmount(amount *float64) { + b.Amount = amount + b.require(bankFeedTransactionFieldAmount) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetDescription(description *string) { + b.Description = description + b.require(bankFeedTransactionFieldDescription) +} + +// SetTransactionType sets the TransactionType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetTransactionType(transactionType *string) { + b.TransactionType = transactionType + b.require(bankFeedTransactionFieldTransactionType) +} + +// SetPayee sets the Payee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetPayee(payee *string) { + b.Payee = payee + b.require(bankFeedTransactionFieldPayee) +} + +// SetCreditOrDebit sets the CreditOrDebit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetCreditOrDebit(creditOrDebit *BankFeedTransactionCreditOrDebit) { + b.CreditOrDebit = creditOrDebit + b.require(bankFeedTransactionFieldCreditOrDebit) +} + +// SetSourceTransactionId sets the SourceTransactionId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetSourceTransactionId(sourceTransactionId *string) { + b.SourceTransactionId = sourceTransactionId + b.require(bankFeedTransactionFieldSourceTransactionId) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetRemoteWasDeleted(remoteWasDeleted *bool) { + b.RemoteWasDeleted = remoteWasDeleted + b.require(bankFeedTransactionFieldRemoteWasDeleted) +} + +// SetIsProcessed sets the IsProcessed field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransaction) SetIsProcessed(isProcessed *bool) { + b.IsProcessed = isProcessed + b.require(bankFeedTransactionFieldIsProcessed) +} + func (b *BankFeedTransaction) UnmarshalJSON(data []byte) error { type embed BankFeedTransaction var unmarshaler = struct { @@ -249,7 +566,8 @@ func (b *BankFeedTransaction) MarshalJSON() ([]byte, error) { TransactionDate: internal.NewOptionalDateTime(b.TransactionDate), PostedDate: internal.NewOptionalDateTime(b.PostedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) } func (b *BankFeedTransaction) String() string { @@ -399,6 +717,20 @@ func (b *BankFeedTransactionCreditOrDebit) Accept(visitor BankFeedTransactionCre // // ### Usage Example // Fetch from the `GET BankFeedTransaction` endpoint to view details of a transaction associated with a bank feed account. +var ( + bankFeedTransactionRequestRequestFieldBankFeedAccount = big.NewInt(1 << 0) + bankFeedTransactionRequestRequestFieldTransactionDate = big.NewInt(1 << 1) + bankFeedTransactionRequestRequestFieldPostedDate = big.NewInt(1 << 2) + bankFeedTransactionRequestRequestFieldAmount = big.NewInt(1 << 3) + bankFeedTransactionRequestRequestFieldDescription = big.NewInt(1 << 4) + bankFeedTransactionRequestRequestFieldTransactionType = big.NewInt(1 << 5) + bankFeedTransactionRequestRequestFieldPayee = big.NewInt(1 << 6) + bankFeedTransactionRequestRequestFieldCreditOrDebit = big.NewInt(1 << 7) + bankFeedTransactionRequestRequestFieldSourceTransactionId = big.NewInt(1 << 8) + bankFeedTransactionRequestRequestFieldIntegrationParams = big.NewInt(1 << 9) + bankFeedTransactionRequestRequestFieldLinkedAccountParams = big.NewInt(1 << 10) +) + type BankFeedTransactionRequestRequest struct { // The bank feed account associated with the transaction. BankFeedAccount *BankFeedTransactionRequestRequestBankFeedAccount `json:"bank_feed_account,omitempty" url:"bank_feed_account,omitempty"` @@ -424,6 +756,9 @@ type BankFeedTransactionRequestRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -509,6 +844,90 @@ func (b *BankFeedTransactionRequestRequest) GetExtraProperties() map[string]inte return b.extraProperties } +func (b *BankFeedTransactionRequestRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetBankFeedAccount sets the BankFeedAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetBankFeedAccount(bankFeedAccount *BankFeedTransactionRequestRequestBankFeedAccount) { + b.BankFeedAccount = bankFeedAccount + b.require(bankFeedTransactionRequestRequestFieldBankFeedAccount) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetTransactionDate(transactionDate *time.Time) { + b.TransactionDate = transactionDate + b.require(bankFeedTransactionRequestRequestFieldTransactionDate) +} + +// SetPostedDate sets the PostedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetPostedDate(postedDate *time.Time) { + b.PostedDate = postedDate + b.require(bankFeedTransactionRequestRequestFieldPostedDate) +} + +// SetAmount sets the Amount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetAmount(amount *float64) { + b.Amount = amount + b.require(bankFeedTransactionRequestRequestFieldAmount) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetDescription(description *string) { + b.Description = description + b.require(bankFeedTransactionRequestRequestFieldDescription) +} + +// SetTransactionType sets the TransactionType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetTransactionType(transactionType *string) { + b.TransactionType = transactionType + b.require(bankFeedTransactionRequestRequestFieldTransactionType) +} + +// SetPayee sets the Payee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetPayee(payee *string) { + b.Payee = payee + b.require(bankFeedTransactionRequestRequestFieldPayee) +} + +// SetCreditOrDebit sets the CreditOrDebit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetCreditOrDebit(creditOrDebit *BankFeedTransactionRequestRequestCreditOrDebit) { + b.CreditOrDebit = creditOrDebit + b.require(bankFeedTransactionRequestRequestFieldCreditOrDebit) +} + +// SetSourceTransactionId sets the SourceTransactionId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetSourceTransactionId(sourceTransactionId *string) { + b.SourceTransactionId = sourceTransactionId + b.require(bankFeedTransactionRequestRequestFieldSourceTransactionId) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + b.IntegrationParams = integrationParams + b.require(bankFeedTransactionRequestRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionRequestRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + b.LinkedAccountParams = linkedAccountParams + b.require(bankFeedTransactionRequestRequestFieldLinkedAccountParams) +} + func (b *BankFeedTransactionRequestRequest) UnmarshalJSON(data []byte) error { type embed BankFeedTransactionRequestRequest var unmarshaler = struct { @@ -544,7 +963,8 @@ func (b *BankFeedTransactionRequestRequest) MarshalJSON() ([]byte, error) { TransactionDate: internal.NewOptionalDateTime(b.TransactionDate), PostedDate: internal.NewOptionalDateTime(b.PostedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) } func (b *BankFeedTransactionRequestRequest) String() string { @@ -688,12 +1108,22 @@ func (b *BankFeedTransactionRequestRequestCreditOrDebit) Accept(visitor BankFeed return fmt.Errorf("type %T does not include a non-empty union type", b) } +var ( + bankFeedTransactionResponseFieldModel = big.NewInt(1 << 0) + bankFeedTransactionResponseFieldWarnings = big.NewInt(1 << 1) + bankFeedTransactionResponseFieldErrors = big.NewInt(1 << 2) + bankFeedTransactionResponseFieldLogs = big.NewInt(1 << 3) +) + type BankFeedTransactionResponse struct { Model *BankFeedTransaction `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -730,6 +1160,41 @@ func (b *BankFeedTransactionResponse) GetExtraProperties() map[string]interface{ return b.extraProperties } +func (b *BankFeedTransactionResponse) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionResponse) SetModel(model *BankFeedTransaction) { + b.Model = model + b.require(bankFeedTransactionResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionResponse) SetWarnings(warnings []*WarningValidationProblem) { + b.Warnings = warnings + b.require(bankFeedTransactionResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionResponse) SetErrors(errors []*ErrorValidationProblem) { + b.Errors = errors + b.require(bankFeedTransactionResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedTransactionResponse) SetLogs(logs []*DebugModeLog) { + b.Logs = logs + b.require(bankFeedTransactionResponseFieldLogs) +} + func (b *BankFeedTransactionResponse) UnmarshalJSON(data []byte) error { type unmarshaler BankFeedTransactionResponse var value unmarshaler @@ -746,6 +1211,17 @@ func (b *BankFeedTransactionResponse) UnmarshalJSON(data []byte) error { return nil } +func (b *BankFeedTransactionResponse) MarshalJSON() ([]byte, error) { + type embed BankFeedTransactionResponse + var marshaler = struct { + embed + }{ + embed: embed(*b), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (b *BankFeedTransactionResponse) String() string { if len(b.rawJSON) > 0 { if value, err := internal.StringifyJSON(b.rawJSON); err == nil { @@ -782,11 +1258,20 @@ func (c CreditOrDebitEnum) Ptr() *CreditOrDebitEnum { return &c } +var ( + paginatedBankFeedTransactionListFieldNext = big.NewInt(1 << 0) + paginatedBankFeedTransactionListFieldPrevious = big.NewInt(1 << 1) + paginatedBankFeedTransactionListFieldResults = big.NewInt(1 << 2) +) + type PaginatedBankFeedTransactionList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*BankFeedTransaction `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -816,6 +1301,34 @@ func (p *PaginatedBankFeedTransactionList) GetExtraProperties() map[string]inter return p.extraProperties } +func (p *PaginatedBankFeedTransactionList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBankFeedTransactionList) SetNext(next *string) { + p.Next = next + p.require(paginatedBankFeedTransactionListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBankFeedTransactionList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedBankFeedTransactionListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBankFeedTransactionList) SetResults(results []*BankFeedTransaction) { + p.Results = results + p.require(paginatedBankFeedTransactionListFieldResults) +} + func (p *PaginatedBankFeedTransactionList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedBankFeedTransactionList var value unmarshaler @@ -832,6 +1345,17 @@ func (p *PaginatedBankFeedTransactionList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedBankFeedTransactionList) MarshalJSON() ([]byte, error) { + type embed PaginatedBankFeedTransactionList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedBankFeedTransactionList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/bankfeedaccounts/accounting_bank_feed_accounts_test/accounting_bank_feed_accounts_test.go b/accounting/bankfeedaccounts/accounting_bank_feed_accounts_test/accounting_bank_feed_accounts_test.go new file mode 100644 index 0000000..28a3142 --- /dev/null +++ b/accounting/bankfeedaccounts/accounting_bank_feed_accounts_test/accounting_bank_feed_accounts_test.go @@ -0,0 +1,173 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_bank_feed_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingBankFeedAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.BankFeedAccountsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.BankFeedAccounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/bank-feed-accounts", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} + +func TestAccountingBankFeedAccountsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.BankFeedAccountEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.BankFeedAccountRequest{}, + } + _, invocationErr := client.Accounting.BankFeedAccounts.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/bank-feed-accounts", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingBankFeedAccountsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.BankFeedAccountsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.BankFeedAccounts.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/bank-feed-accounts/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestAccountingBankFeedAccountsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.BankFeedAccounts.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/bank-feed-accounts/meta/post", nil, 1) +} diff --git a/accounting/bankfeedaccounts/client.go b/accounting/bankfeedaccounts/client.go index 40c8748..62def4d 100644 --- a/accounting/bankfeedaccounts/client.go +++ b/accounting/bankfeedaccounts/client.go @@ -4,7 +4,6 @@ package bankfeedaccounts import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.BankFeedAccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.BankFeedAccount], error) { +) (*core.Page[*string, *accounting.BankFeedAccount], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedBankFeedAccountList) *internal.PageResponse[*string, *accounting.BankFeedAccount] { + readPageResponse := func(response *accounting.PaginatedBankFeedAccountList) *core.PageResponse[*string, *accounting.BankFeedAccount] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.BankFeedAccount]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.BankFeedAccount]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.BankFeedAccountEndpointRequest, opts ...option.RequestOption, ) (*accounting.BankFeedAccountResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/bank-feed-accounts" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.BankFeedAccountResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `BankFeedAccount` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.BankFeedAccountsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.BankFeedAccount, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/bank-feed-accounts/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.BankFeedAccount - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `BankFeedAccount` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/bank-feed-accounts/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/bankfeedaccounts/raw_client.go b/accounting/bankfeedaccounts/raw_client.go new file mode 100644 index 0000000..4465702 --- /dev/null +++ b/accounting/bankfeedaccounts/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package bankfeedaccounts + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.BankFeedAccountEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.BankFeedAccountResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/bank-feed-accounts" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.BankFeedAccountResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.BankFeedAccountResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.BankFeedAccountsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.BankFeedAccount], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/bank-feed-accounts/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.BankFeedAccount + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.BankFeedAccount]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/bank-feed-accounts/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/bankfeedtransactions/accounting_bank_feed_transactions_test/accounting_bank_feed_transactions_test.go b/accounting/bankfeedtransactions/accounting_bank_feed_transactions_test/accounting_bank_feed_transactions_test.go new file mode 100644 index 0000000..4e20ad4 --- /dev/null +++ b/accounting/bankfeedtransactions/accounting_bank_feed_transactions_test/accounting_bank_feed_transactions_test.go @@ -0,0 +1,199 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_bank_feed_transactions_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingBankFeedTransactionsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.BankFeedTransactionsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsProcessed: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.BankFeedTransactions.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/bank-feed-transactions", map[string]string{"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"}, 1) +} + +func TestAccountingBankFeedTransactionsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.BankFeedTransactionEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.BankFeedTransactionRequestRequest{}, + } + _, invocationErr := client.Accounting.BankFeedTransactions.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/bank-feed-transactions", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingBankFeedTransactionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.BankFeedTransactionsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.BankFeedTransactions.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/bank-feed-transactions/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestAccountingBankFeedTransactionsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.BankFeedTransactions.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/bank-feed-transactions/meta/post", nil, 1) +} diff --git a/accounting/bankfeedtransactions/client.go b/accounting/bankfeedtransactions/client.go index 510ac96..e013cd0 100644 --- a/accounting/bankfeedtransactions/client.go +++ b/accounting/bankfeedtransactions/client.go @@ -4,7 +4,6 @@ package bankfeedtransactions import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.BankFeedTransactionsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.BankFeedTransaction], error) { +) (*core.Page[*string, *accounting.BankFeedTransaction], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedBankFeedTransactionList) *internal.PageResponse[*string, *accounting.BankFeedTransaction] { + readPageResponse := func(response *accounting.PaginatedBankFeedTransactionList) *core.PageResponse[*string, *accounting.BankFeedTransaction] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.BankFeedTransaction]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.BankFeedTransaction]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.BankFeedTransactionEndpointRequest, opts ...option.RequestOption, ) (*accounting.BankFeedTransactionResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/bank-feed-transactions" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.BankFeedTransactionResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `BankFeedTransaction` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.BankFeedTransactionsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.BankFeedTransaction, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/bank-feed-transactions/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.BankFeedTransaction - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `BankFeedTransaction` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/bank-feed-transactions/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/bankfeedtransactions/raw_client.go b/accounting/bankfeedtransactions/raw_client.go new file mode 100644 index 0000000..dfce341 --- /dev/null +++ b/accounting/bankfeedtransactions/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package bankfeedtransactions + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.BankFeedTransactionEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.BankFeedTransactionResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/bank-feed-transactions" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.BankFeedTransactionResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.BankFeedTransactionResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.BankFeedTransactionsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.BankFeedTransaction], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/bank-feed-transactions/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.BankFeedTransaction + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.BankFeedTransaction]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/bank-feed-transactions/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/cash_flow_statements.go b/accounting/cash_flow_statements.go index 634ddfe..1aa77d5 100644 --- a/accounting/cash_flow_statements.go +++ b/accounting/cash_flow_statements.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + cashFlowStatementsListRequestFieldCompanyId = big.NewInt(1 << 0) + cashFlowStatementsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + cashFlowStatementsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + cashFlowStatementsListRequestFieldCursor = big.NewInt(1 << 3) + cashFlowStatementsListRequestFieldExpand = big.NewInt(1 << 4) + cashFlowStatementsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + cashFlowStatementsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + cashFlowStatementsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + cashFlowStatementsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + cashFlowStatementsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + cashFlowStatementsListRequestFieldPageSize = big.NewInt(1 << 10) + cashFlowStatementsListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type CashFlowStatementsListRequest struct { // If provided, will only return cash flow statements for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -34,8 +50,108 @@ type CashFlowStatementsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CashFlowStatementsListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetCompanyId(companyId *string) { + c.CompanyId = companyId + c.require(cashFlowStatementsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(cashFlowStatementsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(cashFlowStatementsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(cashFlowStatementsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(cashFlowStatementsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(cashFlowStatementsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(cashFlowStatementsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(cashFlowStatementsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(cashFlowStatementsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(cashFlowStatementsListRequestFieldModifiedBefore) } +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(cashFlowStatementsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(cashFlowStatementsListRequestFieldRemoteId) +} + +var ( + cashFlowStatementsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + cashFlowStatementsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + cashFlowStatementsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type CashFlowStatementsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -43,6 +159,37 @@ type CashFlowStatementsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CashFlowStatementsRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsRetrieveRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(cashFlowStatementsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(cashFlowStatementsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatementsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(cashFlowStatementsRetrieveRequestFieldIncludeShellData) } // # The CashFlowStatement Object @@ -51,6 +198,27 @@ type CashFlowStatementsRetrieveRequest struct { // // ### Usage Example // Fetch from the `LIST CashFlowStatements` endpoint and view a company's cash flow statements. +var ( + cashFlowStatementFieldId = big.NewInt(1 << 0) + cashFlowStatementFieldRemoteId = big.NewInt(1 << 1) + cashFlowStatementFieldCreatedAt = big.NewInt(1 << 2) + cashFlowStatementFieldModifiedAt = big.NewInt(1 << 3) + cashFlowStatementFieldName = big.NewInt(1 << 4) + cashFlowStatementFieldCurrency = big.NewInt(1 << 5) + cashFlowStatementFieldCompany = big.NewInt(1 << 6) + cashFlowStatementFieldStartPeriod = big.NewInt(1 << 7) + cashFlowStatementFieldEndPeriod = big.NewInt(1 << 8) + cashFlowStatementFieldCashAtBeginningOfPeriod = big.NewInt(1 << 9) + cashFlowStatementFieldCashAtEndOfPeriod = big.NewInt(1 << 10) + cashFlowStatementFieldOperatingActivities = big.NewInt(1 << 11) + cashFlowStatementFieldInvestingActivities = big.NewInt(1 << 12) + cashFlowStatementFieldFinancingActivities = big.NewInt(1 << 13) + cashFlowStatementFieldRemoteGeneratedAt = big.NewInt(1 << 14) + cashFlowStatementFieldRemoteWasDeleted = big.NewInt(1 << 15) + cashFlowStatementFieldFieldMappings = big.NewInt(1 << 16) + cashFlowStatementFieldRemoteData = big.NewInt(1 << 17) +) + type CashFlowStatement struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -390,6 +558,9 @@ type CashFlowStatement struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -524,6 +695,139 @@ func (c *CashFlowStatement) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CashFlowStatement) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetId(id *string) { + c.Id = id + c.require(cashFlowStatementFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(cashFlowStatementFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(cashFlowStatementFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(cashFlowStatementFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetName(name *string) { + c.Name = name + c.require(cashFlowStatementFieldName) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetCurrency(currency *CashFlowStatementCurrency) { + c.Currency = currency + c.require(cashFlowStatementFieldCurrency) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetCompany(company *CashFlowStatementCompany) { + c.Company = company + c.require(cashFlowStatementFieldCompany) +} + +// SetStartPeriod sets the StartPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetStartPeriod(startPeriod *time.Time) { + c.StartPeriod = startPeriod + c.require(cashFlowStatementFieldStartPeriod) +} + +// SetEndPeriod sets the EndPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetEndPeriod(endPeriod *time.Time) { + c.EndPeriod = endPeriod + c.require(cashFlowStatementFieldEndPeriod) +} + +// SetCashAtBeginningOfPeriod sets the CashAtBeginningOfPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetCashAtBeginningOfPeriod(cashAtBeginningOfPeriod *float64) { + c.CashAtBeginningOfPeriod = cashAtBeginningOfPeriod + c.require(cashFlowStatementFieldCashAtBeginningOfPeriod) +} + +// SetCashAtEndOfPeriod sets the CashAtEndOfPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetCashAtEndOfPeriod(cashAtEndOfPeriod *float64) { + c.CashAtEndOfPeriod = cashAtEndOfPeriod + c.require(cashFlowStatementFieldCashAtEndOfPeriod) +} + +// SetOperatingActivities sets the OperatingActivities field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetOperatingActivities(operatingActivities []*ReportItem) { + c.OperatingActivities = operatingActivities + c.require(cashFlowStatementFieldOperatingActivities) +} + +// SetInvestingActivities sets the InvestingActivities field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetInvestingActivities(investingActivities []*ReportItem) { + c.InvestingActivities = investingActivities + c.require(cashFlowStatementFieldInvestingActivities) +} + +// SetFinancingActivities sets the FinancingActivities field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetFinancingActivities(financingActivities []*ReportItem) { + c.FinancingActivities = financingActivities + c.require(cashFlowStatementFieldFinancingActivities) +} + +// SetRemoteGeneratedAt sets the RemoteGeneratedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetRemoteGeneratedAt(remoteGeneratedAt *time.Time) { + c.RemoteGeneratedAt = remoteGeneratedAt + c.require(cashFlowStatementFieldRemoteGeneratedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(cashFlowStatementFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(cashFlowStatementFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CashFlowStatement) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(cashFlowStatementFieldRemoteData) +} + func (c *CashFlowStatement) UnmarshalJSON(data []byte) error { type embed CashFlowStatement var unmarshaler = struct { @@ -571,7 +875,8 @@ func (c *CashFlowStatement) MarshalJSON() ([]byte, error) { EndPeriod: internal.NewOptionalDateTime(c.EndPeriod), RemoteGeneratedAt: internal.NewOptionalDateTime(c.RemoteGeneratedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CashFlowStatement) String() string { @@ -1019,11 +1324,20 @@ func (c *CashFlowStatementCurrency) Accept(visitor CashFlowStatementCurrencyVisi return fmt.Errorf("type %T does not include a non-empty union type", c) } +var ( + paginatedCashFlowStatementListFieldNext = big.NewInt(1 << 0) + paginatedCashFlowStatementListFieldPrevious = big.NewInt(1 << 1) + paginatedCashFlowStatementListFieldResults = big.NewInt(1 << 2) +) + type PaginatedCashFlowStatementList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*CashFlowStatement `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1053,6 +1367,34 @@ func (p *PaginatedCashFlowStatementList) GetExtraProperties() map[string]interfa return p.extraProperties } +func (p *PaginatedCashFlowStatementList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCashFlowStatementList) SetNext(next *string) { + p.Next = next + p.require(paginatedCashFlowStatementListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCashFlowStatementList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedCashFlowStatementListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCashFlowStatementList) SetResults(results []*CashFlowStatement) { + p.Results = results + p.require(paginatedCashFlowStatementListFieldResults) +} + func (p *PaginatedCashFlowStatementList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedCashFlowStatementList var value unmarshaler @@ -1069,6 +1411,17 @@ func (p *PaginatedCashFlowStatementList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedCashFlowStatementList) MarshalJSON() ([]byte, error) { + type embed PaginatedCashFlowStatementList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedCashFlowStatementList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/cashflowstatements/accounting_cash_flow_statements_test/accounting_cash_flow_statements_test.go b/accounting/cashflowstatements/accounting_cash_flow_statements_test/accounting_cash_flow_statements_test.go new file mode 100644 index 0000000..dafc559 --- /dev/null +++ b/accounting/cashflowstatements/accounting_cash_flow_statements_test/accounting_cash_flow_statements_test.go @@ -0,0 +1,153 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_cash_flow_statements_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingCashFlowStatementsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.CashFlowStatementsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.CashFlowStatements.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/cash-flow-statements", map[string]string{"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"}, 1) +} + +func TestAccountingCashFlowStatementsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.CashFlowStatementsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.CashFlowStatements.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/cash-flow-statements/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/cashflowstatements/client.go b/accounting/cashflowstatements/client.go index 229444a..9adbfe3 100644 --- a/accounting/cashflowstatements/client.go +++ b/accounting/cashflowstatements/client.go @@ -4,7 +4,6 @@ package cashflowstatements import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.CashFlowStatementsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.CashFlowStatement], error) { +) (*core.Page[*string, *accounting.CashFlowStatement], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedCashFlowStatementList) *internal.PageResponse[*string, *accounting.CashFlowStatement] { + readPageResponse := func(response *accounting.PaginatedCashFlowStatementList) *core.PageResponse[*string, *accounting.CashFlowStatement] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.CashFlowStatement]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.CashFlowStatement]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.CashFlowStatementsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.CashFlowStatement, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/cash-flow-statements/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.CashFlowStatement - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/cashflowstatements/raw_client.go b/accounting/cashflowstatements/raw_client.go new file mode 100644 index 0000000..970fa12 --- /dev/null +++ b/accounting/cashflowstatements/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package cashflowstatements + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.CashFlowStatementsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.CashFlowStatement], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/cash-flow-statements/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.CashFlowStatement + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.CashFlowStatement]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/client/client.go b/accounting/client/client.go index ffd3423..9b91d4c 100644 --- a/accounting/client/client.go +++ b/accounting/client/client.go @@ -51,15 +51,9 @@ import ( webhookreceivers "github.com/merge-api/merge-go-client/v2/accounting/webhookreceivers" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" - option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { - baseURL string - caller *internal.Caller - header http.Header - AccountDetails *accountdetails.Client AccountToken *accounttoken.Client AccountingPeriods *accountingperiods.Client @@ -106,64 +100,67 @@ type Client struct { Transactions *transactions.Client VendorCredits *vendorcredits.Client WebhookReceivers *webhookreceivers.Client + + options *core.RequestOptions + baseURL string + caller *internal.Caller } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + AccountDetails: accountdetails.NewClient(options), + AccountToken: accounttoken.NewClient(options), + AccountingPeriods: accountingperiods.NewClient(options), + Accounts: accounts.NewClient(options), + Addresses: addresses.NewClient(options), + AsyncPassthrough: asyncpassthrough.NewClient(options), + AsyncTasks: asynctasks.NewClient(options), + Attachments: attachments.NewClient(options), + AuditTrail: audittrail.NewClient(options), + AvailableActions: availableactions.NewClient(options), + BalanceSheets: balancesheets.NewClient(options), + BankFeedAccounts: bankfeedaccounts.NewClient(options), + BankFeedTransactions: bankfeedtransactions.NewClient(options), + CashFlowStatements: cashflowstatements.NewClient(options), + CompanyInfo: companyinfo.NewClient(options), + Contacts: contacts.NewClient(options), + CreditNotes: creditnotes.NewClient(options), + Scopes: scopes.NewClient(options), + DeleteAccount: deleteaccount.NewClient(options), + Employees: employees.NewClient(options), + Expenses: expenses.NewClient(options), + FieldMapping: fieldmapping.NewClient(options), + GeneralLedgerTransactions: generalledgertransactions.NewClient(options), + GenerateKey: generatekey.NewClient(options), + IncomeStatements: incomestatements.NewClient(options), + Invoices: invoices.NewClient(options), + Issues: issues.NewClient(options), + Items: items.NewClient(options), + JournalEntries: journalentries.NewClient(options), + LinkToken: linktoken.NewClient(options), + LinkedAccounts: linkedaccounts.NewClient(options), + Passthrough: passthrough.NewClient(options), + PaymentMethods: paymentmethods.NewClient(options), + PaymentTerms: paymentterms.NewClient(options), + Payments: payments.NewClient(options), + PhoneNumbers: phonenumbers.NewClient(options), + Projects: projects.NewClient(options), + PurchaseOrders: purchaseorders.NewClient(options), + RegenerateKey: regeneratekey.NewClient(options), + SyncStatus: syncstatus.NewClient(options), + ForceResync: forceresync.NewClient(options), + TaxRates: taxrates.NewClient(options), + TrackingCategories: trackingcategories.NewClient(options), + Transactions: transactions.NewClient(options), + VendorCredits: vendorcredits.NewClient(options), + WebhookReceivers: webhookreceivers.NewClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), - AccountDetails: accountdetails.NewClient(opts...), - AccountToken: accounttoken.NewClient(opts...), - AccountingPeriods: accountingperiods.NewClient(opts...), - Accounts: accounts.NewClient(opts...), - Addresses: addresses.NewClient(opts...), - AsyncPassthrough: asyncpassthrough.NewClient(opts...), - AsyncTasks: asynctasks.NewClient(opts...), - Attachments: attachments.NewClient(opts...), - AuditTrail: audittrail.NewClient(opts...), - AvailableActions: availableactions.NewClient(opts...), - BalanceSheets: balancesheets.NewClient(opts...), - BankFeedAccounts: bankfeedaccounts.NewClient(opts...), - BankFeedTransactions: bankfeedtransactions.NewClient(opts...), - CashFlowStatements: cashflowstatements.NewClient(opts...), - CompanyInfo: companyinfo.NewClient(opts...), - Contacts: contacts.NewClient(opts...), - CreditNotes: creditnotes.NewClient(opts...), - Scopes: scopes.NewClient(opts...), - DeleteAccount: deleteaccount.NewClient(opts...), - Employees: employees.NewClient(opts...), - Expenses: expenses.NewClient(opts...), - FieldMapping: fieldmapping.NewClient(opts...), - GeneralLedgerTransactions: generalledgertransactions.NewClient(opts...), - GenerateKey: generatekey.NewClient(opts...), - IncomeStatements: incomestatements.NewClient(opts...), - Invoices: invoices.NewClient(opts...), - Issues: issues.NewClient(opts...), - Items: items.NewClient(opts...), - JournalEntries: journalentries.NewClient(opts...), - LinkToken: linktoken.NewClient(opts...), - LinkedAccounts: linkedaccounts.NewClient(opts...), - Passthrough: passthrough.NewClient(opts...), - PaymentMethods: paymentmethods.NewClient(opts...), - PaymentTerms: paymentterms.NewClient(opts...), - Payments: payments.NewClient(opts...), - PhoneNumbers: phonenumbers.NewClient(opts...), - Projects: projects.NewClient(opts...), - PurchaseOrders: purchaseorders.NewClient(opts...), - RegenerateKey: regeneratekey.NewClient(opts...), - SyncStatus: syncstatus.NewClient(opts...), - ForceResync: forceresync.NewClient(opts...), - TaxRates: taxrates.NewClient(opts...), - TrackingCategories: trackingcategories.NewClient(opts...), - Transactions: transactions.NewClient(opts...), - VendorCredits: vendorcredits.NewClient(opts...), - WebhookReceivers: webhookreceivers.NewClient(opts...), } } diff --git a/accounting/company_info.go b/accounting/company_info.go index b0457b5..e8bfca4 100644 --- a/accounting/company_info.go +++ b/accounting/company_info.go @@ -6,9 +6,24 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + companyInfoListRequestFieldCreatedAfter = big.NewInt(1 << 0) + companyInfoListRequestFieldCreatedBefore = big.NewInt(1 << 1) + companyInfoListRequestFieldCursor = big.NewInt(1 << 2) + companyInfoListRequestFieldExpand = big.NewInt(1 << 3) + companyInfoListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + companyInfoListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + companyInfoListRequestFieldIncludeShellData = big.NewInt(1 << 6) + companyInfoListRequestFieldModifiedAfter = big.NewInt(1 << 7) + companyInfoListRequestFieldModifiedBefore = big.NewInt(1 << 8) + companyInfoListRequestFieldPageSize = big.NewInt(1 << 9) + companyInfoListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type CompanyInfoListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -32,8 +47,101 @@ type CompanyInfoListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CompanyInfoListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(companyInfoListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(companyInfoListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(companyInfoListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetExpand(expand []*CompanyInfoListRequestExpandItem) { + c.Expand = expand + c.require(companyInfoListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(companyInfoListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(companyInfoListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(companyInfoListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(companyInfoListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(companyInfoListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(companyInfoListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(companyInfoListRequestFieldRemoteId) } +var ( + companyInfoRetrieveRequestFieldExpand = big.NewInt(1 << 0) + companyInfoRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + companyInfoRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type CompanyInfoRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*CompanyInfoRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -41,6 +149,37 @@ type CompanyInfoRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CompanyInfoRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoRetrieveRequest) SetExpand(expand []*CompanyInfoRetrieveRequestExpandItem) { + c.Expand = expand + c.require(companyInfoRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(companyInfoRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfoRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(companyInfoRetrieveRequestFieldIncludeShellData) } type CompanyInfoListRequestExpandItem string @@ -87,11 +226,20 @@ func (c CompanyInfoRetrieveRequestExpandItem) Ptr() *CompanyInfoRetrieveRequestE return &c } +var ( + paginatedCompanyInfoListFieldNext = big.NewInt(1 << 0) + paginatedCompanyInfoListFieldPrevious = big.NewInt(1 << 1) + paginatedCompanyInfoListFieldResults = big.NewInt(1 << 2) +) + type PaginatedCompanyInfoList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*CompanyInfo `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -121,6 +269,34 @@ func (p *PaginatedCompanyInfoList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedCompanyInfoList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCompanyInfoList) SetNext(next *string) { + p.Next = next + p.require(paginatedCompanyInfoListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCompanyInfoList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedCompanyInfoListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCompanyInfoList) SetResults(results []*CompanyInfo) { + p.Results = results + p.require(paginatedCompanyInfoListFieldResults) +} + func (p *PaginatedCompanyInfoList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedCompanyInfoList var value unmarshaler @@ -137,6 +313,17 @@ func (p *PaginatedCompanyInfoList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedCompanyInfoList) MarshalJSON() ([]byte, error) { + type embed PaginatedCompanyInfoList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedCompanyInfoList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/companyinfo/accounting_company_info_test/accounting_company_info_test.go b/accounting/companyinfo/accounting_company_info_test/accounting_company_info_test.go new file mode 100644 index 0000000..7d708c2 --- /dev/null +++ b/accounting/companyinfo/accounting_company_info_test/accounting_company_info_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_company_info_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingCompanyInfoListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.CompanyInfoListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.CompanyInfo.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/company-info", map[string]string{"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"}, 1) +} + +func TestAccountingCompanyInfoRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.CompanyInfoRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.CompanyInfo.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/company-info/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/companyinfo/client.go b/accounting/companyinfo/client.go index 8b0ca7f..4189cd6 100644 --- a/accounting/companyinfo/client.go +++ b/accounting/companyinfo/client.go @@ -4,7 +4,6 @@ package companyinfo import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.CompanyInfoListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.CompanyInfo], error) { +) (*core.Page[*string, *accounting.CompanyInfo], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedCompanyInfoList) *internal.PageResponse[*string, *accounting.CompanyInfo] { + readPageResponse := func(response *accounting.PaginatedCompanyInfoList) *core.PageResponse[*string, *accounting.CompanyInfo] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.CompanyInfo]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.CompanyInfo]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.CompanyInfoRetrieveRequest, opts ...option.RequestOption, ) (*accounting.CompanyInfo, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/company-info/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.CompanyInfo - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/companyinfo/raw_client.go b/accounting/companyinfo/raw_client.go new file mode 100644 index 0000000..b850691 --- /dev/null +++ b/accounting/companyinfo/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package companyinfo + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.CompanyInfoRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.CompanyInfo], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/company-info/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.CompanyInfo + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.CompanyInfo]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/contacts.go b/accounting/contacts.go index 4cd9169..13a3fa4 100644 --- a/accounting/contacts.go +++ b/accounting/contacts.go @@ -6,17 +6,78 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + contactEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + contactEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + contactEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type ContactEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *ContactRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ContactEndpointRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + c.IsDebugMode = isDebugMode + c.require(contactEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactEndpointRequest) SetRunAsync(runAsync *bool) { + c.RunAsync = runAsync + c.require(contactEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactEndpointRequest) SetModel(model *ContactRequest) { + c.Model = model + c.require(contactEndpointRequestFieldModel) } +var ( + contactsListRequestFieldCompanyId = big.NewInt(1 << 0) + contactsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + contactsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + contactsListRequestFieldCursor = big.NewInt(1 << 3) + contactsListRequestFieldEmailAddress = big.NewInt(1 << 4) + contactsListRequestFieldExpand = big.NewInt(1 << 5) + contactsListRequestFieldIncludeDeletedData = big.NewInt(1 << 6) + contactsListRequestFieldIncludeRemoteData = big.NewInt(1 << 7) + contactsListRequestFieldIncludeRemoteFields = big.NewInt(1 << 8) + contactsListRequestFieldIncludeShellData = big.NewInt(1 << 9) + contactsListRequestFieldIsCustomer = big.NewInt(1 << 10) + contactsListRequestFieldIsSupplier = big.NewInt(1 << 11) + contactsListRequestFieldModifiedAfter = big.NewInt(1 << 12) + contactsListRequestFieldModifiedBefore = big.NewInt(1 << 13) + contactsListRequestFieldName = big.NewInt(1 << 14) + contactsListRequestFieldPageSize = big.NewInt(1 << 15) + contactsListRequestFieldRemoteFields = big.NewInt(1 << 16) + contactsListRequestFieldRemoteId = big.NewInt(1 << 17) + contactsListRequestFieldShowEnumOrigins = big.NewInt(1 << 18) + contactsListRequestFieldStatus = big.NewInt(1 << 19) +) + type ContactsListRequest struct { // If provided, will only return contacts for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -57,9 +118,169 @@ type ContactsListRequest struct { // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` // If provided, will only return Contacts that match this status. - Status *string `json:"-" url:"status,omitempty"` + Status *ContactsListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ContactsListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCompanyId(companyId *string) { + c.CompanyId = companyId + c.require(contactsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(contactsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(contactsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(contactsListRequestFieldCursor) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetEmailAddress(emailAddress *string) { + c.EmailAddress = emailAddress + c.require(contactsListRequestFieldEmailAddress) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetExpand(expand []*ContactsListRequestExpandItem) { + c.Expand = expand + c.require(contactsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(contactsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(contactsListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + c.IncludeRemoteFields = includeRemoteFields + c.require(contactsListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(contactsListRequestFieldIncludeShellData) +} + +// SetIsCustomer sets the IsCustomer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIsCustomer(isCustomer *string) { + c.IsCustomer = isCustomer + c.require(contactsListRequestFieldIsCustomer) +} + +// SetIsSupplier sets the IsSupplier field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIsSupplier(isSupplier *string) { + c.IsSupplier = isSupplier + c.require(contactsListRequestFieldIsSupplier) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(contactsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(contactsListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetName(name *string) { + c.Name = name + c.require(contactsListRequestFieldName) } +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(contactsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetRemoteFields(remoteFields *string) { + c.RemoteFields = remoteFields + c.require(contactsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(contactsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + c.ShowEnumOrigins = showEnumOrigins + c.require(contactsListRequestFieldShowEnumOrigins) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetStatus(status *ContactsListRequestStatus) { + c.Status = status + c.require(contactsListRequestFieldStatus) +} + +var ( + contactsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + contactsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + contactsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + contactsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + contactsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + contactsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + contactsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type ContactsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -75,8 +296,76 @@ type ContactsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ContactsRemoteFieldClassesListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(contactsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(contactsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(contactsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(contactsRemoteFieldClassesListRequestFieldIncludeShellData) } +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + c.IsCommonModelField = isCommonModelField + c.require(contactsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + c.IsCustom = isCustom + c.require(contactsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(contactsRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + contactsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + contactsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + contactsRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + contactsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) + contactsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 4) + contactsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 5) +) + type ContactsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*ContactsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -90,6 +379,58 @@ type ContactsRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ContactsRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetExpand(expand []*ContactsRetrieveRequestExpandItem) { + c.Expand = expand + c.require(contactsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(contactsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + c.IncludeRemoteFields = includeRemoteFields + c.require(contactsRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(contactsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetRemoteFields(remoteFields *string) { + c.RemoteFields = remoteFields + c.require(contactsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + c.ShowEnumOrigins = showEnumOrigins + c.require(contactsRetrieveRequestFieldShowEnumOrigins) } type ContactsListRequestExpandItem string @@ -117,6 +458,31 @@ func (c ContactsListRequestExpandItem) Ptr() *ContactsListRequestExpandItem { return &c } +type ContactsListRequestStatus string + +const ( + ContactsListRequestStatusEmpty ContactsListRequestStatus = "" + ContactsListRequestStatusActive ContactsListRequestStatus = "ACTIVE" + ContactsListRequestStatusArchived ContactsListRequestStatus = "ARCHIVED" +) + +func NewContactsListRequestStatusFromString(s string) (ContactsListRequestStatus, error) { + switch s { + case "": + return ContactsListRequestStatusEmpty, nil + case "ACTIVE": + return ContactsListRequestStatusActive, nil + case "ARCHIVED": + return ContactsListRequestStatusArchived, nil + } + var t ContactsListRequestStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ContactsListRequestStatus) Ptr() *ContactsListRequestStatus { + return &c +} + type ContactsRetrieveRequestExpandItem string const ( @@ -148,6 +514,13 @@ func (c ContactsRetrieveRequestExpandItem) Ptr() *ContactsRetrieveRequestExpandI // // ### Usage Example // Fetch from the `GET CompanyInfo` endpoint and view the company's phone numbers. +var ( + accountingPhoneNumberRequestFieldNumber = big.NewInt(1 << 0) + accountingPhoneNumberRequestFieldType = big.NewInt(1 << 1) + accountingPhoneNumberRequestFieldIntegrationParams = big.NewInt(1 << 2) + accountingPhoneNumberRequestFieldLinkedAccountParams = big.NewInt(1 << 3) +) + type AccountingPhoneNumberRequest struct { // The phone number. Number *string `json:"number,omitempty" url:"number,omitempty"` @@ -156,6 +529,9 @@ type AccountingPhoneNumberRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -192,6 +568,41 @@ func (a *AccountingPhoneNumberRequest) GetExtraProperties() map[string]interface return a.extraProperties } +func (a *AccountingPhoneNumberRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPhoneNumberRequest) SetNumber(number *string) { + a.Number = number + a.require(accountingPhoneNumberRequestFieldNumber) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPhoneNumberRequest) SetType(type_ *string) { + a.Type = type_ + a.require(accountingPhoneNumberRequestFieldType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPhoneNumberRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(accountingPhoneNumberRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPhoneNumberRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(accountingPhoneNumberRequestFieldLinkedAccountParams) +} + func (a *AccountingPhoneNumberRequest) UnmarshalJSON(data []byte) error { type unmarshaler AccountingPhoneNumberRequest var value unmarshaler @@ -208,6 +619,17 @@ func (a *AccountingPhoneNumberRequest) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountingPhoneNumberRequest) MarshalJSON() ([]byte, error) { + type embed AccountingPhoneNumberRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountingPhoneNumberRequest) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -228,6 +650,22 @@ func (a *AccountingPhoneNumberRequest) String() string { // // ### Usage Example // Fetch from the `LIST Contacts` endpoint and view a company's contacts. +var ( + contactRequestFieldName = big.NewInt(1 << 0) + contactRequestFieldIsSupplier = big.NewInt(1 << 1) + contactRequestFieldIsCustomer = big.NewInt(1 << 2) + contactRequestFieldEmailAddress = big.NewInt(1 << 3) + contactRequestFieldTaxNumber = big.NewInt(1 << 4) + contactRequestFieldStatus = big.NewInt(1 << 5) + contactRequestFieldCurrency = big.NewInt(1 << 6) + contactRequestFieldCompany = big.NewInt(1 << 7) + contactRequestFieldAddresses = big.NewInt(1 << 8) + contactRequestFieldPhoneNumbers = big.NewInt(1 << 9) + contactRequestFieldIntegrationParams = big.NewInt(1 << 10) + contactRequestFieldLinkedAccountParams = big.NewInt(1 << 11) + contactRequestFieldRemoteFields = big.NewInt(1 << 12) +) + type ContactRequest struct { // The contact's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -256,6 +694,9 @@ type ContactRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -355,6 +796,104 @@ func (c *ContactRequest) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *ContactRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetName(name *string) { + c.Name = name + c.require(contactRequestFieldName) +} + +// SetIsSupplier sets the IsSupplier field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetIsSupplier(isSupplier *bool) { + c.IsSupplier = isSupplier + c.require(contactRequestFieldIsSupplier) +} + +// SetIsCustomer sets the IsCustomer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetIsCustomer(isCustomer *bool) { + c.IsCustomer = isCustomer + c.require(contactRequestFieldIsCustomer) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetEmailAddress(emailAddress *string) { + c.EmailAddress = emailAddress + c.require(contactRequestFieldEmailAddress) +} + +// SetTaxNumber sets the TaxNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetTaxNumber(taxNumber *string) { + c.TaxNumber = taxNumber + c.require(contactRequestFieldTaxNumber) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetStatus(status *ContactRequestStatus) { + c.Status = status + c.require(contactRequestFieldStatus) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetCurrency(currency *string) { + c.Currency = currency + c.require(contactRequestFieldCurrency) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetCompany(company *string) { + c.Company = company + c.require(contactRequestFieldCompany) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetAddresses(addresses []*ContactRequestAddressesItem) { + c.Addresses = addresses + c.require(contactRequestFieldAddresses) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetPhoneNumbers(phoneNumbers []*AccountingPhoneNumberRequest) { + c.PhoneNumbers = phoneNumbers + c.require(contactRequestFieldPhoneNumbers) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + c.IntegrationParams = integrationParams + c.require(contactRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + c.LinkedAccountParams = linkedAccountParams + c.require(contactRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + c.RemoteFields = remoteFields + c.require(contactRequestFieldRemoteFields) +} + func (c *ContactRequest) UnmarshalJSON(data []byte) error { type unmarshaler ContactRequest var value unmarshaler @@ -371,6 +910,17 @@ func (c *ContactRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *ContactRequest) MarshalJSON() ([]byte, error) { + type embed ContactRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *ContactRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -511,12 +1061,22 @@ func (c *ContactRequestStatus) Accept(visitor ContactRequestStatusVisitor) error return fmt.Errorf("type %T does not include a non-empty union type", c) } +var ( + contactResponseFieldModel = big.NewInt(1 << 0) + contactResponseFieldWarnings = big.NewInt(1 << 1) + contactResponseFieldErrors = big.NewInt(1 << 2) + contactResponseFieldLogs = big.NewInt(1 << 3) +) + type ContactResponse struct { Model *Contact `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -553,6 +1113,41 @@ func (c *ContactResponse) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *ContactResponse) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactResponse) SetModel(model *Contact) { + c.Model = model + c.require(contactResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactResponse) SetWarnings(warnings []*WarningValidationProblem) { + c.Warnings = warnings + c.require(contactResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactResponse) SetErrors(errors []*ErrorValidationProblem) { + c.Errors = errors + c.require(contactResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactResponse) SetLogs(logs []*DebugModeLog) { + c.Logs = logs + c.require(contactResponseFieldLogs) +} + func (c *ContactResponse) UnmarshalJSON(data []byte) error { type unmarshaler ContactResponse var value unmarshaler @@ -569,6 +1164,17 @@ func (c *ContactResponse) UnmarshalJSON(data []byte) error { return nil } +func (c *ContactResponse) MarshalJSON() ([]byte, error) { + type embed ContactResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *ContactResponse) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -581,11 +1187,20 @@ func (c *ContactResponse) String() string { return fmt.Sprintf("%#v", c) } +var ( + paginatedContactListFieldNext = big.NewInt(1 << 0) + paginatedContactListFieldPrevious = big.NewInt(1 << 1) + paginatedContactListFieldResults = big.NewInt(1 << 2) +) + type PaginatedContactList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Contact `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -615,6 +1230,34 @@ func (p *PaginatedContactList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedContactList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedContactList) SetNext(next *string) { + p.Next = next + p.require(paginatedContactListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedContactList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedContactListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedContactList) SetResults(results []*Contact) { + p.Results = results + p.require(paginatedContactListFieldResults) +} + func (p *PaginatedContactList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedContactList var value unmarshaler @@ -631,6 +1274,17 @@ func (p *PaginatedContactList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedContactList) MarshalJSON() ([]byte, error) { + type embed PaginatedContactList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedContactList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/contacts/accounting_contacts_test/accounting_contacts_test.go b/accounting/contacts/accounting_contacts_test/accounting_contacts_test.go new file mode 100644 index 0000000..1deb348 --- /dev/null +++ b/accounting/contacts/accounting_contacts_test/accounting_contacts_test.go @@ -0,0 +1,260 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_contacts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingContactsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ContactsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddress: merge.String( + "email_address", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCustomer: merge.String( + "is_customer", + ), + IsSupplier: merge.String( + "is_supplier", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: accounting.ContactsListRequestStatusEmpty.Ptr(), + } + _, invocationErr := client.Accounting.Contacts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/contacts", map[string]string{"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": ""}, 1) +} + +func TestAccountingContactsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ContactEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.ContactRequest{}, + } + _, invocationErr := client.Accounting.Contacts.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/contacts", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingContactsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ContactsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Contacts.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/contacts/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true", "remote_fields": "status", "show_enum_origins": "status"}, 1) +} + +func TestAccountingContactsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Contacts.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/contacts/meta/post", nil, 1) +} + +func TestAccountingContactsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ContactsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.Contacts.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/contacts/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/accounting/contacts/client.go b/accounting/contacts/client.go index 4cc9bb7..dfd02c0 100644 --- a/accounting/contacts/client.go +++ b/accounting/contacts/client.go @@ -4,7 +4,6 @@ package contacts import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.ContactsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.Contact], error) { +) (*core.Page[*string, *accounting.Contact], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedContactList) *internal.PageResponse[*string, *accounting.Contact] { + readPageResponse := func(response *accounting.PaginatedContactList) *core.PageResponse[*string, *accounting.Contact] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.Contact]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.Contact]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.ContactEndpointRequest, opts ...option.RequestOption, ) (*accounting.ContactResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/contacts" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.ContactResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Contact` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.ContactsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Contact, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/contacts/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Contact - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Contact` POSTs. @@ -190,35 +132,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/contacts/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -226,7 +147,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *accounting.ContactsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -239,13 +160,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -262,11 +182,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/accounting/contacts/raw_client.go b/accounting/contacts/raw_client.go new file mode 100644 index 0000000..7335569 --- /dev/null +++ b/accounting/contacts/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package contacts + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.ContactEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.ContactResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/contacts" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.ContactResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.ContactResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.ContactsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Contact], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/contacts/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Contact + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Contact]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/contacts/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/credit_notes.go b/accounting/credit_notes.go index f2de4b9..aa5ca65 100644 --- a/accounting/credit_notes.go +++ b/accounting/credit_notes.go @@ -6,17 +6,74 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + creditNoteEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + creditNoteEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + creditNoteEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type CreditNoteEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *CreditNoteRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreditNoteEndpointRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + c.IsDebugMode = isDebugMode + c.require(creditNoteEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteEndpointRequest) SetRunAsync(runAsync *bool) { + c.RunAsync = runAsync + c.require(creditNoteEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteEndpointRequest) SetModel(model *CreditNoteRequest) { + c.Model = model + c.require(creditNoteEndpointRequestFieldModel) +} + +var ( + creditNotesListRequestFieldCompanyId = big.NewInt(1 << 0) + creditNotesListRequestFieldCreatedAfter = big.NewInt(1 << 1) + creditNotesListRequestFieldCreatedBefore = big.NewInt(1 << 2) + creditNotesListRequestFieldCursor = big.NewInt(1 << 3) + creditNotesListRequestFieldExpand = big.NewInt(1 << 4) + creditNotesListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + creditNotesListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + creditNotesListRequestFieldIncludeShellData = big.NewInt(1 << 7) + creditNotesListRequestFieldModifiedAfter = big.NewInt(1 << 8) + creditNotesListRequestFieldModifiedBefore = big.NewInt(1 << 9) + creditNotesListRequestFieldPageSize = big.NewInt(1 << 10) + creditNotesListRequestFieldRemoteFields = big.NewInt(1 << 11) + creditNotesListRequestFieldRemoteId = big.NewInt(1 << 12) + creditNotesListRequestFieldShowEnumOrigins = big.NewInt(1 << 13) + creditNotesListRequestFieldTransactionDateAfter = big.NewInt(1 << 14) + creditNotesListRequestFieldTransactionDateBefore = big.NewInt(1 << 15) +) + type CreditNotesListRequest struct { // If provided, will only return credit notes for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -50,8 +107,138 @@ type CreditNotesListRequest struct { TransactionDateAfter *time.Time `json:"-" url:"transaction_date_after,omitempty"` // If provided, will only return objects created before this datetime. TransactionDateBefore *time.Time `json:"-" url:"transaction_date_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreditNotesListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) } +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetCompanyId(companyId *string) { + c.CompanyId = companyId + c.require(creditNotesListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(creditNotesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(creditNotesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(creditNotesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetExpand(expand []*CreditNotesListRequestExpandItem) { + c.Expand = expand + c.require(creditNotesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(creditNotesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(creditNotesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(creditNotesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(creditNotesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(creditNotesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(creditNotesListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetRemoteFields(remoteFields *CreditNotesListRequestRemoteFields) { + c.RemoteFields = remoteFields + c.require(creditNotesListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(creditNotesListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetShowEnumOrigins(showEnumOrigins *CreditNotesListRequestShowEnumOrigins) { + c.ShowEnumOrigins = showEnumOrigins + c.require(creditNotesListRequestFieldShowEnumOrigins) +} + +// SetTransactionDateAfter sets the TransactionDateAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetTransactionDateAfter(transactionDateAfter *time.Time) { + c.TransactionDateAfter = transactionDateAfter + c.require(creditNotesListRequestFieldTransactionDateAfter) +} + +// SetTransactionDateBefore sets the TransactionDateBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesListRequest) SetTransactionDateBefore(transactionDateBefore *time.Time) { + c.TransactionDateBefore = transactionDateBefore + c.require(creditNotesListRequestFieldTransactionDateBefore) +} + +var ( + creditNotesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + creditNotesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + creditNotesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + creditNotesRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + creditNotesRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type CreditNotesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*CreditNotesRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -63,6 +250,51 @@ type CreditNotesRetrieveRequest struct { RemoteFields *CreditNotesRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *CreditNotesRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreditNotesRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesRetrieveRequest) SetExpand(expand []*CreditNotesRetrieveRequestExpandItem) { + c.Expand = expand + c.require(creditNotesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(creditNotesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(creditNotesRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesRetrieveRequest) SetRemoteFields(remoteFields *CreditNotesRetrieveRequestRemoteFields) { + c.RemoteFields = remoteFields + c.require(creditNotesRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNotesRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *CreditNotesRetrieveRequestShowEnumOrigins) { + c.ShowEnumOrigins = showEnumOrigins + c.require(creditNotesRetrieveRequestFieldShowEnumOrigins) } type CreditNotesListRequestExpandItem string @@ -245,6 +477,15 @@ func (c CreditNotesRetrieveRequestShowEnumOrigins) Ptr() *CreditNotesRetrieveReq // // ### Usage Example // Fetch from the `GET CreditNote` endpoint and view the invoice's applied to lines. +var ( + creditNoteApplyLineForCreditNoteRequestFieldRemoteId = big.NewInt(1 << 0) + creditNoteApplyLineForCreditNoteRequestFieldInvoice = big.NewInt(1 << 1) + creditNoteApplyLineForCreditNoteRequestFieldAppliedDate = big.NewInt(1 << 2) + creditNoteApplyLineForCreditNoteRequestFieldAppliedAmount = big.NewInt(1 << 3) + creditNoteApplyLineForCreditNoteRequestFieldIntegrationParams = big.NewInt(1 << 4) + creditNoteApplyLineForCreditNoteRequestFieldLinkedAccountParams = big.NewInt(1 << 5) +) + type CreditNoteApplyLineForCreditNoteRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -256,6 +497,9 @@ type CreditNoteApplyLineForCreditNoteRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -306,6 +550,55 @@ func (c *CreditNoteApplyLineForCreditNoteRequest) GetExtraProperties() map[strin return c.extraProperties } +func (c *CreditNoteApplyLineForCreditNoteRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNoteRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(creditNoteApplyLineForCreditNoteRequestFieldRemoteId) +} + +// SetInvoice sets the Invoice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNoteRequest) SetInvoice(invoice *CreditNoteApplyLineForCreditNoteRequestInvoice) { + c.Invoice = invoice + c.require(creditNoteApplyLineForCreditNoteRequestFieldInvoice) +} + +// SetAppliedDate sets the AppliedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNoteRequest) SetAppliedDate(appliedDate *time.Time) { + c.AppliedDate = appliedDate + c.require(creditNoteApplyLineForCreditNoteRequestFieldAppliedDate) +} + +// SetAppliedAmount sets the AppliedAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNoteRequest) SetAppliedAmount(appliedAmount *string) { + c.AppliedAmount = appliedAmount + c.require(creditNoteApplyLineForCreditNoteRequestFieldAppliedAmount) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNoteRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + c.IntegrationParams = integrationParams + c.require(creditNoteApplyLineForCreditNoteRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNoteRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + c.LinkedAccountParams = linkedAccountParams + c.require(creditNoteApplyLineForCreditNoteRequestFieldLinkedAccountParams) +} + func (c *CreditNoteApplyLineForCreditNoteRequest) UnmarshalJSON(data []byte) error { type embed CreditNoteApplyLineForCreditNoteRequest var unmarshaler = struct { @@ -337,7 +630,8 @@ func (c *CreditNoteApplyLineForCreditNoteRequest) MarshalJSON() ([]byte, error) embed: embed(*c), AppliedDate: internal.NewOptionalDateTime(c.AppliedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CreditNoteApplyLineForCreditNoteRequest) String() string { @@ -420,6 +714,26 @@ func (c *CreditNoteApplyLineForCreditNoteRequestInvoice) Accept(visitor CreditNo // // ### Usage Example // Fetch from the `GET CreditNote` endpoint and view the credit note's line items. +var ( + creditNoteLineItemRequestFieldRemoteId = big.NewInt(1 << 0) + creditNoteLineItemRequestFieldItem = big.NewInt(1 << 1) + creditNoteLineItemRequestFieldName = big.NewInt(1 << 2) + creditNoteLineItemRequestFieldDescription = big.NewInt(1 << 3) + creditNoteLineItemRequestFieldQuantity = big.NewInt(1 << 4) + creditNoteLineItemRequestFieldMemo = big.NewInt(1 << 5) + creditNoteLineItemRequestFieldUnitPrice = big.NewInt(1 << 6) + creditNoteLineItemRequestFieldTaxRate = big.NewInt(1 << 7) + creditNoteLineItemRequestFieldTotalLineAmount = big.NewInt(1 << 8) + creditNoteLineItemRequestFieldTrackingCategory = big.NewInt(1 << 9) + creditNoteLineItemRequestFieldTrackingCategories = big.NewInt(1 << 10) + creditNoteLineItemRequestFieldAccount = big.NewInt(1 << 11) + creditNoteLineItemRequestFieldCompany = big.NewInt(1 << 12) + creditNoteLineItemRequestFieldContact = big.NewInt(1 << 13) + creditNoteLineItemRequestFieldProject = big.NewInt(1 << 14) + creditNoteLineItemRequestFieldIntegrationParams = big.NewInt(1 << 15) + creditNoteLineItemRequestFieldLinkedAccountParams = big.NewInt(1 << 16) +) + type CreditNoteLineItemRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -452,6 +766,9 @@ type CreditNoteLineItemRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -579,6 +896,132 @@ func (c *CreditNoteLineItemRequest) GetExtraProperties() map[string]interface{} return c.extraProperties } +func (c *CreditNoteLineItemRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(creditNoteLineItemRequestFieldRemoteId) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetItem(item *CreditNoteLineItemRequestItem) { + c.Item = item + c.require(creditNoteLineItemRequestFieldItem) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetName(name *string) { + c.Name = name + c.require(creditNoteLineItemRequestFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetDescription(description *string) { + c.Description = description + c.require(creditNoteLineItemRequestFieldDescription) +} + +// SetQuantity sets the Quantity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetQuantity(quantity *string) { + c.Quantity = quantity + c.require(creditNoteLineItemRequestFieldQuantity) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetMemo(memo *string) { + c.Memo = memo + c.require(creditNoteLineItemRequestFieldMemo) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetUnitPrice(unitPrice *string) { + c.UnitPrice = unitPrice + c.require(creditNoteLineItemRequestFieldUnitPrice) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetTaxRate(taxRate *string) { + c.TaxRate = taxRate + c.require(creditNoteLineItemRequestFieldTaxRate) +} + +// SetTotalLineAmount sets the TotalLineAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetTotalLineAmount(totalLineAmount *string) { + c.TotalLineAmount = totalLineAmount + c.require(creditNoteLineItemRequestFieldTotalLineAmount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetTrackingCategory(trackingCategory *string) { + c.TrackingCategory = trackingCategory + c.require(creditNoteLineItemRequestFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetTrackingCategories(trackingCategories []*string) { + c.TrackingCategories = trackingCategories + c.require(creditNoteLineItemRequestFieldTrackingCategories) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetAccount(account *string) { + c.Account = account + c.require(creditNoteLineItemRequestFieldAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetCompany(company *CreditNoteLineItemRequestCompany) { + c.Company = company + c.require(creditNoteLineItemRequestFieldCompany) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetContact(contact *CreditNoteLineItemRequestContact) { + c.Contact = contact + c.require(creditNoteLineItemRequestFieldContact) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetProject(project *CreditNoteLineItemRequestProject) { + c.Project = project + c.require(creditNoteLineItemRequestFieldProject) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + c.IntegrationParams = integrationParams + c.require(creditNoteLineItemRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItemRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + c.LinkedAccountParams = linkedAccountParams + c.require(creditNoteLineItemRequestFieldLinkedAccountParams) +} + func (c *CreditNoteLineItemRequest) UnmarshalJSON(data []byte) error { type unmarshaler CreditNoteLineItemRequest var value unmarshaler @@ -595,6 +1038,17 @@ func (c *CreditNoteLineItemRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *CreditNoteLineItemRequest) MarshalJSON() ([]byte, error) { + type embed CreditNoteLineItemRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CreditNoteLineItemRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -863,6 +1317,27 @@ func (c *CreditNoteLineItemRequestProject) Accept(visitor CreditNoteLineItemRequ // // ### Usage Example // Fetch from the `LIST CreditNotes` endpoint and view a company's credit notes. +var ( + creditNoteRequestFieldTransactionDate = big.NewInt(1 << 0) + creditNoteRequestFieldStatus = big.NewInt(1 << 1) + creditNoteRequestFieldNumber = big.NewInt(1 << 2) + creditNoteRequestFieldContact = big.NewInt(1 << 3) + creditNoteRequestFieldCompany = big.NewInt(1 << 4) + creditNoteRequestFieldExchangeRate = big.NewInt(1 << 5) + creditNoteRequestFieldTotalAmount = big.NewInt(1 << 6) + creditNoteRequestFieldRemainingCredit = big.NewInt(1 << 7) + creditNoteRequestFieldInclusiveOfTax = big.NewInt(1 << 8) + creditNoteRequestFieldLineItems = big.NewInt(1 << 9) + creditNoteRequestFieldTrackingCategories = big.NewInt(1 << 10) + creditNoteRequestFieldCurrency = big.NewInt(1 << 11) + creditNoteRequestFieldPayments = big.NewInt(1 << 12) + creditNoteRequestFieldAppliedPayments = big.NewInt(1 << 13) + creditNoteRequestFieldAccountingPeriod = big.NewInt(1 << 14) + creditNoteRequestFieldAppliedToLines = big.NewInt(1 << 15) + creditNoteRequestFieldIntegrationParams = big.NewInt(1 << 16) + creditNoteRequestFieldLinkedAccountParams = big.NewInt(1 << 17) +) + type CreditNoteRequest struct { // The credit note's transaction date. TransactionDate *time.Time `json:"transaction_date,omitempty" url:"transaction_date,omitempty"` @@ -1208,6 +1683,9 @@ type CreditNoteRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1342,6 +1820,139 @@ func (c *CreditNoteRequest) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CreditNoteRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetTransactionDate(transactionDate *time.Time) { + c.TransactionDate = transactionDate + c.require(creditNoteRequestFieldTransactionDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetStatus(status *CreditNoteRequestStatus) { + c.Status = status + c.require(creditNoteRequestFieldStatus) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetNumber(number *string) { + c.Number = number + c.require(creditNoteRequestFieldNumber) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetContact(contact *CreditNoteRequestContact) { + c.Contact = contact + c.require(creditNoteRequestFieldContact) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetCompany(company *CreditNoteRequestCompany) { + c.Company = company + c.require(creditNoteRequestFieldCompany) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetExchangeRate(exchangeRate *string) { + c.ExchangeRate = exchangeRate + c.require(creditNoteRequestFieldExchangeRate) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetTotalAmount(totalAmount *float64) { + c.TotalAmount = totalAmount + c.require(creditNoteRequestFieldTotalAmount) +} + +// SetRemainingCredit sets the RemainingCredit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetRemainingCredit(remainingCredit *float64) { + c.RemainingCredit = remainingCredit + c.require(creditNoteRequestFieldRemainingCredit) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetInclusiveOfTax(inclusiveOfTax *bool) { + c.InclusiveOfTax = inclusiveOfTax + c.require(creditNoteRequestFieldInclusiveOfTax) +} + +// SetLineItems sets the LineItems field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetLineItems(lineItems []*CreditNoteRequestLineItemsItem) { + c.LineItems = lineItems + c.require(creditNoteRequestFieldLineItems) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetTrackingCategories(trackingCategories []*CreditNoteRequestTrackingCategoriesItem) { + c.TrackingCategories = trackingCategories + c.require(creditNoteRequestFieldTrackingCategories) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetCurrency(currency *CreditNoteRequestCurrency) { + c.Currency = currency + c.require(creditNoteRequestFieldCurrency) +} + +// SetPayments sets the Payments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetPayments(payments []*CreditNoteRequestPaymentsItem) { + c.Payments = payments + c.require(creditNoteRequestFieldPayments) +} + +// SetAppliedPayments sets the AppliedPayments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetAppliedPayments(appliedPayments []*CreditNoteRequestAppliedPaymentsItem) { + c.AppliedPayments = appliedPayments + c.require(creditNoteRequestFieldAppliedPayments) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetAccountingPeriod(accountingPeriod *CreditNoteRequestAccountingPeriod) { + c.AccountingPeriod = accountingPeriod + c.require(creditNoteRequestFieldAccountingPeriod) +} + +// SetAppliedToLines sets the AppliedToLines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetAppliedToLines(appliedToLines []*CreditNoteApplyLineForCreditNoteRequest) { + c.AppliedToLines = appliedToLines + c.require(creditNoteRequestFieldAppliedToLines) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + c.IntegrationParams = integrationParams + c.require(creditNoteRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + c.LinkedAccountParams = linkedAccountParams + c.require(creditNoteRequestFieldLinkedAccountParams) +} + func (c *CreditNoteRequest) UnmarshalJSON(data []byte) error { type embed CreditNoteRequest var unmarshaler = struct { @@ -1373,7 +1984,8 @@ func (c *CreditNoteRequest) MarshalJSON() ([]byte, error) { embed: embed(*c), TransactionDate: internal.NewOptionalDateTime(c.TransactionDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CreditNoteRequest) String() string { @@ -2262,12 +2874,22 @@ func (c *CreditNoteRequestTrackingCategoriesItem) Accept(visitor CreditNoteReque return fmt.Errorf("type %T does not include a non-empty union type", c) } +var ( + creditNoteResponseFieldModel = big.NewInt(1 << 0) + creditNoteResponseFieldWarnings = big.NewInt(1 << 1) + creditNoteResponseFieldErrors = big.NewInt(1 << 2) + creditNoteResponseFieldLogs = big.NewInt(1 << 3) +) + type CreditNoteResponse struct { Model *CreditNote `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2304,6 +2926,41 @@ func (c *CreditNoteResponse) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CreditNoteResponse) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteResponse) SetModel(model *CreditNote) { + c.Model = model + c.require(creditNoteResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteResponse) SetWarnings(warnings []*WarningValidationProblem) { + c.Warnings = warnings + c.require(creditNoteResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteResponse) SetErrors(errors []*ErrorValidationProblem) { + c.Errors = errors + c.require(creditNoteResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteResponse) SetLogs(logs []*DebugModeLog) { + c.Logs = logs + c.require(creditNoteResponseFieldLogs) +} + func (c *CreditNoteResponse) UnmarshalJSON(data []byte) error { type unmarshaler CreditNoteResponse var value unmarshaler @@ -2320,6 +2977,17 @@ func (c *CreditNoteResponse) UnmarshalJSON(data []byte) error { return nil } +func (c *CreditNoteResponse) MarshalJSON() ([]byte, error) { + type embed CreditNoteResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CreditNoteResponse) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -2332,11 +3000,20 @@ func (c *CreditNoteResponse) String() string { return fmt.Sprintf("%#v", c) } +var ( + paginatedCreditNoteListFieldNext = big.NewInt(1 << 0) + paginatedCreditNoteListFieldPrevious = big.NewInt(1 << 1) + paginatedCreditNoteListFieldResults = big.NewInt(1 << 2) +) + type PaginatedCreditNoteList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*CreditNote `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2366,6 +3043,34 @@ func (p *PaginatedCreditNoteList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedCreditNoteList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCreditNoteList) SetNext(next *string) { + p.Next = next + p.require(paginatedCreditNoteListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCreditNoteList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedCreditNoteListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCreditNoteList) SetResults(results []*CreditNote) { + p.Results = results + p.require(paginatedCreditNoteListFieldResults) +} + func (p *PaginatedCreditNoteList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedCreditNoteList var value unmarshaler @@ -2382,6 +3087,17 @@ func (p *PaginatedCreditNoteList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedCreditNoteList) MarshalJSON() ([]byte, error) { + type embed PaginatedCreditNoteList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedCreditNoteList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/creditnotes/accounting_credit_notes_test/accounting_credit_notes_test.go b/accounting/creditnotes/accounting_credit_notes_test/accounting_credit_notes_test.go new file mode 100644 index 0000000..cb81173 --- /dev/null +++ b/accounting/creditnotes/accounting_credit_notes_test/accounting_credit_notes_test.go @@ -0,0 +1,213 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_credit_notes_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingCreditNotesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.CreditNotesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: accounting.CreditNotesListRequestRemoteFieldsStatus.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: accounting.CreditNotesListRequestShowEnumOriginsStatus.Ptr(), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Accounting.CreditNotes.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/credit-notes", map[string]string{"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"}, 1) +} + +func TestAccountingCreditNotesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.CreditNoteEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.CreditNoteRequest{}, + } + _, invocationErr := client.Accounting.CreditNotes.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/credit-notes", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingCreditNotesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.CreditNotesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: accounting.CreditNotesRetrieveRequestRemoteFieldsStatus.Ptr(), + ShowEnumOrigins: accounting.CreditNotesRetrieveRequestShowEnumOriginsStatus.Ptr(), + } + _, invocationErr := client.Accounting.CreditNotes.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/credit-notes/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "status", "show_enum_origins": "status"}, 1) +} + +func TestAccountingCreditNotesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.CreditNotes.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/credit-notes/meta/post", nil, 1) +} diff --git a/accounting/creditnotes/client.go b/accounting/creditnotes/client.go index df2447e..8717e08 100644 --- a/accounting/creditnotes/client.go +++ b/accounting/creditnotes/client.go @@ -4,7 +4,6 @@ package creditnotes import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.CreditNotesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.CreditNote], error) { +) (*core.Page[*string, *accounting.CreditNote], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedCreditNoteList) *internal.PageResponse[*string, *accounting.CreditNote] { + readPageResponse := func(response *accounting.PaginatedCreditNoteList) *core.PageResponse[*string, *accounting.CreditNote] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.CreditNote]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.CreditNote]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.CreditNoteEndpointRequest, opts ...option.RequestOption, ) (*accounting.CreditNoteResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/credit-notes" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.CreditNoteResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `CreditNote` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.CreditNotesRetrieveRequest, opts ...option.RequestOption, ) (*accounting.CreditNote, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/credit-notes/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.CreditNote - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `CreditNote` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/credit-notes/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/creditnotes/raw_client.go b/accounting/creditnotes/raw_client.go new file mode 100644 index 0000000..48b1adc --- /dev/null +++ b/accounting/creditnotes/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package creditnotes + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.CreditNoteEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.CreditNoteResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/credit-notes" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.CreditNoteResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.CreditNoteResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.CreditNotesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.CreditNote], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/credit-notes/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.CreditNote + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.CreditNote]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/credit-notes/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/deleteaccount/accounting_delete_account_test/accounting_delete_account_test.go b/accounting/deleteaccount/accounting_delete_account_test/accounting_delete_account_test.go new file mode 100644 index 0000000..2d5576d --- /dev/null +++ b/accounting/deleteaccount/accounting_delete_account_test/accounting_delete_account_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_delete_account_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingDeleteAccountDeleteWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + invocationErr := client.Accounting.DeleteAccount.Delete( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/delete-account", nil, 1) +} diff --git a/accounting/deleteaccount/client.go b/accounting/deleteaccount/client.go index 63091e6..9f2d80e 100644 --- a/accounting/deleteaccount/client.go +++ b/accounting/deleteaccount/client.go @@ -7,26 +7,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -35,30 +36,11 @@ func (c *Client) Delete( ctx context.Context, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/delete-account" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - if err := c.caller.Call( + _, err := c.WithRawResponse.Delete( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - }, - ); err != nil { + opts..., + ) + if err != nil { return err } return nil diff --git a/accounting/deleteaccount/raw_client.go b/accounting/deleteaccount/raw_client.go new file mode 100644 index 0000000..7520c3b --- /dev/null +++ b/accounting/deleteaccount/raw_client.go @@ -0,0 +1,67 @@ +// Code generated by Fern. DO NOT EDIT. + +package deleteaccount + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Delete( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/delete-account" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} diff --git a/accounting/employees.go b/accounting/employees.go index 48e8e7a..7ba66c8 100644 --- a/accounting/employees.go +++ b/accounting/employees.go @@ -6,6 +6,16 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + employeesListRequestFieldCursor = big.NewInt(1 << 0) + employeesListRequestFieldExpand = big.NewInt(1 << 1) + employeesListRequestFieldIncludeDeletedData = big.NewInt(1 << 2) + employeesListRequestFieldIncludeRemoteData = big.NewInt(1 << 3) + employeesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + employeesListRequestFieldPageSize = big.NewInt(1 << 5) ) type EmployeesListRequest struct { @@ -21,8 +31,66 @@ type EmployeesListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmployeesListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(employeesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetExpand(expand []*string) { + e.Expand = expand + e.require(employeesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(employeesListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employeesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employeesListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(employeesListRequestFieldPageSize) +} + +var ( + employeesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + employeesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + employeesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type EmployeesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -30,13 +98,53 @@ type EmployeesRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (e *EmployeesRetrieveRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesRetrieveRequest) SetExpand(expand []*string) { + e.Expand = expand + e.require(employeesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employeesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employeesRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedEmployeeListFieldNext = big.NewInt(1 << 0) + paginatedEmployeeListFieldPrevious = big.NewInt(1 << 1) + paginatedEmployeeListFieldResults = big.NewInt(1 << 2) +) + type PaginatedEmployeeList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Employee `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -66,6 +174,34 @@ func (p *PaginatedEmployeeList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedEmployeeList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployeeList) SetNext(next *string) { + p.Next = next + p.require(paginatedEmployeeListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployeeList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedEmployeeListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployeeList) SetResults(results []*Employee) { + p.Results = results + p.require(paginatedEmployeeListFieldResults) +} + func (p *PaginatedEmployeeList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedEmployeeList var value unmarshaler @@ -82,6 +218,17 @@ func (p *PaginatedEmployeeList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedEmployeeList) MarshalJSON() ([]byte, error) { + type embed PaginatedEmployeeList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedEmployeeList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/employees/accounting_employees_test/accounting_employees_test.go b/accounting/employees/accounting_employees_test/accounting_employees_test.go new file mode 100644 index 0000000..f672686 --- /dev/null +++ b/accounting/employees/accounting_employees_test/accounting_employees_test.go @@ -0,0 +1,127 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_employees_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingEmployeesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.EmployeesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.Employees.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/employees", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} + +func TestAccountingEmployeesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.EmployeesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Employees.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/employees/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/employees/client.go b/accounting/employees/client.go index 101346a..49043e0 100644 --- a/accounting/employees/client.go +++ b/accounting/employees/client.go @@ -4,7 +4,6 @@ package employees import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.EmployeesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.Employee], error) { +) (*core.Page[*string, *accounting.Employee], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedEmployeeList) *internal.PageResponse[*string, *accounting.Employee] { + readPageResponse := func(response *accounting.PaginatedEmployeeList) *core.PageResponse[*string, *accounting.Employee] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.Employee]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.Employee]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.EmployeesRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Employee, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/employees/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Employee - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/employees/raw_client.go b/accounting/employees/raw_client.go new file mode 100644 index 0000000..7ece3c4 --- /dev/null +++ b/accounting/employees/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package employees + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.EmployeesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Employee], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/employees/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Employee + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Employee]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/expenses.go b/accounting/expenses.go index faae613..900b89e 100644 --- a/accounting/expenses.go +++ b/accounting/expenses.go @@ -6,17 +6,65 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + expenseEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + expenseEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + expenseEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type ExpenseEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *ExpenseRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *ExpenseEndpointRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) } +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + e.IsDebugMode = isDebugMode + e.require(expenseEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseEndpointRequest) SetRunAsync(runAsync *bool) { + e.RunAsync = runAsync + e.require(expenseEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseEndpointRequest) SetModel(model *ExpenseRequest) { + e.Model = model + e.require(expenseEndpointRequestFieldModel) +} + +var ( + expensesLinesRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + expensesLinesRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + expensesLinesRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + expensesLinesRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + expensesLinesRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + expensesLinesRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + expensesLinesRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type ExpensesLinesRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -32,8 +80,85 @@ type ExpensesLinesRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *ExpensesLinesRemoteFieldClassesListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) } +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesLinesRemoteFieldClassesListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(expensesLinesRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesLinesRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(expensesLinesRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesLinesRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(expensesLinesRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesLinesRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(expensesLinesRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesLinesRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + e.IsCommonModelField = isCommonModelField + e.require(expensesLinesRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesLinesRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + e.IsCustom = isCustom + e.require(expensesLinesRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesLinesRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(expensesLinesRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + expensesListRequestFieldCompanyId = big.NewInt(1 << 0) + expensesListRequestFieldCreatedAfter = big.NewInt(1 << 1) + expensesListRequestFieldCreatedBefore = big.NewInt(1 << 2) + expensesListRequestFieldCursor = big.NewInt(1 << 3) + expensesListRequestFieldExpand = big.NewInt(1 << 4) + expensesListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + expensesListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + expensesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 7) + expensesListRequestFieldIncludeShellData = big.NewInt(1 << 8) + expensesListRequestFieldModifiedAfter = big.NewInt(1 << 9) + expensesListRequestFieldModifiedBefore = big.NewInt(1 << 10) + expensesListRequestFieldPageSize = big.NewInt(1 << 11) + expensesListRequestFieldRemoteId = big.NewInt(1 << 12) + expensesListRequestFieldTransactionDateAfter = big.NewInt(1 << 13) + expensesListRequestFieldTransactionDateBefore = big.NewInt(1 << 14) +) + type ExpensesListRequest struct { // If provided, will only return expenses for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -65,8 +190,133 @@ type ExpensesListRequest struct { TransactionDateAfter *time.Time `json:"-" url:"transaction_date_after,omitempty"` // If provided, will only return objects created before this datetime. TransactionDateBefore *time.Time `json:"-" url:"transaction_date_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *ExpensesListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetCompanyId(companyId *string) { + e.CompanyId = companyId + e.require(expensesListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetCreatedAfter(createdAfter *time.Time) { + e.CreatedAfter = createdAfter + e.require(expensesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetCreatedBefore(createdBefore *time.Time) { + e.CreatedBefore = createdBefore + e.require(expensesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(expensesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetExpand(expand []*ExpensesListRequestExpandItem) { + e.Expand = expand + e.require(expensesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(expensesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(expensesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + e.IncludeRemoteFields = includeRemoteFields + e.require(expensesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(expensesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + e.ModifiedAfter = modifiedAfter + e.require(expensesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + e.ModifiedBefore = modifiedBefore + e.require(expensesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(expensesListRequestFieldPageSize) } +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(expensesListRequestFieldRemoteId) +} + +// SetTransactionDateAfter sets the TransactionDateAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetTransactionDateAfter(transactionDateAfter *time.Time) { + e.TransactionDateAfter = transactionDateAfter + e.require(expensesListRequestFieldTransactionDateAfter) +} + +// SetTransactionDateBefore sets the TransactionDateBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesListRequest) SetTransactionDateBefore(transactionDateBefore *time.Time) { + e.TransactionDateBefore = transactionDateBefore + e.require(expensesListRequestFieldTransactionDateBefore) +} + +var ( + expensesRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + expensesRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + expensesRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + expensesRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + expensesRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + expensesRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + expensesRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type ExpensesRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -82,8 +332,74 @@ type ExpensesRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *ExpensesRemoteFieldClassesListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRemoteFieldClassesListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(expensesRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(expensesRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(expensesRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(expensesRemoteFieldClassesListRequestFieldIncludeShellData) } +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + e.IsCommonModelField = isCommonModelField + e.require(expensesRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + e.IsCustom = isCustom + e.require(expensesRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(expensesRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + expensesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + expensesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + expensesRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + expensesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) +) + type ExpensesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*ExpensesRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -93,6 +409,44 @@ type ExpensesRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *ExpensesRetrieveRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRetrieveRequest) SetExpand(expand []*ExpensesRetrieveRequestExpandItem) { + e.Expand = expand + e.require(expensesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(expensesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + e.IncludeRemoteFields = includeRemoteFields + e.require(expensesRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpensesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(expensesRetrieveRequestFieldIncludeShellData) } type ExpensesListRequestExpandItem string @@ -171,6 +525,33 @@ func (e ExpensesRetrieveRequestExpandItem) Ptr() *ExpensesRetrieveRequestExpandI // // ### Usage Example // Fetch from the `GET Expense` endpoint and view a company's expense. +var ( + expenseFieldId = big.NewInt(1 << 0) + expenseFieldRemoteId = big.NewInt(1 << 1) + expenseFieldCreatedAt = big.NewInt(1 << 2) + expenseFieldModifiedAt = big.NewInt(1 << 3) + expenseFieldTransactionDate = big.NewInt(1 << 4) + expenseFieldRemoteCreatedAt = big.NewInt(1 << 5) + expenseFieldAccount = big.NewInt(1 << 6) + expenseFieldContact = big.NewInt(1 << 7) + expenseFieldTotalAmount = big.NewInt(1 << 8) + expenseFieldSubTotal = big.NewInt(1 << 9) + expenseFieldTotalTaxAmount = big.NewInt(1 << 10) + expenseFieldCurrency = big.NewInt(1 << 11) + expenseFieldExchangeRate = big.NewInt(1 << 12) + expenseFieldInclusiveOfTax = big.NewInt(1 << 13) + expenseFieldCompany = big.NewInt(1 << 14) + expenseFieldEmployee = big.NewInt(1 << 15) + expenseFieldMemo = big.NewInt(1 << 16) + expenseFieldLines = big.NewInt(1 << 17) + expenseFieldTrackingCategories = big.NewInt(1 << 18) + expenseFieldRemoteWasDeleted = big.NewInt(1 << 19) + expenseFieldAccountingPeriod = big.NewInt(1 << 20) + expenseFieldFieldMappings = big.NewInt(1 << 21) + expenseFieldRemoteData = big.NewInt(1 << 22) + expenseFieldRemoteFields = big.NewInt(1 << 23) +) + type Expense struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -522,6 +903,9 @@ type Expense struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -698,6 +1082,181 @@ func (e *Expense) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *Expense) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetId(id *string) { + e.Id = id + e.require(expenseFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(expenseFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(expenseFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(expenseFieldModifiedAt) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetTransactionDate(transactionDate *time.Time) { + e.TransactionDate = transactionDate + e.require(expenseFieldTransactionDate) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + e.RemoteCreatedAt = remoteCreatedAt + e.require(expenseFieldRemoteCreatedAt) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetAccount(account *ExpenseAccount) { + e.Account = account + e.require(expenseFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetContact(contact *ExpenseContact) { + e.Contact = contact + e.require(expenseFieldContact) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetTotalAmount(totalAmount *float64) { + e.TotalAmount = totalAmount + e.require(expenseFieldTotalAmount) +} + +// SetSubTotal sets the SubTotal field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetSubTotal(subTotal *float64) { + e.SubTotal = subTotal + e.require(expenseFieldSubTotal) +} + +// SetTotalTaxAmount sets the TotalTaxAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetTotalTaxAmount(totalTaxAmount *float64) { + e.TotalTaxAmount = totalTaxAmount + e.require(expenseFieldTotalTaxAmount) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetCurrency(currency *ExpenseCurrency) { + e.Currency = currency + e.require(expenseFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetExchangeRate(exchangeRate *string) { + e.ExchangeRate = exchangeRate + e.require(expenseFieldExchangeRate) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetInclusiveOfTax(inclusiveOfTax *bool) { + e.InclusiveOfTax = inclusiveOfTax + e.require(expenseFieldInclusiveOfTax) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetCompany(company *ExpenseCompany) { + e.Company = company + e.require(expenseFieldCompany) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetEmployee(employee *ExpenseEmployee) { + e.Employee = employee + e.require(expenseFieldEmployee) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetMemo(memo *string) { + e.Memo = memo + e.require(expenseFieldMemo) +} + +// SetLines sets the Lines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetLines(lines []*ExpenseLine) { + e.Lines = lines + e.require(expenseFieldLines) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetTrackingCategories(trackingCategories []*ExpenseTrackingCategoriesItem) { + e.TrackingCategories = trackingCategories + e.require(expenseFieldTrackingCategories) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(expenseFieldRemoteWasDeleted) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetAccountingPeriod(accountingPeriod *ExpenseAccountingPeriod) { + e.AccountingPeriod = accountingPeriod + e.require(expenseFieldAccountingPeriod) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetFieldMappings(fieldMappings map[string]interface{}) { + e.FieldMappings = fieldMappings + e.require(expenseFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetRemoteData(remoteData []*RemoteData) { + e.RemoteData = remoteData + e.require(expenseFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Expense) SetRemoteFields(remoteFields []*RemoteField) { + e.RemoteFields = remoteFields + e.require(expenseFieldRemoteFields) +} + func (e *Expense) UnmarshalJSON(data []byte) error { type embed Expense var unmarshaler = struct { @@ -741,7 +1300,8 @@ func (e *Expense) MarshalJSON() ([]byte, error) { TransactionDate: internal.NewOptionalDateTime(e.TransactionDate), RemoteCreatedAt: internal.NewOptionalDateTime(e.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *Expense) String() string { @@ -1447,6 +2007,27 @@ func (e *ExpenseEmployee) Accept(visitor ExpenseEmployeeVisitor) error { // // ### Usage Example // Fetch from the `GET Expense` endpoint and view the expense's line items. +var ( + expenseLineFieldId = big.NewInt(1 << 0) + expenseLineFieldRemoteId = big.NewInt(1 << 1) + expenseLineFieldCreatedAt = big.NewInt(1 << 2) + expenseLineFieldModifiedAt = big.NewInt(1 << 3) + expenseLineFieldItem = big.NewInt(1 << 4) + expenseLineFieldNetAmount = big.NewInt(1 << 5) + expenseLineFieldTrackingCategory = big.NewInt(1 << 6) + expenseLineFieldTrackingCategories = big.NewInt(1 << 7) + expenseLineFieldCompany = big.NewInt(1 << 8) + expenseLineFieldEmployee = big.NewInt(1 << 9) + expenseLineFieldCurrency = big.NewInt(1 << 10) + expenseLineFieldAccount = big.NewInt(1 << 11) + expenseLineFieldContact = big.NewInt(1 << 12) + expenseLineFieldProject = big.NewInt(1 << 13) + expenseLineFieldDescription = big.NewInt(1 << 14) + expenseLineFieldExchangeRate = big.NewInt(1 << 15) + expenseLineFieldTaxRate = big.NewInt(1 << 16) + expenseLineFieldRemoteWasDeleted = big.NewInt(1 << 17) +) + type ExpenseLine struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -1789,6 +2370,9 @@ type ExpenseLine struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1923,6 +2507,139 @@ func (e *ExpenseLine) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExpenseLine) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetId(id *string) { + e.Id = id + e.require(expenseLineFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(expenseLineFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(expenseLineFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(expenseLineFieldModifiedAt) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetItem(item *ExpenseLineItem) { + e.Item = item + e.require(expenseLineFieldItem) +} + +// SetNetAmount sets the NetAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetNetAmount(netAmount *float64) { + e.NetAmount = netAmount + e.require(expenseLineFieldNetAmount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetTrackingCategory(trackingCategory *ExpenseLineTrackingCategory) { + e.TrackingCategory = trackingCategory + e.require(expenseLineFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetTrackingCategories(trackingCategories []*ExpenseLineTrackingCategoriesItem) { + e.TrackingCategories = trackingCategories + e.require(expenseLineFieldTrackingCategories) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetCompany(company *string) { + e.Company = company + e.require(expenseLineFieldCompany) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetEmployee(employee *ExpenseLineEmployee) { + e.Employee = employee + e.require(expenseLineFieldEmployee) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetCurrency(currency *TransactionCurrencyEnum) { + e.Currency = currency + e.require(expenseLineFieldCurrency) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetAccount(account *ExpenseLineAccount) { + e.Account = account + e.require(expenseLineFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetContact(contact *ExpenseLineContact) { + e.Contact = contact + e.require(expenseLineFieldContact) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetProject(project *ExpenseLineProject) { + e.Project = project + e.require(expenseLineFieldProject) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetDescription(description *string) { + e.Description = description + e.require(expenseLineFieldDescription) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetExchangeRate(exchangeRate *string) { + e.ExchangeRate = exchangeRate + e.require(expenseLineFieldExchangeRate) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetTaxRate(taxRate *string) { + e.TaxRate = taxRate + e.require(expenseLineFieldTaxRate) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLine) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(expenseLineFieldRemoteWasDeleted) +} + func (e *ExpenseLine) UnmarshalJSON(data []byte) error { type embed ExpenseLine var unmarshaler = struct { @@ -1958,7 +2675,8 @@ func (e *ExpenseLine) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(e.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(e.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *ExpenseLine) String() string { @@ -2293,6 +3011,26 @@ func (e *ExpenseLineProject) Accept(visitor ExpenseLineProjectVisitor) error { // // ### Usage Example // Fetch from the `GET Expense` endpoint and view the expense's line items. +var ( + expenseLineRequestFieldRemoteId = big.NewInt(1 << 0) + expenseLineRequestFieldItem = big.NewInt(1 << 1) + expenseLineRequestFieldNetAmount = big.NewInt(1 << 2) + expenseLineRequestFieldTrackingCategory = big.NewInt(1 << 3) + expenseLineRequestFieldTrackingCategories = big.NewInt(1 << 4) + expenseLineRequestFieldCompany = big.NewInt(1 << 5) + expenseLineRequestFieldEmployee = big.NewInt(1 << 6) + expenseLineRequestFieldCurrency = big.NewInt(1 << 7) + expenseLineRequestFieldAccount = big.NewInt(1 << 8) + expenseLineRequestFieldContact = big.NewInt(1 << 9) + expenseLineRequestFieldProject = big.NewInt(1 << 10) + expenseLineRequestFieldDescription = big.NewInt(1 << 11) + expenseLineRequestFieldExchangeRate = big.NewInt(1 << 12) + expenseLineRequestFieldTaxRate = big.NewInt(1 << 13) + expenseLineRequestFieldIntegrationParams = big.NewInt(1 << 14) + expenseLineRequestFieldLinkedAccountParams = big.NewInt(1 << 15) + expenseLineRequestFieldRemoteFields = big.NewInt(1 << 16) +) + type ExpenseLineRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -2631,6 +3369,9 @@ type ExpenseLineRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2758,6 +3499,132 @@ func (e *ExpenseLineRequest) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExpenseLineRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(expenseLineRequestFieldRemoteId) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetItem(item *ExpenseLineRequestItem) { + e.Item = item + e.require(expenseLineRequestFieldItem) +} + +// SetNetAmount sets the NetAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetNetAmount(netAmount *float64) { + e.NetAmount = netAmount + e.require(expenseLineRequestFieldNetAmount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetTrackingCategory(trackingCategory *ExpenseLineRequestTrackingCategory) { + e.TrackingCategory = trackingCategory + e.require(expenseLineRequestFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetTrackingCategories(trackingCategories []*ExpenseLineRequestTrackingCategoriesItem) { + e.TrackingCategories = trackingCategories + e.require(expenseLineRequestFieldTrackingCategories) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetCompany(company *string) { + e.Company = company + e.require(expenseLineRequestFieldCompany) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetEmployee(employee *ExpenseLineRequestEmployee) { + e.Employee = employee + e.require(expenseLineRequestFieldEmployee) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetCurrency(currency *ExpenseLineRequestCurrency) { + e.Currency = currency + e.require(expenseLineRequestFieldCurrency) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetAccount(account *ExpenseLineRequestAccount) { + e.Account = account + e.require(expenseLineRequestFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetContact(contact *ExpenseLineRequestContact) { + e.Contact = contact + e.require(expenseLineRequestFieldContact) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetProject(project *ExpenseLineRequestProject) { + e.Project = project + e.require(expenseLineRequestFieldProject) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetDescription(description *string) { + e.Description = description + e.require(expenseLineRequestFieldDescription) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetExchangeRate(exchangeRate *string) { + e.ExchangeRate = exchangeRate + e.require(expenseLineRequestFieldExchangeRate) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetTaxRate(taxRate *string) { + e.TaxRate = taxRate + e.require(expenseLineRequestFieldTaxRate) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + e.IntegrationParams = integrationParams + e.require(expenseLineRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + e.LinkedAccountParams = linkedAccountParams + e.require(expenseLineRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseLineRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + e.RemoteFields = remoteFields + e.require(expenseLineRequestFieldRemoteFields) +} + func (e *ExpenseLineRequest) UnmarshalJSON(data []byte) error { type unmarshaler ExpenseLineRequest var value unmarshaler @@ -2774,6 +3641,17 @@ func (e *ExpenseLineRequest) UnmarshalJSON(data []byte) error { return nil } +func (e *ExpenseLineRequest) MarshalJSON() ([]byte, error) { + type embed ExpenseLineRequest + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExpenseLineRequest) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -3726,6 +4604,27 @@ func (e *ExpenseLineTrackingCategory) Accept(visitor ExpenseLineTrackingCategory // // ### Usage Example // Fetch from the `GET Expense` endpoint and view a company's expense. +var ( + expenseRequestFieldTransactionDate = big.NewInt(1 << 0) + expenseRequestFieldAccount = big.NewInt(1 << 1) + expenseRequestFieldContact = big.NewInt(1 << 2) + expenseRequestFieldTotalAmount = big.NewInt(1 << 3) + expenseRequestFieldSubTotal = big.NewInt(1 << 4) + expenseRequestFieldTotalTaxAmount = big.NewInt(1 << 5) + expenseRequestFieldCurrency = big.NewInt(1 << 6) + expenseRequestFieldExchangeRate = big.NewInt(1 << 7) + expenseRequestFieldInclusiveOfTax = big.NewInt(1 << 8) + expenseRequestFieldCompany = big.NewInt(1 << 9) + expenseRequestFieldEmployee = big.NewInt(1 << 10) + expenseRequestFieldMemo = big.NewInt(1 << 11) + expenseRequestFieldLines = big.NewInt(1 << 12) + expenseRequestFieldTrackingCategories = big.NewInt(1 << 13) + expenseRequestFieldAccountingPeriod = big.NewInt(1 << 14) + expenseRequestFieldIntegrationParams = big.NewInt(1 << 15) + expenseRequestFieldLinkedAccountParams = big.NewInt(1 << 16) + expenseRequestFieldRemoteFields = big.NewInt(1 << 17) +) + type ExpenseRequest struct { // When the transaction occurred. TransactionDate *time.Time `json:"transaction_date,omitempty" url:"transaction_date,omitempty"` @@ -4066,6 +4965,9 @@ type ExpenseRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4200,6 +5102,139 @@ func (e *ExpenseRequest) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExpenseRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetTransactionDate(transactionDate *time.Time) { + e.TransactionDate = transactionDate + e.require(expenseRequestFieldTransactionDate) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetAccount(account *ExpenseRequestAccount) { + e.Account = account + e.require(expenseRequestFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetContact(contact *ExpenseRequestContact) { + e.Contact = contact + e.require(expenseRequestFieldContact) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetTotalAmount(totalAmount *float64) { + e.TotalAmount = totalAmount + e.require(expenseRequestFieldTotalAmount) +} + +// SetSubTotal sets the SubTotal field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetSubTotal(subTotal *float64) { + e.SubTotal = subTotal + e.require(expenseRequestFieldSubTotal) +} + +// SetTotalTaxAmount sets the TotalTaxAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetTotalTaxAmount(totalTaxAmount *float64) { + e.TotalTaxAmount = totalTaxAmount + e.require(expenseRequestFieldTotalTaxAmount) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetCurrency(currency *TransactionCurrencyEnum) { + e.Currency = currency + e.require(expenseRequestFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetExchangeRate(exchangeRate *string) { + e.ExchangeRate = exchangeRate + e.require(expenseRequestFieldExchangeRate) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetInclusiveOfTax(inclusiveOfTax *bool) { + e.InclusiveOfTax = inclusiveOfTax + e.require(expenseRequestFieldInclusiveOfTax) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetCompany(company *ExpenseRequestCompany) { + e.Company = company + e.require(expenseRequestFieldCompany) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetEmployee(employee *ExpenseRequestEmployee) { + e.Employee = employee + e.require(expenseRequestFieldEmployee) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetMemo(memo *string) { + e.Memo = memo + e.require(expenseRequestFieldMemo) +} + +// SetLines sets the Lines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetLines(lines []*ExpenseLineRequest) { + e.Lines = lines + e.require(expenseRequestFieldLines) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetTrackingCategories(trackingCategories []*ExpenseRequestTrackingCategoriesItem) { + e.TrackingCategories = trackingCategories + e.require(expenseRequestFieldTrackingCategories) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetAccountingPeriod(accountingPeriod *ExpenseRequestAccountingPeriod) { + e.AccountingPeriod = accountingPeriod + e.require(expenseRequestFieldAccountingPeriod) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + e.IntegrationParams = integrationParams + e.require(expenseRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + e.LinkedAccountParams = linkedAccountParams + e.require(expenseRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + e.RemoteFields = remoteFields + e.require(expenseRequestFieldRemoteFields) +} + func (e *ExpenseRequest) UnmarshalJSON(data []byte) error { type embed ExpenseRequest var unmarshaler = struct { @@ -4231,7 +5266,8 @@ func (e *ExpenseRequest) MarshalJSON() ([]byte, error) { embed: embed(*e), TransactionDate: internal.NewOptionalDateTime(e.TransactionDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *ExpenseRequest) String() string { @@ -4623,12 +5659,22 @@ func (e *ExpenseRequestTrackingCategoriesItem) Accept(visitor ExpenseRequestTrac return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + expenseResponseFieldModel = big.NewInt(1 << 0) + expenseResponseFieldWarnings = big.NewInt(1 << 1) + expenseResponseFieldErrors = big.NewInt(1 << 2) + expenseResponseFieldLogs = big.NewInt(1 << 3) +) + type ExpenseResponse struct { Model *Expense `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4665,6 +5711,41 @@ func (e *ExpenseResponse) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExpenseResponse) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseResponse) SetModel(model *Expense) { + e.Model = model + e.require(expenseResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseResponse) SetWarnings(warnings []*WarningValidationProblem) { + e.Warnings = warnings + e.require(expenseResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseResponse) SetErrors(errors []*ErrorValidationProblem) { + e.Errors = errors + e.require(expenseResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExpenseResponse) SetLogs(logs []*DebugModeLog) { + e.Logs = logs + e.require(expenseResponseFieldLogs) +} + func (e *ExpenseResponse) UnmarshalJSON(data []byte) error { type unmarshaler ExpenseResponse var value unmarshaler @@ -4681,6 +5762,17 @@ func (e *ExpenseResponse) UnmarshalJSON(data []byte) error { return nil } +func (e *ExpenseResponse) MarshalJSON() ([]byte, error) { + type embed ExpenseResponse + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExpenseResponse) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -4755,11 +5847,20 @@ func (e *ExpenseTrackingCategoriesItem) Accept(visitor ExpenseTrackingCategories return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + paginatedExpenseListFieldNext = big.NewInt(1 << 0) + paginatedExpenseListFieldPrevious = big.NewInt(1 << 1) + paginatedExpenseListFieldResults = big.NewInt(1 << 2) +) + type PaginatedExpenseList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Expense `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4789,6 +5890,34 @@ func (p *PaginatedExpenseList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedExpenseList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedExpenseList) SetNext(next *string) { + p.Next = next + p.require(paginatedExpenseListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedExpenseList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedExpenseListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedExpenseList) SetResults(results []*Expense) { + p.Results = results + p.require(paginatedExpenseListFieldResults) +} + func (p *PaginatedExpenseList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedExpenseList var value unmarshaler @@ -4805,6 +5934,17 @@ func (p *PaginatedExpenseList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedExpenseList) MarshalJSON() ([]byte, error) { + type embed PaginatedExpenseList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedExpenseList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/expenses/accounting_expenses_test/accounting_expenses_test.go b/accounting/expenses/accounting_expenses_test/accounting_expenses_test.go new file mode 100644 index 0000000..e1a11e2 --- /dev/null +++ b/accounting/expenses/accounting_expenses_test/accounting_expenses_test.go @@ -0,0 +1,299 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_expenses_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingExpensesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ExpensesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Accounting.Expenses.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/expenses", map[string]string{"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"}, 1) +} + +func TestAccountingExpensesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ExpenseEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.ExpenseRequest{}, + } + _, invocationErr := client.Accounting.Expenses.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/expenses", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingExpensesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ExpensesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Expenses.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/expenses/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestAccountingExpensesLinesRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ExpensesLinesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.Expenses.LinesRemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/expenses/lines/remote-field-classes", map[string]string{"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"}, 1) +} + +func TestAccountingExpensesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Expenses.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/expenses/meta/post", nil, 1) +} + +func TestAccountingExpensesRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ExpensesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.Expenses.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/expenses/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/accounting/expenses/client.go b/accounting/expenses/client.go index 3b8615d..166eaf7 100644 --- a/accounting/expenses/client.go +++ b/accounting/expenses/client.go @@ -4,7 +4,6 @@ package expenses import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.ExpensesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.Expense], error) { +) (*core.Page[*string, *accounting.Expense], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedExpenseList) *internal.PageResponse[*string, *accounting.Expense] { + readPageResponse := func(response *accounting.PaginatedExpenseList) *core.PageResponse[*string, *accounting.Expense] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.Expense]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.Expense]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.ExpenseEndpointRequest, opts ...option.RequestOption, ) (*accounting.ExpenseResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/expenses" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.ExpenseResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Expense` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.ExpensesRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Expense, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/expenses/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Expense - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -190,7 +132,7 @@ func (c *Client) LinesRemoteFieldClassesList( ctx context.Context, request *accounting.ExpensesLinesRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -203,13 +145,12 @@ func (c *Client) LinesRemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -226,11 +167,11 @@ func (c *Client) LinesRemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, @@ -249,35 +190,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/expenses/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -285,7 +205,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *accounting.ExpensesRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -298,13 +218,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -321,11 +240,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/accounting/expenses/raw_client.go b/accounting/expenses/raw_client.go new file mode 100644 index 0000000..e2a8339 --- /dev/null +++ b/accounting/expenses/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package expenses + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.ExpenseEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.ExpenseResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/expenses" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.ExpenseResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.ExpenseResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.ExpensesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Expense], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/expenses/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Expense + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Expense]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/expenses/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/field_mapping.go b/accounting/field_mapping.go index a726b64..d7edb3b 100644 --- a/accounting/field_mapping.go +++ b/accounting/field_mapping.go @@ -6,6 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + createFieldMappingRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) + createFieldMappingRequestFieldTargetFieldName = big.NewInt(1 << 1) + createFieldMappingRequestFieldTargetFieldDescription = big.NewInt(1 << 2) + createFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 3) + createFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 4) + createFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 5) + createFieldMappingRequestFieldCommonModelName = big.NewInt(1 << 6) ) type CreateFieldMappingRequest struct { @@ -23,8 +34,73 @@ type CreateFieldMappingRequest struct { RemoteUrlPath string `json:"remote_url_path" url:"-"` // The name of the Common Model that the remote field corresponds to in a given category. CommonModelName string `json:"common_model_name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreateFieldMappingRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + c.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + c.require(createFieldMappingRequestFieldExcludeRemoteFieldMetadata) +} + +// SetTargetFieldName sets the TargetFieldName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldName(targetFieldName string) { + c.TargetFieldName = targetFieldName + c.require(createFieldMappingRequestFieldTargetFieldName) +} + +// SetTargetFieldDescription sets the TargetFieldDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldDescription(targetFieldDescription string) { + c.TargetFieldDescription = targetFieldDescription + c.require(createFieldMappingRequestFieldTargetFieldDescription) } +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + c.RemoteFieldTraversalPath = remoteFieldTraversalPath + c.require(createFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteMethod(remoteMethod string) { + c.RemoteMethod = remoteMethod + c.require(createFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath string) { + c.RemoteUrlPath = remoteUrlPath + c.require(createFieldMappingRequestFieldRemoteUrlPath) +} + +// SetCommonModelName sets the CommonModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetCommonModelName(commonModelName string) { + c.CommonModelName = commonModelName + c.require(createFieldMappingRequestFieldCommonModelName) +} + +var ( + patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 0) + patchedEditFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 1) + patchedEditFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 2) +) + type PatchedEditFieldMappingRequest struct { // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty" url:"-"` @@ -32,20 +108,110 @@ type PatchedEditFieldMappingRequest struct { RemoteMethod *string `json:"remote_method,omitempty" url:"-"` // The path of the remote endpoint where the remote field is coming from. RemoteUrlPath *string `json:"remote_url_path,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedEditFieldMappingRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + p.RemoteFieldTraversalPath = remoteFieldTraversalPath + p.require(patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteMethod(remoteMethod *string) { + p.RemoteMethod = remoteMethod + p.require(patchedEditFieldMappingRequestFieldRemoteMethod) } +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath *string) { + p.RemoteUrlPath = remoteUrlPath + p.require(patchedEditFieldMappingRequestFieldRemoteUrlPath) +} + +var ( + fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) +) + type FieldMappingsRetrieveRequest struct { // 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. ExcludeRemoteFieldMetadata *bool `json:"-" url:"exclude_remote_field_metadata,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FieldMappingsRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingsRetrieveRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + f.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + f.require(fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata) } +var ( + remoteFieldsRetrieveRequestFieldCommonModels = big.NewInt(1 << 0) + remoteFieldsRetrieveRequestFieldIncludeExampleValues = big.NewInt(1 << 1) +) + type RemoteFieldsRetrieveRequest struct { // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. CommonModels *string `json:"-" url:"common_models,omitempty"` // 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. IncludeExampleValues *string `json:"-" url:"include_example_values,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteFieldsRetrieveRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetCommonModels(commonModels *string) { + r.CommonModels = commonModels + r.require(remoteFieldsRetrieveRequestFieldCommonModels) } +// SetIncludeExampleValues sets the IncludeExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetIncludeExampleValues(includeExampleValues *string) { + r.IncludeExampleValues = includeExampleValues + r.require(remoteFieldsRetrieveRequestFieldIncludeExampleValues) +} + +var ( + advancedMetadataFieldId = big.NewInt(1 << 0) + advancedMetadataFieldDisplayName = big.NewInt(1 << 1) + advancedMetadataFieldDescription = big.NewInt(1 << 2) + advancedMetadataFieldIsRequired = big.NewInt(1 << 3) + advancedMetadataFieldIsCustom = big.NewInt(1 << 4) + advancedMetadataFieldFieldChoices = big.NewInt(1 << 5) +) + type AdvancedMetadata struct { Id string `json:"id" url:"id"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` @@ -54,6 +220,9 @@ type AdvancedMetadata struct { IsCustom *bool `json:"is_custom,omitempty" url:"is_custom,omitempty"` FieldChoices []interface{} `json:"field_choices,omitempty" url:"field_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -104,6 +273,55 @@ func (a *AdvancedMetadata) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AdvancedMetadata) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetId(id string) { + a.Id = id + a.require(advancedMetadataFieldId) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDisplayName(displayName *string) { + a.DisplayName = displayName + a.require(advancedMetadataFieldDisplayName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDescription(description *string) { + a.Description = description + a.require(advancedMetadataFieldDescription) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsRequired(isRequired *bool) { + a.IsRequired = isRequired + a.require(advancedMetadataFieldIsRequired) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsCustom(isCustom *bool) { + a.IsCustom = isCustom + a.require(advancedMetadataFieldIsCustom) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetFieldChoices(fieldChoices []interface{}) { + a.FieldChoices = fieldChoices + a.require(advancedMetadataFieldFieldChoices) +} + func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { type unmarshaler AdvancedMetadata var value unmarshaler @@ -120,6 +338,17 @@ func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { return nil } +func (a *AdvancedMetadata) MarshalJSON() ([]byte, error) { + type embed AdvancedMetadata + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AdvancedMetadata) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -132,11 +361,20 @@ func (a *AdvancedMetadata) String() string { return fmt.Sprintf("%#v", a) } +var ( + externalTargetFieldApiFieldName = big.NewInt(1 << 0) + externalTargetFieldApiFieldDescription = big.NewInt(1 << 1) + externalTargetFieldApiFieldIsMapped = big.NewInt(1 << 2) +) + type ExternalTargetFieldApi struct { Name *string `json:"name,omitempty" url:"name,omitempty"` Description *string `json:"description,omitempty" url:"description,omitempty"` IsMapped *string `json:"is_mapped,omitempty" url:"is_mapped,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -166,6 +404,34 @@ func (e *ExternalTargetFieldApi) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExternalTargetFieldApi) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetName(name *string) { + e.Name = name + e.require(externalTargetFieldApiFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetDescription(description *string) { + e.Description = description + e.require(externalTargetFieldApiFieldDescription) +} + +// SetIsMapped sets the IsMapped field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetIsMapped(isMapped *string) { + e.IsMapped = isMapped + e.require(externalTargetFieldApiFieldIsMapped) +} + func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApi var value unmarshaler @@ -182,6 +448,17 @@ func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApi) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApi) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -194,6 +471,34 @@ func (e *ExternalTargetFieldApi) String() string { return fmt.Sprintf("%#v", e) } +var ( + externalTargetFieldApiResponseFieldAccount = big.NewInt(1 << 0) + externalTargetFieldApiResponseFieldAccountingAttachment = big.NewInt(1 << 1) + externalTargetFieldApiResponseFieldBalanceSheet = big.NewInt(1 << 2) + externalTargetFieldApiResponseFieldCashFlowStatement = big.NewInt(1 << 3) + externalTargetFieldApiResponseFieldCompanyInfo = big.NewInt(1 << 4) + externalTargetFieldApiResponseFieldContact = big.NewInt(1 << 5) + externalTargetFieldApiResponseFieldIncomeStatement = big.NewInt(1 << 6) + externalTargetFieldApiResponseFieldCreditNote = big.NewInt(1 << 7) + externalTargetFieldApiResponseFieldItem = big.NewInt(1 << 8) + externalTargetFieldApiResponseFieldPurchaseOrder = big.NewInt(1 << 9) + externalTargetFieldApiResponseFieldTrackingCategory = big.NewInt(1 << 10) + externalTargetFieldApiResponseFieldJournalEntry = big.NewInt(1 << 11) + externalTargetFieldApiResponseFieldTaxRate = big.NewInt(1 << 12) + externalTargetFieldApiResponseFieldInvoice = big.NewInt(1 << 13) + externalTargetFieldApiResponseFieldPayment = big.NewInt(1 << 14) + externalTargetFieldApiResponseFieldExpense = big.NewInt(1 << 15) + externalTargetFieldApiResponseFieldVendorCredit = big.NewInt(1 << 16) + externalTargetFieldApiResponseFieldTransaction = big.NewInt(1 << 17) + externalTargetFieldApiResponseFieldAccountingPeriod = big.NewInt(1 << 18) + externalTargetFieldApiResponseFieldGeneralLedgerTransaction = big.NewInt(1 << 19) + externalTargetFieldApiResponseFieldBankFeedAccount = big.NewInt(1 << 20) + externalTargetFieldApiResponseFieldEmployee = big.NewInt(1 << 21) + externalTargetFieldApiResponseFieldPaymentMethod = big.NewInt(1 << 22) + externalTargetFieldApiResponseFieldProject = big.NewInt(1 << 23) + externalTargetFieldApiResponseFieldPaymentTerm = big.NewInt(1 << 24) +) + type ExternalTargetFieldApiResponse struct { Account []*ExternalTargetFieldApi `json:"Account,omitempty" url:"Account,omitempty"` AccountingAttachment []*ExternalTargetFieldApi `json:"AccountingAttachment,omitempty" url:"AccountingAttachment,omitempty"` @@ -221,6 +526,9 @@ type ExternalTargetFieldApiResponse struct { Project []*ExternalTargetFieldApi `json:"Project,omitempty" url:"Project,omitempty"` PaymentTerm []*ExternalTargetFieldApi `json:"PaymentTerm,omitempty" url:"PaymentTerm,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -404,6 +712,188 @@ func (e *ExternalTargetFieldApiResponse) GetExtraProperties() map[string]interfa return e.extraProperties } +func (e *ExternalTargetFieldApiResponse) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetAccount(account []*ExternalTargetFieldApi) { + e.Account = account + e.require(externalTargetFieldApiResponseFieldAccount) +} + +// SetAccountingAttachment sets the AccountingAttachment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetAccountingAttachment(accountingAttachment []*ExternalTargetFieldApi) { + e.AccountingAttachment = accountingAttachment + e.require(externalTargetFieldApiResponseFieldAccountingAttachment) +} + +// SetBalanceSheet sets the BalanceSheet field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetBalanceSheet(balanceSheet []*ExternalTargetFieldApi) { + e.BalanceSheet = balanceSheet + e.require(externalTargetFieldApiResponseFieldBalanceSheet) +} + +// SetCashFlowStatement sets the CashFlowStatement field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetCashFlowStatement(cashFlowStatement []*ExternalTargetFieldApi) { + e.CashFlowStatement = cashFlowStatement + e.require(externalTargetFieldApiResponseFieldCashFlowStatement) +} + +// SetCompanyInfo sets the CompanyInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetCompanyInfo(companyInfo []*ExternalTargetFieldApi) { + e.CompanyInfo = companyInfo + e.require(externalTargetFieldApiResponseFieldCompanyInfo) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetContact(contact []*ExternalTargetFieldApi) { + e.Contact = contact + e.require(externalTargetFieldApiResponseFieldContact) +} + +// SetIncomeStatement sets the IncomeStatement field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetIncomeStatement(incomeStatement []*ExternalTargetFieldApi) { + e.IncomeStatement = incomeStatement + e.require(externalTargetFieldApiResponseFieldIncomeStatement) +} + +// SetCreditNote sets the CreditNote field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetCreditNote(creditNote []*ExternalTargetFieldApi) { + e.CreditNote = creditNote + e.require(externalTargetFieldApiResponseFieldCreditNote) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetItem(item []*ExternalTargetFieldApi) { + e.Item = item + e.require(externalTargetFieldApiResponseFieldItem) +} + +// SetPurchaseOrder sets the PurchaseOrder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetPurchaseOrder(purchaseOrder []*ExternalTargetFieldApi) { + e.PurchaseOrder = purchaseOrder + e.require(externalTargetFieldApiResponseFieldPurchaseOrder) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTrackingCategory(trackingCategory []*ExternalTargetFieldApi) { + e.TrackingCategory = trackingCategory + e.require(externalTargetFieldApiResponseFieldTrackingCategory) +} + +// SetJournalEntry sets the JournalEntry field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetJournalEntry(journalEntry []*ExternalTargetFieldApi) { + e.JournalEntry = journalEntry + e.require(externalTargetFieldApiResponseFieldJournalEntry) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTaxRate(taxRate []*ExternalTargetFieldApi) { + e.TaxRate = taxRate + e.require(externalTargetFieldApiResponseFieldTaxRate) +} + +// SetInvoice sets the Invoice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetInvoice(invoice []*ExternalTargetFieldApi) { + e.Invoice = invoice + e.require(externalTargetFieldApiResponseFieldInvoice) +} + +// SetPayment sets the Payment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetPayment(payment []*ExternalTargetFieldApi) { + e.Payment = payment + e.require(externalTargetFieldApiResponseFieldPayment) +} + +// SetExpense sets the Expense field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetExpense(expense []*ExternalTargetFieldApi) { + e.Expense = expense + e.require(externalTargetFieldApiResponseFieldExpense) +} + +// SetVendorCredit sets the VendorCredit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetVendorCredit(vendorCredit []*ExternalTargetFieldApi) { + e.VendorCredit = vendorCredit + e.require(externalTargetFieldApiResponseFieldVendorCredit) +} + +// SetTransaction sets the Transaction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTransaction(transaction []*ExternalTargetFieldApi) { + e.Transaction = transaction + e.require(externalTargetFieldApiResponseFieldTransaction) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetAccountingPeriod(accountingPeriod []*ExternalTargetFieldApi) { + e.AccountingPeriod = accountingPeriod + e.require(externalTargetFieldApiResponseFieldAccountingPeriod) +} + +// SetGeneralLedgerTransaction sets the GeneralLedgerTransaction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetGeneralLedgerTransaction(generalLedgerTransaction []*ExternalTargetFieldApi) { + e.GeneralLedgerTransaction = generalLedgerTransaction + e.require(externalTargetFieldApiResponseFieldGeneralLedgerTransaction) +} + +// SetBankFeedAccount sets the BankFeedAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetBankFeedAccount(bankFeedAccount []*ExternalTargetFieldApi) { + e.BankFeedAccount = bankFeedAccount + e.require(externalTargetFieldApiResponseFieldBankFeedAccount) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetEmployee(employee []*ExternalTargetFieldApi) { + e.Employee = employee + e.require(externalTargetFieldApiResponseFieldEmployee) +} + +// SetPaymentMethod sets the PaymentMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetPaymentMethod(paymentMethod []*ExternalTargetFieldApi) { + e.PaymentMethod = paymentMethod + e.require(externalTargetFieldApiResponseFieldPaymentMethod) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetProject(project []*ExternalTargetFieldApi) { + e.Project = project + e.require(externalTargetFieldApiResponseFieldProject) +} + +// SetPaymentTerm sets the PaymentTerm field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetPaymentTerm(paymentTerm []*ExternalTargetFieldApi) { + e.PaymentTerm = paymentTerm + e.require(externalTargetFieldApiResponseFieldPaymentTerm) +} + func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApiResponse var value unmarshaler @@ -420,6 +910,17 @@ func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApiResponse) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -432,12 +933,22 @@ func (e *ExternalTargetFieldApiResponse) String() string { return fmt.Sprintf("%#v", e) } +var ( + fieldMappingApiInstanceFieldId = big.NewInt(1 << 0) + fieldMappingApiInstanceFieldIsIntegrationWide = big.NewInt(1 << 1) + fieldMappingApiInstanceFieldTargetField = big.NewInt(1 << 2) + fieldMappingApiInstanceFieldRemoteField = big.NewInt(1 << 3) +) + type FieldMappingApiInstance struct { Id *string `json:"id,omitempty" url:"id,omitempty"` IsIntegrationWide *bool `json:"is_integration_wide,omitempty" url:"is_integration_wide,omitempty"` TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty" url:"target_field,omitempty"` RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty" url:"remote_field,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -474,6 +985,41 @@ func (f *FieldMappingApiInstance) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *FieldMappingApiInstance) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetId(id *string) { + f.Id = id + f.require(fieldMappingApiInstanceFieldId) +} + +// SetIsIntegrationWide sets the IsIntegrationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetIsIntegrationWide(isIntegrationWide *bool) { + f.IsIntegrationWide = isIntegrationWide + f.require(fieldMappingApiInstanceFieldIsIntegrationWide) +} + +// SetTargetField sets the TargetField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetTargetField(targetField *FieldMappingApiInstanceTargetField) { + f.TargetField = targetField + f.require(fieldMappingApiInstanceFieldTargetField) +} + +// SetRemoteField sets the RemoteField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetRemoteField(remoteField *FieldMappingApiInstanceRemoteField) { + f.RemoteField = remoteField + f.require(fieldMappingApiInstanceFieldRemoteField) +} + func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstance var value unmarshaler @@ -490,6 +1036,17 @@ func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstance) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstance + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstance) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -502,11 +1059,20 @@ func (f *FieldMappingApiInstance) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldFieldSchema = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteField struct { RemoteKeyName *string `json:"remote_key_name,omitempty" url:"remote_key_name,omitempty"` Schema map[string]interface{} `json:"schema,omitempty" url:"schema,omitempty"` RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info" url:"remote_endpoint_info"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -536,6 +1102,34 @@ func (f *FieldMappingApiInstanceRemoteField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteKeyName(remoteKeyName *string) { + f.RemoteKeyName = remoteKeyName + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetSchema(schema map[string]interface{}) { + f.Schema = schema + f.require(fieldMappingApiInstanceRemoteFieldFieldSchema) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteEndpointInfo(remoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) { + f.RemoteEndpointInfo = remoteEndpointInfo + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo) +} + func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteField var value unmarshaler @@ -552,6 +1146,17 @@ func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceRemoteField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -564,11 +1169,20 @@ func (f *FieldMappingApiInstanceRemoteField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { Method *string `json:"method,omitempty" url:"method,omitempty"` UrlPath *string `json:"url_path,omitempty" url:"url_path,omitempty"` FieldTraversalPath []string `json:"field_traversal_path,omitempty" url:"field_traversal_path,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -598,6 +1212,34 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) GetExtraPropertie return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetMethod(method *string) { + f.Method = method + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetUrlPath(urlPath *string) { + f.UrlPath = urlPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []string) { + f.FieldTraversalPath = fieldTraversalPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo var value unmarshaler @@ -614,6 +1256,17 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(dat return nil } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -626,6 +1279,34 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceResponseFieldAccount = big.NewInt(1 << 0) + fieldMappingApiInstanceResponseFieldAccountingAttachment = big.NewInt(1 << 1) + fieldMappingApiInstanceResponseFieldBalanceSheet = big.NewInt(1 << 2) + fieldMappingApiInstanceResponseFieldCashFlowStatement = big.NewInt(1 << 3) + fieldMappingApiInstanceResponseFieldCompanyInfo = big.NewInt(1 << 4) + fieldMappingApiInstanceResponseFieldContact = big.NewInt(1 << 5) + fieldMappingApiInstanceResponseFieldIncomeStatement = big.NewInt(1 << 6) + fieldMappingApiInstanceResponseFieldCreditNote = big.NewInt(1 << 7) + fieldMappingApiInstanceResponseFieldItem = big.NewInt(1 << 8) + fieldMappingApiInstanceResponseFieldPurchaseOrder = big.NewInt(1 << 9) + fieldMappingApiInstanceResponseFieldTrackingCategory = big.NewInt(1 << 10) + fieldMappingApiInstanceResponseFieldJournalEntry = big.NewInt(1 << 11) + fieldMappingApiInstanceResponseFieldTaxRate = big.NewInt(1 << 12) + fieldMappingApiInstanceResponseFieldInvoice = big.NewInt(1 << 13) + fieldMappingApiInstanceResponseFieldPayment = big.NewInt(1 << 14) + fieldMappingApiInstanceResponseFieldExpense = big.NewInt(1 << 15) + fieldMappingApiInstanceResponseFieldVendorCredit = big.NewInt(1 << 16) + fieldMappingApiInstanceResponseFieldTransaction = big.NewInt(1 << 17) + fieldMappingApiInstanceResponseFieldAccountingPeriod = big.NewInt(1 << 18) + fieldMappingApiInstanceResponseFieldGeneralLedgerTransaction = big.NewInt(1 << 19) + fieldMappingApiInstanceResponseFieldBankFeedAccount = big.NewInt(1 << 20) + fieldMappingApiInstanceResponseFieldEmployee = big.NewInt(1 << 21) + fieldMappingApiInstanceResponseFieldPaymentMethod = big.NewInt(1 << 22) + fieldMappingApiInstanceResponseFieldProject = big.NewInt(1 << 23) + fieldMappingApiInstanceResponseFieldPaymentTerm = big.NewInt(1 << 24) +) + type FieldMappingApiInstanceResponse struct { Account []*FieldMappingApiInstance `json:"Account,omitempty" url:"Account,omitempty"` AccountingAttachment []*FieldMappingApiInstance `json:"AccountingAttachment,omitempty" url:"AccountingAttachment,omitempty"` @@ -653,6 +1334,9 @@ type FieldMappingApiInstanceResponse struct { Project []*FieldMappingApiInstance `json:"Project,omitempty" url:"Project,omitempty"` PaymentTerm []*FieldMappingApiInstance `json:"PaymentTerm,omitempty" url:"PaymentTerm,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -836,6 +1520,188 @@ func (f *FieldMappingApiInstanceResponse) GetExtraProperties() map[string]interf return f.extraProperties } +func (f *FieldMappingApiInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetAccount(account []*FieldMappingApiInstance) { + f.Account = account + f.require(fieldMappingApiInstanceResponseFieldAccount) +} + +// SetAccountingAttachment sets the AccountingAttachment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetAccountingAttachment(accountingAttachment []*FieldMappingApiInstance) { + f.AccountingAttachment = accountingAttachment + f.require(fieldMappingApiInstanceResponseFieldAccountingAttachment) +} + +// SetBalanceSheet sets the BalanceSheet field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetBalanceSheet(balanceSheet []*FieldMappingApiInstance) { + f.BalanceSheet = balanceSheet + f.require(fieldMappingApiInstanceResponseFieldBalanceSheet) +} + +// SetCashFlowStatement sets the CashFlowStatement field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetCashFlowStatement(cashFlowStatement []*FieldMappingApiInstance) { + f.CashFlowStatement = cashFlowStatement + f.require(fieldMappingApiInstanceResponseFieldCashFlowStatement) +} + +// SetCompanyInfo sets the CompanyInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetCompanyInfo(companyInfo []*FieldMappingApiInstance) { + f.CompanyInfo = companyInfo + f.require(fieldMappingApiInstanceResponseFieldCompanyInfo) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetContact(contact []*FieldMappingApiInstance) { + f.Contact = contact + f.require(fieldMappingApiInstanceResponseFieldContact) +} + +// SetIncomeStatement sets the IncomeStatement field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetIncomeStatement(incomeStatement []*FieldMappingApiInstance) { + f.IncomeStatement = incomeStatement + f.require(fieldMappingApiInstanceResponseFieldIncomeStatement) +} + +// SetCreditNote sets the CreditNote field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetCreditNote(creditNote []*FieldMappingApiInstance) { + f.CreditNote = creditNote + f.require(fieldMappingApiInstanceResponseFieldCreditNote) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetItem(item []*FieldMappingApiInstance) { + f.Item = item + f.require(fieldMappingApiInstanceResponseFieldItem) +} + +// SetPurchaseOrder sets the PurchaseOrder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetPurchaseOrder(purchaseOrder []*FieldMappingApiInstance) { + f.PurchaseOrder = purchaseOrder + f.require(fieldMappingApiInstanceResponseFieldPurchaseOrder) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTrackingCategory(trackingCategory []*FieldMappingApiInstance) { + f.TrackingCategory = trackingCategory + f.require(fieldMappingApiInstanceResponseFieldTrackingCategory) +} + +// SetJournalEntry sets the JournalEntry field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetJournalEntry(journalEntry []*FieldMappingApiInstance) { + f.JournalEntry = journalEntry + f.require(fieldMappingApiInstanceResponseFieldJournalEntry) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTaxRate(taxRate []*FieldMappingApiInstance) { + f.TaxRate = taxRate + f.require(fieldMappingApiInstanceResponseFieldTaxRate) +} + +// SetInvoice sets the Invoice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetInvoice(invoice []*FieldMappingApiInstance) { + f.Invoice = invoice + f.require(fieldMappingApiInstanceResponseFieldInvoice) +} + +// SetPayment sets the Payment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetPayment(payment []*FieldMappingApiInstance) { + f.Payment = payment + f.require(fieldMappingApiInstanceResponseFieldPayment) +} + +// SetExpense sets the Expense field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetExpense(expense []*FieldMappingApiInstance) { + f.Expense = expense + f.require(fieldMappingApiInstanceResponseFieldExpense) +} + +// SetVendorCredit sets the VendorCredit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetVendorCredit(vendorCredit []*FieldMappingApiInstance) { + f.VendorCredit = vendorCredit + f.require(fieldMappingApiInstanceResponseFieldVendorCredit) +} + +// SetTransaction sets the Transaction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTransaction(transaction []*FieldMappingApiInstance) { + f.Transaction = transaction + f.require(fieldMappingApiInstanceResponseFieldTransaction) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetAccountingPeriod(accountingPeriod []*FieldMappingApiInstance) { + f.AccountingPeriod = accountingPeriod + f.require(fieldMappingApiInstanceResponseFieldAccountingPeriod) +} + +// SetGeneralLedgerTransaction sets the GeneralLedgerTransaction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetGeneralLedgerTransaction(generalLedgerTransaction []*FieldMappingApiInstance) { + f.GeneralLedgerTransaction = generalLedgerTransaction + f.require(fieldMappingApiInstanceResponseFieldGeneralLedgerTransaction) +} + +// SetBankFeedAccount sets the BankFeedAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetBankFeedAccount(bankFeedAccount []*FieldMappingApiInstance) { + f.BankFeedAccount = bankFeedAccount + f.require(fieldMappingApiInstanceResponseFieldBankFeedAccount) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetEmployee(employee []*FieldMappingApiInstance) { + f.Employee = employee + f.require(fieldMappingApiInstanceResponseFieldEmployee) +} + +// SetPaymentMethod sets the PaymentMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetPaymentMethod(paymentMethod []*FieldMappingApiInstance) { + f.PaymentMethod = paymentMethod + f.require(fieldMappingApiInstanceResponseFieldPaymentMethod) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetProject(project []*FieldMappingApiInstance) { + f.Project = project + f.require(fieldMappingApiInstanceResponseFieldProject) +} + +// SetPaymentTerm sets the PaymentTerm field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetPaymentTerm(paymentTerm []*FieldMappingApiInstance) { + f.PaymentTerm = paymentTerm + f.require(fieldMappingApiInstanceResponseFieldPaymentTerm) +} + func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceResponse var value unmarshaler @@ -852,6 +1718,17 @@ func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -864,11 +1741,20 @@ func (f *FieldMappingApiInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceTargetFieldFieldName = big.NewInt(1 << 0) + fieldMappingApiInstanceTargetFieldFieldDescription = big.NewInt(1 << 1) + fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceTargetField struct { Name string `json:"name" url:"name"` Description string `json:"description" url:"description"` IsOrganizationWide bool `json:"is_organization_wide" url:"is_organization_wide"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -898,6 +1784,34 @@ func (f *FieldMappingApiInstanceTargetField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceTargetField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetName(name string) { + f.Name = name + f.require(fieldMappingApiInstanceTargetFieldFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetDescription(description string) { + f.Description = description + f.require(fieldMappingApiInstanceTargetFieldFieldDescription) +} + +// SetIsOrganizationWide sets the IsOrganizationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetIsOrganizationWide(isOrganizationWide bool) { + f.IsOrganizationWide = isOrganizationWide + f.require(fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide) +} + func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceTargetField var value unmarshaler @@ -914,6 +1828,17 @@ func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceTargetField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceTargetField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceTargetField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -926,12 +1851,22 @@ func (f *FieldMappingApiInstanceTargetField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingInstanceResponseFieldModel = big.NewInt(1 << 0) + fieldMappingInstanceResponseFieldWarnings = big.NewInt(1 << 1) + fieldMappingInstanceResponseFieldErrors = big.NewInt(1 << 2) + fieldMappingInstanceResponseFieldLogs = big.NewInt(1 << 3) +) + type FieldMappingInstanceResponse struct { Model *FieldMappingApiInstance `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -968,6 +1903,41 @@ func (f *FieldMappingInstanceResponse) GetExtraProperties() map[string]interface return f.extraProperties } +func (f *FieldMappingInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetModel(model *FieldMappingApiInstance) { + f.Model = model + f.require(fieldMappingInstanceResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetWarnings(warnings []*WarningValidationProblem) { + f.Warnings = warnings + f.require(fieldMappingInstanceResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetErrors(errors []*ErrorValidationProblem) { + f.Errors = errors + f.require(fieldMappingInstanceResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetLogs(logs []*DebugModeLog) { + f.Logs = logs + f.require(fieldMappingInstanceResponseFieldLogs) +} + func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingInstanceResponse var value unmarshaler @@ -984,6 +1954,17 @@ func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -996,11 +1977,20 @@ func (f *FieldMappingInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + remoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + remoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + remoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type RemoteEndpointInfo struct { Method string `json:"method" url:"method"` UrlPath string `json:"url_path" url:"url_path"` FieldTraversalPath []interface{} `json:"field_traversal_path" url:"field_traversal_path"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1030,6 +2020,34 @@ func (r *RemoteEndpointInfo) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteEndpointInfo) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetMethod(method string) { + r.Method = method + r.require(remoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetUrlPath(urlPath string) { + r.UrlPath = urlPath + r.require(remoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []interface{}) { + r.FieldTraversalPath = fieldTraversalPath + r.require(remoteEndpointInfoFieldFieldTraversalPath) +} + func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler RemoteEndpointInfo var value unmarshaler @@ -1046,6 +2064,17 @@ func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed RemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteEndpointInfo) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -1058,6 +2087,15 @@ func (r *RemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldApiFieldSchema = big.NewInt(1 << 0) + remoteFieldApiFieldRemoteKeyName = big.NewInt(1 << 1) + remoteFieldApiFieldRemoteEndpointInfo = big.NewInt(1 << 2) + remoteFieldApiFieldExampleValues = big.NewInt(1 << 3) + remoteFieldApiFieldAdvancedMetadata = big.NewInt(1 << 4) + remoteFieldApiFieldCoverage = big.NewInt(1 << 5) +) + type RemoteFieldApi struct { Schema map[string]interface{} `json:"schema" url:"schema"` RemoteKeyName string `json:"remote_key_name" url:"remote_key_name"` @@ -1066,6 +2104,9 @@ type RemoteFieldApi struct { AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty" url:"advanced_metadata,omitempty"` Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty" url:"coverage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1116,6 +2157,55 @@ func (r *RemoteFieldApi) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApi) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetSchema(schema map[string]interface{}) { + r.Schema = schema + r.require(remoteFieldApiFieldSchema) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteKeyName(remoteKeyName string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldApiFieldRemoteKeyName) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteEndpointInfo(remoteEndpointInfo *RemoteEndpointInfo) { + r.RemoteEndpointInfo = remoteEndpointInfo + r.require(remoteFieldApiFieldRemoteEndpointInfo) +} + +// SetExampleValues sets the ExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetExampleValues(exampleValues []interface{}) { + r.ExampleValues = exampleValues + r.require(remoteFieldApiFieldExampleValues) +} + +// SetAdvancedMetadata sets the AdvancedMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetAdvancedMetadata(advancedMetadata *AdvancedMetadata) { + r.AdvancedMetadata = advancedMetadata + r.require(remoteFieldApiFieldAdvancedMetadata) +} + +// SetCoverage sets the Coverage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetCoverage(coverage *RemoteFieldApiCoverage) { + r.Coverage = coverage + r.require(remoteFieldApiFieldCoverage) +} + func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApi var value unmarshaler @@ -1132,6 +2222,17 @@ func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApi) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApi) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -1206,6 +2307,34 @@ func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) e return fmt.Errorf("type %T does not include a non-empty union type", r) } +var ( + remoteFieldApiResponseFieldAccount = big.NewInt(1 << 0) + remoteFieldApiResponseFieldAccountingAttachment = big.NewInt(1 << 1) + remoteFieldApiResponseFieldBalanceSheet = big.NewInt(1 << 2) + remoteFieldApiResponseFieldCashFlowStatement = big.NewInt(1 << 3) + remoteFieldApiResponseFieldCompanyInfo = big.NewInt(1 << 4) + remoteFieldApiResponseFieldContact = big.NewInt(1 << 5) + remoteFieldApiResponseFieldIncomeStatement = big.NewInt(1 << 6) + remoteFieldApiResponseFieldCreditNote = big.NewInt(1 << 7) + remoteFieldApiResponseFieldItem = big.NewInt(1 << 8) + remoteFieldApiResponseFieldPurchaseOrder = big.NewInt(1 << 9) + remoteFieldApiResponseFieldTrackingCategory = big.NewInt(1 << 10) + remoteFieldApiResponseFieldJournalEntry = big.NewInt(1 << 11) + remoteFieldApiResponseFieldTaxRate = big.NewInt(1 << 12) + remoteFieldApiResponseFieldInvoice = big.NewInt(1 << 13) + remoteFieldApiResponseFieldPayment = big.NewInt(1 << 14) + remoteFieldApiResponseFieldExpense = big.NewInt(1 << 15) + remoteFieldApiResponseFieldVendorCredit = big.NewInt(1 << 16) + remoteFieldApiResponseFieldTransaction = big.NewInt(1 << 17) + remoteFieldApiResponseFieldAccountingPeriod = big.NewInt(1 << 18) + remoteFieldApiResponseFieldGeneralLedgerTransaction = big.NewInt(1 << 19) + remoteFieldApiResponseFieldBankFeedAccount = big.NewInt(1 << 20) + remoteFieldApiResponseFieldEmployee = big.NewInt(1 << 21) + remoteFieldApiResponseFieldPaymentMethod = big.NewInt(1 << 22) + remoteFieldApiResponseFieldProject = big.NewInt(1 << 23) + remoteFieldApiResponseFieldPaymentTerm = big.NewInt(1 << 24) +) + type RemoteFieldApiResponse struct { Account []*RemoteFieldApi `json:"Account,omitempty" url:"Account,omitempty"` AccountingAttachment []*RemoteFieldApi `json:"AccountingAttachment,omitempty" url:"AccountingAttachment,omitempty"` @@ -1233,6 +2362,9 @@ type RemoteFieldApiResponse struct { Project []*RemoteFieldApi `json:"Project,omitempty" url:"Project,omitempty"` PaymentTerm []*RemoteFieldApi `json:"PaymentTerm,omitempty" url:"PaymentTerm,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1416,6 +2548,188 @@ func (r *RemoteFieldApiResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApiResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetAccount(account []*RemoteFieldApi) { + r.Account = account + r.require(remoteFieldApiResponseFieldAccount) +} + +// SetAccountingAttachment sets the AccountingAttachment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetAccountingAttachment(accountingAttachment []*RemoteFieldApi) { + r.AccountingAttachment = accountingAttachment + r.require(remoteFieldApiResponseFieldAccountingAttachment) +} + +// SetBalanceSheet sets the BalanceSheet field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetBalanceSheet(balanceSheet []*RemoteFieldApi) { + r.BalanceSheet = balanceSheet + r.require(remoteFieldApiResponseFieldBalanceSheet) +} + +// SetCashFlowStatement sets the CashFlowStatement field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetCashFlowStatement(cashFlowStatement []*RemoteFieldApi) { + r.CashFlowStatement = cashFlowStatement + r.require(remoteFieldApiResponseFieldCashFlowStatement) +} + +// SetCompanyInfo sets the CompanyInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetCompanyInfo(companyInfo []*RemoteFieldApi) { + r.CompanyInfo = companyInfo + r.require(remoteFieldApiResponseFieldCompanyInfo) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetContact(contact []*RemoteFieldApi) { + r.Contact = contact + r.require(remoteFieldApiResponseFieldContact) +} + +// SetIncomeStatement sets the IncomeStatement field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetIncomeStatement(incomeStatement []*RemoteFieldApi) { + r.IncomeStatement = incomeStatement + r.require(remoteFieldApiResponseFieldIncomeStatement) +} + +// SetCreditNote sets the CreditNote field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetCreditNote(creditNote []*RemoteFieldApi) { + r.CreditNote = creditNote + r.require(remoteFieldApiResponseFieldCreditNote) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetItem(item []*RemoteFieldApi) { + r.Item = item + r.require(remoteFieldApiResponseFieldItem) +} + +// SetPurchaseOrder sets the PurchaseOrder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetPurchaseOrder(purchaseOrder []*RemoteFieldApi) { + r.PurchaseOrder = purchaseOrder + r.require(remoteFieldApiResponseFieldPurchaseOrder) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTrackingCategory(trackingCategory []*RemoteFieldApi) { + r.TrackingCategory = trackingCategory + r.require(remoteFieldApiResponseFieldTrackingCategory) +} + +// SetJournalEntry sets the JournalEntry field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetJournalEntry(journalEntry []*RemoteFieldApi) { + r.JournalEntry = journalEntry + r.require(remoteFieldApiResponseFieldJournalEntry) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTaxRate(taxRate []*RemoteFieldApi) { + r.TaxRate = taxRate + r.require(remoteFieldApiResponseFieldTaxRate) +} + +// SetInvoice sets the Invoice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetInvoice(invoice []*RemoteFieldApi) { + r.Invoice = invoice + r.require(remoteFieldApiResponseFieldInvoice) +} + +// SetPayment sets the Payment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetPayment(payment []*RemoteFieldApi) { + r.Payment = payment + r.require(remoteFieldApiResponseFieldPayment) +} + +// SetExpense sets the Expense field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetExpense(expense []*RemoteFieldApi) { + r.Expense = expense + r.require(remoteFieldApiResponseFieldExpense) +} + +// SetVendorCredit sets the VendorCredit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetVendorCredit(vendorCredit []*RemoteFieldApi) { + r.VendorCredit = vendorCredit + r.require(remoteFieldApiResponseFieldVendorCredit) +} + +// SetTransaction sets the Transaction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTransaction(transaction []*RemoteFieldApi) { + r.Transaction = transaction + r.require(remoteFieldApiResponseFieldTransaction) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetAccountingPeriod(accountingPeriod []*RemoteFieldApi) { + r.AccountingPeriod = accountingPeriod + r.require(remoteFieldApiResponseFieldAccountingPeriod) +} + +// SetGeneralLedgerTransaction sets the GeneralLedgerTransaction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetGeneralLedgerTransaction(generalLedgerTransaction []*RemoteFieldApi) { + r.GeneralLedgerTransaction = generalLedgerTransaction + r.require(remoteFieldApiResponseFieldGeneralLedgerTransaction) +} + +// SetBankFeedAccount sets the BankFeedAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetBankFeedAccount(bankFeedAccount []*RemoteFieldApi) { + r.BankFeedAccount = bankFeedAccount + r.require(remoteFieldApiResponseFieldBankFeedAccount) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetEmployee(employee []*RemoteFieldApi) { + r.Employee = employee + r.require(remoteFieldApiResponseFieldEmployee) +} + +// SetPaymentMethod sets the PaymentMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetPaymentMethod(paymentMethod []*RemoteFieldApi) { + r.PaymentMethod = paymentMethod + r.require(remoteFieldApiResponseFieldPaymentMethod) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetProject(project []*RemoteFieldApi) { + r.Project = project + r.require(remoteFieldApiResponseFieldProject) +} + +// SetPaymentTerm sets the PaymentTerm field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetPaymentTerm(paymentTerm []*RemoteFieldApi) { + r.PaymentTerm = paymentTerm + r.require(remoteFieldApiResponseFieldPaymentTerm) +} + func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApiResponse var value unmarshaler @@ -1432,6 +2746,17 @@ func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApiResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { diff --git a/accounting/fieldmapping/accounting_field_mapping_test/accounting_field_mapping_test.go b/accounting/fieldmapping/accounting_field_mapping_test/accounting_field_mapping_test.go new file mode 100644 index 0000000..b01360d --- /dev/null +++ b/accounting/fieldmapping/accounting_field_mapping_test/accounting_field_mapping_test.go @@ -0,0 +1,210 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_field_mapping_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingFieldMappingFieldMappingsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestAccountingFieldMappingFieldMappingsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } + _, invocationErr := client.Accounting.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestAccountingFieldMappingFieldMappingsDestroyWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + response, invocationErr := client.Accounting.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) + + // DELETE operations may return nil response body, which is acceptable + if invocationErr != nil && response == nil { + // This is expected for DELETE operations that return 204 No Content + require.Contains(t, invocationErr.Error(), "but the server responded with nothing", "Expected empty response error") + } else { + require.NoError(t, invocationErr, "Client method call should succeed") + } + VerifyRequestCount(t, "DELETE", "/accounting/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestAccountingFieldMappingFieldMappingsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PatchedEditFieldMappingRequest{} + _, invocationErr := client.Accounting.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/accounting/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestAccountingFieldMappingRemoteFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } + _, invocationErr := client.Accounting.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/remote-fields", map[string]string{"common_models": "common_models", "include_example_values": "include_example_values"}, 1) +} + +func TestAccountingFieldMappingTargetFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/target-fields", nil, 1) +} diff --git a/accounting/fieldmapping/client.go b/accounting/fieldmapping/client.go index ed2e42d..24b161e 100644 --- a/accounting/fieldmapping/client.go +++ b/accounting/fieldmapping/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,42 +38,15 @@ func (c *Client) FieldMappingsRetrieve( request *accounting.FieldMappingsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.FieldMappingApiInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.FieldMappingApiInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -81,44 +55,15 @@ func (c *Client) FieldMappingsCreate( request *accounting.CreateFieldMappingRequest, opts ...option.RequestOption, ) (*accounting.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsCreate( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -127,38 +72,15 @@ func (c *Client) FieldMappingsDestroy( fieldMappingId string, opts ...option.RequestOption, ) (*accounting.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsDestroy( + ctx, fieldMappingId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodDelete, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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. @@ -168,40 +90,16 @@ func (c *Client) FieldMappingsPartialUpdate( request *accounting.PatchedEditFieldMappingRequest, opts ...option.RequestOption, ) (*accounting.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsPartialUpdate( + ctx, fieldMappingId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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/). @@ -210,42 +108,15 @@ func (c *Client) RemoteFieldsRetrieve( request *accounting.RemoteFieldsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.RemoteFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.RemoteFieldsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/remote-fields" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.RemoteFieldApiResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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/). @@ -253,33 +124,12 @@ func (c *Client) TargetFieldsRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.ExternalTargetFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/target-fields" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.ExternalTargetFieldApiResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.TargetFieldsRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/fieldmapping/raw_client.go b/accounting/fieldmapping/raw_client.go new file mode 100644 index 0000000..c727127 --- /dev/null +++ b/accounting/fieldmapping/raw_client.go @@ -0,0 +1,302 @@ +// Code generated by Fern. DO NOT EDIT. + +package fieldmapping + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) FieldMappingsRetrieve( + ctx context.Context, + request *accounting.FieldMappingsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.FieldMappingApiInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.FieldMappingApiInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.FieldMappingApiInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsCreate( + ctx context.Context, + request *accounting.CreateFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsDestroy( + ctx context.Context, + fieldMappingId string, + opts ...option.RequestOption, +) (*core.Response[*accounting.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsPartialUpdate( + ctx context.Context, + fieldMappingId string, + request *accounting.PatchedEditFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) RemoteFieldsRetrieve( + ctx context.Context, + request *accounting.RemoteFieldsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.RemoteFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/remote-fields" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.RemoteFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.RemoteFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) TargetFieldsRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.ExternalTargetFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/target-fields" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.ExternalTargetFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.ExternalTargetFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/forceresync/accounting_force_resync_test/accounting_force_resync_test.go b/accounting/forceresync/accounting_force_resync_test/accounting_force_resync_test.go new file mode 100644 index 0000000..f201c73 --- /dev/null +++ b/accounting/forceresync/accounting_force_resync_test/accounting_force_resync_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_force_resync_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingForceResyncSyncStatusResyncCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/sync-status/resync", nil, 1) +} diff --git a/accounting/forceresync/client.go b/accounting/forceresync/client.go index 25784b0..8bcbb21 100644 --- a/accounting/forceresync/client.go +++ b/accounting/forceresync/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) SyncStatusResyncCreate( ctx context.Context, opts ...option.RequestOption, ) ([]*accounting.SyncStatus, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/sync-status/resync" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*accounting.SyncStatus - if err := c.caller.Call( + response, err := c.WithRawResponse.SyncStatusResyncCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/forceresync/raw_client.go b/accounting/forceresync/raw_client.go new file mode 100644 index 0000000..4c696e3 --- /dev/null +++ b/accounting/forceresync/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package forceresync + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) SyncStatusResyncCreate( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*accounting.SyncStatus], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/sync-status/resync" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*accounting.SyncStatus + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*accounting.SyncStatus]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/general_ledger_transactions.go b/accounting/general_ledger_transactions.go index cc9c181..983ec32 100644 --- a/accounting/general_ledger_transactions.go +++ b/accounting/general_ledger_transactions.go @@ -6,9 +6,27 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + generalLedgerTransactionsListRequestFieldCompanyId = big.NewInt(1 << 0) + generalLedgerTransactionsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + generalLedgerTransactionsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + generalLedgerTransactionsListRequestFieldCursor = big.NewInt(1 << 3) + generalLedgerTransactionsListRequestFieldExpand = big.NewInt(1 << 4) + generalLedgerTransactionsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + generalLedgerTransactionsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + generalLedgerTransactionsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + generalLedgerTransactionsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + generalLedgerTransactionsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + generalLedgerTransactionsListRequestFieldPageSize = big.NewInt(1 << 10) + generalLedgerTransactionsListRequestFieldPostedDateAfter = big.NewInt(1 << 11) + generalLedgerTransactionsListRequestFieldPostedDateBefore = big.NewInt(1 << 12) + generalLedgerTransactionsListRequestFieldRemoteId = big.NewInt(1 << 13) +) + type GeneralLedgerTransactionsListRequest struct { // If provided, will only return general ledger transactions for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -38,8 +56,122 @@ type GeneralLedgerTransactionsListRequest struct { PostedDateBefore *time.Time `json:"-" url:"posted_date_before,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GeneralLedgerTransactionsListRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetCompanyId(companyId *string) { + g.CompanyId = companyId + g.require(generalLedgerTransactionsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetCreatedAfter(createdAfter *time.Time) { + g.CreatedAfter = createdAfter + g.require(generalLedgerTransactionsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetCreatedBefore(createdBefore *time.Time) { + g.CreatedBefore = createdBefore + g.require(generalLedgerTransactionsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetCursor(cursor *string) { + g.Cursor = cursor + g.require(generalLedgerTransactionsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetExpand(expand []*GeneralLedgerTransactionsListRequestExpandItem) { + g.Expand = expand + g.require(generalLedgerTransactionsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + g.IncludeDeletedData = includeDeletedData + g.require(generalLedgerTransactionsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + g.IncludeRemoteData = includeRemoteData + g.require(generalLedgerTransactionsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetIncludeShellData(includeShellData *bool) { + g.IncludeShellData = includeShellData + g.require(generalLedgerTransactionsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + g.ModifiedAfter = modifiedAfter + g.require(generalLedgerTransactionsListRequestFieldModifiedAfter) } +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + g.ModifiedBefore = modifiedBefore + g.require(generalLedgerTransactionsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetPageSize(pageSize *int) { + g.PageSize = pageSize + g.require(generalLedgerTransactionsListRequestFieldPageSize) +} + +// SetPostedDateAfter sets the PostedDateAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetPostedDateAfter(postedDateAfter *time.Time) { + g.PostedDateAfter = postedDateAfter + g.require(generalLedgerTransactionsListRequestFieldPostedDateAfter) +} + +// SetPostedDateBefore sets the PostedDateBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetPostedDateBefore(postedDateBefore *time.Time) { + g.PostedDateBefore = postedDateBefore + g.require(generalLedgerTransactionsListRequestFieldPostedDateBefore) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsListRequest) SetRemoteId(remoteId *string) { + g.RemoteId = remoteId + g.require(generalLedgerTransactionsListRequestFieldRemoteId) +} + +var ( + generalLedgerTransactionsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + generalLedgerTransactionsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + generalLedgerTransactionsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type GeneralLedgerTransactionsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*GeneralLedgerTransactionsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -47,6 +179,37 @@ type GeneralLedgerTransactionsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GeneralLedgerTransactionsRetrieveRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsRetrieveRequest) SetExpand(expand []*GeneralLedgerTransactionsRetrieveRequestExpandItem) { + g.Expand = expand + g.require(generalLedgerTransactionsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + g.IncludeRemoteData = includeRemoteData + g.require(generalLedgerTransactionsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + g.IncludeShellData = includeShellData + g.require(generalLedgerTransactionsRetrieveRequestFieldIncludeShellData) } type GeneralLedgerTransactionsListRequestExpandItem string @@ -115,6 +278,25 @@ func (g GeneralLedgerTransactionsRetrieveRequestExpandItem) Ptr() *GeneralLedger // // ### Usage Example // Fetch from the `GET GeneralLedgerTransaction` endpoint and view a general ledger transaction. +var ( + generalLedgerTransactionFieldId = big.NewInt(1 << 0) + generalLedgerTransactionFieldRemoteId = big.NewInt(1 << 1) + generalLedgerTransactionFieldCreatedAt = big.NewInt(1 << 2) + generalLedgerTransactionFieldModifiedAt = big.NewInt(1 << 3) + generalLedgerTransactionFieldUnderlyingTransactionRemoteId = big.NewInt(1 << 4) + generalLedgerTransactionFieldUnderlyingTransactionType = big.NewInt(1 << 5) + generalLedgerTransactionFieldAccountingPeriod = big.NewInt(1 << 6) + generalLedgerTransactionFieldCompany = big.NewInt(1 << 7) + generalLedgerTransactionFieldRemoteUpdatedAt = big.NewInt(1 << 8) + generalLedgerTransactionFieldRemoteCreatedAt = big.NewInt(1 << 9) + generalLedgerTransactionFieldTrackingCategories = big.NewInt(1 << 10) + generalLedgerTransactionFieldPostingDate = big.NewInt(1 << 11) + generalLedgerTransactionFieldGeneralLedgerTransactionLines = big.NewInt(1 << 12) + generalLedgerTransactionFieldRemoteWasDeleted = big.NewInt(1 << 13) + generalLedgerTransactionFieldFieldMappings = big.NewInt(1 << 14) + generalLedgerTransactionFieldRemoteData = big.NewInt(1 << 15) +) + type GeneralLedgerTransaction struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -153,6 +335,9 @@ type GeneralLedgerTransaction struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -273,6 +458,125 @@ func (g *GeneralLedgerTransaction) GetExtraProperties() map[string]interface{} { return g.extraProperties } +func (g *GeneralLedgerTransaction) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetId(id *string) { + g.Id = id + g.require(generalLedgerTransactionFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetRemoteId(remoteId *string) { + g.RemoteId = remoteId + g.require(generalLedgerTransactionFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetCreatedAt(createdAt *time.Time) { + g.CreatedAt = createdAt + g.require(generalLedgerTransactionFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetModifiedAt(modifiedAt *time.Time) { + g.ModifiedAt = modifiedAt + g.require(generalLedgerTransactionFieldModifiedAt) +} + +// SetUnderlyingTransactionRemoteId sets the UnderlyingTransactionRemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetUnderlyingTransactionRemoteId(underlyingTransactionRemoteId *string) { + g.UnderlyingTransactionRemoteId = underlyingTransactionRemoteId + g.require(generalLedgerTransactionFieldUnderlyingTransactionRemoteId) +} + +// SetUnderlyingTransactionType sets the UnderlyingTransactionType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetUnderlyingTransactionType(underlyingTransactionType *GeneralLedgerTransactionUnderlyingTransactionType) { + g.UnderlyingTransactionType = underlyingTransactionType + g.require(generalLedgerTransactionFieldUnderlyingTransactionType) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetAccountingPeriod(accountingPeriod *GeneralLedgerTransactionAccountingPeriod) { + g.AccountingPeriod = accountingPeriod + g.require(generalLedgerTransactionFieldAccountingPeriod) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetCompany(company *GeneralLedgerTransactionCompany) { + g.Company = company + g.require(generalLedgerTransactionFieldCompany) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + g.RemoteUpdatedAt = remoteUpdatedAt + g.require(generalLedgerTransactionFieldRemoteUpdatedAt) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + g.RemoteCreatedAt = remoteCreatedAt + g.require(generalLedgerTransactionFieldRemoteCreatedAt) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetTrackingCategories(trackingCategories []*GeneralLedgerTransactionTrackingCategoriesItem) { + g.TrackingCategories = trackingCategories + g.require(generalLedgerTransactionFieldTrackingCategories) +} + +// SetPostingDate sets the PostingDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetPostingDate(postingDate *time.Time) { + g.PostingDate = postingDate + g.require(generalLedgerTransactionFieldPostingDate) +} + +// SetGeneralLedgerTransactionLines sets the GeneralLedgerTransactionLines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetGeneralLedgerTransactionLines(generalLedgerTransactionLines []*GeneralLedgerTransactionGeneralLedgerTransactionLinesItem) { + g.GeneralLedgerTransactionLines = generalLedgerTransactionLines + g.require(generalLedgerTransactionFieldGeneralLedgerTransactionLines) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetRemoteWasDeleted(remoteWasDeleted *bool) { + g.RemoteWasDeleted = remoteWasDeleted + g.require(generalLedgerTransactionFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetFieldMappings(fieldMappings map[string]interface{}) { + g.FieldMappings = fieldMappings + g.require(generalLedgerTransactionFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransaction) SetRemoteData(remoteData []*RemoteData) { + g.RemoteData = remoteData + g.require(generalLedgerTransactionFieldRemoteData) +} + func (g *GeneralLedgerTransaction) UnmarshalJSON(data []byte) error { type embed GeneralLedgerTransaction var unmarshaler = struct { @@ -320,7 +624,8 @@ func (g *GeneralLedgerTransaction) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(g.RemoteCreatedAt), PostingDate: internal.NewOptionalDateTime(g.PostingDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, g.explicitFields) + return json.Marshal(explicitMarshaler) } func (g *GeneralLedgerTransaction) String() string { @@ -529,6 +834,30 @@ func (g *GeneralLedgerTransactionGeneralLedgerTransactionLinesItem) Accept(visit // // ### Usage Example Fetch from the `GET GeneralLedgerTransactionLineSerializer` endpoint and view an // `GeneralLedgerTransaction` line item. +var ( + generalLedgerTransactionLineFieldId = big.NewInt(1 << 0) + generalLedgerTransactionLineFieldRemoteId = big.NewInt(1 << 1) + generalLedgerTransactionLineFieldCreatedAt = big.NewInt(1 << 2) + generalLedgerTransactionLineFieldModifiedAt = big.NewInt(1 << 3) + generalLedgerTransactionLineFieldAccount = big.NewInt(1 << 4) + generalLedgerTransactionLineFieldCompany = big.NewInt(1 << 5) + generalLedgerTransactionLineFieldEmployee = big.NewInt(1 << 6) + generalLedgerTransactionLineFieldContact = big.NewInt(1 << 7) + generalLedgerTransactionLineFieldProject = big.NewInt(1 << 8) + generalLedgerTransactionLineFieldBaseCurrency = big.NewInt(1 << 9) + generalLedgerTransactionLineFieldTransactionCurrency = big.NewInt(1 << 10) + generalLedgerTransactionLineFieldExchangeRate = big.NewInt(1 << 11) + generalLedgerTransactionLineFieldDescription = big.NewInt(1 << 12) + generalLedgerTransactionLineFieldTrackingCategories = big.NewInt(1 << 13) + generalLedgerTransactionLineFieldDebitAmount = big.NewInt(1 << 14) + generalLedgerTransactionLineFieldCreditAmount = big.NewInt(1 << 15) + generalLedgerTransactionLineFieldItem = big.NewInt(1 << 16) + generalLedgerTransactionLineFieldForeignDebitAmount = big.NewInt(1 << 17) + generalLedgerTransactionLineFieldForeignCreditAmount = big.NewInt(1 << 18) + generalLedgerTransactionLineFieldRemoteWasDeleted = big.NewInt(1 << 19) + generalLedgerTransactionLineFieldFieldMappings = big.NewInt(1 << 20) +) + type GeneralLedgerTransactionLine struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -1175,6 +1504,9 @@ type GeneralLedgerTransactionLine struct { RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1330,6 +1662,160 @@ func (g *GeneralLedgerTransactionLine) GetExtraProperties() map[string]interface return g.extraProperties } +func (g *GeneralLedgerTransactionLine) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetId(id *string) { + g.Id = id + g.require(generalLedgerTransactionLineFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetRemoteId(remoteId *string) { + g.RemoteId = remoteId + g.require(generalLedgerTransactionLineFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetCreatedAt(createdAt *time.Time) { + g.CreatedAt = createdAt + g.require(generalLedgerTransactionLineFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetModifiedAt(modifiedAt *time.Time) { + g.ModifiedAt = modifiedAt + g.require(generalLedgerTransactionLineFieldModifiedAt) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetAccount(account *GeneralLedgerTransactionLineAccount) { + g.Account = account + g.require(generalLedgerTransactionLineFieldAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetCompany(company *GeneralLedgerTransactionLineCompany) { + g.Company = company + g.require(generalLedgerTransactionLineFieldCompany) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetEmployee(employee *GeneralLedgerTransactionLineEmployee) { + g.Employee = employee + g.require(generalLedgerTransactionLineFieldEmployee) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetContact(contact *GeneralLedgerTransactionLineContact) { + g.Contact = contact + g.require(generalLedgerTransactionLineFieldContact) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetProject(project *GeneralLedgerTransactionLineProject) { + g.Project = project + g.require(generalLedgerTransactionLineFieldProject) +} + +// SetBaseCurrency sets the BaseCurrency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetBaseCurrency(baseCurrency *TransactionCurrencyEnum) { + g.BaseCurrency = baseCurrency + g.require(generalLedgerTransactionLineFieldBaseCurrency) +} + +// SetTransactionCurrency sets the TransactionCurrency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetTransactionCurrency(transactionCurrency *GeneralLedgerTransactionLineTransactionCurrency) { + g.TransactionCurrency = transactionCurrency + g.require(generalLedgerTransactionLineFieldTransactionCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetExchangeRate(exchangeRate *string) { + g.ExchangeRate = exchangeRate + g.require(generalLedgerTransactionLineFieldExchangeRate) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetDescription(description *string) { + g.Description = description + g.require(generalLedgerTransactionLineFieldDescription) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetTrackingCategories(trackingCategories []*GeneralLedgerTransactionLineTrackingCategoriesItem) { + g.TrackingCategories = trackingCategories + g.require(generalLedgerTransactionLineFieldTrackingCategories) +} + +// SetDebitAmount sets the DebitAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetDebitAmount(debitAmount string) { + g.DebitAmount = debitAmount + g.require(generalLedgerTransactionLineFieldDebitAmount) +} + +// SetCreditAmount sets the CreditAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetCreditAmount(creditAmount string) { + g.CreditAmount = creditAmount + g.require(generalLedgerTransactionLineFieldCreditAmount) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetItem(item *GeneralLedgerTransactionLineItem) { + g.Item = item + g.require(generalLedgerTransactionLineFieldItem) +} + +// SetForeignDebitAmount sets the ForeignDebitAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetForeignDebitAmount(foreignDebitAmount string) { + g.ForeignDebitAmount = foreignDebitAmount + g.require(generalLedgerTransactionLineFieldForeignDebitAmount) +} + +// SetForeignCreditAmount sets the ForeignCreditAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetForeignCreditAmount(foreignCreditAmount string) { + g.ForeignCreditAmount = foreignCreditAmount + g.require(generalLedgerTransactionLineFieldForeignCreditAmount) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetRemoteWasDeleted(remoteWasDeleted *bool) { + g.RemoteWasDeleted = remoteWasDeleted + g.require(generalLedgerTransactionLineFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GeneralLedgerTransactionLine) SetFieldMappings(fieldMappings map[string]interface{}) { + g.FieldMappings = fieldMappings + g.require(generalLedgerTransactionLineFieldFieldMappings) +} + func (g *GeneralLedgerTransactionLine) UnmarshalJSON(data []byte) error { type embed GeneralLedgerTransactionLine var unmarshaler = struct { @@ -1365,7 +1851,8 @@ func (g *GeneralLedgerTransactionLine) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(g.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(g.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, g.explicitFields) + return json.Marshal(explicitMarshaler) } func (g *GeneralLedgerTransactionLine) String() string { @@ -2318,11 +2805,20 @@ func (g *GeneralLedgerTransactionUnderlyingTransactionType) Accept(visitor Gener return fmt.Errorf("type %T does not include a non-empty union type", g) } +var ( + paginatedGeneralLedgerTransactionListFieldNext = big.NewInt(1 << 0) + paginatedGeneralLedgerTransactionListFieldPrevious = big.NewInt(1 << 1) + paginatedGeneralLedgerTransactionListFieldResults = big.NewInt(1 << 2) +) + type PaginatedGeneralLedgerTransactionList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*GeneralLedgerTransaction `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2352,6 +2848,34 @@ func (p *PaginatedGeneralLedgerTransactionList) GetExtraProperties() map[string] return p.extraProperties } +func (p *PaginatedGeneralLedgerTransactionList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedGeneralLedgerTransactionList) SetNext(next *string) { + p.Next = next + p.require(paginatedGeneralLedgerTransactionListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedGeneralLedgerTransactionList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedGeneralLedgerTransactionListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedGeneralLedgerTransactionList) SetResults(results []*GeneralLedgerTransaction) { + p.Results = results + p.require(paginatedGeneralLedgerTransactionListFieldResults) +} + func (p *PaginatedGeneralLedgerTransactionList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedGeneralLedgerTransactionList var value unmarshaler @@ -2368,6 +2892,17 @@ func (p *PaginatedGeneralLedgerTransactionList) UnmarshalJSON(data []byte) error return nil } +func (p *PaginatedGeneralLedgerTransactionList) MarshalJSON() ([]byte, error) { + type embed PaginatedGeneralLedgerTransactionList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedGeneralLedgerTransactionList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/generalledgertransactions/accounting_general_ledger_transactions_test/accounting_general_ledger_transactions_test.go b/accounting/generalledgertransactions/accounting_general_ledger_transactions_test/accounting_general_ledger_transactions_test.go new file mode 100644 index 0000000..7a57799 --- /dev/null +++ b/accounting/generalledgertransactions/accounting_general_ledger_transactions_test/accounting_general_ledger_transactions_test.go @@ -0,0 +1,163 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_general_ledger_transactions_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingGeneralLedgerTransactionsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.GeneralLedgerTransactionsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PostedDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PostedDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.GeneralLedgerTransactions.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/general-ledger-transactions", map[string]string{"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"}, 1) +} + +func TestAccountingGeneralLedgerTransactionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.GeneralLedgerTransactionsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.GeneralLedgerTransactions.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/general-ledger-transactions/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/generalledgertransactions/client.go b/accounting/generalledgertransactions/client.go index 3573b3e..a96a445 100644 --- a/accounting/generalledgertransactions/client.go +++ b/accounting/generalledgertransactions/client.go @@ -4,7 +4,6 @@ package generalledgertransactions import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.GeneralLedgerTransactionsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.GeneralLedgerTransaction], error) { +) (*core.Page[*string, *accounting.GeneralLedgerTransaction], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedGeneralLedgerTransactionList) *internal.PageResponse[*string, *accounting.GeneralLedgerTransaction] { + readPageResponse := func(response *accounting.PaginatedGeneralLedgerTransactionList) *core.PageResponse[*string, *accounting.GeneralLedgerTransaction] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.GeneralLedgerTransaction]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.GeneralLedgerTransaction]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.GeneralLedgerTransactionsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.GeneralLedgerTransaction, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/general-ledger-transactions/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.GeneralLedgerTransaction - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/generalledgertransactions/raw_client.go b/accounting/generalledgertransactions/raw_client.go new file mode 100644 index 0000000..424bd7d --- /dev/null +++ b/accounting/generalledgertransactions/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package generalledgertransactions + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.GeneralLedgerTransactionsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.GeneralLedgerTransaction], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/general-ledger-transactions/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.GeneralLedgerTransaction + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.GeneralLedgerTransaction]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/generate_key.go b/accounting/generate_key.go index 3fe53f4..fc128a7 100644 --- a/accounting/generate_key.go +++ b/accounting/generate_key.go @@ -2,7 +2,32 @@ package accounting +import ( + big "math/big" +) + +var ( + generateRemoteKeyRequestFieldName = big.NewInt(1 << 0) +) + type GenerateRemoteKeyRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GenerateRemoteKeyRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GenerateRemoteKeyRequest) SetName(name string) { + g.Name = name + g.require(generateRemoteKeyRequestFieldName) } diff --git a/accounting/generatekey/accounting_generate_key_test/accounting_generate_key_test.go b/accounting/generatekey/accounting_generate_key_test/accounting_generate_key_test.go new file mode 100644 index 0000000..da8587c --- /dev/null +++ b/accounting/generatekey/accounting_generate_key_test/accounting_generate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_generate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingGenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Accounting.GenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/generate-key", nil, 1) +} diff --git a/accounting/generatekey/client.go b/accounting/generatekey/client.go index 512026b..ae21cff 100644 --- a/accounting/generatekey/client.go +++ b/accounting/generatekey/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *accounting.GenerateRemoteKeyRequest, opts ...option.RequestOption, ) (*accounting.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/generate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/generatekey/raw_client.go b/accounting/generatekey/raw_client.go new file mode 100644 index 0000000..2c59cac --- /dev/null +++ b/accounting/generatekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package generatekey + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.GenerateRemoteKeyRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/generate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/income_statements.go b/accounting/income_statements.go index eb5daaa..bb1fd69 100644 --- a/accounting/income_statements.go +++ b/accounting/income_statements.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + incomeStatementsListRequestFieldCompanyId = big.NewInt(1 << 0) + incomeStatementsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + incomeStatementsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + incomeStatementsListRequestFieldCursor = big.NewInt(1 << 3) + incomeStatementsListRequestFieldExpand = big.NewInt(1 << 4) + incomeStatementsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + incomeStatementsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + incomeStatementsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + incomeStatementsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + incomeStatementsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + incomeStatementsListRequestFieldPageSize = big.NewInt(1 << 10) + incomeStatementsListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type IncomeStatementsListRequest struct { // If provided, will only return income statements for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -34,8 +50,108 @@ type IncomeStatementsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *IncomeStatementsListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetCompanyId(companyId *string) { + i.CompanyId = companyId + i.require(incomeStatementsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetCreatedAfter(createdAfter *time.Time) { + i.CreatedAfter = createdAfter + i.require(incomeStatementsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetCreatedBefore(createdBefore *time.Time) { + i.CreatedBefore = createdBefore + i.require(incomeStatementsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(incomeStatementsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetExpand(expand []*string) { + i.Expand = expand + i.require(incomeStatementsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + i.IncludeDeletedData = includeDeletedData + i.require(incomeStatementsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(incomeStatementsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(incomeStatementsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + i.ModifiedAfter = modifiedAfter + i.require(incomeStatementsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + i.ModifiedBefore = modifiedBefore + i.require(incomeStatementsListRequestFieldModifiedBefore) } +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(incomeStatementsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsListRequest) SetRemoteId(remoteId *string) { + i.RemoteId = remoteId + i.require(incomeStatementsListRequestFieldRemoteId) +} + +var ( + incomeStatementsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + incomeStatementsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + incomeStatementsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type IncomeStatementsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -43,6 +159,37 @@ type IncomeStatementsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *IncomeStatementsRetrieveRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsRetrieveRequest) SetExpand(expand []*string) { + i.Expand = expand + i.require(incomeStatementsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(incomeStatementsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatementsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(incomeStatementsRetrieveRequestFieldIncludeShellData) } // # The IncomeStatement Object @@ -51,6 +198,28 @@ type IncomeStatementsRetrieveRequest struct { // // ### Usage Example // Fetch from the `GET IncomeStatement` endpoint and view a company's income statement for a given period. +var ( + incomeStatementFieldId = big.NewInt(1 << 0) + incomeStatementFieldRemoteId = big.NewInt(1 << 1) + incomeStatementFieldCreatedAt = big.NewInt(1 << 2) + incomeStatementFieldModifiedAt = big.NewInt(1 << 3) + incomeStatementFieldName = big.NewInt(1 << 4) + incomeStatementFieldCurrency = big.NewInt(1 << 5) + incomeStatementFieldCompany = big.NewInt(1 << 6) + incomeStatementFieldStartPeriod = big.NewInt(1 << 7) + incomeStatementFieldEndPeriod = big.NewInt(1 << 8) + incomeStatementFieldIncome = big.NewInt(1 << 9) + incomeStatementFieldCostOfSales = big.NewInt(1 << 10) + incomeStatementFieldGrossProfit = big.NewInt(1 << 11) + incomeStatementFieldOperatingExpenses = big.NewInt(1 << 12) + incomeStatementFieldNetOperatingIncome = big.NewInt(1 << 13) + incomeStatementFieldNonOperatingExpenses = big.NewInt(1 << 14) + incomeStatementFieldNetIncome = big.NewInt(1 << 15) + incomeStatementFieldRemoteWasDeleted = big.NewInt(1 << 16) + incomeStatementFieldFieldMappings = big.NewInt(1 << 17) + incomeStatementFieldRemoteData = big.NewInt(1 << 18) +) + type IncomeStatement struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -391,6 +560,9 @@ type IncomeStatement struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -532,6 +704,146 @@ func (i *IncomeStatement) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *IncomeStatement) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetId(id *string) { + i.Id = id + i.require(incomeStatementFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetRemoteId(remoteId *string) { + i.RemoteId = remoteId + i.require(incomeStatementFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetCreatedAt(createdAt *time.Time) { + i.CreatedAt = createdAt + i.require(incomeStatementFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetModifiedAt(modifiedAt *time.Time) { + i.ModifiedAt = modifiedAt + i.require(incomeStatementFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetName(name *string) { + i.Name = name + i.require(incomeStatementFieldName) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetCurrency(currency *IncomeStatementCurrency) { + i.Currency = currency + i.require(incomeStatementFieldCurrency) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetCompany(company *IncomeStatementCompany) { + i.Company = company + i.require(incomeStatementFieldCompany) +} + +// SetStartPeriod sets the StartPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetStartPeriod(startPeriod *time.Time) { + i.StartPeriod = startPeriod + i.require(incomeStatementFieldStartPeriod) +} + +// SetEndPeriod sets the EndPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetEndPeriod(endPeriod *time.Time) { + i.EndPeriod = endPeriod + i.require(incomeStatementFieldEndPeriod) +} + +// SetIncome sets the Income field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetIncome(income []*ReportItem) { + i.Income = income + i.require(incomeStatementFieldIncome) +} + +// SetCostOfSales sets the CostOfSales field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetCostOfSales(costOfSales []*ReportItem) { + i.CostOfSales = costOfSales + i.require(incomeStatementFieldCostOfSales) +} + +// SetGrossProfit sets the GrossProfit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetGrossProfit(grossProfit *float64) { + i.GrossProfit = grossProfit + i.require(incomeStatementFieldGrossProfit) +} + +// SetOperatingExpenses sets the OperatingExpenses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetOperatingExpenses(operatingExpenses []*ReportItem) { + i.OperatingExpenses = operatingExpenses + i.require(incomeStatementFieldOperatingExpenses) +} + +// SetNetOperatingIncome sets the NetOperatingIncome field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetNetOperatingIncome(netOperatingIncome *float64) { + i.NetOperatingIncome = netOperatingIncome + i.require(incomeStatementFieldNetOperatingIncome) +} + +// SetNonOperatingExpenses sets the NonOperatingExpenses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetNonOperatingExpenses(nonOperatingExpenses []*ReportItem) { + i.NonOperatingExpenses = nonOperatingExpenses + i.require(incomeStatementFieldNonOperatingExpenses) +} + +// SetNetIncome sets the NetIncome field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetNetIncome(netIncome *float64) { + i.NetIncome = netIncome + i.require(incomeStatementFieldNetIncome) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetRemoteWasDeleted(remoteWasDeleted *bool) { + i.RemoteWasDeleted = remoteWasDeleted + i.require(incomeStatementFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetFieldMappings(fieldMappings map[string]interface{}) { + i.FieldMappings = fieldMappings + i.require(incomeStatementFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IncomeStatement) SetRemoteData(remoteData []*RemoteData) { + i.RemoteData = remoteData + i.require(incomeStatementFieldRemoteData) +} + func (i *IncomeStatement) UnmarshalJSON(data []byte) error { type embed IncomeStatement var unmarshaler = struct { @@ -575,7 +887,8 @@ func (i *IncomeStatement) MarshalJSON() ([]byte, error) { StartPeriod: internal.NewOptionalDateTime(i.StartPeriod), EndPeriod: internal.NewOptionalDateTime(i.EndPeriod), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *IncomeStatement) String() string { @@ -1023,11 +1336,20 @@ func (i *IncomeStatementCurrency) Accept(visitor IncomeStatementCurrencyVisitor) return fmt.Errorf("type %T does not include a non-empty union type", i) } +var ( + paginatedIncomeStatementListFieldNext = big.NewInt(1 << 0) + paginatedIncomeStatementListFieldPrevious = big.NewInt(1 << 1) + paginatedIncomeStatementListFieldResults = big.NewInt(1 << 2) +) + type PaginatedIncomeStatementList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*IncomeStatement `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1057,6 +1379,34 @@ func (p *PaginatedIncomeStatementList) GetExtraProperties() map[string]interface return p.extraProperties } +func (p *PaginatedIncomeStatementList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIncomeStatementList) SetNext(next *string) { + p.Next = next + p.require(paginatedIncomeStatementListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIncomeStatementList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedIncomeStatementListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIncomeStatementList) SetResults(results []*IncomeStatement) { + p.Results = results + p.require(paginatedIncomeStatementListFieldResults) +} + func (p *PaginatedIncomeStatementList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedIncomeStatementList var value unmarshaler @@ -1073,6 +1423,17 @@ func (p *PaginatedIncomeStatementList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedIncomeStatementList) MarshalJSON() ([]byte, error) { + type embed PaginatedIncomeStatementList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedIncomeStatementList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/incomestatements/accounting_income_statements_test/accounting_income_statements_test.go b/accounting/incomestatements/accounting_income_statements_test/accounting_income_statements_test.go new file mode 100644 index 0000000..4a4b71e --- /dev/null +++ b/accounting/incomestatements/accounting_income_statements_test/accounting_income_statements_test.go @@ -0,0 +1,153 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_income_statements_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingIncomeStatementsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.IncomeStatementsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.IncomeStatements.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/income-statements", map[string]string{"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"}, 1) +} + +func TestAccountingIncomeStatementsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.IncomeStatementsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.IncomeStatements.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/income-statements/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/incomestatements/client.go b/accounting/incomestatements/client.go index 1b7d66d..828d6a3 100644 --- a/accounting/incomestatements/client.go +++ b/accounting/incomestatements/client.go @@ -4,7 +4,6 @@ package incomestatements import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.IncomeStatementsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.IncomeStatement], error) { +) (*core.Page[*string, *accounting.IncomeStatement], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedIncomeStatementList) *internal.PageResponse[*string, *accounting.IncomeStatement] { + readPageResponse := func(response *accounting.PaginatedIncomeStatementList) *core.PageResponse[*string, *accounting.IncomeStatement] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.IncomeStatement]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.IncomeStatement]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.IncomeStatementsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.IncomeStatement, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/income-statements/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.IncomeStatement - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/incomestatements/raw_client.go b/accounting/incomestatements/raw_client.go new file mode 100644 index 0000000..57f26af --- /dev/null +++ b/accounting/incomestatements/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package incomestatements + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.IncomeStatementsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.IncomeStatement], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/income-statements/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.IncomeStatement + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.IncomeStatement]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/invoices.go b/accounting/invoices.go index b7431c2..4c0c955 100644 --- a/accounting/invoices.go +++ b/accounting/invoices.go @@ -6,17 +6,65 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + invoiceEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + invoiceEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + invoiceEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type InvoiceEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *InvoiceRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *InvoiceEndpointRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + i.IsDebugMode = isDebugMode + i.require(invoiceEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceEndpointRequest) SetRunAsync(runAsync *bool) { + i.RunAsync = runAsync + i.require(invoiceEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceEndpointRequest) SetModel(model *InvoiceRequest) { + i.Model = model + i.require(invoiceEndpointRequestFieldModel) } +var ( + invoicesLineItemsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + invoicesLineItemsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + invoicesLineItemsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + invoicesLineItemsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + invoicesLineItemsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + invoicesLineItemsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + invoicesLineItemsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type InvoicesLineItemsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -32,8 +80,91 @@ type InvoicesLineItemsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *InvoicesLineItemsRemoteFieldClassesListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) } +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesLineItemsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(invoicesLineItemsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesLineItemsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + i.IncludeDeletedData = includeDeletedData + i.require(invoicesLineItemsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesLineItemsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(invoicesLineItemsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesLineItemsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(invoicesLineItemsRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesLineItemsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + i.IsCommonModelField = isCommonModelField + i.require(invoicesLineItemsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesLineItemsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + i.IsCustom = isCustom + i.require(invoicesLineItemsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesLineItemsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(invoicesLineItemsRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + invoicesListRequestFieldCompanyId = big.NewInt(1 << 0) + invoicesListRequestFieldContactId = big.NewInt(1 << 1) + invoicesListRequestFieldCreatedAfter = big.NewInt(1 << 2) + invoicesListRequestFieldCreatedBefore = big.NewInt(1 << 3) + invoicesListRequestFieldCursor = big.NewInt(1 << 4) + invoicesListRequestFieldExpand = big.NewInt(1 << 5) + invoicesListRequestFieldIncludeDeletedData = big.NewInt(1 << 6) + invoicesListRequestFieldIncludeRemoteData = big.NewInt(1 << 7) + invoicesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 8) + invoicesListRequestFieldIncludeShellData = big.NewInt(1 << 9) + invoicesListRequestFieldIssueDateAfter = big.NewInt(1 << 10) + invoicesListRequestFieldIssueDateBefore = big.NewInt(1 << 11) + invoicesListRequestFieldModifiedAfter = big.NewInt(1 << 12) + invoicesListRequestFieldModifiedBefore = big.NewInt(1 << 13) + invoicesListRequestFieldNumber = big.NewInt(1 << 14) + invoicesListRequestFieldPageSize = big.NewInt(1 << 15) + invoicesListRequestFieldRemoteFields = big.NewInt(1 << 16) + invoicesListRequestFieldRemoteId = big.NewInt(1 << 17) + invoicesListRequestFieldShowEnumOrigins = big.NewInt(1 << 18) + invoicesListRequestFieldStatus = big.NewInt(1 << 19) + invoicesListRequestFieldType = big.NewInt(1 << 20) +) + type InvoicesListRequest struct { // If provided, will only return invoices for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -87,16 +218,220 @@ type InvoicesListRequest struct { // * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE // * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE Type *InvoicesListRequestType `json:"-" url:"type,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *InvoicesListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetCompanyId(companyId *string) { + i.CompanyId = companyId + i.require(invoicesListRequestFieldCompanyId) +} + +// SetContactId sets the ContactId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetContactId(contactId *string) { + i.ContactId = contactId + i.require(invoicesListRequestFieldContactId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetCreatedAfter(createdAfter *time.Time) { + i.CreatedAfter = createdAfter + i.require(invoicesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetCreatedBefore(createdBefore *time.Time) { + i.CreatedBefore = createdBefore + i.require(invoicesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(invoicesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetExpand(expand []*InvoicesListRequestExpandItem) { + i.Expand = expand + i.require(invoicesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + i.IncludeDeletedData = includeDeletedData + i.require(invoicesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(invoicesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + i.IncludeRemoteFields = includeRemoteFields + i.require(invoicesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(invoicesListRequestFieldIncludeShellData) +} + +// SetIssueDateAfter sets the IssueDateAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetIssueDateAfter(issueDateAfter *time.Time) { + i.IssueDateAfter = issueDateAfter + i.require(invoicesListRequestFieldIssueDateAfter) +} + +// SetIssueDateBefore sets the IssueDateBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetIssueDateBefore(issueDateBefore *time.Time) { + i.IssueDateBefore = issueDateBefore + i.require(invoicesListRequestFieldIssueDateBefore) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + i.ModifiedAfter = modifiedAfter + i.require(invoicesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + i.ModifiedBefore = modifiedBefore + i.require(invoicesListRequestFieldModifiedBefore) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetNumber(number *string) { + i.Number = number + i.require(invoicesListRequestFieldNumber) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(invoicesListRequestFieldPageSize) } +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetRemoteFields(remoteFields *string) { + i.RemoteFields = remoteFields + i.require(invoicesListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetRemoteId(remoteId *string) { + i.RemoteId = remoteId + i.require(invoicesListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + i.ShowEnumOrigins = showEnumOrigins + i.require(invoicesListRequestFieldShowEnumOrigins) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetStatus(status *InvoicesListRequestStatus) { + i.Status = status + i.require(invoicesListRequestFieldStatus) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesListRequest) SetType(type_ *InvoicesListRequestType) { + i.Type = type_ + i.require(invoicesListRequestFieldType) +} + +var ( + patchedInvoiceEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedInvoiceEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedInvoiceEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PatchedInvoiceEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *InvoiceRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedInvoiceEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedInvoiceEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedInvoiceEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedInvoiceEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedInvoiceEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedInvoiceEndpointRequest) SetModel(model *InvoiceRequest) { + p.Model = model + p.require(patchedInvoiceEndpointRequestFieldModel) +} + +var ( + invoicesRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + invoicesRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + invoicesRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + invoicesRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + invoicesRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + invoicesRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + invoicesRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type InvoicesRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -112,8 +447,76 @@ type InvoicesRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (i *InvoicesRemoteFieldClassesListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRemoteFieldClassesListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(invoicesRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + i.IncludeDeletedData = includeDeletedData + i.require(invoicesRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(invoicesRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(invoicesRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + i.IsCommonModelField = isCommonModelField + i.require(invoicesRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + i.IsCustom = isCustom + i.require(invoicesRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(invoicesRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + invoicesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + invoicesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + invoicesRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + invoicesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) + invoicesRetrieveRequestFieldRemoteFields = big.NewInt(1 << 4) + invoicesRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 5) +) + type InvoicesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*InvoicesRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -127,6 +530,58 @@ type InvoicesRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *InvoicesRetrieveRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRetrieveRequest) SetExpand(expand []*InvoicesRetrieveRequestExpandItem) { + i.Expand = expand + i.require(invoicesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(invoicesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + i.IncludeRemoteFields = includeRemoteFields + i.require(invoicesRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(invoicesRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRetrieveRequest) SetRemoteFields(remoteFields *string) { + i.RemoteFields = remoteFields + i.require(invoicesRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoicesRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + i.ShowEnumOrigins = showEnumOrigins + i.require(invoicesRetrieveRequestFieldShowEnumOrigins) } type InvoicesListRequestExpandItem string @@ -295,6 +750,28 @@ func (i InvoicesRetrieveRequestExpandItem) Ptr() *InvoicesRetrieveRequestExpandI // // ### Usage Example // Fetch from the `GET Invoice` endpoint and view the invoice's line items. +var ( + invoiceLineItemRequestFieldRemoteId = big.NewInt(1 << 0) + invoiceLineItemRequestFieldDescription = big.NewInt(1 << 1) + invoiceLineItemRequestFieldUnitPrice = big.NewInt(1 << 2) + invoiceLineItemRequestFieldQuantity = big.NewInt(1 << 3) + invoiceLineItemRequestFieldTotalAmount = big.NewInt(1 << 4) + invoiceLineItemRequestFieldEmployee = big.NewInt(1 << 5) + invoiceLineItemRequestFieldProject = big.NewInt(1 << 6) + invoiceLineItemRequestFieldContact = big.NewInt(1 << 7) + invoiceLineItemRequestFieldCurrency = big.NewInt(1 << 8) + invoiceLineItemRequestFieldExchangeRate = big.NewInt(1 << 9) + invoiceLineItemRequestFieldItem = big.NewInt(1 << 10) + invoiceLineItemRequestFieldAccount = big.NewInt(1 << 11) + invoiceLineItemRequestFieldTaxRate = big.NewInt(1 << 12) + invoiceLineItemRequestFieldTrackingCategory = big.NewInt(1 << 13) + invoiceLineItemRequestFieldTrackingCategories = big.NewInt(1 << 14) + invoiceLineItemRequestFieldCompany = big.NewInt(1 << 15) + invoiceLineItemRequestFieldIntegrationParams = big.NewInt(1 << 16) + invoiceLineItemRequestFieldLinkedAccountParams = big.NewInt(1 << 17) + invoiceLineItemRequestFieldRemoteFields = big.NewInt(1 << 18) +) + type InvoiceLineItemRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -635,6 +1112,9 @@ type InvoiceLineItemRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -776,6 +1256,146 @@ func (i *InvoiceLineItemRequest) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *InvoiceLineItemRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetRemoteId(remoteId *string) { + i.RemoteId = remoteId + i.require(invoiceLineItemRequestFieldRemoteId) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetDescription(description *string) { + i.Description = description + i.require(invoiceLineItemRequestFieldDescription) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetUnitPrice(unitPrice *float64) { + i.UnitPrice = unitPrice + i.require(invoiceLineItemRequestFieldUnitPrice) +} + +// SetQuantity sets the Quantity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetQuantity(quantity *float64) { + i.Quantity = quantity + i.require(invoiceLineItemRequestFieldQuantity) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetTotalAmount(totalAmount *float64) { + i.TotalAmount = totalAmount + i.require(invoiceLineItemRequestFieldTotalAmount) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetEmployee(employee *InvoiceLineItemRequestEmployee) { + i.Employee = employee + i.require(invoiceLineItemRequestFieldEmployee) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetProject(project *InvoiceLineItemRequestProject) { + i.Project = project + i.require(invoiceLineItemRequestFieldProject) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetContact(contact *InvoiceLineItemRequestContact) { + i.Contact = contact + i.require(invoiceLineItemRequestFieldContact) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetCurrency(currency *InvoiceLineItemRequestCurrency) { + i.Currency = currency + i.require(invoiceLineItemRequestFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetExchangeRate(exchangeRate *string) { + i.ExchangeRate = exchangeRate + i.require(invoiceLineItemRequestFieldExchangeRate) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetItem(item *InvoiceLineItemRequestItem) { + i.Item = item + i.require(invoiceLineItemRequestFieldItem) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetAccount(account *InvoiceLineItemRequestAccount) { + i.Account = account + i.require(invoiceLineItemRequestFieldAccount) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetTaxRate(taxRate *string) { + i.TaxRate = taxRate + i.require(invoiceLineItemRequestFieldTaxRate) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetTrackingCategory(trackingCategory *InvoiceLineItemRequestTrackingCategory) { + i.TrackingCategory = trackingCategory + i.require(invoiceLineItemRequestFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetTrackingCategories(trackingCategories []*InvoiceLineItemRequestTrackingCategoriesItem) { + i.TrackingCategories = trackingCategories + i.require(invoiceLineItemRequestFieldTrackingCategories) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetCompany(company *string) { + i.Company = company + i.require(invoiceLineItemRequestFieldCompany) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + i.IntegrationParams = integrationParams + i.require(invoiceLineItemRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + i.LinkedAccountParams = linkedAccountParams + i.require(invoiceLineItemRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItemRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + i.RemoteFields = remoteFields + i.require(invoiceLineItemRequestFieldRemoteFields) +} + func (i *InvoiceLineItemRequest) UnmarshalJSON(data []byte) error { type unmarshaler InvoiceLineItemRequest var value unmarshaler @@ -792,6 +1412,17 @@ func (i *InvoiceLineItemRequest) UnmarshalJSON(data []byte) error { return nil } +func (i *InvoiceLineItemRequest) MarshalJSON() ([]byte, error) { + type embed InvoiceLineItemRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *InvoiceLineItemRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -1618,6 +2249,35 @@ func (i *InvoiceLineItemRequestTrackingCategory) Accept(visitor InvoiceLineItemR // // ### Usage Example // Fetch from the `LIST Invoices` endpoint and view a company's invoices. +var ( + invoiceRequestFieldType = big.NewInt(1 << 0) + invoiceRequestFieldContact = big.NewInt(1 << 1) + invoiceRequestFieldNumber = big.NewInt(1 << 2) + invoiceRequestFieldIssueDate = big.NewInt(1 << 3) + invoiceRequestFieldDueDate = big.NewInt(1 << 4) + invoiceRequestFieldPaidOnDate = big.NewInt(1 << 5) + invoiceRequestFieldEmployee = big.NewInt(1 << 6) + invoiceRequestFieldMemo = big.NewInt(1 << 7) + invoiceRequestFieldStatus = big.NewInt(1 << 8) + invoiceRequestFieldCompany = big.NewInt(1 << 9) + invoiceRequestFieldCurrency = big.NewInt(1 << 10) + invoiceRequestFieldExchangeRate = big.NewInt(1 << 11) + invoiceRequestFieldTotalDiscount = big.NewInt(1 << 12) + invoiceRequestFieldSubTotal = big.NewInt(1 << 13) + invoiceRequestFieldPaymentTerm = big.NewInt(1 << 14) + invoiceRequestFieldTotalTaxAmount = big.NewInt(1 << 15) + invoiceRequestFieldInclusiveOfTax = big.NewInt(1 << 16) + invoiceRequestFieldTotalAmount = big.NewInt(1 << 17) + invoiceRequestFieldBalance = big.NewInt(1 << 18) + invoiceRequestFieldPayments = big.NewInt(1 << 19) + invoiceRequestFieldTrackingCategories = big.NewInt(1 << 20) + invoiceRequestFieldLineItems = big.NewInt(1 << 21) + invoiceRequestFieldPurchaseOrders = big.NewInt(1 << 22) + invoiceRequestFieldIntegrationParams = big.NewInt(1 << 23) + invoiceRequestFieldLinkedAccountParams = big.NewInt(1 << 24) + invoiceRequestFieldRemoteFields = big.NewInt(1 << 25) +) + type InvoiceRequest struct { // 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. // @@ -1983,6 +2643,9 @@ type InvoiceRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2173,6 +2836,195 @@ func (i *InvoiceRequest) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *InvoiceRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetType(type_ *InvoiceRequestType) { + i.Type = type_ + i.require(invoiceRequestFieldType) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetContact(contact *InvoiceRequestContact) { + i.Contact = contact + i.require(invoiceRequestFieldContact) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetNumber(number *string) { + i.Number = number + i.require(invoiceRequestFieldNumber) +} + +// SetIssueDate sets the IssueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetIssueDate(issueDate *time.Time) { + i.IssueDate = issueDate + i.require(invoiceRequestFieldIssueDate) +} + +// SetDueDate sets the DueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetDueDate(dueDate *time.Time) { + i.DueDate = dueDate + i.require(invoiceRequestFieldDueDate) +} + +// SetPaidOnDate sets the PaidOnDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetPaidOnDate(paidOnDate *time.Time) { + i.PaidOnDate = paidOnDate + i.require(invoiceRequestFieldPaidOnDate) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetEmployee(employee *InvoiceRequestEmployee) { + i.Employee = employee + i.require(invoiceRequestFieldEmployee) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetMemo(memo *string) { + i.Memo = memo + i.require(invoiceRequestFieldMemo) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetStatus(status *InvoiceRequestStatus) { + i.Status = status + i.require(invoiceRequestFieldStatus) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetCompany(company *InvoiceRequestCompany) { + i.Company = company + i.require(invoiceRequestFieldCompany) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetCurrency(currency *InvoiceRequestCurrency) { + i.Currency = currency + i.require(invoiceRequestFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetExchangeRate(exchangeRate *string) { + i.ExchangeRate = exchangeRate + i.require(invoiceRequestFieldExchangeRate) +} + +// SetTotalDiscount sets the TotalDiscount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetTotalDiscount(totalDiscount *float64) { + i.TotalDiscount = totalDiscount + i.require(invoiceRequestFieldTotalDiscount) +} + +// SetSubTotal sets the SubTotal field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetSubTotal(subTotal *float64) { + i.SubTotal = subTotal + i.require(invoiceRequestFieldSubTotal) +} + +// SetPaymentTerm sets the PaymentTerm field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetPaymentTerm(paymentTerm *InvoiceRequestPaymentTerm) { + i.PaymentTerm = paymentTerm + i.require(invoiceRequestFieldPaymentTerm) +} + +// SetTotalTaxAmount sets the TotalTaxAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetTotalTaxAmount(totalTaxAmount *float64) { + i.TotalTaxAmount = totalTaxAmount + i.require(invoiceRequestFieldTotalTaxAmount) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetInclusiveOfTax(inclusiveOfTax *bool) { + i.InclusiveOfTax = inclusiveOfTax + i.require(invoiceRequestFieldInclusiveOfTax) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetTotalAmount(totalAmount *float64) { + i.TotalAmount = totalAmount + i.require(invoiceRequestFieldTotalAmount) +} + +// SetBalance sets the Balance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetBalance(balance *float64) { + i.Balance = balance + i.require(invoiceRequestFieldBalance) +} + +// SetPayments sets the Payments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetPayments(payments []*InvoiceRequestPaymentsItem) { + i.Payments = payments + i.require(invoiceRequestFieldPayments) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetTrackingCategories(trackingCategories []*InvoiceRequestTrackingCategoriesItem) { + i.TrackingCategories = trackingCategories + i.require(invoiceRequestFieldTrackingCategories) +} + +// SetLineItems sets the LineItems field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetLineItems(lineItems []*InvoiceLineItemRequest) { + i.LineItems = lineItems + i.require(invoiceRequestFieldLineItems) +} + +// SetPurchaseOrders sets the PurchaseOrders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetPurchaseOrders(purchaseOrders []*InvoiceRequestPurchaseOrdersItem) { + i.PurchaseOrders = purchaseOrders + i.require(invoiceRequestFieldPurchaseOrders) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + i.IntegrationParams = integrationParams + i.require(invoiceRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + i.LinkedAccountParams = linkedAccountParams + i.require(invoiceRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + i.RemoteFields = remoteFields + i.require(invoiceRequestFieldRemoteFields) +} + func (i *InvoiceRequest) UnmarshalJSON(data []byte) error { type embed InvoiceRequest var unmarshaler = struct { @@ -2212,7 +3064,8 @@ func (i *InvoiceRequest) MarshalJSON() ([]byte, error) { DueDate: internal.NewOptionalDateTime(i.DueDate), PaidOnDate: internal.NewOptionalDateTime(i.PaidOnDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *InvoiceRequest) String() string { @@ -3171,12 +4024,22 @@ func (i *InvoiceRequestType) Accept(visitor InvoiceRequestTypeVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", i) } +var ( + invoiceResponseFieldModel = big.NewInt(1 << 0) + invoiceResponseFieldWarnings = big.NewInt(1 << 1) + invoiceResponseFieldErrors = big.NewInt(1 << 2) + invoiceResponseFieldLogs = big.NewInt(1 << 3) +) + type InvoiceResponse struct { Model *Invoice `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3213,6 +4076,41 @@ func (i *InvoiceResponse) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *InvoiceResponse) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceResponse) SetModel(model *Invoice) { + i.Model = model + i.require(invoiceResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceResponse) SetWarnings(warnings []*WarningValidationProblem) { + i.Warnings = warnings + i.require(invoiceResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceResponse) SetErrors(errors []*ErrorValidationProblem) { + i.Errors = errors + i.require(invoiceResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceResponse) SetLogs(logs []*DebugModeLog) { + i.Logs = logs + i.require(invoiceResponseFieldLogs) +} + func (i *InvoiceResponse) UnmarshalJSON(data []byte) error { type unmarshaler InvoiceResponse var value unmarshaler @@ -3229,6 +4127,17 @@ func (i *InvoiceResponse) UnmarshalJSON(data []byte) error { return nil } +func (i *InvoiceResponse) MarshalJSON() ([]byte, error) { + type embed InvoiceResponse + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *InvoiceResponse) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -3241,11 +4150,20 @@ func (i *InvoiceResponse) String() string { return fmt.Sprintf("%#v", i) } +var ( + paginatedInvoiceListFieldNext = big.NewInt(1 << 0) + paginatedInvoiceListFieldPrevious = big.NewInt(1 << 1) + paginatedInvoiceListFieldResults = big.NewInt(1 << 2) +) + type PaginatedInvoiceList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Invoice `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3275,6 +4193,34 @@ func (p *PaginatedInvoiceList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedInvoiceList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedInvoiceList) SetNext(next *string) { + p.Next = next + p.require(paginatedInvoiceListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedInvoiceList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedInvoiceListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedInvoiceList) SetResults(results []*Invoice) { + p.Results = results + p.require(paginatedInvoiceListFieldResults) +} + func (p *PaginatedInvoiceList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedInvoiceList var value unmarshaler @@ -3291,6 +4237,17 @@ func (p *PaginatedInvoiceList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedInvoiceList) MarshalJSON() ([]byte, error) { + type embed PaginatedInvoiceList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedInvoiceList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/invoices/accounting_invoices_test/accounting_invoices_test.go b/accounting/invoices/accounting_invoices_test/accounting_invoices_test.go new file mode 100644 index 0000000..6d90dc0 --- /dev/null +++ b/accounting/invoices/accounting_invoices_test/accounting_invoices_test.go @@ -0,0 +1,355 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_invoices_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingInvoicesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.InvoicesListRequest{ + CompanyId: merge.String( + "company_id", + ), + ContactId: merge.String( + "contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IssueDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IssueDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Number: merge.String( + "number", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: accounting.InvoicesListRequestStatusDraft.Ptr(), + Type: accounting.InvoicesListRequestTypeAccountsPayable.Ptr(), + } + _, invocationErr := client.Accounting.Invoices.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/invoices", map[string]string{"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"}, 1) +} + +func TestAccountingInvoicesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.InvoiceEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.InvoiceRequest{}, + } + _, invocationErr := client.Accounting.Invoices.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/invoices", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingInvoicesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.InvoicesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Invoices.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/invoices/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true", "remote_fields": "type", "show_enum_origins": "type"}, 1) +} + +func TestAccountingInvoicesPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PatchedInvoiceEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.InvoiceRequest{}, + } + _, invocationErr := client.Accounting.Invoices.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/accounting/v1/invoices/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingInvoicesLineItemsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.InvoicesLineItemsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.Invoices.LineItemsRemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/invoices/line-items/remote-field-classes", map[string]string{"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"}, 1) +} + +func TestAccountingInvoicesMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Invoices.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/invoices/meta/patch/id", nil, 1) +} + +func TestAccountingInvoicesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Invoices.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/invoices/meta/post", nil, 1) +} + +func TestAccountingInvoicesRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.InvoicesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.Invoices.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/invoices/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/accounting/invoices/client.go b/accounting/invoices/client.go index f302cc9..fb7a6df 100644 --- a/accounting/invoices/client.go +++ b/accounting/invoices/client.go @@ -4,7 +4,6 @@ package invoices import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.InvoicesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.Invoice], error) { +) (*core.Page[*string, *accounting.Invoice], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedInvoiceList) *internal.PageResponse[*string, *accounting.Invoice] { + readPageResponse := func(response *accounting.PaginatedInvoiceList) *core.PageResponse[*string, *accounting.Invoice] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.Invoice]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.Invoice]{ Next: next, Results: results, Done: next == zeroValue, @@ -99,44 +99,15 @@ func (c *Client) Create( request *accounting.InvoiceEndpointRequest, opts ...option.RequestOption, ) (*accounting.InvoiceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/invoices" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.InvoiceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Invoice` object with the given `id`. @@ -146,45 +117,16 @@ func (c *Client) Retrieve( request *accounting.InvoicesRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Invoice, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/invoices/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Invoice - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates an `Invoice` object with the given `id`. @@ -194,47 +136,16 @@ func (c *Client) PartialUpdate( request *accounting.PatchedInvoiceEndpointRequest, opts ...option.RequestOption, ) (*accounting.InvoiceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/invoices/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.InvoiceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -242,7 +153,7 @@ func (c *Client) LineItemsRemoteFieldClassesList( ctx context.Context, request *accounting.InvoicesLineItemsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -255,13 +166,12 @@ func (c *Client) LineItemsRemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -278,11 +188,11 @@ func (c *Client) LineItemsRemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, @@ -302,38 +212,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/invoices/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `Invoice` POSTs. @@ -341,35 +228,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/invoices/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -377,7 +243,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *accounting.InvoicesRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -390,13 +256,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -413,11 +278,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/accounting/invoices/raw_client.go b/accounting/invoices/raw_client.go new file mode 100644 index 0000000..ca9537d --- /dev/null +++ b/accounting/invoices/raw_client.go @@ -0,0 +1,266 @@ +// Code generated by Fern. DO NOT EDIT. + +package invoices + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.InvoiceEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.InvoiceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/invoices" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.InvoiceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.InvoiceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.InvoicesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Invoice], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/invoices/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Invoice + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Invoice]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *accounting.PatchedInvoiceEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.InvoiceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/invoices/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.InvoiceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.InvoiceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/invoices/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/invoices/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/issues.go b/accounting/issues.go index 2d63926..aa32b9a 100644 --- a/accounting/issues.go +++ b/accounting/issues.go @@ -6,9 +6,27 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + issuesListRequestFieldAccountToken = big.NewInt(1 << 0) + issuesListRequestFieldCursor = big.NewInt(1 << 1) + issuesListRequestFieldEndDate = big.NewInt(1 << 2) + issuesListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + issuesListRequestFieldFirstIncidentTimeAfter = big.NewInt(1 << 4) + issuesListRequestFieldFirstIncidentTimeBefore = big.NewInt(1 << 5) + issuesListRequestFieldIncludeMuted = big.NewInt(1 << 6) + issuesListRequestFieldIntegrationName = big.NewInt(1 << 7) + issuesListRequestFieldLastIncidentTimeAfter = big.NewInt(1 << 8) + issuesListRequestFieldLastIncidentTimeBefore = big.NewInt(1 << 9) + issuesListRequestFieldLinkedAccountId = big.NewInt(1 << 10) + issuesListRequestFieldPageSize = big.NewInt(1 << 11) + issuesListRequestFieldStartDate = big.NewInt(1 << 12) + issuesListRequestFieldStatus = big.NewInt(1 << 13) +) + type IssuesListRequest struct { AccountToken *string `json:"-" url:"account_token,omitempty"` // The pagination cursor value. @@ -38,6 +56,114 @@ type IssuesListRequest struct { // * `ONGOING` - ONGOING // * `RESOLVED` - RESOLVED Status *IssuesListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *IssuesListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetAccountToken(accountToken *string) { + i.AccountToken = accountToken + i.require(issuesListRequestFieldAccountToken) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(issuesListRequestFieldCursor) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndDate(endDate *string) { + i.EndDate = endDate + i.require(issuesListRequestFieldEndDate) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + i.EndUserOrganizationName = endUserOrganizationName + i.require(issuesListRequestFieldEndUserOrganizationName) +} + +// SetFirstIncidentTimeAfter sets the FirstIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeAfter(firstIncidentTimeAfter *time.Time) { + i.FirstIncidentTimeAfter = firstIncidentTimeAfter + i.require(issuesListRequestFieldFirstIncidentTimeAfter) +} + +// SetFirstIncidentTimeBefore sets the FirstIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeBefore(firstIncidentTimeBefore *time.Time) { + i.FirstIncidentTimeBefore = firstIncidentTimeBefore + i.require(issuesListRequestFieldFirstIncidentTimeBefore) +} + +// SetIncludeMuted sets the IncludeMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIncludeMuted(includeMuted *string) { + i.IncludeMuted = includeMuted + i.require(issuesListRequestFieldIncludeMuted) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIntegrationName(integrationName *string) { + i.IntegrationName = integrationName + i.require(issuesListRequestFieldIntegrationName) +} + +// SetLastIncidentTimeAfter sets the LastIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeAfter(lastIncidentTimeAfter *time.Time) { + i.LastIncidentTimeAfter = lastIncidentTimeAfter + i.require(issuesListRequestFieldLastIncidentTimeAfter) +} + +// SetLastIncidentTimeBefore sets the LastIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeBefore(lastIncidentTimeBefore *time.Time) { + i.LastIncidentTimeBefore = lastIncidentTimeBefore + i.require(issuesListRequestFieldLastIncidentTimeBefore) +} + +// SetLinkedAccountId sets the LinkedAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLinkedAccountId(linkedAccountId *string) { + i.LinkedAccountId = linkedAccountId + i.require(issuesListRequestFieldLinkedAccountId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(issuesListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStartDate(startDate *string) { + i.StartDate = startDate + i.require(issuesListRequestFieldStartDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStatus(status *IssuesListRequestStatus) { + i.Status = status + i.require(issuesListRequestFieldStatus) } type IssuesListRequestStatus string @@ -62,6 +188,17 @@ func (i IssuesListRequestStatus) Ptr() *IssuesListRequestStatus { return &i } +var ( + issueFieldId = big.NewInt(1 << 0) + issueFieldStatus = big.NewInt(1 << 1) + issueFieldErrorDescription = big.NewInt(1 << 2) + issueFieldEndUser = big.NewInt(1 << 3) + issueFieldFirstIncidentTime = big.NewInt(1 << 4) + issueFieldLastIncidentTime = big.NewInt(1 << 5) + issueFieldIsMuted = big.NewInt(1 << 6) + issueFieldErrorDetails = big.NewInt(1 << 7) +) + type Issue struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -76,6 +213,9 @@ type Issue struct { IsMuted *bool `json:"is_muted,omitempty" url:"is_muted,omitempty"` ErrorDetails []string `json:"error_details,omitempty" url:"error_details,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +280,69 @@ func (i *Issue) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *Issue) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetId(id *string) { + i.Id = id + i.require(issueFieldId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetStatus(status *IssueStatus) { + i.Status = status + i.require(issueFieldStatus) +} + +// SetErrorDescription sets the ErrorDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDescription(errorDescription string) { + i.ErrorDescription = errorDescription + i.require(issueFieldErrorDescription) +} + +// SetEndUser sets the EndUser field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetEndUser(endUser map[string]interface{}) { + i.EndUser = endUser + i.require(issueFieldEndUser) +} + +// SetFirstIncidentTime sets the FirstIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetFirstIncidentTime(firstIncidentTime *time.Time) { + i.FirstIncidentTime = firstIncidentTime + i.require(issueFieldFirstIncidentTime) +} + +// SetLastIncidentTime sets the LastIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetLastIncidentTime(lastIncidentTime *time.Time) { + i.LastIncidentTime = lastIncidentTime + i.require(issueFieldLastIncidentTime) +} + +// SetIsMuted sets the IsMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetIsMuted(isMuted *bool) { + i.IsMuted = isMuted + i.require(issueFieldIsMuted) +} + +// SetErrorDetails sets the ErrorDetails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDetails(errorDetails []string) { + i.ErrorDetails = errorDetails + i.require(issueFieldErrorDetails) +} + func (i *Issue) UnmarshalJSON(data []byte) error { type embed Issue var unmarshaler = struct { @@ -175,7 +378,8 @@ func (i *Issue) MarshalJSON() ([]byte, error) { FirstIncidentTime: internal.NewOptionalDateTime(i.FirstIncidentTime), LastIncidentTime: internal.NewOptionalDateTime(i.LastIncidentTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *Issue) String() string { @@ -280,11 +484,20 @@ func (i IssueStatusEnum) Ptr() *IssueStatusEnum { return &i } +var ( + paginatedIssueListFieldNext = big.NewInt(1 << 0) + paginatedIssueListFieldPrevious = big.NewInt(1 << 1) + paginatedIssueListFieldResults = big.NewInt(1 << 2) +) + type PaginatedIssueList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Issue `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -314,6 +527,34 @@ func (p *PaginatedIssueList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedIssueList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetNext(next *string) { + p.Next = next + p.require(paginatedIssueListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedIssueListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetResults(results []*Issue) { + p.Results = results + p.require(paginatedIssueListFieldResults) +} + func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedIssueList var value unmarshaler @@ -330,6 +571,17 @@ func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedIssueList) MarshalJSON() ([]byte, error) { + type embed PaginatedIssueList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedIssueList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/issues/accounting_issues_test/accounting_issues_test.go b/accounting/issues/accounting_issues_test/accounting_issues_test.go new file mode 100644 index 0000000..10bdd98 --- /dev/null +++ b/accounting/issues/accounting_issues_test/accounting_issues_test.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_issues_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingIssuesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: accounting.IssuesListRequestStatusOngoing.Ptr(), + } + _, invocationErr := client.Accounting.Issues.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/issues", map[string]string{"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"}, 1) +} + +func TestAccountingIssuesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Issues.Retrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/issues/id", nil, 1) +} diff --git a/accounting/issues/client.go b/accounting/issues/client.go index 08d77fb..8079c0b 100644 --- a/accounting/issues/client.go +++ b/accounting/issues/client.go @@ -4,7 +4,6 @@ package issues import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.IssuesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.Issue], error) { +) (*core.Page[*string, *accounting.Issue], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedIssueList) *internal.PageResponse[*string, *accounting.Issue] { + readPageResponse := func(response *accounting.PaginatedIssueList) *core.PageResponse[*string, *accounting.Issue] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.Issue]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.Issue]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,36 +97,13 @@ func (c *Client) Retrieve( id string, opts ...option.RequestOption, ) (*accounting.Issue, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/issues/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Issue - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/issues/raw_client.go b/accounting/issues/raw_client.go new file mode 100644 index 0000000..4deeeac --- /dev/null +++ b/accounting/issues/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package issues + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*accounting.Issue], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/issues/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Issue + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Issue]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/items.go b/accounting/items.go index 4edab38..581a0b8 100644 --- a/accounting/items.go +++ b/accounting/items.go @@ -6,17 +6,72 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + itemEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + itemEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + itemEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type ItemEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *ItemRequestRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *ItemEndpointRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + i.IsDebugMode = isDebugMode + i.require(itemEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemEndpointRequest) SetRunAsync(runAsync *bool) { + i.RunAsync = runAsync + i.require(itemEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemEndpointRequest) SetModel(model *ItemRequestRequest) { + i.Model = model + i.require(itemEndpointRequestFieldModel) } +var ( + itemsListRequestFieldCompanyId = big.NewInt(1 << 0) + itemsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + itemsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + itemsListRequestFieldCursor = big.NewInt(1 << 3) + itemsListRequestFieldExpand = big.NewInt(1 << 4) + itemsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + itemsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + itemsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + itemsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + itemsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + itemsListRequestFieldPageSize = big.NewInt(1 << 10) + itemsListRequestFieldRemoteFields = big.NewInt(1 << 11) + itemsListRequestFieldRemoteId = big.NewInt(1 << 12) + itemsListRequestFieldShowEnumOrigins = big.NewInt(1 << 13) +) + type ItemsListRequest struct { // If provided, will only return items for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -46,16 +101,169 @@ type ItemsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *ItemsListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetCompanyId(companyId *string) { + i.CompanyId = companyId + i.require(itemsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetCreatedAfter(createdAfter *time.Time) { + i.CreatedAfter = createdAfter + i.require(itemsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetCreatedBefore(createdBefore *time.Time) { + i.CreatedBefore = createdBefore + i.require(itemsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(itemsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetExpand(expand []*ItemsListRequestExpandItem) { + i.Expand = expand + i.require(itemsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + i.IncludeDeletedData = includeDeletedData + i.require(itemsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(itemsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(itemsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + i.ModifiedAfter = modifiedAfter + i.require(itemsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + i.ModifiedBefore = modifiedBefore + i.require(itemsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(itemsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetRemoteFields(remoteFields *string) { + i.RemoteFields = remoteFields + i.require(itemsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetRemoteId(remoteId *string) { + i.RemoteId = remoteId + i.require(itemsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + i.ShowEnumOrigins = showEnumOrigins + i.require(itemsListRequestFieldShowEnumOrigins) } +var ( + patchedItemEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedItemEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedItemEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PatchedItemEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PatchedItemRequestRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedItemEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedItemEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedItemEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemEndpointRequest) SetModel(model *PatchedItemRequestRequest) { + p.Model = model + p.require(patchedItemEndpointRequestFieldModel) +} + +var ( + itemsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + itemsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + itemsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + itemsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + itemsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type ItemsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*ItemsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -67,6 +275,51 @@ type ItemsRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *ItemsRetrieveRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsRetrieveRequest) SetExpand(expand []*ItemsRetrieveRequestExpandItem) { + i.Expand = expand + i.require(itemsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(itemsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(itemsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsRetrieveRequest) SetRemoteFields(remoteFields *string) { + i.RemoteFields = remoteFields + i.require(itemsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + i.ShowEnumOrigins = showEnumOrigins + i.require(itemsRetrieveRequestFieldShowEnumOrigins) } type ItemsListRequestExpandItem string @@ -137,6 +390,21 @@ func (i ItemsRetrieveRequestExpandItem) Ptr() *ItemsRetrieveRequestExpandItem { // // ### Usage Example // Fetch from the `LIST Items` endpoint and view a company's items. +var ( + itemRequestRequestFieldName = big.NewInt(1 << 0) + itemRequestRequestFieldStatus = big.NewInt(1 << 1) + itemRequestRequestFieldType = big.NewInt(1 << 2) + itemRequestRequestFieldUnitPrice = big.NewInt(1 << 3) + itemRequestRequestFieldPurchasePrice = big.NewInt(1 << 4) + itemRequestRequestFieldPurchaseAccount = big.NewInt(1 << 5) + itemRequestRequestFieldSalesAccount = big.NewInt(1 << 6) + itemRequestRequestFieldCompany = big.NewInt(1 << 7) + itemRequestRequestFieldPurchaseTaxRate = big.NewInt(1 << 8) + itemRequestRequestFieldSalesTaxRate = big.NewInt(1 << 9) + itemRequestRequestFieldIntegrationParams = big.NewInt(1 << 10) + itemRequestRequestFieldLinkedAccountParams = big.NewInt(1 << 11) +) + type ItemRequestRequest struct { // The item's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -169,6 +437,9 @@ type ItemRequestRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -261,6 +532,97 @@ func (i *ItemRequestRequest) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *ItemRequestRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetName(name *string) { + i.Name = name + i.require(itemRequestRequestFieldName) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetStatus(status *ItemRequestRequestStatus) { + i.Status = status + i.require(itemRequestRequestFieldStatus) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetType(type_ *ItemRequestRequestType) { + i.Type = type_ + i.require(itemRequestRequestFieldType) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetUnitPrice(unitPrice *float64) { + i.UnitPrice = unitPrice + i.require(itemRequestRequestFieldUnitPrice) +} + +// SetPurchasePrice sets the PurchasePrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetPurchasePrice(purchasePrice *float64) { + i.PurchasePrice = purchasePrice + i.require(itemRequestRequestFieldPurchasePrice) +} + +// SetPurchaseAccount sets the PurchaseAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetPurchaseAccount(purchaseAccount *ItemRequestRequestPurchaseAccount) { + i.PurchaseAccount = purchaseAccount + i.require(itemRequestRequestFieldPurchaseAccount) +} + +// SetSalesAccount sets the SalesAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetSalesAccount(salesAccount *ItemRequestRequestSalesAccount) { + i.SalesAccount = salesAccount + i.require(itemRequestRequestFieldSalesAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetCompany(company *ItemRequestRequestCompany) { + i.Company = company + i.require(itemRequestRequestFieldCompany) +} + +// SetPurchaseTaxRate sets the PurchaseTaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetPurchaseTaxRate(purchaseTaxRate *ItemRequestRequestPurchaseTaxRate) { + i.PurchaseTaxRate = purchaseTaxRate + i.require(itemRequestRequestFieldPurchaseTaxRate) +} + +// SetSalesTaxRate sets the SalesTaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetSalesTaxRate(salesTaxRate *ItemRequestRequestSalesTaxRate) { + i.SalesTaxRate = salesTaxRate + i.require(itemRequestRequestFieldSalesTaxRate) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + i.IntegrationParams = integrationParams + i.require(itemRequestRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemRequestRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + i.LinkedAccountParams = linkedAccountParams + i.require(itemRequestRequestFieldLinkedAccountParams) +} + func (i *ItemRequestRequest) UnmarshalJSON(data []byte) error { type unmarshaler ItemRequestRequest var value unmarshaler @@ -277,6 +639,17 @@ func (i *ItemRequestRequest) UnmarshalJSON(data []byte) error { return nil } +func (i *ItemRequestRequest) MarshalJSON() ([]byte, error) { + type embed ItemRequestRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *ItemRequestRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -738,12 +1111,22 @@ func (i *ItemRequestRequestType) Accept(visitor ItemRequestRequestTypeVisitor) e return fmt.Errorf("type %T does not include a non-empty union type", i) } +var ( + itemResponseFieldModel = big.NewInt(1 << 0) + itemResponseFieldWarnings = big.NewInt(1 << 1) + itemResponseFieldErrors = big.NewInt(1 << 2) + itemResponseFieldLogs = big.NewInt(1 << 3) +) + type ItemResponse struct { Model *Item `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -780,6 +1163,41 @@ func (i *ItemResponse) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *ItemResponse) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemResponse) SetModel(model *Item) { + i.Model = model + i.require(itemResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemResponse) SetWarnings(warnings []*WarningValidationProblem) { + i.Warnings = warnings + i.require(itemResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemResponse) SetErrors(errors []*ErrorValidationProblem) { + i.Errors = errors + i.require(itemResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemResponse) SetLogs(logs []*DebugModeLog) { + i.Logs = logs + i.require(itemResponseFieldLogs) +} + func (i *ItemResponse) UnmarshalJSON(data []byte) error { type unmarshaler ItemResponse var value unmarshaler @@ -796,6 +1214,17 @@ func (i *ItemResponse) UnmarshalJSON(data []byte) error { return nil } +func (i *ItemResponse) MarshalJSON() ([]byte, error) { + type embed ItemResponse + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *ItemResponse) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -808,11 +1237,20 @@ func (i *ItemResponse) String() string { return fmt.Sprintf("%#v", i) } +var ( + paginatedItemListFieldNext = big.NewInt(1 << 0) + paginatedItemListFieldPrevious = big.NewInt(1 << 1) + paginatedItemListFieldResults = big.NewInt(1 << 2) +) + type PaginatedItemList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Item `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -842,6 +1280,34 @@ func (p *PaginatedItemList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedItemList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedItemList) SetNext(next *string) { + p.Next = next + p.require(paginatedItemListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedItemList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedItemListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedItemList) SetResults(results []*Item) { + p.Results = results + p.require(paginatedItemListFieldResults) +} + func (p *PaginatedItemList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedItemList var value unmarshaler @@ -858,6 +1324,17 @@ func (p *PaginatedItemList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedItemList) MarshalJSON() ([]byte, error) { + type embed PaginatedItemList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedItemList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -876,6 +1353,21 @@ func (p *PaginatedItemList) String() string { // // ### Usage Example // Fetch from the `LIST Items` endpoint and view a company's items. +var ( + patchedItemRequestRequestFieldName = big.NewInt(1 << 0) + patchedItemRequestRequestFieldStatus = big.NewInt(1 << 1) + patchedItemRequestRequestFieldType = big.NewInt(1 << 2) + patchedItemRequestRequestFieldUnitPrice = big.NewInt(1 << 3) + patchedItemRequestRequestFieldPurchasePrice = big.NewInt(1 << 4) + patchedItemRequestRequestFieldPurchaseAccount = big.NewInt(1 << 5) + patchedItemRequestRequestFieldSalesAccount = big.NewInt(1 << 6) + patchedItemRequestRequestFieldCompany = big.NewInt(1 << 7) + patchedItemRequestRequestFieldPurchaseTaxRate = big.NewInt(1 << 8) + patchedItemRequestRequestFieldSalesTaxRate = big.NewInt(1 << 9) + patchedItemRequestRequestFieldIntegrationParams = big.NewInt(1 << 10) + patchedItemRequestRequestFieldLinkedAccountParams = big.NewInt(1 << 11) +) + type PatchedItemRequestRequest struct { // The item's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -908,6 +1400,9 @@ type PatchedItemRequestRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1000,6 +1495,97 @@ func (p *PatchedItemRequestRequest) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PatchedItemRequestRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetName(name *string) { + p.Name = name + p.require(patchedItemRequestRequestFieldName) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetStatus(status *PatchedItemRequestRequestStatus) { + p.Status = status + p.require(patchedItemRequestRequestFieldStatus) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetType(type_ *PatchedItemRequestRequestType) { + p.Type = type_ + p.require(patchedItemRequestRequestFieldType) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetUnitPrice(unitPrice *float64) { + p.UnitPrice = unitPrice + p.require(patchedItemRequestRequestFieldUnitPrice) +} + +// SetPurchasePrice sets the PurchasePrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetPurchasePrice(purchasePrice *float64) { + p.PurchasePrice = purchasePrice + p.require(patchedItemRequestRequestFieldPurchasePrice) +} + +// SetPurchaseAccount sets the PurchaseAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetPurchaseAccount(purchaseAccount *string) { + p.PurchaseAccount = purchaseAccount + p.require(patchedItemRequestRequestFieldPurchaseAccount) +} + +// SetSalesAccount sets the SalesAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetSalesAccount(salesAccount *string) { + p.SalesAccount = salesAccount + p.require(patchedItemRequestRequestFieldSalesAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetCompany(company *string) { + p.Company = company + p.require(patchedItemRequestRequestFieldCompany) +} + +// SetPurchaseTaxRate sets the PurchaseTaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetPurchaseTaxRate(purchaseTaxRate *string) { + p.PurchaseTaxRate = purchaseTaxRate + p.require(patchedItemRequestRequestFieldPurchaseTaxRate) +} + +// SetSalesTaxRate sets the SalesTaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetSalesTaxRate(salesTaxRate *string) { + p.SalesTaxRate = salesTaxRate + p.require(patchedItemRequestRequestFieldSalesTaxRate) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(patchedItemRequestRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedItemRequestRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(patchedItemRequestRequestFieldLinkedAccountParams) +} + func (p *PatchedItemRequestRequest) UnmarshalJSON(data []byte) error { type unmarshaler PatchedItemRequestRequest var value unmarshaler @@ -1016,6 +1602,17 @@ func (p *PatchedItemRequestRequest) UnmarshalJSON(data []byte) error { return nil } +func (p *PatchedItemRequestRequest) MarshalJSON() ([]byte, error) { + type embed PatchedItemRequestRequest + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PatchedItemRequestRequest) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/items/accounting_items_test/accounting_items_test.go b/accounting/items/accounting_items_test/accounting_items_test.go new file mode 100644 index 0000000..cc048e7 --- /dev/null +++ b/accounting/items/accounting_items_test/accounting_items_test.go @@ -0,0 +1,247 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_items_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingItemsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ItemsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.Items.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/items", map[string]string{"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"}, 1) +} + +func TestAccountingItemsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ItemEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.ItemRequestRequest{}, + } + _, invocationErr := client.Accounting.Items.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/items", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingItemsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ItemsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Items.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/items/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "status", "show_enum_origins": "status"}, 1) +} + +func TestAccountingItemsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PatchedItemEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.PatchedItemRequestRequest{}, + } + _, invocationErr := client.Accounting.Items.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/accounting/v1/items/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingItemsMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Items.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/items/meta/patch/id", nil, 1) +} + +func TestAccountingItemsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Items.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/items/meta/post", nil, 1) +} diff --git a/accounting/items/client.go b/accounting/items/client.go index 092f92b..2be8a77 100644 --- a/accounting/items/client.go +++ b/accounting/items/client.go @@ -4,7 +4,6 @@ package items import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.ItemsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.Item], error) { +) (*core.Page[*string, *accounting.Item], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedItemList) *internal.PageResponse[*string, *accounting.Item] { + readPageResponse := func(response *accounting.PaginatedItemList) *core.PageResponse[*string, *accounting.Item] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.Item]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.Item]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.ItemEndpointRequest, opts ...option.RequestOption, ) (*accounting.ItemResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/items" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.ItemResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Item` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.ItemsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Item, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/items/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Item - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates an `Item` object with the given `id`. @@ -192,47 +134,16 @@ func (c *Client) PartialUpdate( request *accounting.PatchedItemEndpointRequest, opts ...option.RequestOption, ) (*accounting.ItemResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/items/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.ItemResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Item` PATCHs. @@ -241,38 +152,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/items/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `Item` POSTs. @@ -280,33 +168,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/items/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/items/raw_client.go b/accounting/items/raw_client.go new file mode 100644 index 0000000..4f499a5 --- /dev/null +++ b/accounting/items/raw_client.go @@ -0,0 +1,266 @@ +// Code generated by Fern. DO NOT EDIT. + +package items + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.ItemEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.ItemResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/items" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.ItemResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.ItemResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.ItemsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Item], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/items/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Item + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Item]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *accounting.PatchedItemEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.ItemResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/items/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.ItemResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.ItemResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/items/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/items/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/journal_entries.go b/accounting/journal_entries.go index a2c52e0..6276189 100644 --- a/accounting/journal_entries.go +++ b/accounting/journal_entries.go @@ -6,17 +6,65 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + journalEntryEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + journalEntryEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + journalEntryEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type JournalEntryEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *JournalEntryRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JournalEntryEndpointRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + j.IsDebugMode = isDebugMode + j.require(journalEntryEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryEndpointRequest) SetRunAsync(runAsync *bool) { + j.RunAsync = runAsync + j.require(journalEntryEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryEndpointRequest) SetModel(model *JournalEntryRequest) { + j.Model = model + j.require(journalEntryEndpointRequestFieldModel) +} + +var ( + journalEntriesLinesRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + journalEntriesLinesRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + journalEntriesLinesRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + journalEntriesLinesRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + journalEntriesLinesRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + journalEntriesLinesRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + journalEntriesLinesRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type JournalEntriesLinesRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -32,8 +80,85 @@ type JournalEntriesLinesRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JournalEntriesLinesRemoteFieldClassesListRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesLinesRemoteFieldClassesListRequest) SetCursor(cursor *string) { + j.Cursor = cursor + j.require(journalEntriesLinesRemoteFieldClassesListRequestFieldCursor) } +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesLinesRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + j.IncludeDeletedData = includeDeletedData + j.require(journalEntriesLinesRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesLinesRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(journalEntriesLinesRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesLinesRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(journalEntriesLinesRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesLinesRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + j.IsCommonModelField = isCommonModelField + j.require(journalEntriesLinesRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesLinesRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + j.IsCustom = isCustom + j.require(journalEntriesLinesRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesLinesRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + j.PageSize = pageSize + j.require(journalEntriesLinesRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + journalEntriesListRequestFieldCompanyId = big.NewInt(1 << 0) + journalEntriesListRequestFieldCreatedAfter = big.NewInt(1 << 1) + journalEntriesListRequestFieldCreatedBefore = big.NewInt(1 << 2) + journalEntriesListRequestFieldCursor = big.NewInt(1 << 3) + journalEntriesListRequestFieldExpand = big.NewInt(1 << 4) + journalEntriesListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + journalEntriesListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + journalEntriesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 7) + journalEntriesListRequestFieldIncludeShellData = big.NewInt(1 << 8) + journalEntriesListRequestFieldModifiedAfter = big.NewInt(1 << 9) + journalEntriesListRequestFieldModifiedBefore = big.NewInt(1 << 10) + journalEntriesListRequestFieldPageSize = big.NewInt(1 << 11) + journalEntriesListRequestFieldRemoteId = big.NewInt(1 << 12) + journalEntriesListRequestFieldTransactionDateAfter = big.NewInt(1 << 13) + journalEntriesListRequestFieldTransactionDateBefore = big.NewInt(1 << 14) +) + type JournalEntriesListRequest struct { // If provided, will only return journal entries for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -65,8 +190,133 @@ type JournalEntriesListRequest struct { TransactionDateAfter *time.Time `json:"-" url:"transaction_date_after,omitempty"` // If provided, will only return objects created before this datetime. TransactionDateBefore *time.Time `json:"-" url:"transaction_date_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JournalEntriesListRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetCompanyId(companyId *string) { + j.CompanyId = companyId + j.require(journalEntriesListRequestFieldCompanyId) } +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetCreatedAfter(createdAfter *time.Time) { + j.CreatedAfter = createdAfter + j.require(journalEntriesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetCreatedBefore(createdBefore *time.Time) { + j.CreatedBefore = createdBefore + j.require(journalEntriesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetCursor(cursor *string) { + j.Cursor = cursor + j.require(journalEntriesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetExpand(expand []*JournalEntriesListRequestExpandItem) { + j.Expand = expand + j.require(journalEntriesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + j.IncludeDeletedData = includeDeletedData + j.require(journalEntriesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(journalEntriesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + j.IncludeRemoteFields = includeRemoteFields + j.require(journalEntriesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(journalEntriesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + j.ModifiedAfter = modifiedAfter + j.require(journalEntriesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + j.ModifiedBefore = modifiedBefore + j.require(journalEntriesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetPageSize(pageSize *int) { + j.PageSize = pageSize + j.require(journalEntriesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(journalEntriesListRequestFieldRemoteId) +} + +// SetTransactionDateAfter sets the TransactionDateAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetTransactionDateAfter(transactionDateAfter *time.Time) { + j.TransactionDateAfter = transactionDateAfter + j.require(journalEntriesListRequestFieldTransactionDateAfter) +} + +// SetTransactionDateBefore sets the TransactionDateBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesListRequest) SetTransactionDateBefore(transactionDateBefore *time.Time) { + j.TransactionDateBefore = transactionDateBefore + j.require(journalEntriesListRequestFieldTransactionDateBefore) +} + +var ( + journalEntriesRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + journalEntriesRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + journalEntriesRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + journalEntriesRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + journalEntriesRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + journalEntriesRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + journalEntriesRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type JournalEntriesRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -82,8 +332,74 @@ type JournalEntriesRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (j *JournalEntriesRemoteFieldClassesListRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRemoteFieldClassesListRequest) SetCursor(cursor *string) { + j.Cursor = cursor + j.require(journalEntriesRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + j.IncludeDeletedData = includeDeletedData + j.require(journalEntriesRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(journalEntriesRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(journalEntriesRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + j.IsCommonModelField = isCommonModelField + j.require(journalEntriesRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + j.IsCustom = isCustom + j.require(journalEntriesRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + j.PageSize = pageSize + j.require(journalEntriesRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + journalEntriesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + journalEntriesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + journalEntriesRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + journalEntriesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) +) + type JournalEntriesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*JournalEntriesRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -93,6 +409,44 @@ type JournalEntriesRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JournalEntriesRetrieveRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRetrieveRequest) SetExpand(expand []*JournalEntriesRetrieveRequestExpandItem) { + j.Expand = expand + j.require(journalEntriesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(journalEntriesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + j.IncludeRemoteFields = includeRemoteFields + j.require(journalEntriesRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntriesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(journalEntriesRetrieveRequestFieldIncludeShellData) } type JournalEntriesListRequestExpandItem string @@ -173,6 +527,32 @@ func (j JournalEntriesRetrieveRequestExpandItem) Ptr() *JournalEntriesRetrieveRe // // ### Usage Example // Fetch from the `GET JournalEntry` endpoint and view a company's journey entry. +var ( + journalEntryFieldId = big.NewInt(1 << 0) + journalEntryFieldRemoteId = big.NewInt(1 << 1) + journalEntryFieldCreatedAt = big.NewInt(1 << 2) + journalEntryFieldModifiedAt = big.NewInt(1 << 3) + journalEntryFieldTransactionDate = big.NewInt(1 << 4) + journalEntryFieldPayments = big.NewInt(1 << 5) + journalEntryFieldAppliedPayments = big.NewInt(1 << 6) + journalEntryFieldMemo = big.NewInt(1 << 7) + journalEntryFieldCurrency = big.NewInt(1 << 8) + journalEntryFieldExchangeRate = big.NewInt(1 << 9) + journalEntryFieldCompany = big.NewInt(1 << 10) + journalEntryFieldInclusiveOfTax = big.NewInt(1 << 11) + journalEntryFieldLines = big.NewInt(1 << 12) + journalEntryFieldJournalNumber = big.NewInt(1 << 13) + journalEntryFieldTrackingCategories = big.NewInt(1 << 14) + journalEntryFieldRemoteWasDeleted = big.NewInt(1 << 15) + journalEntryFieldPostingStatus = big.NewInt(1 << 16) + journalEntryFieldAccountingPeriod = big.NewInt(1 << 17) + journalEntryFieldRemoteCreatedAt = big.NewInt(1 << 18) + journalEntryFieldRemoteUpdatedAt = big.NewInt(1 << 19) + journalEntryFieldFieldMappings = big.NewInt(1 << 20) + journalEntryFieldRemoteData = big.NewInt(1 << 21) + journalEntryFieldRemoteFields = big.NewInt(1 << 22) +) + type JournalEntry struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -525,6 +905,9 @@ type JournalEntry struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -694,6 +1077,174 @@ func (j *JournalEntry) GetExtraProperties() map[string]interface{} { return j.extraProperties } +func (j *JournalEntry) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetId(id *string) { + j.Id = id + j.require(journalEntryFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(journalEntryFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetCreatedAt(createdAt *time.Time) { + j.CreatedAt = createdAt + j.require(journalEntryFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetModifiedAt(modifiedAt *time.Time) { + j.ModifiedAt = modifiedAt + j.require(journalEntryFieldModifiedAt) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetTransactionDate(transactionDate *time.Time) { + j.TransactionDate = transactionDate + j.require(journalEntryFieldTransactionDate) +} + +// SetPayments sets the Payments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetPayments(payments []*JournalEntryPaymentsItem) { + j.Payments = payments + j.require(journalEntryFieldPayments) +} + +// SetAppliedPayments sets the AppliedPayments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetAppliedPayments(appliedPayments []*JournalEntryAppliedPaymentsItem) { + j.AppliedPayments = appliedPayments + j.require(journalEntryFieldAppliedPayments) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetMemo(memo *string) { + j.Memo = memo + j.require(journalEntryFieldMemo) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetCurrency(currency *JournalEntryCurrency) { + j.Currency = currency + j.require(journalEntryFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetExchangeRate(exchangeRate *string) { + j.ExchangeRate = exchangeRate + j.require(journalEntryFieldExchangeRate) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetCompany(company *JournalEntryCompany) { + j.Company = company + j.require(journalEntryFieldCompany) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetInclusiveOfTax(inclusiveOfTax *bool) { + j.InclusiveOfTax = inclusiveOfTax + j.require(journalEntryFieldInclusiveOfTax) +} + +// SetLines sets the Lines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetLines(lines []*JournalLine) { + j.Lines = lines + j.require(journalEntryFieldLines) +} + +// SetJournalNumber sets the JournalNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetJournalNumber(journalNumber *string) { + j.JournalNumber = journalNumber + j.require(journalEntryFieldJournalNumber) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetTrackingCategories(trackingCategories []*JournalEntryTrackingCategoriesItem) { + j.TrackingCategories = trackingCategories + j.require(journalEntryFieldTrackingCategories) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetRemoteWasDeleted(remoteWasDeleted *bool) { + j.RemoteWasDeleted = remoteWasDeleted + j.require(journalEntryFieldRemoteWasDeleted) +} + +// SetPostingStatus sets the PostingStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetPostingStatus(postingStatus *JournalEntryPostingStatus) { + j.PostingStatus = postingStatus + j.require(journalEntryFieldPostingStatus) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetAccountingPeriod(accountingPeriod *JournalEntryAccountingPeriod) { + j.AccountingPeriod = accountingPeriod + j.require(journalEntryFieldAccountingPeriod) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + j.RemoteCreatedAt = remoteCreatedAt + j.require(journalEntryFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + j.RemoteUpdatedAt = remoteUpdatedAt + j.require(journalEntryFieldRemoteUpdatedAt) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetFieldMappings(fieldMappings map[string]interface{}) { + j.FieldMappings = fieldMappings + j.require(journalEntryFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetRemoteData(remoteData []*RemoteData) { + j.RemoteData = remoteData + j.require(journalEntryFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntry) SetRemoteFields(remoteFields []*RemoteField) { + j.RemoteFields = remoteFields + j.require(journalEntryFieldRemoteFields) +} + func (j *JournalEntry) UnmarshalJSON(data []byte) error { type embed JournalEntry var unmarshaler = struct { @@ -741,7 +1292,8 @@ func (j *JournalEntry) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(j.RemoteCreatedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(j.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) } func (j *JournalEntry) String() string { @@ -1448,6 +2000,23 @@ func (j *JournalEntryPostingStatus) Accept(visitor JournalEntryPostingStatusVisi // // ### Usage Example // Fetch from the `GET JournalEntry` endpoint and view a company's journey entry. +var ( + journalEntryRequestFieldTransactionDate = big.NewInt(1 << 0) + journalEntryRequestFieldPayments = big.NewInt(1 << 1) + journalEntryRequestFieldMemo = big.NewInt(1 << 2) + journalEntryRequestFieldCurrency = big.NewInt(1 << 3) + journalEntryRequestFieldExchangeRate = big.NewInt(1 << 4) + journalEntryRequestFieldCompany = big.NewInt(1 << 5) + journalEntryRequestFieldTrackingCategories = big.NewInt(1 << 6) + journalEntryRequestFieldInclusiveOfTax = big.NewInt(1 << 7) + journalEntryRequestFieldLines = big.NewInt(1 << 8) + journalEntryRequestFieldJournalNumber = big.NewInt(1 << 9) + journalEntryRequestFieldPostingStatus = big.NewInt(1 << 10) + journalEntryRequestFieldIntegrationParams = big.NewInt(1 << 11) + journalEntryRequestFieldLinkedAccountParams = big.NewInt(1 << 12) + journalEntryRequestFieldRemoteFields = big.NewInt(1 << 13) +) + type JournalEntryRequest struct { // The journal entry's transaction date. TransactionDate *time.Time `json:"transaction_date,omitempty" url:"transaction_date,omitempty"` @@ -1783,6 +2352,9 @@ type JournalEntryRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1889,6 +2461,111 @@ func (j *JournalEntryRequest) GetExtraProperties() map[string]interface{} { return j.extraProperties } +func (j *JournalEntryRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetTransactionDate(transactionDate *time.Time) { + j.TransactionDate = transactionDate + j.require(journalEntryRequestFieldTransactionDate) +} + +// SetPayments sets the Payments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetPayments(payments []*JournalEntryRequestPaymentsItem) { + j.Payments = payments + j.require(journalEntryRequestFieldPayments) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetMemo(memo *string) { + j.Memo = memo + j.require(journalEntryRequestFieldMemo) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetCurrency(currency *JournalEntryRequestCurrency) { + j.Currency = currency + j.require(journalEntryRequestFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetExchangeRate(exchangeRate *string) { + j.ExchangeRate = exchangeRate + j.require(journalEntryRequestFieldExchangeRate) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetCompany(company *JournalEntryRequestCompany) { + j.Company = company + j.require(journalEntryRequestFieldCompany) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetTrackingCategories(trackingCategories []*JournalEntryRequestTrackingCategoriesItem) { + j.TrackingCategories = trackingCategories + j.require(journalEntryRequestFieldTrackingCategories) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetInclusiveOfTax(inclusiveOfTax *bool) { + j.InclusiveOfTax = inclusiveOfTax + j.require(journalEntryRequestFieldInclusiveOfTax) +} + +// SetLines sets the Lines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetLines(lines []*JournalLineRequest) { + j.Lines = lines + j.require(journalEntryRequestFieldLines) +} + +// SetJournalNumber sets the JournalNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetJournalNumber(journalNumber *string) { + j.JournalNumber = journalNumber + j.require(journalEntryRequestFieldJournalNumber) +} + +// SetPostingStatus sets the PostingStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetPostingStatus(postingStatus *JournalEntryRequestPostingStatus) { + j.PostingStatus = postingStatus + j.require(journalEntryRequestFieldPostingStatus) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + j.IntegrationParams = integrationParams + j.require(journalEntryRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + j.LinkedAccountParams = linkedAccountParams + j.require(journalEntryRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + j.RemoteFields = remoteFields + j.require(journalEntryRequestFieldRemoteFields) +} + func (j *JournalEntryRequest) UnmarshalJSON(data []byte) error { type embed JournalEntryRequest var unmarshaler = struct { @@ -1920,7 +2597,8 @@ func (j *JournalEntryRequest) MarshalJSON() ([]byte, error) { embed: embed(*j), TransactionDate: internal.NewOptionalDateTime(j.TransactionDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) } func (j *JournalEntryRequest) String() string { @@ -2558,12 +3236,22 @@ func (j *JournalEntryRequestTrackingCategoriesItem) Accept(visitor JournalEntryR return fmt.Errorf("type %T does not include a non-empty union type", j) } +var ( + journalEntryResponseFieldModel = big.NewInt(1 << 0) + journalEntryResponseFieldWarnings = big.NewInt(1 << 1) + journalEntryResponseFieldErrors = big.NewInt(1 << 2) + journalEntryResponseFieldLogs = big.NewInt(1 << 3) +) + type JournalEntryResponse struct { Model *JournalEntry `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2600,6 +3288,41 @@ func (j *JournalEntryResponse) GetExtraProperties() map[string]interface{} { return j.extraProperties } +func (j *JournalEntryResponse) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryResponse) SetModel(model *JournalEntry) { + j.Model = model + j.require(journalEntryResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryResponse) SetWarnings(warnings []*WarningValidationProblem) { + j.Warnings = warnings + j.require(journalEntryResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryResponse) SetErrors(errors []*ErrorValidationProblem) { + j.Errors = errors + j.require(journalEntryResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalEntryResponse) SetLogs(logs []*DebugModeLog) { + j.Logs = logs + j.require(journalEntryResponseFieldLogs) +} + func (j *JournalEntryResponse) UnmarshalJSON(data []byte) error { type unmarshaler JournalEntryResponse var value unmarshaler @@ -2616,6 +3339,17 @@ func (j *JournalEntryResponse) UnmarshalJSON(data []byte) error { return nil } +func (j *JournalEntryResponse) MarshalJSON() ([]byte, error) { + type embed JournalEntryResponse + var marshaler = struct { + embed + }{ + embed: embed(*j), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (j *JournalEntryResponse) String() string { if len(j.rawJSON) > 0 { if value, err := internal.StringifyJSON(j.rawJSON); err == nil { @@ -2696,6 +3430,27 @@ func (j *JournalEntryTrackingCategoriesItem) Accept(visitor JournalEntryTracking // // ### Usage Example // Fetch from the `GET JournalEntry` endpoint and view the journal entry's line items. +var ( + journalLineFieldId = big.NewInt(1 << 0) + journalLineFieldRemoteId = big.NewInt(1 << 1) + journalLineFieldCreatedAt = big.NewInt(1 << 2) + journalLineFieldModifiedAt = big.NewInt(1 << 3) + journalLineFieldAccount = big.NewInt(1 << 4) + journalLineFieldNetAmount = big.NewInt(1 << 5) + journalLineFieldTrackingCategory = big.NewInt(1 << 6) + journalLineFieldTrackingCategories = big.NewInt(1 << 7) + journalLineFieldCurrency = big.NewInt(1 << 8) + journalLineFieldCompany = big.NewInt(1 << 9) + journalLineFieldEmployee = big.NewInt(1 << 10) + journalLineFieldProject = big.NewInt(1 << 11) + journalLineFieldContact = big.NewInt(1 << 12) + journalLineFieldTaxRate = big.NewInt(1 << 13) + journalLineFieldDescription = big.NewInt(1 << 14) + journalLineFieldExchangeRate = big.NewInt(1 << 15) + journalLineFieldRemoteWasDeleted = big.NewInt(1 << 16) + journalLineFieldRemoteFields = big.NewInt(1 << 17) +) + type JournalLine struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -3034,6 +3789,9 @@ type JournalLine struct { RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3168,6 +3926,139 @@ func (j *JournalLine) GetExtraProperties() map[string]interface{} { return j.extraProperties } +func (j *JournalLine) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetId(id *string) { + j.Id = id + j.require(journalLineFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(journalLineFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetCreatedAt(createdAt *time.Time) { + j.CreatedAt = createdAt + j.require(journalLineFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetModifiedAt(modifiedAt *time.Time) { + j.ModifiedAt = modifiedAt + j.require(journalLineFieldModifiedAt) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetAccount(account *JournalLineAccount) { + j.Account = account + j.require(journalLineFieldAccount) +} + +// SetNetAmount sets the NetAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetNetAmount(netAmount *float64) { + j.NetAmount = netAmount + j.require(journalLineFieldNetAmount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetTrackingCategory(trackingCategory *JournalLineTrackingCategory) { + j.TrackingCategory = trackingCategory + j.require(journalLineFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetTrackingCategories(trackingCategories []*JournalLineTrackingCategoriesItem) { + j.TrackingCategories = trackingCategories + j.require(journalLineFieldTrackingCategories) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetCurrency(currency *JournalLineCurrency) { + j.Currency = currency + j.require(journalLineFieldCurrency) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetCompany(company *string) { + j.Company = company + j.require(journalLineFieldCompany) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetEmployee(employee *string) { + j.Employee = employee + j.require(journalLineFieldEmployee) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetProject(project *JournalLineProject) { + j.Project = project + j.require(journalLineFieldProject) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetContact(contact *string) { + j.Contact = contact + j.require(journalLineFieldContact) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetTaxRate(taxRate *string) { + j.TaxRate = taxRate + j.require(journalLineFieldTaxRate) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetDescription(description *string) { + j.Description = description + j.require(journalLineFieldDescription) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetExchangeRate(exchangeRate *string) { + j.ExchangeRate = exchangeRate + j.require(journalLineFieldExchangeRate) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetRemoteWasDeleted(remoteWasDeleted *bool) { + j.RemoteWasDeleted = remoteWasDeleted + j.require(journalLineFieldRemoteWasDeleted) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLine) SetRemoteFields(remoteFields []*RemoteField) { + j.RemoteFields = remoteFields + j.require(journalLineFieldRemoteFields) +} + func (j *JournalLine) UnmarshalJSON(data []byte) error { type embed JournalLine var unmarshaler = struct { @@ -3203,7 +4094,8 @@ func (j *JournalLine) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(j.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(j.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) } func (j *JournalLine) String() string { @@ -3718,6 +4610,25 @@ func (j *JournalLineProject) Accept(visitor JournalLineProjectVisitor) error { // // ### Usage Example // Fetch from the `GET JournalEntry` endpoint and view the journal entry's line items. +var ( + journalLineRequestFieldRemoteId = big.NewInt(1 << 0) + journalLineRequestFieldAccount = big.NewInt(1 << 1) + journalLineRequestFieldNetAmount = big.NewInt(1 << 2) + journalLineRequestFieldTrackingCategory = big.NewInt(1 << 3) + journalLineRequestFieldTrackingCategories = big.NewInt(1 << 4) + journalLineRequestFieldCurrency = big.NewInt(1 << 5) + journalLineRequestFieldCompany = big.NewInt(1 << 6) + journalLineRequestFieldEmployee = big.NewInt(1 << 7) + journalLineRequestFieldProject = big.NewInt(1 << 8) + journalLineRequestFieldContact = big.NewInt(1 << 9) + journalLineRequestFieldTaxRate = big.NewInt(1 << 10) + journalLineRequestFieldDescription = big.NewInt(1 << 11) + journalLineRequestFieldExchangeRate = big.NewInt(1 << 12) + journalLineRequestFieldIntegrationParams = big.NewInt(1 << 13) + journalLineRequestFieldLinkedAccountParams = big.NewInt(1 << 14) + journalLineRequestFieldRemoteFields = big.NewInt(1 << 15) +) + type JournalLineRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -4051,6 +4962,9 @@ type JournalLineRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4171,6 +5085,125 @@ func (j *JournalLineRequest) GetExtraProperties() map[string]interface{} { return j.extraProperties } +func (j *JournalLineRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(journalLineRequestFieldRemoteId) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetAccount(account *JournalLineRequestAccount) { + j.Account = account + j.require(journalLineRequestFieldAccount) +} + +// SetNetAmount sets the NetAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetNetAmount(netAmount *float64) { + j.NetAmount = netAmount + j.require(journalLineRequestFieldNetAmount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetTrackingCategory(trackingCategory *JournalLineRequestTrackingCategory) { + j.TrackingCategory = trackingCategory + j.require(journalLineRequestFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetTrackingCategories(trackingCategories []*JournalLineRequestTrackingCategoriesItem) { + j.TrackingCategories = trackingCategories + j.require(journalLineRequestFieldTrackingCategories) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetCurrency(currency *JournalLineRequestCurrency) { + j.Currency = currency + j.require(journalLineRequestFieldCurrency) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetCompany(company *string) { + j.Company = company + j.require(journalLineRequestFieldCompany) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetEmployee(employee *string) { + j.Employee = employee + j.require(journalLineRequestFieldEmployee) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetProject(project *JournalLineRequestProject) { + j.Project = project + j.require(journalLineRequestFieldProject) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetContact(contact *string) { + j.Contact = contact + j.require(journalLineRequestFieldContact) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetTaxRate(taxRate *string) { + j.TaxRate = taxRate + j.require(journalLineRequestFieldTaxRate) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetDescription(description *string) { + j.Description = description + j.require(journalLineRequestFieldDescription) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetExchangeRate(exchangeRate *string) { + j.ExchangeRate = exchangeRate + j.require(journalLineRequestFieldExchangeRate) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + j.IntegrationParams = integrationParams + j.require(journalLineRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + j.LinkedAccountParams = linkedAccountParams + j.require(journalLineRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JournalLineRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + j.RemoteFields = remoteFields + j.require(journalLineRequestFieldRemoteFields) +} + func (j *JournalLineRequest) UnmarshalJSON(data []byte) error { type unmarshaler JournalLineRequest var value unmarshaler @@ -4187,6 +5220,17 @@ func (j *JournalLineRequest) UnmarshalJSON(data []byte) error { return nil } +func (j *JournalLineRequest) MarshalJSON() ([]byte, error) { + type embed JournalLineRequest + var marshaler = struct { + embed + }{ + embed: embed(*j), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (j *JournalLineRequest) String() string { if len(j.rawJSON) > 0 { if value, err := internal.StringifyJSON(j.rawJSON); err == nil { @@ -4941,11 +5985,20 @@ func (j *JournalLineTrackingCategory) Accept(visitor JournalLineTrackingCategory return fmt.Errorf("type %T does not include a non-empty union type", j) } +var ( + paginatedJournalEntryListFieldNext = big.NewInt(1 << 0) + paginatedJournalEntryListFieldPrevious = big.NewInt(1 << 1) + paginatedJournalEntryListFieldResults = big.NewInt(1 << 2) +) + type PaginatedJournalEntryList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*JournalEntry `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4975,6 +6028,34 @@ func (p *PaginatedJournalEntryList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedJournalEntryList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJournalEntryList) SetNext(next *string) { + p.Next = next + p.require(paginatedJournalEntryListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJournalEntryList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedJournalEntryListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJournalEntryList) SetResults(results []*JournalEntry) { + p.Results = results + p.require(paginatedJournalEntryListFieldResults) +} + func (p *PaginatedJournalEntryList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedJournalEntryList var value unmarshaler @@ -4991,6 +6072,17 @@ func (p *PaginatedJournalEntryList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedJournalEntryList) MarshalJSON() ([]byte, error) { + type embed PaginatedJournalEntryList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedJournalEntryList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/journalentries/accounting_journal_entries_test/accounting_journal_entries_test.go b/accounting/journalentries/accounting_journal_entries_test/accounting_journal_entries_test.go new file mode 100644 index 0000000..fb63063 --- /dev/null +++ b/accounting/journalentries/accounting_journal_entries_test/accounting_journal_entries_test.go @@ -0,0 +1,299 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_journal_entries_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingJournalEntriesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.JournalEntriesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Accounting.JournalEntries.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/journal-entries", map[string]string{"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"}, 1) +} + +func TestAccountingJournalEntriesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.JournalEntryEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.JournalEntryRequest{}, + } + _, invocationErr := client.Accounting.JournalEntries.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/journal-entries", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingJournalEntriesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.JournalEntriesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.JournalEntries.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/journal-entries/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestAccountingJournalEntriesLinesRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.JournalEntriesLinesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.JournalEntries.LinesRemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/journal-entries/lines/remote-field-classes", map[string]string{"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"}, 1) +} + +func TestAccountingJournalEntriesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.JournalEntries.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/journal-entries/meta/post", nil, 1) +} + +func TestAccountingJournalEntriesRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.JournalEntriesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.JournalEntries.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/journal-entries/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/accounting/journalentries/client.go b/accounting/journalentries/client.go index 4ed0bfa..eaed7e5 100644 --- a/accounting/journalentries/client.go +++ b/accounting/journalentries/client.go @@ -4,7 +4,6 @@ package journalentries import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.JournalEntriesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.JournalEntry], error) { +) (*core.Page[*string, *accounting.JournalEntry], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedJournalEntryList) *internal.PageResponse[*string, *accounting.JournalEntry] { + readPageResponse := func(response *accounting.PaginatedJournalEntryList) *core.PageResponse[*string, *accounting.JournalEntry] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.JournalEntry]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.JournalEntry]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.JournalEntryEndpointRequest, opts ...option.RequestOption, ) (*accounting.JournalEntryResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/journal-entries" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.JournalEntryResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `JournalEntry` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.JournalEntriesRetrieveRequest, opts ...option.RequestOption, ) (*accounting.JournalEntry, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/journal-entries/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.JournalEntry - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -190,7 +132,7 @@ func (c *Client) LinesRemoteFieldClassesList( ctx context.Context, request *accounting.JournalEntriesLinesRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -203,13 +145,12 @@ func (c *Client) LinesRemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -226,11 +167,11 @@ func (c *Client) LinesRemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, @@ -249,35 +190,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/journal-entries/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -285,7 +205,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *accounting.JournalEntriesRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -298,13 +218,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -321,11 +240,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/accounting/journalentries/raw_client.go b/accounting/journalentries/raw_client.go new file mode 100644 index 0000000..373a4cd --- /dev/null +++ b/accounting/journalentries/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package journalentries + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.JournalEntryEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.JournalEntryResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/journal-entries" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.JournalEntryResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.JournalEntryResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.JournalEntriesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.JournalEntry], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/journal-entries/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.JournalEntry + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.JournalEntry]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/journal-entries/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/link_token.go b/accounting/link_token.go index a700135..82ddbce 100644 --- a/accounting/link_token.go +++ b/accounting/link_token.go @@ -6,6 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + endUserDetailsRequestFieldEndUserEmailAddress = big.NewInt(1 << 0) + endUserDetailsRequestFieldEndUserOrganizationName = big.NewInt(1 << 1) + endUserDetailsRequestFieldEndUserOriginId = big.NewInt(1 << 2) + endUserDetailsRequestFieldCategories = big.NewInt(1 << 3) + endUserDetailsRequestFieldIntegration = big.NewInt(1 << 4) + endUserDetailsRequestFieldLinkExpiryMins = big.NewInt(1 << 5) + endUserDetailsRequestFieldShouldCreateMagicLinkUrl = big.NewInt(1 << 6) + endUserDetailsRequestFieldHideAdminMagicLink = big.NewInt(1 << 7) + endUserDetailsRequestFieldCommonModels = big.NewInt(1 << 8) + endUserDetailsRequestFieldCategoryCommonModelScopes = big.NewInt(1 << 9) + endUserDetailsRequestFieldLanguage = big.NewInt(1 << 10) + endUserDetailsRequestFieldAreSyncsDisabled = big.NewInt(1 << 11) + endUserDetailsRequestFieldIntegrationSpecificConfig = big.NewInt(1 << 12) ) type EndUserDetailsRequest struct { @@ -38,6 +55,107 @@ type EndUserDetailsRequest struct { AreSyncsDisabled *bool `json:"are_syncs_disabled,omitempty" url:"-"` // A JSON object containing integration-specific configuration options. IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EndUserDetailsRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserEmailAddress(endUserEmailAddress string) { + e.EndUserEmailAddress = endUserEmailAddress + e.require(endUserDetailsRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOrganizationName(endUserOrganizationName string) { + e.EndUserOrganizationName = endUserOrganizationName + e.require(endUserDetailsRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOriginId(endUserOriginId string) { + e.EndUserOriginId = endUserOriginId + e.require(endUserDetailsRequestFieldEndUserOriginId) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategories(categories []CategoriesEnum) { + e.Categories = categories + e.require(endUserDetailsRequestFieldCategories) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegration(integration *string) { + e.Integration = integration + e.require(endUserDetailsRequestFieldIntegration) +} + +// SetLinkExpiryMins sets the LinkExpiryMins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLinkExpiryMins(linkExpiryMins *int) { + e.LinkExpiryMins = linkExpiryMins + e.require(endUserDetailsRequestFieldLinkExpiryMins) +} + +// SetShouldCreateMagicLinkUrl sets the ShouldCreateMagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetShouldCreateMagicLinkUrl(shouldCreateMagicLinkUrl *bool) { + e.ShouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl + e.require(endUserDetailsRequestFieldShouldCreateMagicLinkUrl) +} + +// SetHideAdminMagicLink sets the HideAdminMagicLink field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetHideAdminMagicLink(hideAdminMagicLink *bool) { + e.HideAdminMagicLink = hideAdminMagicLink + e.require(endUserDetailsRequestFieldHideAdminMagicLink) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCommonModels(commonModels []*CommonModelScopesBodyRequest) { + e.CommonModels = commonModels + e.require(endUserDetailsRequestFieldCommonModels) +} + +// SetCategoryCommonModelScopes sets the CategoryCommonModelScopes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategoryCommonModelScopes(categoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest) { + e.CategoryCommonModelScopes = categoryCommonModelScopes + e.require(endUserDetailsRequestFieldCategoryCommonModelScopes) +} + +// SetLanguage sets the Language field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLanguage(language *EndUserDetailsRequestLanguage) { + e.Language = language + e.require(endUserDetailsRequestFieldLanguage) +} + +// SetAreSyncsDisabled sets the AreSyncsDisabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetAreSyncsDisabled(areSyncsDisabled *bool) { + e.AreSyncsDisabled = areSyncsDisabled + e.require(endUserDetailsRequestFieldAreSyncsDisabled) +} + +// SetIntegrationSpecificConfig sets the IntegrationSpecificConfig field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegrationSpecificConfig(integrationSpecificConfig map[string]interface{}) { + e.IntegrationSpecificConfig = integrationSpecificConfig + e.require(endUserDetailsRequestFieldIntegrationSpecificConfig) } // The following subset of IETF language tags can be used to configure localization. @@ -106,11 +224,20 @@ func (e *EndUserDetailsRequestLanguage) Accept(visitor EndUserDetailsRequestLang return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + commonModelScopesBodyRequestFieldModelId = big.NewInt(1 << 0) + commonModelScopesBodyRequestFieldEnabledActions = big.NewInt(1 << 1) + commonModelScopesBodyRequestFieldDisabledFields = big.NewInt(1 << 2) +) + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id" url:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions" url:"enabled_actions"` DisabledFields []string `json:"disabled_fields" url:"disabled_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +267,34 @@ func (c *CommonModelScopesBodyRequest) GetExtraProperties() map[string]interface return c.extraProperties } +func (c *CommonModelScopesBodyRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetModelId(modelId string) { + c.ModelId = modelId + c.require(commonModelScopesBodyRequestFieldModelId) +} + +// SetEnabledActions sets the EnabledActions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetEnabledActions(enabledActions []EnabledActionsEnum) { + c.EnabledActions = enabledActions + c.require(commonModelScopesBodyRequestFieldEnabledActions) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetDisabledFields(disabledFields []string) { + c.DisabledFields = disabledFields + c.require(commonModelScopesBodyRequestFieldDisabledFields) +} + func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopesBodyRequest var value unmarshaler @@ -156,6 +311,17 @@ func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopesBodyRequest) MarshalJSON() ([]byte, error) { + type embed CommonModelScopesBodyRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopesBodyRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -216,11 +382,20 @@ func (l LanguageEnum) Ptr() *LanguageEnum { return &l } +var ( + linkTokenFieldLinkToken = big.NewInt(1 << 0) + linkTokenFieldIntegrationName = big.NewInt(1 << 1) + linkTokenFieldMagicLinkUrl = big.NewInt(1 << 2) +) + type LinkToken struct { LinkToken string `json:"link_token" url:"link_token"` IntegrationName *string `json:"integration_name,omitempty" url:"integration_name,omitempty"` MagicLinkUrl *string `json:"magic_link_url,omitempty" url:"magic_link_url,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -250,6 +425,34 @@ func (l *LinkToken) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkToken) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkToken sets the LinkToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetLinkToken(linkToken string) { + l.LinkToken = linkToken + l.require(linkTokenFieldLinkToken) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkTokenFieldIntegrationName) +} + +// SetMagicLinkUrl sets the MagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetMagicLinkUrl(magicLinkUrl *string) { + l.MagicLinkUrl = magicLinkUrl + l.require(linkTokenFieldMagicLinkUrl) +} + func (l *LinkToken) UnmarshalJSON(data []byte) error { type unmarshaler LinkToken var value unmarshaler @@ -266,6 +469,17 @@ func (l *LinkToken) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkToken) MarshalJSON() ([]byte, error) { + type embed LinkToken + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkToken) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { diff --git a/accounting/linked_accounts.go b/accounting/linked_accounts.go index 899987e..10d7f1c 100644 --- a/accounting/linked_accounts.go +++ b/accounting/linked_accounts.go @@ -6,9 +6,26 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + linkedAccountsListRequestFieldCategory = big.NewInt(1 << 0) + linkedAccountsListRequestFieldCursor = big.NewInt(1 << 1) + linkedAccountsListRequestFieldEndUserEmailAddress = big.NewInt(1 << 2) + linkedAccountsListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + linkedAccountsListRequestFieldEndUserOriginId = big.NewInt(1 << 4) + linkedAccountsListRequestFieldEndUserOriginIds = big.NewInt(1 << 5) + linkedAccountsListRequestFieldId = big.NewInt(1 << 6) + linkedAccountsListRequestFieldIds = big.NewInt(1 << 7) + linkedAccountsListRequestFieldIncludeDuplicates = big.NewInt(1 << 8) + linkedAccountsListRequestFieldIntegrationName = big.NewInt(1 << 9) + linkedAccountsListRequestFieldIsTestAccount = big.NewInt(1 << 10) + linkedAccountsListRequestFieldPageSize = big.NewInt(1 << 11) + linkedAccountsListRequestFieldStatus = big.NewInt(1 << 12) +) + type LinkedAccountsListRequest struct { // Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` // @@ -43,6 +60,107 @@ type LinkedAccountsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` Status *string `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountsListRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCategory(category *LinkedAccountsListRequestCategory) { + l.Category = category + l.require(linkedAccountsListRequestFieldCategory) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCursor(cursor *string) { + l.Cursor = cursor + l.require(linkedAccountsListRequestFieldCursor) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserEmailAddress(endUserEmailAddress *string) { + l.EndUserEmailAddress = endUserEmailAddress + l.require(linkedAccountsListRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + l.EndUserOrganizationName = endUserOrganizationName + l.require(linkedAccountsListRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginId(endUserOriginId *string) { + l.EndUserOriginId = endUserOriginId + l.require(linkedAccountsListRequestFieldEndUserOriginId) +} + +// SetEndUserOriginIds sets the EndUserOriginIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginIds(endUserOriginIds *string) { + l.EndUserOriginIds = endUserOriginIds + l.require(linkedAccountsListRequestFieldEndUserOriginIds) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetId(id *string) { + l.Id = id + l.require(linkedAccountsListRequestFieldId) +} + +// SetIds sets the Ids field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIds(ids *string) { + l.Ids = ids + l.require(linkedAccountsListRequestFieldIds) +} + +// SetIncludeDuplicates sets the IncludeDuplicates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIncludeDuplicates(includeDuplicates *bool) { + l.IncludeDuplicates = includeDuplicates + l.require(linkedAccountsListRequestFieldIncludeDuplicates) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkedAccountsListRequestFieldIntegrationName) +} + +// SetIsTestAccount sets the IsTestAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIsTestAccount(isTestAccount *string) { + l.IsTestAccount = isTestAccount + l.require(linkedAccountsListRequestFieldIsTestAccount) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetPageSize(pageSize *int) { + l.PageSize = pageSize + l.require(linkedAccountsListRequestFieldPageSize) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetStatus(status *string) { + l.Status = status + l.require(linkedAccountsListRequestFieldStatus) } type LinkedAccountsListRequestCategory string @@ -88,6 +206,22 @@ func (l LinkedAccountsListRequestCategory) Ptr() *LinkedAccountsListRequestCateg // // ### Usage Example // View a list of your organization's `LinkedAccount` objects. +var ( + accountDetailsAndActionsFieldId = big.NewInt(1 << 0) + accountDetailsAndActionsFieldCategory = big.NewInt(1 << 1) + accountDetailsAndActionsFieldStatus = big.NewInt(1 << 2) + accountDetailsAndActionsFieldStatusDetail = big.NewInt(1 << 3) + accountDetailsAndActionsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsAndActionsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsAndActionsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsAndActionsFieldSubdomain = big.NewInt(1 << 7) + accountDetailsAndActionsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsAndActionsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsAndActionsFieldIntegration = big.NewInt(1 << 10) + accountDetailsAndActionsFieldAccountType = big.NewInt(1 << 11) + accountDetailsAndActionsFieldCompletedAt = big.NewInt(1 << 12) +) + type AccountDetailsAndActions struct { Id string `json:"id" url:"id"` Category *AccountDetailsAndActionsCategory `json:"category,omitempty" url:"category,omitempty"` @@ -105,6 +239,9 @@ type AccountDetailsAndActions struct { AccountType string `json:"account_type" url:"account_type"` CompletedAt time.Time `json:"completed_at" url:"completed_at"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -204,6 +341,104 @@ func (a *AccountDetailsAndActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetailsAndActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetId(id string) { + a.Id = id + a.require(accountDetailsAndActionsFieldId) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCategory(category *AccountDetailsAndActionsCategory) { + a.Category = category + a.require(accountDetailsAndActionsFieldCategory) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatus(status *AccountDetailsAndActionsStatus) { + a.Status = status + a.require(accountDetailsAndActionsFieldStatus) +} + +// SetStatusDetail sets the StatusDetail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatusDetail(statusDetail *string) { + a.StatusDetail = statusDetail + a.require(accountDetailsAndActionsFieldStatusDetail) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsAndActionsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOrganizationName(endUserOrganizationName string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsAndActionsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserEmailAddress(endUserEmailAddress string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsAndActionsFieldEndUserEmailAddress) +} + +// SetSubdomain sets the Subdomain field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetSubdomain(subdomain *string) { + a.Subdomain = subdomain + a.require(accountDetailsAndActionsFieldSubdomain) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetWebhookListenerUrl(webhookListenerUrl string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsAndActionsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsAndActionsFieldIsDuplicate) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIntegration(integration *AccountDetailsAndActionsIntegration) { + a.Integration = integration + a.require(accountDetailsAndActionsFieldIntegration) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetAccountType(accountType string) { + a.AccountType = accountType + a.require(accountDetailsAndActionsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCompletedAt(completedAt time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsAndActionsFieldCompletedAt) +} + func (a *AccountDetailsAndActions) UnmarshalJSON(data []byte) error { type embed AccountDetailsAndActions var unmarshaler = struct { @@ -235,7 +470,8 @@ func (a *AccountDetailsAndActions) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetailsAndActions) String() string { @@ -312,6 +548,17 @@ func (a *AccountDetailsAndActionsCategory) Accept(visitor AccountDetailsAndActio return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + accountDetailsAndActionsIntegrationFieldName = big.NewInt(1 << 0) + accountDetailsAndActionsIntegrationFieldCategories = big.NewInt(1 << 1) + accountDetailsAndActionsIntegrationFieldImage = big.NewInt(1 << 2) + accountDetailsAndActionsIntegrationFieldSquareImage = big.NewInt(1 << 3) + accountDetailsAndActionsIntegrationFieldColor = big.NewInt(1 << 4) + accountDetailsAndActionsIntegrationFieldSlug = big.NewInt(1 << 5) + accountDetailsAndActionsIntegrationFieldPassthroughAvailable = big.NewInt(1 << 6) + accountDetailsAndActionsIntegrationFieldAvailableModelOperations = big.NewInt(1 << 7) +) + type AccountDetailsAndActionsIntegration struct { Name string `json:"name" url:"name"` Categories []CategoriesEnum `json:"categories" url:"categories"` @@ -322,6 +569,9 @@ type AccountDetailsAndActionsIntegration struct { PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -386,6 +636,69 @@ func (a *AccountDetailsAndActionsIntegration) GetExtraProperties() map[string]in return a.extraProperties } +func (a *AccountDetailsAndActionsIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetName(name string) { + a.Name = name + a.require(accountDetailsAndActionsIntegrationFieldName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountDetailsAndActionsIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetImage(image *string) { + a.Image = image + a.require(accountDetailsAndActionsIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountDetailsAndActionsIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetColor(color string) { + a.Color = color + a.require(accountDetailsAndActionsIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSlug(slug string) { + a.Slug = slug + a.require(accountDetailsAndActionsIntegrationFieldSlug) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(accountDetailsAndActionsIntegrationFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(accountDetailsAndActionsIntegrationFieldAvailableModelOperations) +} + func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountDetailsAndActionsIntegration var value unmarshaler @@ -402,6 +715,17 @@ func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountDetailsAndActionsIntegration) MarshalJSON() ([]byte, error) { + type embed AccountDetailsAndActionsIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountDetailsAndActionsIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -508,11 +832,20 @@ func (a AccountDetailsAndActionsStatusEnum) Ptr() *AccountDetailsAndActionsStatu return &a } +var ( + paginatedAccountDetailsAndActionsListFieldNext = big.NewInt(1 << 0) + paginatedAccountDetailsAndActionsListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountDetailsAndActionsListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AccountDetailsAndActions `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -542,6 +875,34 @@ func (p *PaginatedAccountDetailsAndActionsList) GetExtraProperties() map[string] return p.extraProperties } +func (p *PaginatedAccountDetailsAndActionsList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountDetailsAndActionsListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountDetailsAndActionsListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetResults(results []*AccountDetailsAndActions) { + p.Results = results + p.require(paginatedAccountDetailsAndActionsListFieldResults) +} + func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountDetailsAndActionsList var value unmarshaler @@ -558,6 +919,17 @@ func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error return nil } +func (p *PaginatedAccountDetailsAndActionsList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountDetailsAndActionsList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountDetailsAndActionsList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/linkedaccounts/accounting_linked_accounts_test/accounting_linked_accounts_test.go b/accounting/linkedaccounts/accounting_linked_accounts_test/accounting_linked_accounts_test.go new file mode 100644 index 0000000..10b3cdb --- /dev/null +++ b/accounting/linkedaccounts/accounting_linked_accounts_test/accounting_linked_accounts_test.go @@ -0,0 +1,121 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_linked_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingLinkedAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.LinkedAccountsListRequest{ + Category: accounting.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } + _, invocationErr := client.Accounting.LinkedAccounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/linked-accounts", map[string]string{"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"}, 1) +} diff --git a/accounting/linkedaccounts/client.go b/accounting/linkedaccounts/client.go index c089c20..553b7e9 100644 --- a/accounting/linkedaccounts/client.go +++ b/accounting/linkedaccounts/client.go @@ -4,7 +4,6 @@ package linkedaccounts import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.LinkedAccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.AccountDetailsAndActions], error) { +) (*core.Page[*string, *accounting.AccountDetailsAndActions], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedAccountDetailsAndActionsList) *internal.PageResponse[*string, *accounting.AccountDetailsAndActions] { + readPageResponse := func(response *accounting.PaginatedAccountDetailsAndActionsList) *core.PageResponse[*string, *accounting.AccountDetailsAndActions] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.AccountDetailsAndActions]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.AccountDetailsAndActions]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/accounting/linkedaccounts/raw_client.go b/accounting/linkedaccounts/raw_client.go new file mode 100644 index 0000000..cb54205 --- /dev/null +++ b/accounting/linkedaccounts/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package linkedaccounts + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/accounting/linktoken/accounting_link_token_test/accounting_link_token_test.go b/accounting/linktoken/accounting_link_token_test/accounting_link_token_test.go new file mode 100644 index 0000000..4e2045a --- /dev/null +++ b/accounting/linktoken/accounting_link_token_test/accounting_link_token_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_link_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingLinkTokenCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []accounting.CategoriesEnum{ + accounting.CategoriesEnumHris, + accounting.CategoriesEnumAts, + }, + } + _, invocationErr := client.Accounting.LinkToken.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/link-token", nil, 1) +} diff --git a/accounting/linktoken/client.go b/accounting/linktoken/client.go index 7a9b40f..0a3f8f7 100644 --- a/accounting/linktoken/client.go +++ b/accounting/linktoken/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *accounting.EndUserDetailsRequest, opts ...option.RequestOption, ) (*accounting.LinkToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/link-token" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.LinkToken - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/linktoken/raw_client.go b/accounting/linktoken/raw_client.go new file mode 100644 index 0000000..2b0670e --- /dev/null +++ b/accounting/linktoken/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package linktoken + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.EndUserDetailsRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.LinkToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/link-token" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.LinkToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.LinkToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/passthrough/accounting_passthrough_test/accounting_passthrough_test.go b/accounting/passthrough/accounting_passthrough_test/accounting_passthrough_test.go new file mode 100644 index 0000000..3949605 --- /dev/null +++ b/accounting/passthrough/accounting_passthrough_test/accounting_passthrough_test.go @@ -0,0 +1,85 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.DataPassthroughRequest{ + Method: accounting.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Accounting.Passthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/passthrough", nil, 1) +} diff --git a/accounting/passthrough/client.go b/accounting/passthrough/client.go index 1fc9d57..183cd78 100644 --- a/accounting/passthrough/client.go +++ b/accounting/passthrough/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *accounting.DataPassthroughRequest, opts ...option.RequestOption, ) (*accounting.RemoteResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.RemoteResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/passthrough/raw_client.go b/accounting/passthrough/raw_client.go new file mode 100644 index 0000000..0b79959 --- /dev/null +++ b/accounting/passthrough/raw_client.go @@ -0,0 +1,72 @@ +// Code generated by Fern. DO NOT EDIT. + +package passthrough + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.RemoteResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.RemoteResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.RemoteResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/payment_methods.go b/accounting/payment_methods.go index 915ab1b..3d14717 100644 --- a/accounting/payment_methods.go +++ b/accounting/payment_methods.go @@ -6,6 +6,15 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + paymentMethodsListRequestFieldCursor = big.NewInt(1 << 0) + paymentMethodsListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + paymentMethodsListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + paymentMethodsListRequestFieldIncludeShellData = big.NewInt(1 << 3) + paymentMethodsListRequestFieldPageSize = big.NewInt(1 << 4) ) type PaymentMethodsListRequest struct { @@ -19,20 +28,103 @@ type PaymentMethodsListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PaymentMethodsListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) } +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethodsListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(paymentMethodsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethodsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(paymentMethodsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethodsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(paymentMethodsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethodsListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(paymentMethodsListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethodsListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(paymentMethodsListRequestFieldPageSize) +} + +var ( + paymentMethodsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + paymentMethodsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type PaymentMethodsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (p *PaymentMethodsRetrieveRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethodsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(paymentMethodsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethodsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(paymentMethodsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedPaymentMethodListFieldNext = big.NewInt(1 << 0) + paginatedPaymentMethodListFieldPrevious = big.NewInt(1 << 1) + paginatedPaymentMethodListFieldResults = big.NewInt(1 << 2) +) + type PaginatedPaymentMethodList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*PaymentMethod `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -62,6 +154,34 @@ func (p *PaginatedPaymentMethodList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedPaymentMethodList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPaymentMethodList) SetNext(next *string) { + p.Next = next + p.require(paginatedPaymentMethodListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPaymentMethodList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedPaymentMethodListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPaymentMethodList) SetResults(results []*PaymentMethod) { + p.Results = results + p.require(paginatedPaymentMethodListFieldResults) +} + func (p *PaginatedPaymentMethodList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedPaymentMethodList var value unmarshaler @@ -78,6 +198,17 @@ func (p *PaginatedPaymentMethodList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedPaymentMethodList) MarshalJSON() ([]byte, error) { + type embed PaginatedPaymentMethodList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedPaymentMethodList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/payment_terms.go b/accounting/payment_terms.go index 330d27e..a9736e8 100644 --- a/accounting/payment_terms.go +++ b/accounting/payment_terms.go @@ -6,6 +6,16 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + paymentTermsListRequestFieldCursor = big.NewInt(1 << 0) + paymentTermsListRequestFieldExpand = big.NewInt(1 << 1) + paymentTermsListRequestFieldIncludeDeletedData = big.NewInt(1 << 2) + paymentTermsListRequestFieldIncludeRemoteData = big.NewInt(1 << 3) + paymentTermsListRequestFieldIncludeShellData = big.NewInt(1 << 4) + paymentTermsListRequestFieldPageSize = big.NewInt(1 << 5) ) type PaymentTermsListRequest struct { @@ -21,8 +31,66 @@ type PaymentTermsListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PaymentTermsListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTermsListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(paymentTermsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTermsListRequest) SetExpand(expand []*string) { + p.Expand = expand + p.require(paymentTermsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTermsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(paymentTermsListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTermsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(paymentTermsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTermsListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(paymentTermsListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTermsListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(paymentTermsListRequestFieldPageSize) +} + +var ( + paymentTermsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + paymentTermsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + paymentTermsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type PaymentTermsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -30,13 +98,53 @@ type PaymentTermsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (p *PaymentTermsRetrieveRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTermsRetrieveRequest) SetExpand(expand []*string) { + p.Expand = expand + p.require(paymentTermsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTermsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(paymentTermsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTermsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(paymentTermsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedPaymentTermListFieldNext = big.NewInt(1 << 0) + paginatedPaymentTermListFieldPrevious = big.NewInt(1 << 1) + paginatedPaymentTermListFieldResults = big.NewInt(1 << 2) +) + type PaginatedPaymentTermList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*PaymentTerm `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -66,6 +174,34 @@ func (p *PaginatedPaymentTermList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedPaymentTermList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPaymentTermList) SetNext(next *string) { + p.Next = next + p.require(paginatedPaymentTermListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPaymentTermList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedPaymentTermListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPaymentTermList) SetResults(results []*PaymentTerm) { + p.Results = results + p.require(paginatedPaymentTermListFieldResults) +} + func (p *PaginatedPaymentTermList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedPaymentTermList var value unmarshaler @@ -82,6 +218,17 @@ func (p *PaginatedPaymentTermList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedPaymentTermList) MarshalJSON() ([]byte, error) { + type embed PaginatedPaymentTermList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedPaymentTermList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/paymentmethods/accounting_payment_methods_test/accounting_payment_methods_test.go b/accounting/paymentmethods/accounting_payment_methods_test/accounting_payment_methods_test.go new file mode 100644 index 0000000..6388426 --- /dev/null +++ b/accounting/paymentmethods/accounting_payment_methods_test/accounting_payment_methods_test.go @@ -0,0 +1,127 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_payment_methods_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingPaymentMethodsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PaymentMethodsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.PaymentMethods.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payment-methods", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} + +func TestAccountingPaymentMethodsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PaymentMethodsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.PaymentMethods.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payment-methods/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/paymentmethods/client.go b/accounting/paymentmethods/client.go index 1c48d1c..86e50b1 100644 --- a/accounting/paymentmethods/client.go +++ b/accounting/paymentmethods/client.go @@ -4,7 +4,6 @@ package paymentmethods import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.PaymentMethodsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.PaymentMethod], error) { +) (*core.Page[*string, *accounting.PaymentMethod], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedPaymentMethodList) *internal.PageResponse[*string, *accounting.PaymentMethod] { + readPageResponse := func(response *accounting.PaginatedPaymentMethodList) *core.PageResponse[*string, *accounting.PaymentMethod] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.PaymentMethod]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.PaymentMethod]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.PaymentMethodsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.PaymentMethod, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/payment-methods/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.PaymentMethod - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/paymentmethods/raw_client.go b/accounting/paymentmethods/raw_client.go new file mode 100644 index 0000000..a317192 --- /dev/null +++ b/accounting/paymentmethods/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package paymentmethods + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.PaymentMethodsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.PaymentMethod], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/payment-methods/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.PaymentMethod + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.PaymentMethod]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/payments.go b/accounting/payments.go index 2dbbafc..d7b5db5 100644 --- a/accounting/payments.go +++ b/accounting/payments.go @@ -6,17 +6,65 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + paymentEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + paymentEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + paymentEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PaymentEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PaymentRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PaymentEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(paymentEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(paymentEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentEndpointRequest) SetModel(model *PaymentRequest) { + p.Model = model + p.require(paymentEndpointRequestFieldModel) +} + +var ( + paymentsLineItemsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + paymentsLineItemsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + paymentsLineItemsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + paymentsLineItemsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + paymentsLineItemsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + paymentsLineItemsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + paymentsLineItemsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type PaymentsLineItemsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -32,8 +80,87 @@ type PaymentsLineItemsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PaymentsLineItemsRemoteFieldClassesListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsLineItemsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(paymentsLineItemsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsLineItemsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(paymentsLineItemsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsLineItemsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(paymentsLineItemsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsLineItemsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(paymentsLineItemsRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsLineItemsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + p.IsCommonModelField = isCommonModelField + p.require(paymentsLineItemsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsLineItemsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + p.IsCustom = isCustom + p.require(paymentsLineItemsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsLineItemsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(paymentsLineItemsRemoteFieldClassesListRequestFieldPageSize) } +var ( + paymentsListRequestFieldAccountId = big.NewInt(1 << 0) + paymentsListRequestFieldCompanyId = big.NewInt(1 << 1) + paymentsListRequestFieldContactId = big.NewInt(1 << 2) + paymentsListRequestFieldCreatedAfter = big.NewInt(1 << 3) + paymentsListRequestFieldCreatedBefore = big.NewInt(1 << 4) + paymentsListRequestFieldCursor = big.NewInt(1 << 5) + paymentsListRequestFieldExpand = big.NewInt(1 << 6) + paymentsListRequestFieldIncludeDeletedData = big.NewInt(1 << 7) + paymentsListRequestFieldIncludeRemoteData = big.NewInt(1 << 8) + paymentsListRequestFieldIncludeRemoteFields = big.NewInt(1 << 9) + paymentsListRequestFieldIncludeShellData = big.NewInt(1 << 10) + paymentsListRequestFieldModifiedAfter = big.NewInt(1 << 11) + paymentsListRequestFieldModifiedBefore = big.NewInt(1 << 12) + paymentsListRequestFieldPageSize = big.NewInt(1 << 13) + paymentsListRequestFieldRemoteId = big.NewInt(1 << 14) + paymentsListRequestFieldTransactionDateAfter = big.NewInt(1 << 15) + paymentsListRequestFieldTransactionDateBefore = big.NewInt(1 << 16) +) + type PaymentsListRequest struct { // If provided, will only return payments for this account. AccountId *string `json:"-" url:"account_id,omitempty"` @@ -69,16 +196,192 @@ type PaymentsListRequest struct { TransactionDateAfter *time.Time `json:"-" url:"transaction_date_after,omitempty"` // If provided, will only return objects created before this datetime. TransactionDateBefore *time.Time `json:"-" url:"transaction_date_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PaymentsListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetAccountId sets the AccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetAccountId(accountId *string) { + p.AccountId = accountId + p.require(paymentsListRequestFieldAccountId) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetCompanyId(companyId *string) { + p.CompanyId = companyId + p.require(paymentsListRequestFieldCompanyId) +} + +// SetContactId sets the ContactId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetContactId(contactId *string) { + p.ContactId = contactId + p.require(paymentsListRequestFieldContactId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetCreatedAfter(createdAfter *time.Time) { + p.CreatedAfter = createdAfter + p.require(paymentsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetCreatedBefore(createdBefore *time.Time) { + p.CreatedBefore = createdBefore + p.require(paymentsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(paymentsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetExpand(expand []*PaymentsListRequestExpandItem) { + p.Expand = expand + p.require(paymentsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(paymentsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(paymentsListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + p.IncludeRemoteFields = includeRemoteFields + p.require(paymentsListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(paymentsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + p.ModifiedAfter = modifiedAfter + p.require(paymentsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + p.ModifiedBefore = modifiedBefore + p.require(paymentsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(paymentsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(paymentsListRequestFieldRemoteId) +} + +// SetTransactionDateAfter sets the TransactionDateAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetTransactionDateAfter(transactionDateAfter *time.Time) { + p.TransactionDateAfter = transactionDateAfter + p.require(paymentsListRequestFieldTransactionDateAfter) +} + +// SetTransactionDateBefore sets the TransactionDateBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsListRequest) SetTransactionDateBefore(transactionDateBefore *time.Time) { + p.TransactionDateBefore = transactionDateBefore + p.require(paymentsListRequestFieldTransactionDateBefore) } +var ( + patchedPaymentEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedPaymentEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedPaymentEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PatchedPaymentEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PatchedPaymentRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedPaymentEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedPaymentEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedPaymentEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentEndpointRequest) SetModel(model *PatchedPaymentRequest) { + p.Model = model + p.require(patchedPaymentEndpointRequestFieldModel) } +var ( + paymentsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + paymentsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + paymentsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + paymentsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + paymentsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + paymentsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + paymentsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type PaymentsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -94,8 +397,74 @@ type PaymentsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (p *PaymentsRemoteFieldClassesListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(paymentsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(paymentsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(paymentsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(paymentsRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + p.IsCommonModelField = isCommonModelField + p.require(paymentsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + p.IsCustom = isCustom + p.require(paymentsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(paymentsRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + paymentsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + paymentsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + paymentsRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + paymentsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) +) + type PaymentsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*PaymentsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -105,6 +474,44 @@ type PaymentsRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PaymentsRetrieveRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRetrieveRequest) SetExpand(expand []*PaymentsRetrieveRequestExpandItem) { + p.Expand = expand + p.require(paymentsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(paymentsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + p.IncludeRemoteFields = includeRemoteFields + p.require(paymentsRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(paymentsRetrieveRequestFieldIncludeShellData) } type PaymentsListRequestExpandItem string @@ -181,11 +588,20 @@ func (p PaymentsRetrieveRequestExpandItem) Ptr() *PaymentsRetrieveRequestExpandI return &p } +var ( + paginatedPaymentListFieldNext = big.NewInt(1 << 0) + paginatedPaymentListFieldPrevious = big.NewInt(1 << 1) + paginatedPaymentListFieldResults = big.NewInt(1 << 2) +) + type PaginatedPaymentList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Payment `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -215,6 +631,34 @@ func (p *PaginatedPaymentList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedPaymentList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPaymentList) SetNext(next *string) { + p.Next = next + p.require(paginatedPaymentListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPaymentList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedPaymentListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPaymentList) SetResults(results []*Payment) { + p.Results = results + p.require(paginatedPaymentListFieldResults) +} + func (p *PaginatedPaymentList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedPaymentList var value unmarshaler @@ -231,6 +675,17 @@ func (p *PaginatedPaymentList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedPaymentList) MarshalJSON() ([]byte, error) { + type embed PaginatedPaymentList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedPaymentList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -249,6 +704,24 @@ func (p *PaginatedPaymentList) String() string { // // ### Usage Example // Fetch from the `GET Payment` endpoint and view an invoice's payment. +var ( + patchedPaymentRequestFieldTransactionDate = big.NewInt(1 << 0) + patchedPaymentRequestFieldContact = big.NewInt(1 << 1) + patchedPaymentRequestFieldAccount = big.NewInt(1 << 2) + patchedPaymentRequestFieldPaymentMethod = big.NewInt(1 << 3) + patchedPaymentRequestFieldCurrency = big.NewInt(1 << 4) + patchedPaymentRequestFieldExchangeRate = big.NewInt(1 << 5) + patchedPaymentRequestFieldCompany = big.NewInt(1 << 6) + patchedPaymentRequestFieldTotalAmount = big.NewInt(1 << 7) + patchedPaymentRequestFieldType = big.NewInt(1 << 8) + patchedPaymentRequestFieldTrackingCategories = big.NewInt(1 << 9) + patchedPaymentRequestFieldAccountingPeriod = big.NewInt(1 << 10) + patchedPaymentRequestFieldAppliedToLines = big.NewInt(1 << 11) + patchedPaymentRequestFieldIntegrationParams = big.NewInt(1 << 12) + patchedPaymentRequestFieldLinkedAccountParams = big.NewInt(1 << 13) + patchedPaymentRequestFieldRemoteFields = big.NewInt(1 << 14) +) + type PatchedPaymentRequest struct { // The payment's transaction date. TransactionDate *time.Time `json:"transaction_date,omitempty" url:"transaction_date,omitempty"` @@ -587,6 +1060,9 @@ type PatchedPaymentRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -700,6 +1176,118 @@ func (p *PatchedPaymentRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PatchedPaymentRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetTransactionDate(transactionDate *time.Time) { + p.TransactionDate = transactionDate + p.require(patchedPaymentRequestFieldTransactionDate) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetContact(contact *PatchedPaymentRequestContact) { + p.Contact = contact + p.require(patchedPaymentRequestFieldContact) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetAccount(account *PatchedPaymentRequestAccount) { + p.Account = account + p.require(patchedPaymentRequestFieldAccount) +} + +// SetPaymentMethod sets the PaymentMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetPaymentMethod(paymentMethod *PatchedPaymentRequestPaymentMethod) { + p.PaymentMethod = paymentMethod + p.require(patchedPaymentRequestFieldPaymentMethod) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetCurrency(currency *PatchedPaymentRequestCurrency) { + p.Currency = currency + p.require(patchedPaymentRequestFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetExchangeRate(exchangeRate *string) { + p.ExchangeRate = exchangeRate + p.require(patchedPaymentRequestFieldExchangeRate) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetCompany(company *PatchedPaymentRequestCompany) { + p.Company = company + p.require(patchedPaymentRequestFieldCompany) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetTotalAmount(totalAmount *float64) { + p.TotalAmount = totalAmount + p.require(patchedPaymentRequestFieldTotalAmount) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetType(type_ *PatchedPaymentRequestType) { + p.Type = type_ + p.require(patchedPaymentRequestFieldType) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetTrackingCategories(trackingCategories []*PatchedPaymentRequestTrackingCategoriesItem) { + p.TrackingCategories = trackingCategories + p.require(patchedPaymentRequestFieldTrackingCategories) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetAccountingPeriod(accountingPeriod *PatchedPaymentRequestAccountingPeriod) { + p.AccountingPeriod = accountingPeriod + p.require(patchedPaymentRequestFieldAccountingPeriod) +} + +// SetAppliedToLines sets the AppliedToLines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetAppliedToLines(appliedToLines []*PatchedPaymentRequestAppliedToLinesItem) { + p.AppliedToLines = appliedToLines + p.require(patchedPaymentRequestFieldAppliedToLines) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(patchedPaymentRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(patchedPaymentRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedPaymentRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(patchedPaymentRequestFieldRemoteFields) +} + func (p *PatchedPaymentRequest) UnmarshalJSON(data []byte) error { type embed PatchedPaymentRequest var unmarshaler = struct { @@ -731,7 +1319,8 @@ func (p *PatchedPaymentRequest) MarshalJSON() ([]byte, error) { embed: embed(*p), TransactionDate: internal.NewOptionalDateTime(p.TransactionDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PatchedPaymentRequest) String() string { @@ -1627,6 +2216,17 @@ func (p *PatchedPaymentRequestType) Accept(visitor PatchedPaymentRequestTypeVisi // // ### 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`. +var ( + paymentLineItemRequestFieldRemoteId = big.NewInt(1 << 0) + paymentLineItemRequestFieldAppliedAmount = big.NewInt(1 << 1) + paymentLineItemRequestFieldAppliedDate = big.NewInt(1 << 2) + paymentLineItemRequestFieldRelatedObjectId = big.NewInt(1 << 3) + paymentLineItemRequestFieldRelatedObjectType = big.NewInt(1 << 4) + paymentLineItemRequestFieldIntegrationParams = big.NewInt(1 << 5) + paymentLineItemRequestFieldLinkedAccountParams = big.NewInt(1 << 6) + paymentLineItemRequestFieldRemoteFields = big.NewInt(1 << 7) +) + type PaymentLineItemRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -1642,6 +2242,9 @@ type PaymentLineItemRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1706,6 +2309,69 @@ func (p *PaymentLineItemRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaymentLineItemRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItemRequest) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(paymentLineItemRequestFieldRemoteId) +} + +// SetAppliedAmount sets the AppliedAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItemRequest) SetAppliedAmount(appliedAmount *string) { + p.AppliedAmount = appliedAmount + p.require(paymentLineItemRequestFieldAppliedAmount) +} + +// SetAppliedDate sets the AppliedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItemRequest) SetAppliedDate(appliedDate *time.Time) { + p.AppliedDate = appliedDate + p.require(paymentLineItemRequestFieldAppliedDate) +} + +// SetRelatedObjectId sets the RelatedObjectId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItemRequest) SetRelatedObjectId(relatedObjectId *string) { + p.RelatedObjectId = relatedObjectId + p.require(paymentLineItemRequestFieldRelatedObjectId) +} + +// SetRelatedObjectType sets the RelatedObjectType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItemRequest) SetRelatedObjectType(relatedObjectType *string) { + p.RelatedObjectType = relatedObjectType + p.require(paymentLineItemRequestFieldRelatedObjectType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItemRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(paymentLineItemRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItemRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(paymentLineItemRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItemRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(paymentLineItemRequestFieldRemoteFields) +} + func (p *PaymentLineItemRequest) UnmarshalJSON(data []byte) error { type embed PaymentLineItemRequest var unmarshaler = struct { @@ -1737,7 +2403,8 @@ func (p *PaymentLineItemRequest) MarshalJSON() ([]byte, error) { embed: embed(*p), AppliedDate: internal.NewOptionalDateTime(p.AppliedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PaymentLineItemRequest) String() string { @@ -1758,6 +2425,24 @@ func (p *PaymentLineItemRequest) String() string { // // ### Usage Example // Fetch from the `GET Payment` endpoint and view an invoice's payment. +var ( + paymentRequestFieldTransactionDate = big.NewInt(1 << 0) + paymentRequestFieldContact = big.NewInt(1 << 1) + paymentRequestFieldAccount = big.NewInt(1 << 2) + paymentRequestFieldPaymentMethod = big.NewInt(1 << 3) + paymentRequestFieldCurrency = big.NewInt(1 << 4) + paymentRequestFieldExchangeRate = big.NewInt(1 << 5) + paymentRequestFieldCompany = big.NewInt(1 << 6) + paymentRequestFieldTotalAmount = big.NewInt(1 << 7) + paymentRequestFieldType = big.NewInt(1 << 8) + paymentRequestFieldTrackingCategories = big.NewInt(1 << 9) + paymentRequestFieldAccountingPeriod = big.NewInt(1 << 10) + paymentRequestFieldAppliedToLines = big.NewInt(1 << 11) + paymentRequestFieldIntegrationParams = big.NewInt(1 << 12) + paymentRequestFieldLinkedAccountParams = big.NewInt(1 << 13) + paymentRequestFieldRemoteFields = big.NewInt(1 << 14) +) + type PaymentRequest struct { // The payment's transaction date. TransactionDate *time.Time `json:"transaction_date,omitempty" url:"transaction_date,omitempty"` @@ -2096,6 +2781,9 @@ type PaymentRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2209,6 +2897,118 @@ func (p *PaymentRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaymentRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetTransactionDate(transactionDate *time.Time) { + p.TransactionDate = transactionDate + p.require(paymentRequestFieldTransactionDate) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetContact(contact *PaymentRequestContact) { + p.Contact = contact + p.require(paymentRequestFieldContact) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetAccount(account *PaymentRequestAccount) { + p.Account = account + p.require(paymentRequestFieldAccount) +} + +// SetPaymentMethod sets the PaymentMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetPaymentMethod(paymentMethod *PaymentRequestPaymentMethod) { + p.PaymentMethod = paymentMethod + p.require(paymentRequestFieldPaymentMethod) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetCurrency(currency *PaymentRequestCurrency) { + p.Currency = currency + p.require(paymentRequestFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetExchangeRate(exchangeRate *string) { + p.ExchangeRate = exchangeRate + p.require(paymentRequestFieldExchangeRate) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetCompany(company *PaymentRequestCompany) { + p.Company = company + p.require(paymentRequestFieldCompany) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetTotalAmount(totalAmount *float64) { + p.TotalAmount = totalAmount + p.require(paymentRequestFieldTotalAmount) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetType(type_ *PaymentRequestType) { + p.Type = type_ + p.require(paymentRequestFieldType) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetTrackingCategories(trackingCategories []*PaymentRequestTrackingCategoriesItem) { + p.TrackingCategories = trackingCategories + p.require(paymentRequestFieldTrackingCategories) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetAccountingPeriod(accountingPeriod *PaymentRequestAccountingPeriod) { + p.AccountingPeriod = accountingPeriod + p.require(paymentRequestFieldAccountingPeriod) +} + +// SetAppliedToLines sets the AppliedToLines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetAppliedToLines(appliedToLines []*PaymentRequestAppliedToLinesItem) { + p.AppliedToLines = appliedToLines + p.require(paymentRequestFieldAppliedToLines) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(paymentRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(paymentRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(paymentRequestFieldRemoteFields) +} + func (p *PaymentRequest) UnmarshalJSON(data []byte) error { type embed PaymentRequest var unmarshaler = struct { @@ -2240,7 +3040,8 @@ func (p *PaymentRequest) MarshalJSON() ([]byte, error) { embed: embed(*p), TransactionDate: internal.NewOptionalDateTime(p.TransactionDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PaymentRequest) String() string { @@ -3130,12 +3931,22 @@ func (p *PaymentRequestType) Accept(visitor PaymentRequestTypeVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", p) } +var ( + paymentResponseFieldModel = big.NewInt(1 << 0) + paymentResponseFieldWarnings = big.NewInt(1 << 1) + paymentResponseFieldErrors = big.NewInt(1 << 2) + paymentResponseFieldLogs = big.NewInt(1 << 3) +) + type PaymentResponse struct { Model *Payment `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3172,6 +3983,41 @@ func (p *PaymentResponse) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaymentResponse) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentResponse) SetModel(model *Payment) { + p.Model = model + p.require(paymentResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentResponse) SetWarnings(warnings []*WarningValidationProblem) { + p.Warnings = warnings + p.require(paymentResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentResponse) SetErrors(errors []*ErrorValidationProblem) { + p.Errors = errors + p.require(paymentResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentResponse) SetLogs(logs []*DebugModeLog) { + p.Logs = logs + p.require(paymentResponseFieldLogs) +} + func (p *PaymentResponse) UnmarshalJSON(data []byte) error { type unmarshaler PaymentResponse var value unmarshaler @@ -3188,6 +4034,17 @@ func (p *PaymentResponse) UnmarshalJSON(data []byte) error { return nil } +func (p *PaymentResponse) MarshalJSON() ([]byte, error) { + type embed PaymentResponse + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaymentResponse) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/payments/accounting_payments_test/accounting_payments_test.go b/accounting/payments/accounting_payments_test/accounting_payments_test.go new file mode 100644 index 0000000..19a3121 --- /dev/null +++ b/accounting/payments/accounting_payments_test/accounting_payments_test.go @@ -0,0 +1,353 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_payments_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingPaymentsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PaymentsListRequest{ + AccountId: merge.String( + "account_id", + ), + CompanyId: merge.String( + "company_id", + ), + ContactId: merge.String( + "contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Accounting.Payments.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payments", map[string]string{"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"}, 1) +} + +func TestAccountingPaymentsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PaymentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.PaymentRequest{}, + } + _, invocationErr := client.Accounting.Payments.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/payments", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingPaymentsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PaymentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Payments.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payments/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestAccountingPaymentsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PatchedPaymentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.PatchedPaymentRequest{}, + } + _, invocationErr := client.Accounting.Payments.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/accounting/v1/payments/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingPaymentsLineItemsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PaymentsLineItemsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.Payments.LineItemsRemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payments/line-items/remote-field-classes", map[string]string{"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"}, 1) +} + +func TestAccountingPaymentsMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Payments.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payments/meta/patch/id", nil, 1) +} + +func TestAccountingPaymentsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Payments.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payments/meta/post", nil, 1) +} + +func TestAccountingPaymentsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PaymentsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.Payments.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payments/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/accounting/payments/client.go b/accounting/payments/client.go index 93319d1..be02627 100644 --- a/accounting/payments/client.go +++ b/accounting/payments/client.go @@ -4,7 +4,6 @@ package payments import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.PaymentsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.Payment], error) { +) (*core.Page[*string, *accounting.Payment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedPaymentList) *internal.PageResponse[*string, *accounting.Payment] { + readPageResponse := func(response *accounting.PaginatedPaymentList) *core.PageResponse[*string, *accounting.Payment] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.Payment]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.Payment]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.PaymentEndpointRequest, opts ...option.RequestOption, ) (*accounting.PaymentResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/payments" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.PaymentResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Payment` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.PaymentsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Payment, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/payments/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Payment - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates a `Payment` object with the given `id`. @@ -192,47 +134,16 @@ func (c *Client) PartialUpdate( request *accounting.PatchedPaymentEndpointRequest, opts ...option.RequestOption, ) (*accounting.PaymentResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/payments/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.PaymentResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -240,7 +151,7 @@ func (c *Client) LineItemsRemoteFieldClassesList( ctx context.Context, request *accounting.PaymentsLineItemsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -253,13 +164,12 @@ func (c *Client) LineItemsRemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -276,11 +186,11 @@ func (c *Client) LineItemsRemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, @@ -300,38 +210,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/payments/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `Payment` POSTs. @@ -339,35 +226,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/payments/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -375,7 +241,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *accounting.PaymentsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -388,13 +254,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -411,11 +276,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/accounting/payments/raw_client.go b/accounting/payments/raw_client.go new file mode 100644 index 0000000..480f3b5 --- /dev/null +++ b/accounting/payments/raw_client.go @@ -0,0 +1,266 @@ +// Code generated by Fern. DO NOT EDIT. + +package payments + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.PaymentEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.PaymentResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/payments" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.PaymentResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.PaymentResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.PaymentsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Payment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/payments/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Payment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Payment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *accounting.PatchedPaymentEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.PaymentResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/payments/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.PaymentResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.PaymentResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/payments/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/payments/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/paymentterms/accounting_payment_terms_test/accounting_payment_terms_test.go b/accounting/paymentterms/accounting_payment_terms_test/accounting_payment_terms_test.go new file mode 100644 index 0000000..7598e8c --- /dev/null +++ b/accounting/paymentterms/accounting_payment_terms_test/accounting_payment_terms_test.go @@ -0,0 +1,127 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_payment_terms_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingPaymentTermsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PaymentTermsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.PaymentTerms.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payment-terms", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} + +func TestAccountingPaymentTermsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PaymentTermsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.PaymentTerms.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/payment-terms/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/paymentterms/client.go b/accounting/paymentterms/client.go index de2079c..fd1be11 100644 --- a/accounting/paymentterms/client.go +++ b/accounting/paymentterms/client.go @@ -4,7 +4,6 @@ package paymentterms import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.PaymentTermsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.PaymentTerm], error) { +) (*core.Page[*string, *accounting.PaymentTerm], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedPaymentTermList) *internal.PageResponse[*string, *accounting.PaymentTerm] { + readPageResponse := func(response *accounting.PaginatedPaymentTermList) *core.PageResponse[*string, *accounting.PaymentTerm] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.PaymentTerm]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.PaymentTerm]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.PaymentTermsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.PaymentTerm, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/payment-terms/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.PaymentTerm - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/paymentterms/raw_client.go b/accounting/paymentterms/raw_client.go new file mode 100644 index 0000000..a7de2f9 --- /dev/null +++ b/accounting/paymentterms/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package paymentterms + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.PaymentTermsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.PaymentTerm], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/payment-terms/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.PaymentTerm + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.PaymentTerm]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/phone_numbers.go b/accounting/phone_numbers.go index 2c9fdd7..90b6539 100644 --- a/accounting/phone_numbers.go +++ b/accounting/phone_numbers.go @@ -2,9 +2,42 @@ package accounting +import ( + big "math/big" +) + +var ( + phoneNumbersRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + phoneNumbersRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type PhoneNumbersRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PhoneNumbersRetrieveRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumbersRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(phoneNumbersRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumbersRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(phoneNumbersRetrieveRequestFieldIncludeShellData) } diff --git a/accounting/phonenumbers/accounting_phone_numbers_test/accounting_phone_numbers_test.go b/accounting/phonenumbers/accounting_phone_numbers_test/accounting_phone_numbers_test.go new file mode 100644 index 0000000..8d09756 --- /dev/null +++ b/accounting/phonenumbers/accounting_phone_numbers_test/accounting_phone_numbers_test.go @@ -0,0 +1,91 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_phone_numbers_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingPhoneNumbersRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PhoneNumbersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.PhoneNumbers.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/phone-numbers/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/phonenumbers/client.go b/accounting/phonenumbers/client.go index c07c702..3bb5676 100644 --- a/accounting/phonenumbers/client.go +++ b/accounting/phonenumbers/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -38,43 +39,14 @@ func (c *Client) Retrieve( request *accounting.PhoneNumbersRetrieveRequest, opts ...option.RequestOption, ) (*accounting.AccountingPhoneNumber, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/phone-numbers/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.AccountingPhoneNumber - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/phonenumbers/raw_client.go b/accounting/phonenumbers/raw_client.go new file mode 100644 index 0000000..2312b30 --- /dev/null +++ b/accounting/phonenumbers/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package phonenumbers + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.PhoneNumbersRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.AccountingPhoneNumber], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/phone-numbers/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.AccountingPhoneNumber + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.AccountingPhoneNumber]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/projects.go b/accounting/projects.go index 84b26a7..b8ec34c 100644 --- a/accounting/projects.go +++ b/accounting/projects.go @@ -6,6 +6,16 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + projectsListRequestFieldCursor = big.NewInt(1 << 0) + projectsListRequestFieldExpand = big.NewInt(1 << 1) + projectsListRequestFieldIncludeDeletedData = big.NewInt(1 << 2) + projectsListRequestFieldIncludeRemoteData = big.NewInt(1 << 3) + projectsListRequestFieldIncludeShellData = big.NewInt(1 << 4) + projectsListRequestFieldPageSize = big.NewInt(1 << 5) ) type ProjectsListRequest struct { @@ -21,8 +31,66 @@ type ProjectsListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *ProjectsListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(projectsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetExpand(expand []*ProjectsListRequestExpandItem) { + p.Expand = expand + p.require(projectsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(projectsListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(projectsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(projectsListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(projectsListRequestFieldPageSize) +} + +var ( + projectsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + projectsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + projectsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type ProjectsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*ProjectsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -30,6 +98,37 @@ type ProjectsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *ProjectsRetrieveRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsRetrieveRequest) SetExpand(expand []*ProjectsRetrieveRequestExpandItem) { + p.Expand = expand + p.require(projectsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(projectsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(projectsRetrieveRequestFieldIncludeShellData) } type ProjectsListRequestExpandItem string @@ -76,11 +175,20 @@ func (p ProjectsRetrieveRequestExpandItem) Ptr() *ProjectsRetrieveRequestExpandI return &p } +var ( + paginatedProjectListFieldNext = big.NewInt(1 << 0) + paginatedProjectListFieldPrevious = big.NewInt(1 << 1) + paginatedProjectListFieldResults = big.NewInt(1 << 2) +) + type PaginatedProjectList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Project `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -110,6 +218,34 @@ func (p *PaginatedProjectList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedProjectList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedProjectList) SetNext(next *string) { + p.Next = next + p.require(paginatedProjectListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedProjectList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedProjectListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedProjectList) SetResults(results []*Project) { + p.Results = results + p.require(paginatedProjectListFieldResults) +} + func (p *PaginatedProjectList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedProjectList var value unmarshaler @@ -126,6 +262,17 @@ func (p *PaginatedProjectList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedProjectList) MarshalJSON() ([]byte, error) { + type embed PaginatedProjectList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedProjectList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/projects/accounting_projects_test/accounting_projects_test.go b/accounting/projects/accounting_projects_test/accounting_projects_test.go new file mode 100644 index 0000000..61bd85b --- /dev/null +++ b/accounting/projects/accounting_projects_test/accounting_projects_test.go @@ -0,0 +1,127 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_projects_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingProjectsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ProjectsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.Projects.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/projects", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} + +func TestAccountingProjectsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.ProjectsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Projects.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/projects/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/projects/client.go b/accounting/projects/client.go index c98da2b..9afbcf5 100644 --- a/accounting/projects/client.go +++ b/accounting/projects/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,42 +38,15 @@ func (c *Client) List( request *accounting.ProjectsListRequest, opts ...option.RequestOption, ) (*accounting.PaginatedProjectList, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.List( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/projects" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.PaginatedProjectList - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Project` object with the given `id`. @@ -82,43 +56,14 @@ func (c *Client) Retrieve( request *accounting.ProjectsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Project, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/projects/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Project - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/projects/raw_client.go b/accounting/projects/raw_client.go new file mode 100644 index 0000000..7bb95a9 --- /dev/null +++ b/accounting/projects/raw_client.go @@ -0,0 +1,129 @@ +// Code generated by Fern. DO NOT EDIT. + +package projects + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + request *accounting.ProjectsListRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.PaginatedProjectList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/projects" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.PaginatedProjectList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.PaginatedProjectList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.ProjectsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Project], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/projects/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Project + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Project]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/purchase_orders.go b/accounting/purchase_orders.go index 27b0f8f..cc3c3fc 100644 --- a/accounting/purchase_orders.go +++ b/accounting/purchase_orders.go @@ -6,17 +6,65 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + purchaseOrderEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + purchaseOrderEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + purchaseOrderEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PurchaseOrderEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PurchaseOrderRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PurchaseOrderEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(purchaseOrderEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(purchaseOrderEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderEndpointRequest) SetModel(model *PurchaseOrderRequest) { + p.Model = model + p.require(purchaseOrderEndpointRequestFieldModel) +} + +var ( + purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type PurchaseOrdersLineItemsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -32,8 +80,87 @@ type PurchaseOrdersLineItemsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PurchaseOrdersLineItemsRemoteFieldClassesListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersLineItemsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersLineItemsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersLineItemsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersLineItemsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersLineItemsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + p.IsCommonModelField = isCommonModelField + p.require(purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersLineItemsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + p.IsCustom = isCustom + p.require(purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldIsCustom) } +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersLineItemsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(purchaseOrdersLineItemsRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + purchaseOrdersListRequestFieldCompanyId = big.NewInt(1 << 0) + purchaseOrdersListRequestFieldCreatedAfter = big.NewInt(1 << 1) + purchaseOrdersListRequestFieldCreatedBefore = big.NewInt(1 << 2) + purchaseOrdersListRequestFieldCursor = big.NewInt(1 << 3) + purchaseOrdersListRequestFieldExpand = big.NewInt(1 << 4) + purchaseOrdersListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + purchaseOrdersListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + purchaseOrdersListRequestFieldIncludeRemoteFields = big.NewInt(1 << 7) + purchaseOrdersListRequestFieldIncludeShellData = big.NewInt(1 << 8) + purchaseOrdersListRequestFieldIssueDateAfter = big.NewInt(1 << 9) + purchaseOrdersListRequestFieldIssueDateBefore = big.NewInt(1 << 10) + purchaseOrdersListRequestFieldModifiedAfter = big.NewInt(1 << 11) + purchaseOrdersListRequestFieldModifiedBefore = big.NewInt(1 << 12) + purchaseOrdersListRequestFieldPageSize = big.NewInt(1 << 13) + purchaseOrdersListRequestFieldRemoteFields = big.NewInt(1 << 14) + purchaseOrdersListRequestFieldRemoteId = big.NewInt(1 << 15) + purchaseOrdersListRequestFieldShowEnumOrigins = big.NewInt(1 << 16) +) + type PurchaseOrdersListRequest struct { // If provided, will only return purchase orders for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -69,8 +196,147 @@ type PurchaseOrdersListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PurchaseOrdersListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetCompanyId(companyId *string) { + p.CompanyId = companyId + p.require(purchaseOrdersListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetCreatedAfter(createdAfter *time.Time) { + p.CreatedAfter = createdAfter + p.require(purchaseOrdersListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetCreatedBefore(createdBefore *time.Time) { + p.CreatedBefore = createdBefore + p.require(purchaseOrdersListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(purchaseOrdersListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetExpand(expand []*PurchaseOrdersListRequestExpandItem) { + p.Expand = expand + p.require(purchaseOrdersListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(purchaseOrdersListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(purchaseOrdersListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + p.IncludeRemoteFields = includeRemoteFields + p.require(purchaseOrdersListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(purchaseOrdersListRequestFieldIncludeShellData) +} + +// SetIssueDateAfter sets the IssueDateAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetIssueDateAfter(issueDateAfter *time.Time) { + p.IssueDateAfter = issueDateAfter + p.require(purchaseOrdersListRequestFieldIssueDateAfter) +} + +// SetIssueDateBefore sets the IssueDateBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetIssueDateBefore(issueDateBefore *time.Time) { + p.IssueDateBefore = issueDateBefore + p.require(purchaseOrdersListRequestFieldIssueDateBefore) } +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + p.ModifiedAfter = modifiedAfter + p.require(purchaseOrdersListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + p.ModifiedBefore = modifiedBefore + p.require(purchaseOrdersListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(purchaseOrdersListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetRemoteFields(remoteFields *string) { + p.RemoteFields = remoteFields + p.require(purchaseOrdersListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(purchaseOrdersListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + p.ShowEnumOrigins = showEnumOrigins + p.require(purchaseOrdersListRequestFieldShowEnumOrigins) +} + +var ( + purchaseOrdersRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + purchaseOrdersRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + purchaseOrdersRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + purchaseOrdersRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 3) + purchaseOrdersRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 4) + purchaseOrdersRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 5) + purchaseOrdersRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 6) +) + type PurchaseOrdersRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -86,8 +352,76 @@ type PurchaseOrdersRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PurchaseOrdersRemoteFieldClassesListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRemoteFieldClassesListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(purchaseOrdersRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(purchaseOrdersRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(purchaseOrdersRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(purchaseOrdersRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + p.IsCommonModelField = isCommonModelField + p.require(purchaseOrdersRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + p.IsCustom = isCustom + p.require(purchaseOrdersRemoteFieldClassesListRequestFieldIsCustom) } +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(purchaseOrdersRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + purchaseOrdersRetrieveRequestFieldExpand = big.NewInt(1 << 0) + purchaseOrdersRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + purchaseOrdersRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + purchaseOrdersRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) + purchaseOrdersRetrieveRequestFieldRemoteFields = big.NewInt(1 << 4) + purchaseOrdersRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 5) +) + type PurchaseOrdersRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*PurchaseOrdersRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -101,6 +435,58 @@ type PurchaseOrdersRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PurchaseOrdersRetrieveRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRetrieveRequest) SetExpand(expand []*PurchaseOrdersRetrieveRequestExpandItem) { + p.Expand = expand + p.require(purchaseOrdersRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(purchaseOrdersRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + p.IncludeRemoteFields = includeRemoteFields + p.require(purchaseOrdersRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(purchaseOrdersRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRetrieveRequest) SetRemoteFields(remoteFields *string) { + p.RemoteFields = remoteFields + p.require(purchaseOrdersRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrdersRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + p.ShowEnumOrigins = showEnumOrigins + p.require(purchaseOrdersRetrieveRequestFieldShowEnumOrigins) } type PurchaseOrdersListRequestExpandItem string @@ -177,11 +563,20 @@ func (p PurchaseOrdersRetrieveRequestExpandItem) Ptr() *PurchaseOrdersRetrieveRe return &p } +var ( + paginatedPurchaseOrderListFieldNext = big.NewInt(1 << 0) + paginatedPurchaseOrderListFieldPrevious = big.NewInt(1 << 1) + paginatedPurchaseOrderListFieldResults = big.NewInt(1 << 2) +) + type PaginatedPurchaseOrderList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*PurchaseOrder `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -211,6 +606,34 @@ func (p *PaginatedPurchaseOrderList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedPurchaseOrderList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPurchaseOrderList) SetNext(next *string) { + p.Next = next + p.require(paginatedPurchaseOrderListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPurchaseOrderList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedPurchaseOrderListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPurchaseOrderList) SetResults(results []*PurchaseOrder) { + p.Results = results + p.require(paginatedPurchaseOrderListFieldResults) +} + func (p *PaginatedPurchaseOrderList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedPurchaseOrderList var value unmarshaler @@ -227,6 +650,17 @@ func (p *PaginatedPurchaseOrderList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedPurchaseOrderList) MarshalJSON() ([]byte, error) { + type embed PaginatedPurchaseOrderList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedPurchaseOrderList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -245,6 +679,26 @@ func (p *PaginatedPurchaseOrderList) String() string { // // ### Usage Example // Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase orders. +var ( + purchaseOrderLineItemRequestFieldRemoteId = big.NewInt(1 << 0) + purchaseOrderLineItemRequestFieldDescription = big.NewInt(1 << 1) + purchaseOrderLineItemRequestFieldUnitPrice = big.NewInt(1 << 2) + purchaseOrderLineItemRequestFieldQuantity = big.NewInt(1 << 3) + purchaseOrderLineItemRequestFieldItem = big.NewInt(1 << 4) + purchaseOrderLineItemRequestFieldAccount = big.NewInt(1 << 5) + purchaseOrderLineItemRequestFieldTrackingCategory = big.NewInt(1 << 6) + purchaseOrderLineItemRequestFieldTrackingCategories = big.NewInt(1 << 7) + purchaseOrderLineItemRequestFieldTaxAmount = big.NewInt(1 << 8) + purchaseOrderLineItemRequestFieldTotalLineAmount = big.NewInt(1 << 9) + purchaseOrderLineItemRequestFieldCurrency = big.NewInt(1 << 10) + purchaseOrderLineItemRequestFieldTaxRate = big.NewInt(1 << 11) + purchaseOrderLineItemRequestFieldExchangeRate = big.NewInt(1 << 12) + purchaseOrderLineItemRequestFieldCompany = big.NewInt(1 << 13) + purchaseOrderLineItemRequestFieldIntegrationParams = big.NewInt(1 << 14) + purchaseOrderLineItemRequestFieldLinkedAccountParams = big.NewInt(1 << 15) + purchaseOrderLineItemRequestFieldRemoteFields = big.NewInt(1 << 16) +) + type PurchaseOrderLineItemRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -584,6 +1038,9 @@ type PurchaseOrderLineItemRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -711,6 +1168,132 @@ func (p *PurchaseOrderLineItemRequest) GetExtraProperties() map[string]interface return p.extraProperties } +func (p *PurchaseOrderLineItemRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(purchaseOrderLineItemRequestFieldRemoteId) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetDescription(description *string) { + p.Description = description + p.require(purchaseOrderLineItemRequestFieldDescription) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetUnitPrice(unitPrice *float64) { + p.UnitPrice = unitPrice + p.require(purchaseOrderLineItemRequestFieldUnitPrice) +} + +// SetQuantity sets the Quantity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetQuantity(quantity *float64) { + p.Quantity = quantity + p.require(purchaseOrderLineItemRequestFieldQuantity) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetItem(item *PurchaseOrderLineItemRequestItem) { + p.Item = item + p.require(purchaseOrderLineItemRequestFieldItem) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetAccount(account *string) { + p.Account = account + p.require(purchaseOrderLineItemRequestFieldAccount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetTrackingCategory(trackingCategory *string) { + p.TrackingCategory = trackingCategory + p.require(purchaseOrderLineItemRequestFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetTrackingCategories(trackingCategories []*string) { + p.TrackingCategories = trackingCategories + p.require(purchaseOrderLineItemRequestFieldTrackingCategories) +} + +// SetTaxAmount sets the TaxAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetTaxAmount(taxAmount *string) { + p.TaxAmount = taxAmount + p.require(purchaseOrderLineItemRequestFieldTaxAmount) +} + +// SetTotalLineAmount sets the TotalLineAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetTotalLineAmount(totalLineAmount *string) { + p.TotalLineAmount = totalLineAmount + p.require(purchaseOrderLineItemRequestFieldTotalLineAmount) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetCurrency(currency *PurchaseOrderLineItemRequestCurrency) { + p.Currency = currency + p.require(purchaseOrderLineItemRequestFieldCurrency) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetTaxRate(taxRate *string) { + p.TaxRate = taxRate + p.require(purchaseOrderLineItemRequestFieldTaxRate) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetExchangeRate(exchangeRate *string) { + p.ExchangeRate = exchangeRate + p.require(purchaseOrderLineItemRequestFieldExchangeRate) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetCompany(company *string) { + p.Company = company + p.require(purchaseOrderLineItemRequestFieldCompany) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(purchaseOrderLineItemRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(purchaseOrderLineItemRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItemRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(purchaseOrderLineItemRequestFieldRemoteFields) +} + func (p *PurchaseOrderLineItemRequest) UnmarshalJSON(data []byte) error { type unmarshaler PurchaseOrderLineItemRequest var value unmarshaler @@ -727,6 +1310,17 @@ func (p *PurchaseOrderLineItemRequest) UnmarshalJSON(data []byte) error { return nil } +func (p *PurchaseOrderLineItemRequest) MarshalJSON() ([]byte, error) { + type embed PurchaseOrderLineItemRequest + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PurchaseOrderLineItemRequest) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -1177,6 +1771,27 @@ func (p *PurchaseOrderLineItemRequestItem) Accept(visitor PurchaseOrderLineItemR // // ### Usage Example // Fetch from the `LIST PurchaseOrders` endpoint and view a company's purchase orders. +var ( + purchaseOrderRequestFieldStatus = big.NewInt(1 << 0) + purchaseOrderRequestFieldIssueDate = big.NewInt(1 << 1) + purchaseOrderRequestFieldDeliveryDate = big.NewInt(1 << 2) + purchaseOrderRequestFieldDeliveryAddress = big.NewInt(1 << 3) + purchaseOrderRequestFieldCustomer = big.NewInt(1 << 4) + purchaseOrderRequestFieldVendor = big.NewInt(1 << 5) + purchaseOrderRequestFieldMemo = big.NewInt(1 << 6) + purchaseOrderRequestFieldCompany = big.NewInt(1 << 7) + purchaseOrderRequestFieldTotalAmount = big.NewInt(1 << 8) + purchaseOrderRequestFieldPaymentTerm = big.NewInt(1 << 9) + purchaseOrderRequestFieldCurrency = big.NewInt(1 << 10) + purchaseOrderRequestFieldInclusiveOfTax = big.NewInt(1 << 11) + purchaseOrderRequestFieldExchangeRate = big.NewInt(1 << 12) + purchaseOrderRequestFieldTrackingCategories = big.NewInt(1 << 13) + purchaseOrderRequestFieldLineItems = big.NewInt(1 << 14) + purchaseOrderRequestFieldIntegrationParams = big.NewInt(1 << 15) + purchaseOrderRequestFieldLinkedAccountParams = big.NewInt(1 << 16) + purchaseOrderRequestFieldRemoteFields = big.NewInt(1 << 17) +) + type PurchaseOrderRequest struct { // The purchase order's status. // @@ -1523,6 +2138,9 @@ type PurchaseOrderRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1657,6 +2275,139 @@ func (p *PurchaseOrderRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PurchaseOrderRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetStatus(status *PurchaseOrderRequestStatus) { + p.Status = status + p.require(purchaseOrderRequestFieldStatus) +} + +// SetIssueDate sets the IssueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetIssueDate(issueDate *time.Time) { + p.IssueDate = issueDate + p.require(purchaseOrderRequestFieldIssueDate) +} + +// SetDeliveryDate sets the DeliveryDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetDeliveryDate(deliveryDate *time.Time) { + p.DeliveryDate = deliveryDate + p.require(purchaseOrderRequestFieldDeliveryDate) +} + +// SetDeliveryAddress sets the DeliveryAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetDeliveryAddress(deliveryAddress *PurchaseOrderRequestDeliveryAddress) { + p.DeliveryAddress = deliveryAddress + p.require(purchaseOrderRequestFieldDeliveryAddress) +} + +// SetCustomer sets the Customer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetCustomer(customer *string) { + p.Customer = customer + p.require(purchaseOrderRequestFieldCustomer) +} + +// SetVendor sets the Vendor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetVendor(vendor_ *PurchaseOrderRequestVendor) { + p.Vendor = vendor_ + p.require(purchaseOrderRequestFieldVendor) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetMemo(memo *string) { + p.Memo = memo + p.require(purchaseOrderRequestFieldMemo) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetCompany(company *PurchaseOrderRequestCompany) { + p.Company = company + p.require(purchaseOrderRequestFieldCompany) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetTotalAmount(totalAmount *float64) { + p.TotalAmount = totalAmount + p.require(purchaseOrderRequestFieldTotalAmount) +} + +// SetPaymentTerm sets the PaymentTerm field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetPaymentTerm(paymentTerm *PurchaseOrderRequestPaymentTerm) { + p.PaymentTerm = paymentTerm + p.require(purchaseOrderRequestFieldPaymentTerm) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetCurrency(currency *PurchaseOrderRequestCurrency) { + p.Currency = currency + p.require(purchaseOrderRequestFieldCurrency) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetInclusiveOfTax(inclusiveOfTax *bool) { + p.InclusiveOfTax = inclusiveOfTax + p.require(purchaseOrderRequestFieldInclusiveOfTax) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetExchangeRate(exchangeRate *string) { + p.ExchangeRate = exchangeRate + p.require(purchaseOrderRequestFieldExchangeRate) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetTrackingCategories(trackingCategories []*PurchaseOrderRequestTrackingCategoriesItem) { + p.TrackingCategories = trackingCategories + p.require(purchaseOrderRequestFieldTrackingCategories) +} + +// SetLineItems sets the LineItems field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetLineItems(lineItems []*PurchaseOrderLineItemRequest) { + p.LineItems = lineItems + p.require(purchaseOrderRequestFieldLineItems) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(purchaseOrderRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(purchaseOrderRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(purchaseOrderRequestFieldRemoteFields) +} + func (p *PurchaseOrderRequest) UnmarshalJSON(data []byte) error { type embed PurchaseOrderRequest var unmarshaler = struct { @@ -1692,7 +2443,8 @@ func (p *PurchaseOrderRequest) MarshalJSON() ([]byte, error) { IssueDate: internal.NewOptionalDateTime(p.IssueDate), DeliveryDate: internal.NewOptionalDateTime(p.DeliveryDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PurchaseOrderRequest) String() string { @@ -2460,12 +3212,22 @@ func (p *PurchaseOrderRequestVendor) Accept(visitor PurchaseOrderRequestVendorVi return fmt.Errorf("type %T does not include a non-empty union type", p) } +var ( + purchaseOrderResponseFieldModel = big.NewInt(1 << 0) + purchaseOrderResponseFieldWarnings = big.NewInt(1 << 1) + purchaseOrderResponseFieldErrors = big.NewInt(1 << 2) + purchaseOrderResponseFieldLogs = big.NewInt(1 << 3) +) + type PurchaseOrderResponse struct { Model *PurchaseOrder `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2502,6 +3264,41 @@ func (p *PurchaseOrderResponse) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PurchaseOrderResponse) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderResponse) SetModel(model *PurchaseOrder) { + p.Model = model + p.require(purchaseOrderResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderResponse) SetWarnings(warnings []*WarningValidationProblem) { + p.Warnings = warnings + p.require(purchaseOrderResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderResponse) SetErrors(errors []*ErrorValidationProblem) { + p.Errors = errors + p.require(purchaseOrderResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderResponse) SetLogs(logs []*DebugModeLog) { + p.Logs = logs + p.require(purchaseOrderResponseFieldLogs) +} + func (p *PurchaseOrderResponse) UnmarshalJSON(data []byte) error { type unmarshaler PurchaseOrderResponse var value unmarshaler @@ -2518,6 +3315,17 @@ func (p *PurchaseOrderResponse) UnmarshalJSON(data []byte) error { return nil } +func (p *PurchaseOrderResponse) MarshalJSON() ([]byte, error) { + type embed PurchaseOrderResponse + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PurchaseOrderResponse) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/purchaseorders/accounting_purchase_orders_test/accounting_purchase_orders_test.go b/accounting/purchaseorders/accounting_purchase_orders_test/accounting_purchase_orders_test.go new file mode 100644 index 0000000..6fd0048 --- /dev/null +++ b/accounting/purchaseorders/accounting_purchase_orders_test/accounting_purchase_orders_test.go @@ -0,0 +1,299 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_purchase_orders_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingPurchaseOrdersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PurchaseOrdersListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IssueDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IssueDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.PurchaseOrders.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/purchase-orders", map[string]string{"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"}, 1) +} + +func TestAccountingPurchaseOrdersCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PurchaseOrderEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.PurchaseOrderRequest{}, + } + _, invocationErr := client.Accounting.PurchaseOrders.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/purchase-orders", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingPurchaseOrdersRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PurchaseOrdersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.PurchaseOrders.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/purchase-orders/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true", "remote_fields": "status", "show_enum_origins": "status"}, 1) +} + +func TestAccountingPurchaseOrdersLineItemsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PurchaseOrdersLineItemsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.PurchaseOrders.LineItemsRemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/purchase-orders/line-items/remote-field-classes", map[string]string{"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"}, 1) +} + +func TestAccountingPurchaseOrdersMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.PurchaseOrders.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/purchase-orders/meta/post", nil, 1) +} + +func TestAccountingPurchaseOrdersRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.PurchaseOrdersRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.PurchaseOrders.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/purchase-orders/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/accounting/purchaseorders/client.go b/accounting/purchaseorders/client.go index 6b9c701..bbba170 100644 --- a/accounting/purchaseorders/client.go +++ b/accounting/purchaseorders/client.go @@ -4,7 +4,6 @@ package purchaseorders import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.PurchaseOrdersListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.PurchaseOrder], error) { +) (*core.Page[*string, *accounting.PurchaseOrder], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedPurchaseOrderList) *internal.PageResponse[*string, *accounting.PurchaseOrder] { + readPageResponse := func(response *accounting.PaginatedPurchaseOrderList) *core.PageResponse[*string, *accounting.PurchaseOrder] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.PurchaseOrder]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.PurchaseOrder]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.PurchaseOrderEndpointRequest, opts ...option.RequestOption, ) (*accounting.PurchaseOrderResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/purchase-orders" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.PurchaseOrderResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `PurchaseOrder` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.PurchaseOrdersRetrieveRequest, opts ...option.RequestOption, ) (*accounting.PurchaseOrder, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/purchase-orders/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.PurchaseOrder - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -190,7 +132,7 @@ func (c *Client) LineItemsRemoteFieldClassesList( ctx context.Context, request *accounting.PurchaseOrdersLineItemsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -203,13 +145,12 @@ func (c *Client) LineItemsRemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -226,11 +167,11 @@ func (c *Client) LineItemsRemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, @@ -249,35 +190,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/purchase-orders/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -285,7 +205,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *accounting.PurchaseOrdersRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.RemoteFieldClass], error) { +) (*core.Page[*string, *accounting.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -298,13 +218,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -321,11 +240,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *accounting.RemoteFieldClass] { + readPageResponse := func(response *accounting.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *accounting.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/accounting/purchaseorders/raw_client.go b/accounting/purchaseorders/raw_client.go new file mode 100644 index 0000000..ff54e51 --- /dev/null +++ b/accounting/purchaseorders/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package purchaseorders + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.PurchaseOrderEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.PurchaseOrderResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/purchase-orders" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.PurchaseOrderResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.PurchaseOrderResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.PurchaseOrdersRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.PurchaseOrder], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/purchase-orders/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.PurchaseOrder + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.PurchaseOrder]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/purchase-orders/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/regenerate_key.go b/accounting/regenerate_key.go index 3bc9edb..d873064 100644 --- a/accounting/regenerate_key.go +++ b/accounting/regenerate_key.go @@ -2,7 +2,32 @@ package accounting +import ( + big "math/big" +) + +var ( + remoteKeyForRegenerationRequestFieldName = big.NewInt(1 << 0) +) + type RemoteKeyForRegenerationRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteKeyForRegenerationRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKeyForRegenerationRequest) SetName(name string) { + r.Name = name + r.require(remoteKeyForRegenerationRequestFieldName) } diff --git a/accounting/regeneratekey/accounting_regenerate_key_test/accounting_regenerate_key_test.go b/accounting/regeneratekey/accounting_regenerate_key_test/accounting_regenerate_key_test.go new file mode 100644 index 0000000..84e3a84 --- /dev/null +++ b/accounting/regeneratekey/accounting_regenerate_key_test/accounting_regenerate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_regenerate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingRegenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Accounting.RegenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/regenerate-key", nil, 1) +} diff --git a/accounting/regeneratekey/client.go b/accounting/regeneratekey/client.go index 600aba2..dc12c9e 100644 --- a/accounting/regeneratekey/client.go +++ b/accounting/regeneratekey/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *accounting.RemoteKeyForRegenerationRequest, opts ...option.RequestOption, ) (*accounting.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/regenerate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/regeneratekey/raw_client.go b/accounting/regeneratekey/raw_client.go new file mode 100644 index 0000000..1c3f878 --- /dev/null +++ b/accounting/regeneratekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package regeneratekey + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.RemoteKeyForRegenerationRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/regenerate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/scopes.go b/accounting/scopes.go index 65ddb53..af02508 100644 --- a/accounting/scopes.go +++ b/accounting/scopes.go @@ -6,17 +6,46 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels = big.NewInt(1 << 0) ) type LinkedAccountCommonModelScopeDeserializerRequest struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountCommonModelScopeDeserializerRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountCommonModelScopeDeserializerRequest) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializerRequest) { + l.CommonModels = commonModels + l.require(linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels) } +var ( + commonModelScopeApiFieldCommonModels = big.NewInt(1 << 0) +) + type CommonModelScopeApi struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models" url:"common_models"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -32,6 +61,20 @@ func (c *CommonModelScopeApi) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CommonModelScopeApi) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopeApi) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializer) { + c.CommonModels = commonModels + c.require(commonModelScopeApiFieldCommonModels) +} + func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopeApi var value unmarshaler @@ -48,6 +91,17 @@ func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopeApi) MarshalJSON() ([]byte, error) { + type embed CommonModelScopeApi + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopeApi) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -60,10 +114,18 @@ func (c *CommonModelScopeApi) String() string { return fmt.Sprintf("%#v", c) } +var ( + fieldPermissionDeserializerFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializer struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -86,6 +148,27 @@ func (f *FieldPermissionDeserializer) GetExtraProperties() map[string]interface{ return f.extraProperties } +func (f *FieldPermissionDeserializer) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerFieldDisabledFields) +} + func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializer var value unmarshaler @@ -102,6 +185,17 @@ func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializer) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -114,11 +208,20 @@ func (f *FieldPermissionDeserializer) String() string { return fmt.Sprintf("%#v", f) } +var ( + individualCommonModelScopeDeserializerFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializer struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -148,6 +251,34 @@ func (i *IndividualCommonModelScopeDeserializer) GetExtraProperties() map[string return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializer) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializer) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializer) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializer var value unmarshaler @@ -164,6 +295,17 @@ func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) erro return nil } +func (i *IndividualCommonModelScopeDeserializer) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializer) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -176,9 +318,16 @@ func (i *IndividualCommonModelScopeDeserializer) String() string { return fmt.Sprintf("%#v", i) } +var ( + modelPermissionDeserializerFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializer struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -194,6 +343,20 @@ func (m *ModelPermissionDeserializer) GetExtraProperties() map[string]interface{ return m.extraProperties } +func (m *ModelPermissionDeserializer) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializer) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerFieldIsEnabled) +} + func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializer var value unmarshaler @@ -210,6 +373,17 @@ func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializer) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { diff --git a/accounting/scopes/accounting_scopes_test/accounting_scopes_test.go b/accounting/scopes/accounting_scopes_test/accounting_scopes_test.go new file mode 100644 index 0000000..f4213c4 --- /dev/null +++ b/accounting/scopes/accounting_scopes_test/accounting_scopes_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_scopes_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingScopesDefaultScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/default-scopes", nil, 1) +} + +func TestAccountingScopesLinkedAccountScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/linked-account-scopes", nil, 1) +} + +func TestAccountingScopesLinkedAccountScopesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*accounting.IndividualCommonModelScopeDeserializerRequest{ + &accounting.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*accounting.ModelPermissionDeserializerRequest{ + "READ": &accounting.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &accounting.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &accounting.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &accounting.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*accounting.ModelPermissionDeserializerRequest{ + "WRITE": &accounting.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } + _, invocationErr := client.Accounting.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/linked-account-scopes", nil, 1) +} diff --git a/accounting/scopes/client.go b/accounting/scopes/client.go index e315c32..154f266 100644 --- a/accounting/scopes/client.go +++ b/accounting/scopes/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) DefaultScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/default-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.DefaultScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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). @@ -72,35 +52,14 @@ func (c *Client) LinkedAccountScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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) @@ -109,35 +68,13 @@ func (c *Client) LinkedAccountScopesCreate( request *accounting.LinkedAccountCommonModelScopeDeserializerRequest, opts ...option.RequestOption, ) (*accounting.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/scopes/raw_client.go b/accounting/scopes/raw_client.go new file mode 100644 index 0000000..bd05216 --- /dev/null +++ b/accounting/scopes/raw_client.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package scopes + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) DefaultScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/default-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesCreate( + ctx context.Context, + request *accounting.LinkedAccountCommonModelScopeDeserializerRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/sync_status.go b/accounting/sync_status.go index 4063082..f2991ef 100644 --- a/accounting/sync_status.go +++ b/accounting/sync_status.go @@ -6,6 +6,12 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + syncStatusListRequestFieldCursor = big.NewInt(1 << 0) + syncStatusListRequestFieldPageSize = big.NewInt(1 << 1) ) type SyncStatusListRequest struct { @@ -13,13 +19,46 @@ type SyncStatusListRequest struct { Cursor *string `json:"-" url:"cursor,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (s *SyncStatusListRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetCursor(cursor *string) { + s.Cursor = cursor + s.require(syncStatusListRequestFieldCursor) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetPageSize(pageSize *int) { + s.PageSize = pageSize + s.require(syncStatusListRequestFieldPageSize) +} + +var ( + paginatedSyncStatusListFieldNext = big.NewInt(1 << 0) + paginatedSyncStatusListFieldPrevious = big.NewInt(1 << 1) + paginatedSyncStatusListFieldResults = big.NewInt(1 << 2) +) + type PaginatedSyncStatusList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*SyncStatus `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -49,6 +88,34 @@ func (p *PaginatedSyncStatusList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedSyncStatusList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetNext(next *string) { + p.Next = next + p.require(paginatedSyncStatusListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedSyncStatusListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetResults(results []*SyncStatus) { + p.Results = results + p.require(paginatedSyncStatusListFieldResults) +} + func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedSyncStatusList var value unmarshaler @@ -65,6 +132,17 @@ func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedSyncStatusList) MarshalJSON() ([]byte, error) { + type embed PaginatedSyncStatusList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedSyncStatusList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/syncstatus/accounting_sync_status_test/accounting_sync_status_test.go b/accounting/syncstatus/accounting_sync_status_test/accounting_sync_status_test.go new file mode 100644 index 0000000..3e8e4f9 --- /dev/null +++ b/accounting/syncstatus/accounting_sync_status_test/accounting_sync_status_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_sync_status_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingSyncStatusListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Accounting.SyncStatus.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/sync-status", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "page_size": "1"}, 1) +} diff --git a/accounting/syncstatus/client.go b/accounting/syncstatus/client.go index d26b213..ff4f5c2 100644 --- a/accounting/syncstatus/client.go +++ b/accounting/syncstatus/client.go @@ -4,7 +4,6 @@ package syncstatus import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.SyncStatusListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.SyncStatus], error) { +) (*core.Page[*string, *accounting.SyncStatus], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedSyncStatusList) *internal.PageResponse[*string, *accounting.SyncStatus] { + readPageResponse := func(response *accounting.PaginatedSyncStatusList) *core.PageResponse[*string, *accounting.SyncStatus] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.SyncStatus]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.SyncStatus]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/accounting/syncstatus/raw_client.go b/accounting/syncstatus/raw_client.go new file mode 100644 index 0000000..bf7298f --- /dev/null +++ b/accounting/syncstatus/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package syncstatus + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/accounting/tax_rates.go b/accounting/tax_rates.go index 28677f2..99004b6 100644 --- a/accounting/tax_rates.go +++ b/accounting/tax_rates.go @@ -6,9 +6,26 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + taxRatesListRequestFieldCompanyId = big.NewInt(1 << 0) + taxRatesListRequestFieldCreatedAfter = big.NewInt(1 << 1) + taxRatesListRequestFieldCreatedBefore = big.NewInt(1 << 2) + taxRatesListRequestFieldCursor = big.NewInt(1 << 3) + taxRatesListRequestFieldExpand = big.NewInt(1 << 4) + taxRatesListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + taxRatesListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + taxRatesListRequestFieldIncludeShellData = big.NewInt(1 << 7) + taxRatesListRequestFieldModifiedAfter = big.NewInt(1 << 8) + taxRatesListRequestFieldModifiedBefore = big.NewInt(1 << 9) + taxRatesListRequestFieldName = big.NewInt(1 << 10) + taxRatesListRequestFieldPageSize = big.NewInt(1 << 11) + taxRatesListRequestFieldRemoteId = big.NewInt(1 << 12) +) + type TaxRatesListRequest struct { // If provided, will only return tax rates for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -36,8 +53,115 @@ type TaxRatesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TaxRatesListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetCompanyId(companyId *string) { + t.CompanyId = companyId + t.require(taxRatesListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(taxRatesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(taxRatesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(taxRatesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(taxRatesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(taxRatesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(taxRatesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(taxRatesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(taxRatesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(taxRatesListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetName(name *string) { + t.Name = name + t.require(taxRatesListRequestFieldName) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(taxRatesListRequestFieldPageSize) } +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(taxRatesListRequestFieldRemoteId) +} + +var ( + taxRatesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + taxRatesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + taxRatesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type TaxRatesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -45,13 +169,53 @@ type TaxRatesRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TaxRatesRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) } +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesRetrieveRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(taxRatesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(taxRatesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRatesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(taxRatesRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedTaxRateListFieldNext = big.NewInt(1 << 0) + paginatedTaxRateListFieldPrevious = big.NewInt(1 << 1) + paginatedTaxRateListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTaxRateList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*TaxRate `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -81,6 +245,34 @@ func (p *PaginatedTaxRateList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedTaxRateList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTaxRateList) SetNext(next *string) { + p.Next = next + p.require(paginatedTaxRateListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTaxRateList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTaxRateListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTaxRateList) SetResults(results []*TaxRate) { + p.Results = results + p.require(paginatedTaxRateListFieldResults) +} + func (p *PaginatedTaxRateList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTaxRateList var value unmarshaler @@ -97,6 +289,17 @@ func (p *PaginatedTaxRateList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTaxRateList) MarshalJSON() ([]byte, error) { + type embed PaginatedTaxRateList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTaxRateList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/taxrates/accounting_tax_rates_test/accounting_tax_rates_test.go b/accounting/taxrates/accounting_tax_rates_test/accounting_tax_rates_test.go new file mode 100644 index 0000000..21f8580 --- /dev/null +++ b/accounting/taxrates/accounting_tax_rates_test/accounting_tax_rates_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_tax_rates_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingTaxRatesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.TaxRatesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Accounting.TaxRates.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/tax-rates", map[string]string{"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"}, 1) +} + +func TestAccountingTaxRatesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.TaxRatesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.TaxRates.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/tax-rates/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/taxrates/client.go b/accounting/taxrates/client.go index bf4de5d..975b120 100644 --- a/accounting/taxrates/client.go +++ b/accounting/taxrates/client.go @@ -4,7 +4,6 @@ package taxrates import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.TaxRatesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.TaxRate], error) { +) (*core.Page[*string, *accounting.TaxRate], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedTaxRateList) *internal.PageResponse[*string, *accounting.TaxRate] { + readPageResponse := func(response *accounting.PaginatedTaxRateList) *core.PageResponse[*string, *accounting.TaxRate] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.TaxRate]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.TaxRate]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.TaxRatesRetrieveRequest, opts ...option.RequestOption, ) (*accounting.TaxRate, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/tax-rates/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.TaxRate - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/taxrates/raw_client.go b/accounting/taxrates/raw_client.go new file mode 100644 index 0000000..3d3f5c9 --- /dev/null +++ b/accounting/taxrates/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package taxrates + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.TaxRatesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.TaxRate], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/tax-rates/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.TaxRate + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.TaxRate]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/tracking_categories.go b/accounting/tracking_categories.go index c72f876..5a65f3f 100644 --- a/accounting/tracking_categories.go +++ b/accounting/tracking_categories.go @@ -6,12 +6,33 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + trackingCategoriesListRequestFieldCategoryType = big.NewInt(1 << 0) + trackingCategoriesListRequestFieldCompanyId = big.NewInt(1 << 1) + trackingCategoriesListRequestFieldCreatedAfter = big.NewInt(1 << 2) + trackingCategoriesListRequestFieldCreatedBefore = big.NewInt(1 << 3) + trackingCategoriesListRequestFieldCursor = big.NewInt(1 << 4) + trackingCategoriesListRequestFieldExpand = big.NewInt(1 << 5) + trackingCategoriesListRequestFieldIncludeDeletedData = big.NewInt(1 << 6) + trackingCategoriesListRequestFieldIncludeRemoteData = big.NewInt(1 << 7) + trackingCategoriesListRequestFieldIncludeShellData = big.NewInt(1 << 8) + trackingCategoriesListRequestFieldModifiedAfter = big.NewInt(1 << 9) + trackingCategoriesListRequestFieldModifiedBefore = big.NewInt(1 << 10) + trackingCategoriesListRequestFieldName = big.NewInt(1 << 11) + trackingCategoriesListRequestFieldPageSize = big.NewInt(1 << 12) + trackingCategoriesListRequestFieldRemoteFields = big.NewInt(1 << 13) + trackingCategoriesListRequestFieldRemoteId = big.NewInt(1 << 14) + trackingCategoriesListRequestFieldShowEnumOrigins = big.NewInt(1 << 15) + trackingCategoriesListRequestFieldStatus = big.NewInt(1 << 16) +) + type TrackingCategoriesListRequest struct { // If provided, will only return tracking categories with this type. - CategoryType *string `json:"-" url:"category_type,omitempty"` + CategoryType *TrackingCategoriesListRequestCategoryType `json:"-" url:"category_type,omitempty"` // If provided, will only return tracking categories for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` // If provided, will only return objects created after this datetime. @@ -43,9 +64,146 @@ type TrackingCategoriesListRequest struct { // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` // If provided, will only return tracking categories with this status. - Status *string `json:"-" url:"status,omitempty"` + Status *TrackingCategoriesListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TrackingCategoriesListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCategoryType sets the CategoryType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetCategoryType(categoryType *TrackingCategoriesListRequestCategoryType) { + t.CategoryType = categoryType + t.require(trackingCategoriesListRequestFieldCategoryType) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetCompanyId(companyId *string) { + t.CompanyId = companyId + t.require(trackingCategoriesListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(trackingCategoriesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(trackingCategoriesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(trackingCategoriesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(trackingCategoriesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(trackingCategoriesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(trackingCategoriesListRequestFieldIncludeRemoteData) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(trackingCategoriesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(trackingCategoriesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(trackingCategoriesListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetName(name *string) { + t.Name = name + t.require(trackingCategoriesListRequestFieldName) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(trackingCategoriesListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetRemoteFields(remoteFields *string) { + t.RemoteFields = remoteFields + t.require(trackingCategoriesListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(trackingCategoriesListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + t.ShowEnumOrigins = showEnumOrigins + t.require(trackingCategoriesListRequestFieldShowEnumOrigins) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesListRequest) SetStatus(status *TrackingCategoriesListRequestStatus) { + t.Status = status + t.require(trackingCategoriesListRequestFieldStatus) +} + +var ( + trackingCategoriesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + trackingCategoriesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + trackingCategoriesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + trackingCategoriesRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + trackingCategoriesRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type TrackingCategoriesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -57,13 +215,117 @@ type TrackingCategoriesRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (t *TrackingCategoriesRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesRetrieveRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(trackingCategoriesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(trackingCategoriesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(trackingCategoriesRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesRetrieveRequest) SetRemoteFields(remoteFields *string) { + t.RemoteFields = remoteFields + t.require(trackingCategoriesRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategoriesRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + t.ShowEnumOrigins = showEnumOrigins + t.require(trackingCategoriesRetrieveRequestFieldShowEnumOrigins) +} + +type TrackingCategoriesListRequestCategoryType string + +const ( + TrackingCategoriesListRequestCategoryTypeEmpty TrackingCategoriesListRequestCategoryType = "" + TrackingCategoriesListRequestCategoryTypeClass TrackingCategoriesListRequestCategoryType = "CLASS" + TrackingCategoriesListRequestCategoryTypeDepartment TrackingCategoriesListRequestCategoryType = "DEPARTMENT" +) + +func NewTrackingCategoriesListRequestCategoryTypeFromString(s string) (TrackingCategoriesListRequestCategoryType, error) { + switch s { + case "": + return TrackingCategoriesListRequestCategoryTypeEmpty, nil + case "CLASS": + return TrackingCategoriesListRequestCategoryTypeClass, nil + case "DEPARTMENT": + return TrackingCategoriesListRequestCategoryTypeDepartment, nil + } + var t TrackingCategoriesListRequestCategoryType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (t TrackingCategoriesListRequestCategoryType) Ptr() *TrackingCategoriesListRequestCategoryType { + return &t +} + +type TrackingCategoriesListRequestStatus string + +const ( + TrackingCategoriesListRequestStatusEmpty TrackingCategoriesListRequestStatus = "" + TrackingCategoriesListRequestStatusActive TrackingCategoriesListRequestStatus = "ACTIVE" + TrackingCategoriesListRequestStatusArchived TrackingCategoriesListRequestStatus = "ARCHIVED" +) + +func NewTrackingCategoriesListRequestStatusFromString(s string) (TrackingCategoriesListRequestStatus, error) { + switch s { + case "": + return TrackingCategoriesListRequestStatusEmpty, nil + case "ACTIVE": + return TrackingCategoriesListRequestStatusActive, nil + case "ARCHIVED": + return TrackingCategoriesListRequestStatusArchived, nil + } + var t TrackingCategoriesListRequestStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (t TrackingCategoriesListRequestStatus) Ptr() *TrackingCategoriesListRequestStatus { + return &t +} + +var ( + paginatedTrackingCategoryListFieldNext = big.NewInt(1 << 0) + paginatedTrackingCategoryListFieldPrevious = big.NewInt(1 << 1) + paginatedTrackingCategoryListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTrackingCategoryList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*TrackingCategory `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -93,6 +355,34 @@ func (p *PaginatedTrackingCategoryList) GetExtraProperties() map[string]interfac return p.extraProperties } +func (p *PaginatedTrackingCategoryList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTrackingCategoryList) SetNext(next *string) { + p.Next = next + p.require(paginatedTrackingCategoryListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTrackingCategoryList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTrackingCategoryListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTrackingCategoryList) SetResults(results []*TrackingCategory) { + p.Results = results + p.require(paginatedTrackingCategoryListFieldResults) +} + func (p *PaginatedTrackingCategoryList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTrackingCategoryList var value unmarshaler @@ -109,6 +399,17 @@ func (p *PaginatedTrackingCategoryList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTrackingCategoryList) MarshalJSON() ([]byte, error) { + type embed PaginatedTrackingCategoryList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTrackingCategoryList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/accounting/trackingcategories/accounting_tracking_categories_test/accounting_tracking_categories_test.go b/accounting/trackingcategories/accounting_tracking_categories_test/accounting_tracking_categories_test.go new file mode 100644 index 0000000..7772323 --- /dev/null +++ b/accounting/trackingcategories/accounting_tracking_categories_test/accounting_tracking_categories_test.go @@ -0,0 +1,158 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_tracking_categories_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingTrackingCategoriesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.TrackingCategoriesListRequest{ + CategoryType: accounting.TrackingCategoriesListRequestCategoryTypeEmpty.Ptr(), + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: accounting.TrackingCategoriesListRequestStatusEmpty.Ptr(), + } + _, invocationErr := client.Accounting.TrackingCategories.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/tracking-categories", map[string]string{"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": ""}, 1) +} + +func TestAccountingTrackingCategoriesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.TrackingCategoriesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.TrackingCategories.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/tracking-categories/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "status", "show_enum_origins": "status"}, 1) +} diff --git a/accounting/trackingcategories/client.go b/accounting/trackingcategories/client.go index 7b24c58..3b7d5c8 100644 --- a/accounting/trackingcategories/client.go +++ b/accounting/trackingcategories/client.go @@ -4,7 +4,6 @@ package trackingcategories import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.TrackingCategoriesListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.TrackingCategory], error) { +) (*core.Page[*string, *accounting.TrackingCategory], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedTrackingCategoryList) *internal.PageResponse[*string, *accounting.TrackingCategory] { + readPageResponse := func(response *accounting.PaginatedTrackingCategoryList) *core.PageResponse[*string, *accounting.TrackingCategory] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.TrackingCategory]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.TrackingCategory]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.TrackingCategoriesRetrieveRequest, opts ...option.RequestOption, ) (*accounting.TrackingCategory, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/tracking-categories/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.TrackingCategory - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/trackingcategories/raw_client.go b/accounting/trackingcategories/raw_client.go new file mode 100644 index 0000000..d71c1e0 --- /dev/null +++ b/accounting/trackingcategories/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package trackingcategories + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.TrackingCategoriesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.TrackingCategory], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/tracking-categories/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.TrackingCategory + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.TrackingCategory]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/transactions.go b/accounting/transactions.go index 8ccd073..0b6bff8 100644 --- a/accounting/transactions.go +++ b/accounting/transactions.go @@ -6,9 +6,27 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + transactionsListRequestFieldCompanyId = big.NewInt(1 << 0) + transactionsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + transactionsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + transactionsListRequestFieldCursor = big.NewInt(1 << 3) + transactionsListRequestFieldExpand = big.NewInt(1 << 4) + transactionsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + transactionsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + transactionsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + transactionsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + transactionsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + transactionsListRequestFieldPageSize = big.NewInt(1 << 10) + transactionsListRequestFieldRemoteId = big.NewInt(1 << 11) + transactionsListRequestFieldTransactionDateAfter = big.NewInt(1 << 12) + transactionsListRequestFieldTransactionDateBefore = big.NewInt(1 << 13) +) + type TransactionsListRequest struct { // If provided, will only return accounting transactions for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -38,8 +56,122 @@ type TransactionsListRequest struct { TransactionDateAfter *time.Time `json:"-" url:"transaction_date_after,omitempty"` // If provided, will only return objects created before this datetime. TransactionDateBefore *time.Time `json:"-" url:"transaction_date_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TransactionsListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetCompanyId(companyId *string) { + t.CompanyId = companyId + t.require(transactionsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(transactionsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(transactionsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(transactionsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetExpand(expand []*TransactionsListRequestExpandItem) { + t.Expand = expand + t.require(transactionsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(transactionsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(transactionsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(transactionsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(transactionsListRequestFieldModifiedAfter) } +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(transactionsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(transactionsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(transactionsListRequestFieldRemoteId) +} + +// SetTransactionDateAfter sets the TransactionDateAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetTransactionDateAfter(transactionDateAfter *time.Time) { + t.TransactionDateAfter = transactionDateAfter + t.require(transactionsListRequestFieldTransactionDateAfter) +} + +// SetTransactionDateBefore sets the TransactionDateBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsListRequest) SetTransactionDateBefore(transactionDateBefore *time.Time) { + t.TransactionDateBefore = transactionDateBefore + t.require(transactionsListRequestFieldTransactionDateBefore) +} + +var ( + transactionsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + transactionsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + transactionsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type TransactionsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*TransactionsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -47,6 +179,37 @@ type TransactionsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TransactionsRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsRetrieveRequest) SetExpand(expand []*TransactionsRetrieveRequestExpandItem) { + t.Expand = expand + t.require(transactionsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(transactionsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(transactionsRetrieveRequestFieldIncludeShellData) } type TransactionsListRequestExpandItem string @@ -111,11 +274,20 @@ func (t TransactionsRetrieveRequestExpandItem) Ptr() *TransactionsRetrieveReques return &t } +var ( + paginatedTransactionListFieldNext = big.NewInt(1 << 0) + paginatedTransactionListFieldPrevious = big.NewInt(1 << 1) + paginatedTransactionListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTransactionList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Transaction `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -145,6 +317,34 @@ func (p *PaginatedTransactionList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedTransactionList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTransactionList) SetNext(next *string) { + p.Next = next + p.require(paginatedTransactionListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTransactionList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTransactionListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTransactionList) SetResults(results []*Transaction) { + p.Results = results + p.require(paginatedTransactionListFieldResults) +} + func (p *PaginatedTransactionList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTransactionList var value unmarshaler @@ -161,6 +361,17 @@ func (p *PaginatedTransactionList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTransactionList) MarshalJSON() ([]byte, error) { + type embed PaginatedTransactionList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTransactionList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -186,6 +397,29 @@ func (p *PaginatedTransactionList) String() string { // // ### Usage Example // Fetch from the `GET Transaction` endpoint and view a company's transactions. +var ( + transactionFieldId = big.NewInt(1 << 0) + transactionFieldRemoteId = big.NewInt(1 << 1) + transactionFieldCreatedAt = big.NewInt(1 << 2) + transactionFieldModifiedAt = big.NewInt(1 << 3) + transactionFieldTransactionType = big.NewInt(1 << 4) + transactionFieldNumber = big.NewInt(1 << 5) + transactionFieldTransactionDate = big.NewInt(1 << 6) + transactionFieldAccount = big.NewInt(1 << 7) + transactionFieldContact = big.NewInt(1 << 8) + transactionFieldInclusiveOfTax = big.NewInt(1 << 9) + transactionFieldTotalAmount = big.NewInt(1 << 10) + transactionFieldCurrency = big.NewInt(1 << 11) + transactionFieldExchangeRate = big.NewInt(1 << 12) + transactionFieldCompany = big.NewInt(1 << 13) + transactionFieldTrackingCategories = big.NewInt(1 << 14) + transactionFieldLineItems = big.NewInt(1 << 15) + transactionFieldRemoteWasDeleted = big.NewInt(1 << 16) + transactionFieldAccountingPeriod = big.NewInt(1 << 17) + transactionFieldFieldMappings = big.NewInt(1 << 18) + transactionFieldRemoteData = big.NewInt(1 << 19) +) + type Transaction struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -530,6 +764,9 @@ type Transaction struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -678,6 +915,153 @@ func (t *Transaction) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *Transaction) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetId(id *string) { + t.Id = id + t.require(transactionFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(transactionFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(transactionFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(transactionFieldModifiedAt) +} + +// SetTransactionType sets the TransactionType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetTransactionType(transactionType *string) { + t.TransactionType = transactionType + t.require(transactionFieldTransactionType) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetNumber(number *string) { + t.Number = number + t.require(transactionFieldNumber) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetTransactionDate(transactionDate *time.Time) { + t.TransactionDate = transactionDate + t.require(transactionFieldTransactionDate) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetAccount(account *TransactionAccount) { + t.Account = account + t.require(transactionFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetContact(contact *TransactionContact) { + t.Contact = contact + t.require(transactionFieldContact) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetInclusiveOfTax(inclusiveOfTax *bool) { + t.InclusiveOfTax = inclusiveOfTax + t.require(transactionFieldInclusiveOfTax) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetTotalAmount(totalAmount *string) { + t.TotalAmount = totalAmount + t.require(transactionFieldTotalAmount) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetCurrency(currency *TransactionCurrency) { + t.Currency = currency + t.require(transactionFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetExchangeRate(exchangeRate *string) { + t.ExchangeRate = exchangeRate + t.require(transactionFieldExchangeRate) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetCompany(company *string) { + t.Company = company + t.require(transactionFieldCompany) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetTrackingCategories(trackingCategories []*TransactionTrackingCategoriesItem) { + t.TrackingCategories = trackingCategories + t.require(transactionFieldTrackingCategories) +} + +// SetLineItems sets the LineItems field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetLineItems(lineItems []*TransactionLineItem) { + t.LineItems = lineItems + t.require(transactionFieldLineItems) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(transactionFieldRemoteWasDeleted) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetAccountingPeriod(accountingPeriod *TransactionAccountingPeriod) { + t.AccountingPeriod = accountingPeriod + t.require(transactionFieldAccountingPeriod) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(transactionFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Transaction) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(transactionFieldRemoteData) +} + func (t *Transaction) UnmarshalJSON(data []byte) error { type embed Transaction var unmarshaler = struct { @@ -717,7 +1101,8 @@ func (t *Transaction) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), TransactionDate: internal.NewOptionalDateTime(t.TransactionDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *Transaction) String() string { @@ -1297,6 +1682,26 @@ func (t *TransactionCurrency) Accept(visitor TransactionCurrencyVisitor) error { // // ### Usage Example // Fetch from the `GET TransactionLineItem` endpoint and view the transaction's line items. +var ( + transactionLineItemFieldId = big.NewInt(1 << 0) + transactionLineItemFieldRemoteId = big.NewInt(1 << 1) + transactionLineItemFieldCreatedAt = big.NewInt(1 << 2) + transactionLineItemFieldModifiedAt = big.NewInt(1 << 3) + transactionLineItemFieldMemo = big.NewInt(1 << 4) + transactionLineItemFieldUnitPrice = big.NewInt(1 << 5) + transactionLineItemFieldQuantity = big.NewInt(1 << 6) + transactionLineItemFieldItem = big.NewInt(1 << 7) + transactionLineItemFieldAccount = big.NewInt(1 << 8) + transactionLineItemFieldTrackingCategory = big.NewInt(1 << 9) + transactionLineItemFieldTrackingCategories = big.NewInt(1 << 10) + transactionLineItemFieldTotalLineAmount = big.NewInt(1 << 11) + transactionLineItemFieldTaxRate = big.NewInt(1 << 12) + transactionLineItemFieldCurrency = big.NewInt(1 << 13) + transactionLineItemFieldExchangeRate = big.NewInt(1 << 14) + transactionLineItemFieldCompany = big.NewInt(1 << 15) + transactionLineItemFieldRemoteWasDeleted = big.NewInt(1 << 16) +) + type TransactionLineItem struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -1638,6 +2043,9 @@ type TransactionLineItem struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1765,6 +2173,132 @@ func (t *TransactionLineItem) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TransactionLineItem) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetId(id *string) { + t.Id = id + t.require(transactionLineItemFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(transactionLineItemFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(transactionLineItemFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(transactionLineItemFieldModifiedAt) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetMemo(memo *string) { + t.Memo = memo + t.require(transactionLineItemFieldMemo) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetUnitPrice(unitPrice *string) { + t.UnitPrice = unitPrice + t.require(transactionLineItemFieldUnitPrice) +} + +// SetQuantity sets the Quantity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetQuantity(quantity *string) { + t.Quantity = quantity + t.require(transactionLineItemFieldQuantity) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetItem(item *TransactionLineItemItem) { + t.Item = item + t.require(transactionLineItemFieldItem) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetAccount(account *string) { + t.Account = account + t.require(transactionLineItemFieldAccount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetTrackingCategory(trackingCategory *string) { + t.TrackingCategory = trackingCategory + t.require(transactionLineItemFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetTrackingCategories(trackingCategories []*string) { + t.TrackingCategories = trackingCategories + t.require(transactionLineItemFieldTrackingCategories) +} + +// SetTotalLineAmount sets the TotalLineAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetTotalLineAmount(totalLineAmount *string) { + t.TotalLineAmount = totalLineAmount + t.require(transactionLineItemFieldTotalLineAmount) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetTaxRate(taxRate *string) { + t.TaxRate = taxRate + t.require(transactionLineItemFieldTaxRate) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetCurrency(currency *TransactionLineItemCurrency) { + t.Currency = currency + t.require(transactionLineItemFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetExchangeRate(exchangeRate *string) { + t.ExchangeRate = exchangeRate + t.require(transactionLineItemFieldExchangeRate) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetCompany(company *string) { + t.Company = company + t.require(transactionLineItemFieldCompany) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TransactionLineItem) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(transactionLineItemFieldRemoteWasDeleted) +} + func (t *TransactionLineItem) UnmarshalJSON(data []byte) error { type embed TransactionLineItem var unmarshaler = struct { @@ -1800,7 +2334,8 @@ func (t *TransactionLineItem) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TransactionLineItem) String() string { diff --git a/accounting/transactions/accounting_transactions_test/accounting_transactions_test.go b/accounting/transactions/accounting_transactions_test/accounting_transactions_test.go new file mode 100644 index 0000000..21684be --- /dev/null +++ b/accounting/transactions/accounting_transactions_test/accounting_transactions_test.go @@ -0,0 +1,163 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_transactions_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingTransactionsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.TransactionsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Accounting.Transactions.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/transactions", map[string]string{"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"}, 1) +} + +func TestAccountingTransactionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.TransactionsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.Transactions.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/transactions/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/accounting/transactions/client.go b/accounting/transactions/client.go index 202a647..b51d462 100644 --- a/accounting/transactions/client.go +++ b/accounting/transactions/client.go @@ -4,7 +4,6 @@ package transactions import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.TransactionsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.Transaction], error) { +) (*core.Page[*string, *accounting.Transaction], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedTransactionList) *internal.PageResponse[*string, *accounting.Transaction] { + readPageResponse := func(response *accounting.PaginatedTransactionList) *core.PageResponse[*string, *accounting.Transaction] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.Transaction]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.Transaction]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *accounting.TransactionsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.Transaction, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/transactions/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.Transaction - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/accounting/transactions/raw_client.go b/accounting/transactions/raw_client.go new file mode 100644 index 0000000..cddade6 --- /dev/null +++ b/accounting/transactions/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package transactions + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.TransactionsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.Transaction], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/transactions/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.Transaction + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.Transaction]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/types.go b/accounting/types.go index 77f24e5..10104f4 100644 --- a/accounting/types.go +++ b/accounting/types.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) @@ -22,6 +23,27 @@ import ( // // ### Usage Example // Fetch from the `LIST Accounts` endpoint and view a company's accounts. +var ( + accountFieldId = big.NewInt(1 << 0) + accountFieldRemoteId = big.NewInt(1 << 1) + accountFieldCreatedAt = big.NewInt(1 << 2) + accountFieldModifiedAt = big.NewInt(1 << 3) + accountFieldName = big.NewInt(1 << 4) + accountFieldDescription = big.NewInt(1 << 5) + accountFieldClassification = big.NewInt(1 << 6) + accountFieldType = big.NewInt(1 << 7) + accountFieldAccountType = big.NewInt(1 << 8) + accountFieldStatus = big.NewInt(1 << 9) + accountFieldCurrentBalance = big.NewInt(1 << 10) + accountFieldCurrency = big.NewInt(1 << 11) + accountFieldAccountNumber = big.NewInt(1 << 12) + accountFieldParentAccount = big.NewInt(1 << 13) + accountFieldCompany = big.NewInt(1 << 14) + accountFieldRemoteWasDeleted = big.NewInt(1 << 15) + accountFieldFieldMappings = big.NewInt(1 << 16) + accountFieldRemoteData = big.NewInt(1 << 17) +) + type Account struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -388,6 +410,9 @@ type Account struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -522,6 +547,139 @@ func (a *Account) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Account) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetId(id *string) { + a.Id = id + a.require(accountFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(accountFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(accountFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(accountFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetName(name *string) { + a.Name = name + a.require(accountFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetDescription(description *string) { + a.Description = description + a.require(accountFieldDescription) +} + +// SetClassification sets the Classification field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetClassification(classification *AccountClassification) { + a.Classification = classification + a.require(accountFieldClassification) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetType(type_ *string) { + a.Type = type_ + a.require(accountFieldType) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetAccountType(accountType *AccountAccountType) { + a.AccountType = accountType + a.require(accountFieldAccountType) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetStatus(status *AccountStatus) { + a.Status = status + a.require(accountFieldStatus) +} + +// SetCurrentBalance sets the CurrentBalance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetCurrentBalance(currentBalance *float64) { + a.CurrentBalance = currentBalance + a.require(accountFieldCurrentBalance) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetCurrency(currency *AccountCurrency) { + a.Currency = currency + a.require(accountFieldCurrency) +} + +// SetAccountNumber sets the AccountNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetAccountNumber(accountNumber *string) { + a.AccountNumber = accountNumber + a.require(accountFieldAccountNumber) +} + +// SetParentAccount sets the ParentAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetParentAccount(parentAccount *string) { + a.ParentAccount = parentAccount + a.require(accountFieldParentAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetCompany(company *string) { + a.Company = company + a.require(accountFieldCompany) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteWasDeleted(remoteWasDeleted *bool) { + a.RemoteWasDeleted = remoteWasDeleted + a.require(accountFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetFieldMappings(fieldMappings map[string]interface{}) { + a.FieldMappings = fieldMappings + a.require(accountFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteData(remoteData []*RemoteData) { + a.RemoteData = remoteData + a.require(accountFieldRemoteData) +} + func (a *Account) UnmarshalJSON(data []byte) error { type embed Account var unmarshaler = struct { @@ -557,7 +715,8 @@ func (a *Account) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Account) String() string { @@ -1156,6 +1315,19 @@ func (a *AccountCurrency) Accept(visitor AccountCurrencyVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + accountIntegrationFieldName = big.NewInt(1 << 0) + accountIntegrationFieldAbbreviatedName = big.NewInt(1 << 1) + accountIntegrationFieldCategories = big.NewInt(1 << 2) + accountIntegrationFieldImage = big.NewInt(1 << 3) + accountIntegrationFieldSquareImage = big.NewInt(1 << 4) + accountIntegrationFieldColor = big.NewInt(1 << 5) + accountIntegrationFieldSlug = big.NewInt(1 << 6) + accountIntegrationFieldApiEndpointsToDocumentationUrls = big.NewInt(1 << 7) + accountIntegrationFieldWebhookSetupGuideUrl = big.NewInt(1 << 8) + accountIntegrationFieldCategoryBetaStatus = big.NewInt(1 << 9) +) + type AccountIntegration struct { // Company name. Name string `json:"name" url:"name"` @@ -1177,6 +1349,9 @@ type AccountIntegration struct { // Category or categories this integration is in beta status for. CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty" url:"category_beta_status,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1255,6 +1430,83 @@ func (a *AccountIntegration) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetName(name string) { + a.Name = name + a.require(accountIntegrationFieldName) +} + +// SetAbbreviatedName sets the AbbreviatedName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetAbbreviatedName(abbreviatedName *string) { + a.AbbreviatedName = abbreviatedName + a.require(accountIntegrationFieldAbbreviatedName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetImage(image *string) { + a.Image = image + a.require(accountIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetColor(color *string) { + a.Color = color + a.require(accountIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSlug(slug *string) { + a.Slug = slug + a.require(accountIntegrationFieldSlug) +} + +// SetApiEndpointsToDocumentationUrls sets the ApiEndpointsToDocumentationUrls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetApiEndpointsToDocumentationUrls(apiEndpointsToDocumentationUrls map[string]interface{}) { + a.ApiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls + a.require(accountIntegrationFieldApiEndpointsToDocumentationUrls) +} + +// SetWebhookSetupGuideUrl sets the WebhookSetupGuideUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetWebhookSetupGuideUrl(webhookSetupGuideUrl *string) { + a.WebhookSetupGuideUrl = webhookSetupGuideUrl + a.require(accountIntegrationFieldWebhookSetupGuideUrl) +} + +// SetCategoryBetaStatus sets the CategoryBetaStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategoryBetaStatus(categoryBetaStatus map[string]interface{}) { + a.CategoryBetaStatus = categoryBetaStatus + a.require(accountIntegrationFieldCategoryBetaStatus) +} + func (a *AccountIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountIntegration var value unmarshaler @@ -1271,6 +1523,17 @@ func (a *AccountIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountIntegration) MarshalJSON() ([]byte, error) { + type embed AccountIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -1384,6 +1647,19 @@ func (a AccountStatusEnum) Ptr() *AccountStatusEnum { // // ### Usage Example // Common models like `Invoice` and `Transaction` will have `AccountingPeriod` objects which will denote when they occurred. +var ( + accountingPeriodFieldId = big.NewInt(1 << 0) + accountingPeriodFieldRemoteId = big.NewInt(1 << 1) + accountingPeriodFieldCreatedAt = big.NewInt(1 << 2) + accountingPeriodFieldModifiedAt = big.NewInt(1 << 3) + accountingPeriodFieldName = big.NewInt(1 << 4) + accountingPeriodFieldStatus = big.NewInt(1 << 5) + accountingPeriodFieldStartDate = big.NewInt(1 << 6) + accountingPeriodFieldEndDate = big.NewInt(1 << 7) + accountingPeriodFieldFieldMappings = big.NewInt(1 << 8) + accountingPeriodFieldRemoteData = big.NewInt(1 << 9) +) + type AccountingPeriod struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -1402,6 +1678,9 @@ type AccountingPeriod struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1480,6 +1759,83 @@ func (a *AccountingPeriod) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountingPeriod) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetId(id *string) { + a.Id = id + a.require(accountingPeriodFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(accountingPeriodFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(accountingPeriodFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(accountingPeriodFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetName(name *string) { + a.Name = name + a.require(accountingPeriodFieldName) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetStatus(status *AccountingPeriodStatus) { + a.Status = status + a.require(accountingPeriodFieldStatus) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetStartDate(startDate *time.Time) { + a.StartDate = startDate + a.require(accountingPeriodFieldStartDate) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetEndDate(endDate *time.Time) { + a.EndDate = endDate + a.require(accountingPeriodFieldEndDate) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetFieldMappings(fieldMappings map[string]interface{}) { + a.FieldMappings = fieldMappings + a.require(accountingPeriodFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPeriod) SetRemoteData(remoteData []*RemoteData) { + a.RemoteData = remoteData + a.require(accountingPeriodFieldRemoteData) +} + func (a *AccountingPeriod) UnmarshalJSON(data []byte) error { type embed AccountingPeriod var unmarshaler = struct { @@ -1523,7 +1879,8 @@ func (a *AccountingPeriod) MarshalJSON() ([]byte, error) { StartDate: internal.NewOptionalDateTime(a.StartDate), EndDate: internal.NewOptionalDateTime(a.EndDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountingPeriod) String() string { @@ -1606,6 +1963,13 @@ func (a *AccountingPeriodStatus) Accept(visitor AccountingPeriodStatusVisitor) e // // ### Usage Example // Fetch from the `GET CompanyInfo` endpoint and view the company's phone numbers. +var ( + accountingPhoneNumberFieldCreatedAt = big.NewInt(1 << 0) + accountingPhoneNumberFieldModifiedAt = big.NewInt(1 << 1) + accountingPhoneNumberFieldNumber = big.NewInt(1 << 2) + accountingPhoneNumberFieldType = big.NewInt(1 << 3) +) + type AccountingPhoneNumber struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -1616,6 +1980,9 @@ type AccountingPhoneNumber struct { // The phone number's type. Type *string `json:"type,omitempty" url:"type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1652,6 +2019,41 @@ func (a *AccountingPhoneNumber) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountingPhoneNumber) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPhoneNumber) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(accountingPhoneNumberFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPhoneNumber) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(accountingPhoneNumberFieldModifiedAt) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPhoneNumber) SetNumber(number *string) { + a.Number = number + a.require(accountingPhoneNumberFieldNumber) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountingPhoneNumber) SetType(type_ *string) { + a.Type = type_ + a.require(accountingPhoneNumberFieldType) +} + func (a *AccountingPhoneNumber) UnmarshalJSON(data []byte) error { type embed AccountingPhoneNumber var unmarshaler = struct { @@ -1687,7 +2089,8 @@ func (a *AccountingPhoneNumber) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountingPhoneNumber) String() string { @@ -1708,6 +2111,19 @@ func (a *AccountingPhoneNumber) String() string { // // ### Usage Example // Fetch from the `GET CompanyInfo` endpoint and view the company's addresses. +var ( + addressFieldCreatedAt = big.NewInt(1 << 0) + addressFieldModifiedAt = big.NewInt(1 << 1) + addressFieldType = big.NewInt(1 << 2) + addressFieldStreet1 = big.NewInt(1 << 3) + addressFieldStreet2 = big.NewInt(1 << 4) + addressFieldCity = big.NewInt(1 << 5) + addressFieldState = big.NewInt(1 << 6) + addressFieldCountrySubdivision = big.NewInt(1 << 7) + addressFieldCountry = big.NewInt(1 << 8) + addressFieldZipCode = big.NewInt(1 << 9) +) + type Address struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -1982,6 +2398,9 @@ type Address struct { // The address's zip code. ZipCode *string `json:"zip_code,omitempty" url:"zip_code,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2060,6 +2479,83 @@ func (a *Address) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Address) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(addressFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(addressFieldModifiedAt) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetType(type_ *AddressType) { + a.Type = type_ + a.require(addressFieldType) +} + +// SetStreet1 sets the Street1 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetStreet1(street1 *string) { + a.Street1 = street1 + a.require(addressFieldStreet1) +} + +// SetStreet2 sets the Street2 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetStreet2(street2 *string) { + a.Street2 = street2 + a.require(addressFieldStreet2) +} + +// SetCity sets the City field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetCity(city *string) { + a.City = city + a.require(addressFieldCity) +} + +// SetState sets the State field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetState(state interface{}) { + a.State = state + a.require(addressFieldState) +} + +// SetCountrySubdivision sets the CountrySubdivision field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetCountrySubdivision(countrySubdivision *string) { + a.CountrySubdivision = countrySubdivision + a.require(addressFieldCountrySubdivision) +} + +// SetCountry sets the Country field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetCountry(country *AddressCountry) { + a.Country = country + a.require(addressFieldCountry) +} + +// SetZipCode sets the ZipCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetZipCode(zipCode *string) { + a.ZipCode = zipCode + a.require(addressFieldZipCode) +} + func (a *Address) UnmarshalJSON(data []byte) error { type embed Address var unmarshaler = struct { @@ -2095,7 +2591,8 @@ func (a *Address) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Address) String() string { @@ -2429,6 +2926,18 @@ func (a *AddressCountry) Accept(visitor AddressCountryVisitor) error { // // ### Usage Example // Fetch from the `GET CompanyInfo` endpoint and view the company's addresses. +var ( + addressRequestFieldType = big.NewInt(1 << 0) + addressRequestFieldStreet1 = big.NewInt(1 << 1) + addressRequestFieldStreet2 = big.NewInt(1 << 2) + addressRequestFieldCity = big.NewInt(1 << 3) + addressRequestFieldCountrySubdivision = big.NewInt(1 << 4) + addressRequestFieldCountry = big.NewInt(1 << 5) + addressRequestFieldZipCode = big.NewInt(1 << 6) + addressRequestFieldIntegrationParams = big.NewInt(1 << 7) + addressRequestFieldLinkedAccountParams = big.NewInt(1 << 8) +) + type AddressRequest struct { // The address type. // @@ -2700,6 +3209,9 @@ type AddressRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2771,6 +3283,76 @@ func (a *AddressRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AddressRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetType(type_ *AddressRequestType) { + a.Type = type_ + a.require(addressRequestFieldType) +} + +// SetStreet1 sets the Street1 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetStreet1(street1 *string) { + a.Street1 = street1 + a.require(addressRequestFieldStreet1) +} + +// SetStreet2 sets the Street2 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetStreet2(street2 *string) { + a.Street2 = street2 + a.require(addressRequestFieldStreet2) +} + +// SetCity sets the City field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetCity(city *string) { + a.City = city + a.require(addressRequestFieldCity) +} + +// SetCountrySubdivision sets the CountrySubdivision field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetCountrySubdivision(countrySubdivision *string) { + a.CountrySubdivision = countrySubdivision + a.require(addressRequestFieldCountrySubdivision) +} + +// SetCountry sets the Country field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetCountry(country *AddressRequestCountry) { + a.Country = country + a.require(addressRequestFieldCountry) +} + +// SetZipCode sets the ZipCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetZipCode(zipCode *string) { + a.ZipCode = zipCode + a.require(addressRequestFieldZipCode) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(addressRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(addressRequestFieldLinkedAccountParams) +} + func (a *AddressRequest) UnmarshalJSON(data []byte) error { type unmarshaler AddressRequest var value unmarshaler @@ -2787,6 +3369,17 @@ func (a *AddressRequest) UnmarshalJSON(data []byte) error { return nil } +func (a *AddressRequest) MarshalJSON() ([]byte, error) { + type embed AddressRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AddressRequest) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -3274,6 +3867,26 @@ func (a AddressTypeEnum) Ptr() *AddressTypeEnum { // // ### Usage Example // Fetch from the `GET BankFeedAccount` endpoint to view details of a bank feed account. +var ( + bankFeedAccountFieldId = big.NewInt(1 << 0) + bankFeedAccountFieldRemoteId = big.NewInt(1 << 1) + bankFeedAccountFieldCreatedAt = big.NewInt(1 << 2) + bankFeedAccountFieldModifiedAt = big.NewInt(1 << 3) + bankFeedAccountFieldSourceAccountId = big.NewInt(1 << 4) + bankFeedAccountFieldTargetAccountId = big.NewInt(1 << 5) + bankFeedAccountFieldSourceAccountName = big.NewInt(1 << 6) + bankFeedAccountFieldSourceAccountNumber = big.NewInt(1 << 7) + bankFeedAccountFieldTargetAccountName = big.NewInt(1 << 8) + bankFeedAccountFieldCurrency = big.NewInt(1 << 9) + bankFeedAccountFieldFeedStatus = big.NewInt(1 << 10) + bankFeedAccountFieldFeedStartDate = big.NewInt(1 << 11) + bankFeedAccountFieldSourceAccountBalance = big.NewInt(1 << 12) + bankFeedAccountFieldAccountType = big.NewInt(1 << 13) + bankFeedAccountFieldRemoteWasDeleted = big.NewInt(1 << 14) + bankFeedAccountFieldFieldMappings = big.NewInt(1 << 15) + bankFeedAccountFieldRemoteData = big.NewInt(1 << 16) +) + type BankFeedAccount struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -3620,6 +4233,9 @@ type BankFeedAccount struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []map[string]interface{} `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3747,6 +4363,132 @@ func (b *BankFeedAccount) GetExtraProperties() map[string]interface{} { return b.extraProperties } +func (b *BankFeedAccount) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetId(id *string) { + b.Id = id + b.require(bankFeedAccountFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetRemoteId(remoteId *string) { + b.RemoteId = remoteId + b.require(bankFeedAccountFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetCreatedAt(createdAt *time.Time) { + b.CreatedAt = createdAt + b.require(bankFeedAccountFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetModifiedAt(modifiedAt *time.Time) { + b.ModifiedAt = modifiedAt + b.require(bankFeedAccountFieldModifiedAt) +} + +// SetSourceAccountId sets the SourceAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetSourceAccountId(sourceAccountId *string) { + b.SourceAccountId = sourceAccountId + b.require(bankFeedAccountFieldSourceAccountId) +} + +// SetTargetAccountId sets the TargetAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetTargetAccountId(targetAccountId *string) { + b.TargetAccountId = targetAccountId + b.require(bankFeedAccountFieldTargetAccountId) +} + +// SetSourceAccountName sets the SourceAccountName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetSourceAccountName(sourceAccountName *string) { + b.SourceAccountName = sourceAccountName + b.require(bankFeedAccountFieldSourceAccountName) +} + +// SetSourceAccountNumber sets the SourceAccountNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetSourceAccountNumber(sourceAccountNumber *string) { + b.SourceAccountNumber = sourceAccountNumber + b.require(bankFeedAccountFieldSourceAccountNumber) +} + +// SetTargetAccountName sets the TargetAccountName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetTargetAccountName(targetAccountName *string) { + b.TargetAccountName = targetAccountName + b.require(bankFeedAccountFieldTargetAccountName) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetCurrency(currency *BankFeedAccountCurrency) { + b.Currency = currency + b.require(bankFeedAccountFieldCurrency) +} + +// SetFeedStatus sets the FeedStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetFeedStatus(feedStatus *BankFeedAccountFeedStatus) { + b.FeedStatus = feedStatus + b.require(bankFeedAccountFieldFeedStatus) +} + +// SetFeedStartDate sets the FeedStartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetFeedStartDate(feedStartDate *time.Time) { + b.FeedStartDate = feedStartDate + b.require(bankFeedAccountFieldFeedStartDate) +} + +// SetSourceAccountBalance sets the SourceAccountBalance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetSourceAccountBalance(sourceAccountBalance *float64) { + b.SourceAccountBalance = sourceAccountBalance + b.require(bankFeedAccountFieldSourceAccountBalance) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetAccountType(accountType *BankFeedAccountAccountType) { + b.AccountType = accountType + b.require(bankFeedAccountFieldAccountType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetRemoteWasDeleted(remoteWasDeleted *bool) { + b.RemoteWasDeleted = remoteWasDeleted + b.require(bankFeedAccountFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetFieldMappings(fieldMappings map[string]interface{}) { + b.FieldMappings = fieldMappings + b.require(bankFeedAccountFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankFeedAccount) SetRemoteData(remoteData []map[string]interface{}) { + b.RemoteData = remoteData + b.require(bankFeedAccountFieldRemoteData) +} + func (b *BankFeedAccount) UnmarshalJSON(data []byte) error { type embed BankFeedAccount var unmarshaler = struct { @@ -3786,7 +4528,8 @@ func (b *BankFeedAccount) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(b.ModifiedAt), FeedStartDate: internal.NewOptionalDateTime(b.FeedStartDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) } func (b *BankFeedAccount) String() string { @@ -4481,6 +5224,26 @@ func (c ClassificationEnum) Ptr() *ClassificationEnum { // // ### Usage Example // Fetch from the `GET CompanyInfo` endpoint and view a company's information. +var ( + companyInfoFieldId = big.NewInt(1 << 0) + companyInfoFieldRemoteId = big.NewInt(1 << 1) + companyInfoFieldCreatedAt = big.NewInt(1 << 2) + companyInfoFieldModifiedAt = big.NewInt(1 << 3) + companyInfoFieldName = big.NewInt(1 << 4) + companyInfoFieldLegalName = big.NewInt(1 << 5) + companyInfoFieldTaxNumber = big.NewInt(1 << 6) + companyInfoFieldFiscalYearEndMonth = big.NewInt(1 << 7) + companyInfoFieldFiscalYearEndDay = big.NewInt(1 << 8) + companyInfoFieldCurrency = big.NewInt(1 << 9) + companyInfoFieldRemoteCreatedAt = big.NewInt(1 << 10) + companyInfoFieldUrls = big.NewInt(1 << 11) + companyInfoFieldAddresses = big.NewInt(1 << 12) + companyInfoFieldPhoneNumbers = big.NewInt(1 << 13) + companyInfoFieldRemoteWasDeleted = big.NewInt(1 << 14) + companyInfoFieldFieldMappings = big.NewInt(1 << 15) + companyInfoFieldRemoteData = big.NewInt(1 << 16) +) + type CompanyInfo struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -4511,6 +5274,9 @@ type CompanyInfo struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4638,6 +5404,132 @@ func (c *CompanyInfo) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CompanyInfo) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetId(id *string) { + c.Id = id + c.require(companyInfoFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(companyInfoFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(companyInfoFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(companyInfoFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetName(name *string) { + c.Name = name + c.require(companyInfoFieldName) +} + +// SetLegalName sets the LegalName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetLegalName(legalName *string) { + c.LegalName = legalName + c.require(companyInfoFieldLegalName) +} + +// SetTaxNumber sets the TaxNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetTaxNumber(taxNumber *string) { + c.TaxNumber = taxNumber + c.require(companyInfoFieldTaxNumber) +} + +// SetFiscalYearEndMonth sets the FiscalYearEndMonth field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetFiscalYearEndMonth(fiscalYearEndMonth *int) { + c.FiscalYearEndMonth = fiscalYearEndMonth + c.require(companyInfoFieldFiscalYearEndMonth) +} + +// SetFiscalYearEndDay sets the FiscalYearEndDay field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetFiscalYearEndDay(fiscalYearEndDay *int) { + c.FiscalYearEndDay = fiscalYearEndDay + c.require(companyInfoFieldFiscalYearEndDay) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetCurrency(currency interface{}) { + c.Currency = currency + c.require(companyInfoFieldCurrency) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + c.RemoteCreatedAt = remoteCreatedAt + c.require(companyInfoFieldRemoteCreatedAt) +} + +// SetUrls sets the Urls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetUrls(urls []*string) { + c.Urls = urls + c.require(companyInfoFieldUrls) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetAddresses(addresses []*Address) { + c.Addresses = addresses + c.require(companyInfoFieldAddresses) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetPhoneNumbers(phoneNumbers []*AccountingPhoneNumber) { + c.PhoneNumbers = phoneNumbers + c.require(companyInfoFieldPhoneNumbers) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(companyInfoFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(companyInfoFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompanyInfo) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(companyInfoFieldRemoteData) +} + func (c *CompanyInfo) UnmarshalJSON(data []byte) error { type embed CompanyInfo var unmarshaler = struct { @@ -4677,7 +5569,8 @@ func (c *CompanyInfo) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), RemoteCreatedAt: internal.NewOptionalDateTime(c.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CompanyInfo) String() string { @@ -4724,6 +5617,28 @@ func (c ComponentTypeEnum) Ptr() *ComponentTypeEnum { // // ### Usage Example // Fetch from the `LIST Contacts` endpoint and view a company's contacts. +var ( + contactFieldId = big.NewInt(1 << 0) + contactFieldRemoteId = big.NewInt(1 << 1) + contactFieldCreatedAt = big.NewInt(1 << 2) + contactFieldModifiedAt = big.NewInt(1 << 3) + contactFieldName = big.NewInt(1 << 4) + contactFieldIsSupplier = big.NewInt(1 << 5) + contactFieldIsCustomer = big.NewInt(1 << 6) + contactFieldEmailAddress = big.NewInt(1 << 7) + contactFieldTaxNumber = big.NewInt(1 << 8) + contactFieldStatus = big.NewInt(1 << 9) + contactFieldCurrency = big.NewInt(1 << 10) + contactFieldRemoteUpdatedAt = big.NewInt(1 << 11) + contactFieldCompany = big.NewInt(1 << 12) + contactFieldAddresses = big.NewInt(1 << 13) + contactFieldPhoneNumbers = big.NewInt(1 << 14) + contactFieldRemoteWasDeleted = big.NewInt(1 << 15) + contactFieldFieldMappings = big.NewInt(1 << 16) + contactFieldRemoteData = big.NewInt(1 << 17) + contactFieldRemoteFields = big.NewInt(1 << 18) +) + type Contact struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -4763,6 +5678,9 @@ type Contact struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4904,7 +5822,147 @@ func (c *Contact) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *Contact) UnmarshalJSON(data []byte) error { +func (c *Contact) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetId(id *string) { + c.Id = id + c.require(contactFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(contactFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(contactFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(contactFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetName(name *string) { + c.Name = name + c.require(contactFieldName) +} + +// SetIsSupplier sets the IsSupplier field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetIsSupplier(isSupplier *bool) { + c.IsSupplier = isSupplier + c.require(contactFieldIsSupplier) +} + +// SetIsCustomer sets the IsCustomer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetIsCustomer(isCustomer *bool) { + c.IsCustomer = isCustomer + c.require(contactFieldIsCustomer) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetEmailAddress(emailAddress *string) { + c.EmailAddress = emailAddress + c.require(contactFieldEmailAddress) +} + +// SetTaxNumber sets the TaxNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetTaxNumber(taxNumber *string) { + c.TaxNumber = taxNumber + c.require(contactFieldTaxNumber) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetStatus(status *ContactStatus) { + c.Status = status + c.require(contactFieldStatus) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetCurrency(currency *string) { + c.Currency = currency + c.require(contactFieldCurrency) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + c.RemoteUpdatedAt = remoteUpdatedAt + c.require(contactFieldRemoteUpdatedAt) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetCompany(company *string) { + c.Company = company + c.require(contactFieldCompany) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetAddresses(addresses []*ContactAddressesItem) { + c.Addresses = addresses + c.require(contactFieldAddresses) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetPhoneNumbers(phoneNumbers []*AccountingPhoneNumber) { + c.PhoneNumbers = phoneNumbers + c.require(contactFieldPhoneNumbers) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(contactFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(contactFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(contactFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteFields(remoteFields []*RemoteField) { + c.RemoteFields = remoteFields + c.require(contactFieldRemoteFields) +} + +func (c *Contact) UnmarshalJSON(data []byte) error { type embed Contact var unmarshaler = struct { embed @@ -4943,7 +6001,8 @@ func (c *Contact) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(c.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *Contact) String() string { @@ -6104,6 +7163,34 @@ func (c CountryEnum) Ptr() *CountryEnum { // // ### Usage Example // Fetch from the `LIST CreditNotes` endpoint and view a company's credit notes. +var ( + creditNoteFieldId = big.NewInt(1 << 0) + creditNoteFieldRemoteId = big.NewInt(1 << 1) + creditNoteFieldCreatedAt = big.NewInt(1 << 2) + creditNoteFieldModifiedAt = big.NewInt(1 << 3) + creditNoteFieldTransactionDate = big.NewInt(1 << 4) + creditNoteFieldStatus = big.NewInt(1 << 5) + creditNoteFieldNumber = big.NewInt(1 << 6) + creditNoteFieldContact = big.NewInt(1 << 7) + creditNoteFieldCompany = big.NewInt(1 << 8) + creditNoteFieldExchangeRate = big.NewInt(1 << 9) + creditNoteFieldTotalAmount = big.NewInt(1 << 10) + creditNoteFieldRemainingCredit = big.NewInt(1 << 11) + creditNoteFieldInclusiveOfTax = big.NewInt(1 << 12) + creditNoteFieldLineItems = big.NewInt(1 << 13) + creditNoteFieldTrackingCategories = big.NewInt(1 << 14) + creditNoteFieldCurrency = big.NewInt(1 << 15) + creditNoteFieldRemoteCreatedAt = big.NewInt(1 << 16) + creditNoteFieldRemoteUpdatedAt = big.NewInt(1 << 17) + creditNoteFieldPayments = big.NewInt(1 << 18) + creditNoteFieldAppliedPayments = big.NewInt(1 << 19) + creditNoteFieldAccountingPeriod = big.NewInt(1 << 20) + creditNoteFieldAppliedToLines = big.NewInt(1 << 21) + creditNoteFieldRemoteWasDeleted = big.NewInt(1 << 22) + creditNoteFieldFieldMappings = big.NewInt(1 << 23) + creditNoteFieldRemoteData = big.NewInt(1 << 24) +) + type CreditNote struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -6462,6 +7549,9 @@ type CreditNote struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6645,6 +7735,188 @@ func (c *CreditNote) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CreditNote) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetId(id *string) { + c.Id = id + c.require(creditNoteFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(creditNoteFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(creditNoteFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(creditNoteFieldModifiedAt) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetTransactionDate(transactionDate *time.Time) { + c.TransactionDate = transactionDate + c.require(creditNoteFieldTransactionDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetStatus(status *CreditNoteStatus) { + c.Status = status + c.require(creditNoteFieldStatus) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetNumber(number *string) { + c.Number = number + c.require(creditNoteFieldNumber) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetContact(contact *CreditNoteContact) { + c.Contact = contact + c.require(creditNoteFieldContact) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetCompany(company *CreditNoteCompany) { + c.Company = company + c.require(creditNoteFieldCompany) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetExchangeRate(exchangeRate *string) { + c.ExchangeRate = exchangeRate + c.require(creditNoteFieldExchangeRate) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetTotalAmount(totalAmount *float64) { + c.TotalAmount = totalAmount + c.require(creditNoteFieldTotalAmount) +} + +// SetRemainingCredit sets the RemainingCredit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetRemainingCredit(remainingCredit *float64) { + c.RemainingCredit = remainingCredit + c.require(creditNoteFieldRemainingCredit) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetInclusiveOfTax(inclusiveOfTax *bool) { + c.InclusiveOfTax = inclusiveOfTax + c.require(creditNoteFieldInclusiveOfTax) +} + +// SetLineItems sets the LineItems field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetLineItems(lineItems []*CreditNoteLineItem) { + c.LineItems = lineItems + c.require(creditNoteFieldLineItems) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetTrackingCategories(trackingCategories []*CreditNoteTrackingCategoriesItem) { + c.TrackingCategories = trackingCategories + c.require(creditNoteFieldTrackingCategories) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetCurrency(currency *CreditNoteCurrency) { + c.Currency = currency + c.require(creditNoteFieldCurrency) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + c.RemoteCreatedAt = remoteCreatedAt + c.require(creditNoteFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + c.RemoteUpdatedAt = remoteUpdatedAt + c.require(creditNoteFieldRemoteUpdatedAt) +} + +// SetPayments sets the Payments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetPayments(payments []*CreditNotePaymentsItem) { + c.Payments = payments + c.require(creditNoteFieldPayments) +} + +// SetAppliedPayments sets the AppliedPayments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetAppliedPayments(appliedPayments []*CreditNoteAppliedPaymentsItem) { + c.AppliedPayments = appliedPayments + c.require(creditNoteFieldAppliedPayments) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetAccountingPeriod(accountingPeriod *CreditNoteAccountingPeriod) { + c.AccountingPeriod = accountingPeriod + c.require(creditNoteFieldAccountingPeriod) +} + +// SetAppliedToLines sets the AppliedToLines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetAppliedToLines(appliedToLines []*CreditNoteApplyLineForCreditNote) { + c.AppliedToLines = appliedToLines + c.require(creditNoteFieldAppliedToLines) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(creditNoteFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(creditNoteFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNote) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(creditNoteFieldRemoteData) +} + func (c *CreditNote) UnmarshalJSON(data []byte) error { type embed CreditNote var unmarshaler = struct { @@ -6692,7 +7964,8 @@ func (c *CreditNote) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(c.RemoteCreatedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(c.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CreditNote) String() string { @@ -6838,6 +8111,16 @@ func (c *CreditNoteAppliedPaymentsItem) Accept(visitor CreditNoteAppliedPayments // // ### Usage Example // Fetch from the `GET CreditNote` endpoint and view the invoice's applied to lines. +var ( + creditNoteApplyLineForCreditNoteFieldRemoteId = big.NewInt(1 << 0) + creditNoteApplyLineForCreditNoteFieldCreatedAt = big.NewInt(1 << 1) + creditNoteApplyLineForCreditNoteFieldModifiedAt = big.NewInt(1 << 2) + creditNoteApplyLineForCreditNoteFieldInvoice = big.NewInt(1 << 3) + creditNoteApplyLineForCreditNoteFieldAppliedDate = big.NewInt(1 << 4) + creditNoteApplyLineForCreditNoteFieldAppliedAmount = big.NewInt(1 << 5) + creditNoteApplyLineForCreditNoteFieldRemoteWasDeleted = big.NewInt(1 << 6) +) + type CreditNoteApplyLineForCreditNote struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -6853,6 +8136,9 @@ type CreditNoteApplyLineForCreditNote struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6910,6 +8196,62 @@ func (c *CreditNoteApplyLineForCreditNote) GetExtraProperties() map[string]inter return c.extraProperties } +func (c *CreditNoteApplyLineForCreditNote) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNote) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(creditNoteApplyLineForCreditNoteFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNote) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(creditNoteApplyLineForCreditNoteFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNote) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(creditNoteApplyLineForCreditNoteFieldModifiedAt) +} + +// SetInvoice sets the Invoice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNote) SetInvoice(invoice *CreditNoteApplyLineForCreditNoteInvoice) { + c.Invoice = invoice + c.require(creditNoteApplyLineForCreditNoteFieldInvoice) +} + +// SetAppliedDate sets the AppliedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNote) SetAppliedDate(appliedDate *time.Time) { + c.AppliedDate = appliedDate + c.require(creditNoteApplyLineForCreditNoteFieldAppliedDate) +} + +// SetAppliedAmount sets the AppliedAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNote) SetAppliedAmount(appliedAmount *string) { + c.AppliedAmount = appliedAmount + c.require(creditNoteApplyLineForCreditNoteFieldAppliedAmount) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForCreditNote) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(creditNoteApplyLineForCreditNoteFieldRemoteWasDeleted) +} + func (c *CreditNoteApplyLineForCreditNote) UnmarshalJSON(data []byte) error { type embed CreditNoteApplyLineForCreditNote var unmarshaler = struct { @@ -6949,7 +8291,8 @@ func (c *CreditNoteApplyLineForCreditNote) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), AppliedDate: internal.NewOptionalDateTime(c.AppliedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CreditNoteApplyLineForCreditNote) String() string { @@ -7032,6 +8375,16 @@ func (c *CreditNoteApplyLineForCreditNoteInvoice) Accept(visitor CreditNoteApply // // ### Usage Example // Fetch from the `GET CreditNote` endpoint and view the invoice's applied to lines. +var ( + creditNoteApplyLineForInvoiceFieldRemoteId = big.NewInt(1 << 0) + creditNoteApplyLineForInvoiceFieldCreatedAt = big.NewInt(1 << 1) + creditNoteApplyLineForInvoiceFieldModifiedAt = big.NewInt(1 << 2) + creditNoteApplyLineForInvoiceFieldCreditNote = big.NewInt(1 << 3) + creditNoteApplyLineForInvoiceFieldAppliedDate = big.NewInt(1 << 4) + creditNoteApplyLineForInvoiceFieldAppliedAmount = big.NewInt(1 << 5) + creditNoteApplyLineForInvoiceFieldRemoteWasDeleted = big.NewInt(1 << 6) +) + type CreditNoteApplyLineForInvoice struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -7047,6 +8400,9 @@ type CreditNoteApplyLineForInvoice struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7104,6 +8460,62 @@ func (c *CreditNoteApplyLineForInvoice) GetExtraProperties() map[string]interfac return c.extraProperties } +func (c *CreditNoteApplyLineForInvoice) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForInvoice) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(creditNoteApplyLineForInvoiceFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForInvoice) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(creditNoteApplyLineForInvoiceFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForInvoice) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(creditNoteApplyLineForInvoiceFieldModifiedAt) +} + +// SetCreditNote sets the CreditNote field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForInvoice) SetCreditNote(creditNote *CreditNoteApplyLineForInvoiceCreditNote) { + c.CreditNote = creditNote + c.require(creditNoteApplyLineForInvoiceFieldCreditNote) +} + +// SetAppliedDate sets the AppliedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForInvoice) SetAppliedDate(appliedDate *time.Time) { + c.AppliedDate = appliedDate + c.require(creditNoteApplyLineForInvoiceFieldAppliedDate) +} + +// SetAppliedAmount sets the AppliedAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForInvoice) SetAppliedAmount(appliedAmount *string) { + c.AppliedAmount = appliedAmount + c.require(creditNoteApplyLineForInvoiceFieldAppliedAmount) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteApplyLineForInvoice) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(creditNoteApplyLineForInvoiceFieldRemoteWasDeleted) +} + func (c *CreditNoteApplyLineForInvoice) UnmarshalJSON(data []byte) error { type embed CreditNoteApplyLineForInvoice var unmarshaler = struct { @@ -7143,7 +8555,8 @@ func (c *CreditNoteApplyLineForInvoice) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), AppliedDate: internal.NewOptionalDateTime(c.AppliedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CreditNoteApplyLineForInvoice) String() string { @@ -7722,6 +9135,28 @@ func (c *CreditNoteCurrency) Accept(visitor CreditNoteCurrencyVisitor) error { // // ### Usage Example // Fetch from the `GET CreditNote` endpoint and view the credit note's line items. +var ( + creditNoteLineItemFieldId = big.NewInt(1 << 0) + creditNoteLineItemFieldRemoteId = big.NewInt(1 << 1) + creditNoteLineItemFieldCreatedAt = big.NewInt(1 << 2) + creditNoteLineItemFieldModifiedAt = big.NewInt(1 << 3) + creditNoteLineItemFieldItem = big.NewInt(1 << 4) + creditNoteLineItemFieldName = big.NewInt(1 << 5) + creditNoteLineItemFieldDescription = big.NewInt(1 << 6) + creditNoteLineItemFieldQuantity = big.NewInt(1 << 7) + creditNoteLineItemFieldMemo = big.NewInt(1 << 8) + creditNoteLineItemFieldUnitPrice = big.NewInt(1 << 9) + creditNoteLineItemFieldTaxRate = big.NewInt(1 << 10) + creditNoteLineItemFieldTotalLineAmount = big.NewInt(1 << 11) + creditNoteLineItemFieldTrackingCategory = big.NewInt(1 << 12) + creditNoteLineItemFieldTrackingCategories = big.NewInt(1 << 13) + creditNoteLineItemFieldAccount = big.NewInt(1 << 14) + creditNoteLineItemFieldCompany = big.NewInt(1 << 15) + creditNoteLineItemFieldContact = big.NewInt(1 << 16) + creditNoteLineItemFieldProject = big.NewInt(1 << 17) + creditNoteLineItemFieldRemoteWasDeleted = big.NewInt(1 << 18) +) + type CreditNoteLineItem struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -7759,6 +9194,9 @@ type CreditNoteLineItem struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7900,6 +9338,146 @@ func (c *CreditNoteLineItem) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CreditNoteLineItem) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetId(id *string) { + c.Id = id + c.require(creditNoteLineItemFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(creditNoteLineItemFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(creditNoteLineItemFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(creditNoteLineItemFieldModifiedAt) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetItem(item *CreditNoteLineItemItem) { + c.Item = item + c.require(creditNoteLineItemFieldItem) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetName(name *string) { + c.Name = name + c.require(creditNoteLineItemFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetDescription(description *string) { + c.Description = description + c.require(creditNoteLineItemFieldDescription) +} + +// SetQuantity sets the Quantity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetQuantity(quantity *string) { + c.Quantity = quantity + c.require(creditNoteLineItemFieldQuantity) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetMemo(memo *string) { + c.Memo = memo + c.require(creditNoteLineItemFieldMemo) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetUnitPrice(unitPrice *string) { + c.UnitPrice = unitPrice + c.require(creditNoteLineItemFieldUnitPrice) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetTaxRate(taxRate *string) { + c.TaxRate = taxRate + c.require(creditNoteLineItemFieldTaxRate) +} + +// SetTotalLineAmount sets the TotalLineAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetTotalLineAmount(totalLineAmount *string) { + c.TotalLineAmount = totalLineAmount + c.require(creditNoteLineItemFieldTotalLineAmount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetTrackingCategory(trackingCategory *string) { + c.TrackingCategory = trackingCategory + c.require(creditNoteLineItemFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetTrackingCategories(trackingCategories []*string) { + c.TrackingCategories = trackingCategories + c.require(creditNoteLineItemFieldTrackingCategories) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetAccount(account *string) { + c.Account = account + c.require(creditNoteLineItemFieldAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetCompany(company *CreditNoteLineItemCompany) { + c.Company = company + c.require(creditNoteLineItemFieldCompany) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetContact(contact *CreditNoteLineItemContact) { + c.Contact = contact + c.require(creditNoteLineItemFieldContact) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetProject(project *CreditNoteLineItemProject) { + c.Project = project + c.require(creditNoteLineItemFieldProject) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreditNoteLineItem) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(creditNoteLineItemFieldRemoteWasDeleted) +} + func (c *CreditNoteLineItem) UnmarshalJSON(data []byte) error { type embed CreditNoteLineItem var unmarshaler = struct { @@ -7935,7 +9513,8 @@ func (c *CreditNoteLineItem) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(c.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CreditNoteLineItem) String() string { @@ -8425,6 +10004,17 @@ func (c *CreditNoteTrackingCategoriesItem) Accept(visitor CreditNoteTrackingCate // // ### Usage Example // Create a `DataPassthrough` to get team hierarchies from your Rippling integration. +var ( + dataPassthroughRequestFieldMethod = big.NewInt(1 << 0) + dataPassthroughRequestFieldPath = big.NewInt(1 << 1) + dataPassthroughRequestFieldBaseUrlOverride = big.NewInt(1 << 2) + dataPassthroughRequestFieldData = big.NewInt(1 << 3) + dataPassthroughRequestFieldMultipartFormData = big.NewInt(1 << 4) + dataPassthroughRequestFieldHeaders = big.NewInt(1 << 5) + dataPassthroughRequestFieldRequestFormat = big.NewInt(1 << 6) + dataPassthroughRequestFieldNormalizeResponse = big.NewInt(1 << 7) +) + type DataPassthroughRequest struct { Method MethodEnum `json:"method" url:"method"` // The path of the request in the third party's platform. @@ -8441,6 +10031,9 @@ type DataPassthroughRequest struct { // 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`. NormalizeResponse *bool `json:"normalize_response,omitempty" url:"normalize_response,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8505,6 +10098,69 @@ func (d *DataPassthroughRequest) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DataPassthroughRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMethod(method MethodEnum) { + d.Method = method + d.require(dataPassthroughRequestFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetPath(path string) { + d.Path = path + d.require(dataPassthroughRequestFieldPath) +} + +// SetBaseUrlOverride sets the BaseUrlOverride field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetBaseUrlOverride(baseUrlOverride *string) { + d.BaseUrlOverride = baseUrlOverride + d.require(dataPassthroughRequestFieldBaseUrlOverride) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetData(data *string) { + d.Data = data + d.require(dataPassthroughRequestFieldData) +} + +// SetMultipartFormData sets the MultipartFormData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMultipartFormData(multipartFormData []*MultipartFormFieldRequest) { + d.MultipartFormData = multipartFormData + d.require(dataPassthroughRequestFieldMultipartFormData) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetHeaders(headers map[string]interface{}) { + d.Headers = headers + d.require(dataPassthroughRequestFieldHeaders) +} + +// SetRequestFormat sets the RequestFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetRequestFormat(requestFormat *RequestFormatEnum) { + d.RequestFormat = requestFormat + d.require(dataPassthroughRequestFieldRequestFormat) +} + +// SetNormalizeResponse sets the NormalizeResponse field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetNormalizeResponse(normalizeResponse *bool) { + d.NormalizeResponse = normalizeResponse + d.require(dataPassthroughRequestFieldNormalizeResponse) +} + func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { type unmarshaler DataPassthroughRequest var value unmarshaler @@ -8521,6 +10177,17 @@ func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { return nil } +func (d *DataPassthroughRequest) MarshalJSON() ([]byte, error) { + type embed DataPassthroughRequest + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DataPassthroughRequest) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -8533,11 +10200,20 @@ func (d *DataPassthroughRequest) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModeLogFieldLogId = big.NewInt(1 << 0) + debugModeLogFieldDashboardView = big.NewInt(1 << 1) + debugModeLogFieldLogSummary = big.NewInt(1 << 2) +) + type DebugModeLog struct { LogId string `json:"log_id" url:"log_id"` DashboardView string `json:"dashboard_view" url:"dashboard_view"` LogSummary *DebugModelLogSummary `json:"log_summary" url:"log_summary"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8567,6 +10243,34 @@ func (d *DebugModeLog) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModeLog) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetLogId sets the LogId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogId(logId string) { + d.LogId = logId + d.require(debugModeLogFieldLogId) +} + +// SetDashboardView sets the DashboardView field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetDashboardView(dashboardView string) { + d.DashboardView = dashboardView + d.require(debugModeLogFieldDashboardView) +} + +// SetLogSummary sets the LogSummary field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogSummary(logSummary *DebugModelLogSummary) { + d.LogSummary = logSummary + d.require(debugModeLogFieldLogSummary) +} + func (d *DebugModeLog) UnmarshalJSON(data []byte) error { type unmarshaler DebugModeLog var value unmarshaler @@ -8583,6 +10287,17 @@ func (d *DebugModeLog) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModeLog) MarshalJSON() ([]byte, error) { + type embed DebugModeLog + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModeLog) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -8595,11 +10310,20 @@ func (d *DebugModeLog) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModelLogSummaryFieldUrl = big.NewInt(1 << 0) + debugModelLogSummaryFieldMethod = big.NewInt(1 << 1) + debugModelLogSummaryFieldStatusCode = big.NewInt(1 << 2) +) + type DebugModelLogSummary struct { Url string `json:"url" url:"url"` Method string `json:"method" url:"method"` StatusCode int `json:"status_code" url:"status_code"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8629,6 +10353,34 @@ func (d *DebugModelLogSummary) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModelLogSummary) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetUrl sets the Url field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetUrl(url string) { + d.Url = url + d.require(debugModelLogSummaryFieldUrl) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetMethod(method string) { + d.Method = method + d.require(debugModelLogSummaryFieldMethod) +} + +// SetStatusCode sets the StatusCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetStatusCode(statusCode int) { + d.StatusCode = statusCode + d.require(debugModelLogSummaryFieldStatusCode) +} + func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { type unmarshaler DebugModelLogSummary var value unmarshaler @@ -8645,6 +10397,17 @@ func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModelLogSummary) MarshalJSON() ([]byte, error) { + type embed DebugModelLogSummary + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModelLogSummary) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -8665,6 +10428,23 @@ func (d *DebugModelLogSummary) String() string { // // ### Usage Example // Fetch from the `LIST Employees` endpoint and view a company's employees. +var ( + employeeFieldId = big.NewInt(1 << 0) + employeeFieldRemoteId = big.NewInt(1 << 1) + employeeFieldCreatedAt = big.NewInt(1 << 2) + employeeFieldModifiedAt = big.NewInt(1 << 3) + employeeFieldFirstName = big.NewInt(1 << 4) + employeeFieldLastName = big.NewInt(1 << 5) + employeeFieldIsContractor = big.NewInt(1 << 6) + employeeFieldEmployeeNumber = big.NewInt(1 << 7) + employeeFieldEmailAddress = big.NewInt(1 << 8) + employeeFieldCompany = big.NewInt(1 << 9) + employeeFieldStatus = big.NewInt(1 << 10) + employeeFieldRemoteWasDeleted = big.NewInt(1 << 11) + employeeFieldFieldMappings = big.NewInt(1 << 12) + employeeFieldRemoteData = big.NewInt(1 << 13) +) + type Employee struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -8695,6 +10475,9 @@ type Employee struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8801,13 +10584,118 @@ func (e *Employee) GetExtraProperties() map[string]interface{} { return e.extraProperties } -func (e *Employee) UnmarshalJSON(data []byte) error { - type embed Employee - var unmarshaler = struct { - embed - CreatedAt *internal.DateTime `json:"created_at,omitempty"` - ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` - }{ +func (e *Employee) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetId(id *string) { + e.Id = id + e.require(employeeFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(employeeFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(employeeFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(employeeFieldModifiedAt) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetFirstName(firstName *string) { + e.FirstName = firstName + e.require(employeeFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetLastName(lastName *string) { + e.LastName = lastName + e.require(employeeFieldLastName) +} + +// SetIsContractor sets the IsContractor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetIsContractor(isContractor *bool) { + e.IsContractor = isContractor + e.require(employeeFieldIsContractor) +} + +// SetEmployeeNumber sets the EmployeeNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetEmployeeNumber(employeeNumber *string) { + e.EmployeeNumber = employeeNumber + e.require(employeeFieldEmployeeNumber) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetEmailAddress(emailAddress *string) { + e.EmailAddress = emailAddress + e.require(employeeFieldEmailAddress) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetCompany(company *EmployeeCompany) { + e.Company = company + e.require(employeeFieldCompany) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetStatus(status *EmployeeStatus) { + e.Status = status + e.require(employeeFieldStatus) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(employeeFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetFieldMappings(fieldMappings map[string]interface{}) { + e.FieldMappings = fieldMappings + e.require(employeeFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetRemoteData(remoteData []*RemoteData) { + e.RemoteData = remoteData + e.require(employeeFieldRemoteData) +} + +func (e *Employee) UnmarshalJSON(data []byte) error { + type embed Employee + var unmarshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at,omitempty"` + ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` + }{ embed: embed(*e), } if err := json.Unmarshal(data, &unmarshaler); err != nil { @@ -8836,7 +10724,8 @@ func (e *Employee) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(e.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(e.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *Employee) String() string { @@ -9008,12 +10897,22 @@ func (e EncodingEnum) Ptr() *EncodingEnum { return &e } +var ( + errorValidationProblemFieldSource = big.NewInt(1 << 0) + errorValidationProblemFieldTitle = big.NewInt(1 << 1) + errorValidationProblemFieldDetail = big.NewInt(1 << 2) + errorValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type ErrorValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -9050,6 +10949,41 @@ func (e *ErrorValidationProblem) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ErrorValidationProblem) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetSource(source *ValidationProblemSource) { + e.Source = source + e.require(errorValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetTitle(title string) { + e.Title = title + e.require(errorValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetDetail(detail string) { + e.Detail = detail + e.require(errorValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetProblemType(problemType string) { + e.ProblemType = problemType + e.require(errorValidationProblemFieldProblemType) +} + func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler ErrorValidationProblem var value unmarshaler @@ -9066,6 +11000,17 @@ func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (e *ErrorValidationProblem) MarshalJSON() ([]byte, error) { + type embed ErrorValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ErrorValidationProblem) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -9142,10 +11087,18 @@ func (f FieldFormatEnum) Ptr() *FieldFormatEnum { return &f } +var ( + fieldPermissionDeserializerRequestFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerRequestFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializerRequest struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -9168,6 +11121,27 @@ func (f *FieldPermissionDeserializerRequest) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldPermissionDeserializerRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerRequestFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerRequestFieldDisabledFields) +} + func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializerRequest var value unmarshaler @@ -9184,6 +11158,17 @@ func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializerRequest) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -9236,11 +11221,20 @@ func (f FieldTypeEnum) Ptr() *FieldTypeEnum { return &f } +var ( + individualCommonModelScopeDeserializerRequestFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerRequestFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerRequestFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializerRequest struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -9270,6 +11264,34 @@ func (i *IndividualCommonModelScopeDeserializerRequest) GetExtraProperties() map return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializerRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerRequestFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializerRequest) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializerRequest) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializerRequest var value unmarshaler @@ -9286,6 +11308,17 @@ func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byt return nil } +func (i *IndividualCommonModelScopeDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializerRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -9306,6 +11339,45 @@ func (i *IndividualCommonModelScopeDeserializerRequest) String() string { // // ### Usage Example // Fetch from the `LIST Invoices` endpoint and view a company's invoices. +var ( + invoiceFieldId = big.NewInt(1 << 0) + invoiceFieldRemoteId = big.NewInt(1 << 1) + invoiceFieldCreatedAt = big.NewInt(1 << 2) + invoiceFieldModifiedAt = big.NewInt(1 << 3) + invoiceFieldType = big.NewInt(1 << 4) + invoiceFieldContact = big.NewInt(1 << 5) + invoiceFieldNumber = big.NewInt(1 << 6) + invoiceFieldIssueDate = big.NewInt(1 << 7) + invoiceFieldDueDate = big.NewInt(1 << 8) + invoiceFieldPaidOnDate = big.NewInt(1 << 9) + invoiceFieldMemo = big.NewInt(1 << 10) + invoiceFieldCompany = big.NewInt(1 << 11) + invoiceFieldEmployee = big.NewInt(1 << 12) + invoiceFieldCurrency = big.NewInt(1 << 13) + invoiceFieldExchangeRate = big.NewInt(1 << 14) + invoiceFieldPaymentTerm = big.NewInt(1 << 15) + invoiceFieldTotalDiscount = big.NewInt(1 << 16) + invoiceFieldSubTotal = big.NewInt(1 << 17) + invoiceFieldStatus = big.NewInt(1 << 18) + invoiceFieldTotalTaxAmount = big.NewInt(1 << 19) + invoiceFieldTotalAmount = big.NewInt(1 << 20) + invoiceFieldBalance = big.NewInt(1 << 21) + invoiceFieldRemoteUpdatedAt = big.NewInt(1 << 22) + invoiceFieldTrackingCategories = big.NewInt(1 << 23) + invoiceFieldAccountingPeriod = big.NewInt(1 << 24) + invoiceFieldPurchaseOrders = big.NewInt(1 << 25) + invoiceFieldPayments = big.NewInt(1 << 26) + invoiceFieldAppliedPayments = big.NewInt(1 << 27) + invoiceFieldLineItems = big.NewInt(1 << 28) + invoiceFieldAppliedCreditNotes = big.NewInt(1 << 29) + invoiceFieldAppliedVendorCredits = big.NewInt(1 << 30) + invoiceFieldInclusiveOfTax = big.NewInt(1 << 31) + invoiceFieldRemoteWasDeleted = big.NewInt(1 << 32) + invoiceFieldFieldMappings = big.NewInt(1 << 33) + invoiceFieldRemoteData = big.NewInt(1 << 34) + invoiceFieldRemoteFields = big.NewInt(1 << 35) +) + type Invoice struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -9690,6 +11762,9 @@ type Invoice struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -9950,6 +12025,265 @@ func (i *Invoice) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *Invoice) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetId(id *string) { + i.Id = id + i.require(invoiceFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetRemoteId(remoteId *string) { + i.RemoteId = remoteId + i.require(invoiceFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetCreatedAt(createdAt *time.Time) { + i.CreatedAt = createdAt + i.require(invoiceFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetModifiedAt(modifiedAt *time.Time) { + i.ModifiedAt = modifiedAt + i.require(invoiceFieldModifiedAt) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetType(type_ *InvoiceTypeEnum) { + i.Type = type_ + i.require(invoiceFieldType) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetContact(contact *InvoiceContact) { + i.Contact = contact + i.require(invoiceFieldContact) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetNumber(number *string) { + i.Number = number + i.require(invoiceFieldNumber) +} + +// SetIssueDate sets the IssueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetIssueDate(issueDate *time.Time) { + i.IssueDate = issueDate + i.require(invoiceFieldIssueDate) +} + +// SetDueDate sets the DueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetDueDate(dueDate *time.Time) { + i.DueDate = dueDate + i.require(invoiceFieldDueDate) +} + +// SetPaidOnDate sets the PaidOnDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetPaidOnDate(paidOnDate *time.Time) { + i.PaidOnDate = paidOnDate + i.require(invoiceFieldPaidOnDate) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetMemo(memo *string) { + i.Memo = memo + i.require(invoiceFieldMemo) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetCompany(company *InvoiceCompany) { + i.Company = company + i.require(invoiceFieldCompany) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetEmployee(employee *InvoiceEmployee) { + i.Employee = employee + i.require(invoiceFieldEmployee) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetCurrency(currency *InvoiceCurrency) { + i.Currency = currency + i.require(invoiceFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetExchangeRate(exchangeRate *string) { + i.ExchangeRate = exchangeRate + i.require(invoiceFieldExchangeRate) +} + +// SetPaymentTerm sets the PaymentTerm field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetPaymentTerm(paymentTerm *InvoicePaymentTerm) { + i.PaymentTerm = paymentTerm + i.require(invoiceFieldPaymentTerm) +} + +// SetTotalDiscount sets the TotalDiscount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetTotalDiscount(totalDiscount *float64) { + i.TotalDiscount = totalDiscount + i.require(invoiceFieldTotalDiscount) +} + +// SetSubTotal sets the SubTotal field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetSubTotal(subTotal *float64) { + i.SubTotal = subTotal + i.require(invoiceFieldSubTotal) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetStatus(status *InvoiceStatus) { + i.Status = status + i.require(invoiceFieldStatus) +} + +// SetTotalTaxAmount sets the TotalTaxAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetTotalTaxAmount(totalTaxAmount *float64) { + i.TotalTaxAmount = totalTaxAmount + i.require(invoiceFieldTotalTaxAmount) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetTotalAmount(totalAmount *float64) { + i.TotalAmount = totalAmount + i.require(invoiceFieldTotalAmount) +} + +// SetBalance sets the Balance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetBalance(balance *float64) { + i.Balance = balance + i.require(invoiceFieldBalance) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + i.RemoteUpdatedAt = remoteUpdatedAt + i.require(invoiceFieldRemoteUpdatedAt) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetTrackingCategories(trackingCategories []*InvoiceTrackingCategoriesItem) { + i.TrackingCategories = trackingCategories + i.require(invoiceFieldTrackingCategories) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetAccountingPeriod(accountingPeriod *InvoiceAccountingPeriod) { + i.AccountingPeriod = accountingPeriod + i.require(invoiceFieldAccountingPeriod) +} + +// SetPurchaseOrders sets the PurchaseOrders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetPurchaseOrders(purchaseOrders []*InvoicePurchaseOrdersItem) { + i.PurchaseOrders = purchaseOrders + i.require(invoiceFieldPurchaseOrders) +} + +// SetPayments sets the Payments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetPayments(payments []*InvoicePaymentsItem) { + i.Payments = payments + i.require(invoiceFieldPayments) +} + +// SetAppliedPayments sets the AppliedPayments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetAppliedPayments(appliedPayments []*InvoiceAppliedPaymentsItem) { + i.AppliedPayments = appliedPayments + i.require(invoiceFieldAppliedPayments) +} + +// SetLineItems sets the LineItems field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetLineItems(lineItems []*InvoiceLineItem) { + i.LineItems = lineItems + i.require(invoiceFieldLineItems) +} + +// SetAppliedCreditNotes sets the AppliedCreditNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetAppliedCreditNotes(appliedCreditNotes []*InvoiceAppliedCreditNotesItem) { + i.AppliedCreditNotes = appliedCreditNotes + i.require(invoiceFieldAppliedCreditNotes) +} + +// SetAppliedVendorCredits sets the AppliedVendorCredits field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetAppliedVendorCredits(appliedVendorCredits []*InvoiceAppliedVendorCreditsItem) { + i.AppliedVendorCredits = appliedVendorCredits + i.require(invoiceFieldAppliedVendorCredits) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetInclusiveOfTax(inclusiveOfTax *bool) { + i.InclusiveOfTax = inclusiveOfTax + i.require(invoiceFieldInclusiveOfTax) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetRemoteWasDeleted(remoteWasDeleted *bool) { + i.RemoteWasDeleted = remoteWasDeleted + i.require(invoiceFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetFieldMappings(fieldMappings map[string]interface{}) { + i.FieldMappings = fieldMappings + i.require(invoiceFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetRemoteData(remoteData []*RemoteData) { + i.RemoteData = remoteData + i.require(invoiceFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Invoice) SetRemoteFields(remoteFields []*RemoteField) { + i.RemoteFields = remoteFields + i.require(invoiceFieldRemoteFields) +} + func (i *Invoice) UnmarshalJSON(data []byte) error { type embed Invoice var unmarshaler = struct { @@ -10001,7 +12335,8 @@ func (i *Invoice) MarshalJSON() ([]byte, error) { PaidOnDate: internal.NewOptionalDateTime(i.PaidOnDate), RemoteUpdatedAt: internal.NewOptionalDateTime(i.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *Invoice) String() string { @@ -10830,6 +13165,31 @@ func (i *InvoiceEmployee) Accept(visitor InvoiceEmployeeVisitor) error { // // ### Usage Example // Fetch from the `GET Invoice` endpoint and view the invoice's line items. +var ( + invoiceLineItemFieldId = big.NewInt(1 << 0) + invoiceLineItemFieldRemoteId = big.NewInt(1 << 1) + invoiceLineItemFieldCreatedAt = big.NewInt(1 << 2) + invoiceLineItemFieldModifiedAt = big.NewInt(1 << 3) + invoiceLineItemFieldDescription = big.NewInt(1 << 4) + invoiceLineItemFieldUnitPrice = big.NewInt(1 << 5) + invoiceLineItemFieldQuantity = big.NewInt(1 << 6) + invoiceLineItemFieldTotalAmount = big.NewInt(1 << 7) + invoiceLineItemFieldEmployee = big.NewInt(1 << 8) + invoiceLineItemFieldProject = big.NewInt(1 << 9) + invoiceLineItemFieldContact = big.NewInt(1 << 10) + invoiceLineItemFieldCurrency = big.NewInt(1 << 11) + invoiceLineItemFieldExchangeRate = big.NewInt(1 << 12) + invoiceLineItemFieldItem = big.NewInt(1 << 13) + invoiceLineItemFieldAccount = big.NewInt(1 << 14) + invoiceLineItemFieldTaxRate = big.NewInt(1 << 15) + invoiceLineItemFieldTrackingCategory = big.NewInt(1 << 16) + invoiceLineItemFieldTrackingCategories = big.NewInt(1 << 17) + invoiceLineItemFieldCompany = big.NewInt(1 << 18) + invoiceLineItemFieldRemoteWasDeleted = big.NewInt(1 << 19) + invoiceLineItemFieldFieldMappings = big.NewInt(1 << 20) + invoiceLineItemFieldRemoteFields = big.NewInt(1 << 21) +) + type InvoiceLineItem struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -11176,6 +13536,9 @@ type InvoiceLineItem struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -11338,6 +13701,167 @@ func (i *InvoiceLineItem) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *InvoiceLineItem) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetId(id *string) { + i.Id = id + i.require(invoiceLineItemFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetRemoteId(remoteId *string) { + i.RemoteId = remoteId + i.require(invoiceLineItemFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetCreatedAt(createdAt *time.Time) { + i.CreatedAt = createdAt + i.require(invoiceLineItemFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetModifiedAt(modifiedAt *time.Time) { + i.ModifiedAt = modifiedAt + i.require(invoiceLineItemFieldModifiedAt) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetDescription(description *string) { + i.Description = description + i.require(invoiceLineItemFieldDescription) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetUnitPrice(unitPrice *float64) { + i.UnitPrice = unitPrice + i.require(invoiceLineItemFieldUnitPrice) +} + +// SetQuantity sets the Quantity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetQuantity(quantity *float64) { + i.Quantity = quantity + i.require(invoiceLineItemFieldQuantity) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetTotalAmount(totalAmount *float64) { + i.TotalAmount = totalAmount + i.require(invoiceLineItemFieldTotalAmount) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetEmployee(employee *InvoiceLineItemEmployee) { + i.Employee = employee + i.require(invoiceLineItemFieldEmployee) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetProject(project *InvoiceLineItemProject) { + i.Project = project + i.require(invoiceLineItemFieldProject) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetContact(contact *InvoiceLineItemContact) { + i.Contact = contact + i.require(invoiceLineItemFieldContact) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetCurrency(currency *InvoiceLineItemCurrency) { + i.Currency = currency + i.require(invoiceLineItemFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetExchangeRate(exchangeRate *string) { + i.ExchangeRate = exchangeRate + i.require(invoiceLineItemFieldExchangeRate) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetItem(item *InvoiceLineItemItem) { + i.Item = item + i.require(invoiceLineItemFieldItem) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetAccount(account *InvoiceLineItemAccount) { + i.Account = account + i.require(invoiceLineItemFieldAccount) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetTaxRate(taxRate *string) { + i.TaxRate = taxRate + i.require(invoiceLineItemFieldTaxRate) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetTrackingCategory(trackingCategory *InvoiceLineItemTrackingCategory) { + i.TrackingCategory = trackingCategory + i.require(invoiceLineItemFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetTrackingCategories(trackingCategories []*InvoiceLineItemTrackingCategoriesItem) { + i.TrackingCategories = trackingCategories + i.require(invoiceLineItemFieldTrackingCategories) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetCompany(company *string) { + i.Company = company + i.require(invoiceLineItemFieldCompany) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetRemoteWasDeleted(remoteWasDeleted *bool) { + i.RemoteWasDeleted = remoteWasDeleted + i.require(invoiceLineItemFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetFieldMappings(fieldMappings map[string]interface{}) { + i.FieldMappings = fieldMappings + i.require(invoiceLineItemFieldFieldMappings) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InvoiceLineItem) SetRemoteFields(remoteFields []*RemoteField) { + i.RemoteFields = remoteFields + i.require(invoiceLineItemFieldRemoteFields) +} + func (i *InvoiceLineItem) UnmarshalJSON(data []byte) error { type embed InvoiceLineItem var unmarshaler = struct { @@ -11373,7 +13897,8 @@ func (i *InvoiceLineItem) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(i.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(i.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *InvoiceLineItem) String() string { @@ -12583,6 +15108,27 @@ func (i InvoiceTypeEnum) Ptr() *InvoiceTypeEnum { // // ### Usage Example // Fetch from the `LIST Items` endpoint and view a company's items. +var ( + itemFieldId = big.NewInt(1 << 0) + itemFieldRemoteId = big.NewInt(1 << 1) + itemFieldCreatedAt = big.NewInt(1 << 2) + itemFieldModifiedAt = big.NewInt(1 << 3) + itemFieldName = big.NewInt(1 << 4) + itemFieldStatus = big.NewInt(1 << 5) + itemFieldType = big.NewInt(1 << 6) + itemFieldUnitPrice = big.NewInt(1 << 7) + itemFieldPurchasePrice = big.NewInt(1 << 8) + itemFieldPurchaseAccount = big.NewInt(1 << 9) + itemFieldSalesAccount = big.NewInt(1 << 10) + itemFieldCompany = big.NewInt(1 << 11) + itemFieldPurchaseTaxRate = big.NewInt(1 << 12) + itemFieldSalesTaxRate = big.NewInt(1 << 13) + itemFieldRemoteUpdatedAt = big.NewInt(1 << 14) + itemFieldRemoteWasDeleted = big.NewInt(1 << 15) + itemFieldFieldMappings = big.NewInt(1 << 16) + itemFieldRemoteData = big.NewInt(1 << 17) +) + type Item struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -12626,6 +15172,9 @@ type Item struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -12760,46 +15309,180 @@ func (i *Item) GetExtraProperties() map[string]interface{} { return i.extraProperties } -func (i *Item) UnmarshalJSON(data []byte) error { - type embed Item - var unmarshaler = struct { - embed - CreatedAt *internal.DateTime `json:"created_at,omitempty"` - ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` - RemoteUpdatedAt *internal.DateTime `json:"remote_updated_at,omitempty"` - }{ - embed: embed(*i), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *i = Item(unmarshaler.embed) - i.CreatedAt = unmarshaler.CreatedAt.TimePtr() - i.ModifiedAt = unmarshaler.ModifiedAt.TimePtr() - i.RemoteUpdatedAt = unmarshaler.RemoteUpdatedAt.TimePtr() - extraProperties, err := internal.ExtractExtraProperties(data, *i) - if err != nil { - return err +func (i *Item) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) } - i.extraProperties = extraProperties - i.rawJSON = json.RawMessage(data) - return nil + i.explicitFields.Or(i.explicitFields, field) } -func (i *Item) MarshalJSON() ([]byte, error) { - type embed Item - var marshaler = struct { - embed - CreatedAt *internal.DateTime `json:"created_at,omitempty"` - ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` - RemoteUpdatedAt *internal.DateTime `json:"remote_updated_at,omitempty"` - }{ +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetId(id *string) { + i.Id = id + i.require(itemFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetRemoteId(remoteId *string) { + i.RemoteId = remoteId + i.require(itemFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetCreatedAt(createdAt *time.Time) { + i.CreatedAt = createdAt + i.require(itemFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetModifiedAt(modifiedAt *time.Time) { + i.ModifiedAt = modifiedAt + i.require(itemFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetName(name *string) { + i.Name = name + i.require(itemFieldName) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetStatus(status *ItemStatus) { + i.Status = status + i.require(itemFieldStatus) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetType(type_ *ItemType) { + i.Type = type_ + i.require(itemFieldType) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetUnitPrice(unitPrice *float64) { + i.UnitPrice = unitPrice + i.require(itemFieldUnitPrice) +} + +// SetPurchasePrice sets the PurchasePrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetPurchasePrice(purchasePrice *float64) { + i.PurchasePrice = purchasePrice + i.require(itemFieldPurchasePrice) +} + +// SetPurchaseAccount sets the PurchaseAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetPurchaseAccount(purchaseAccount *ItemPurchaseAccount) { + i.PurchaseAccount = purchaseAccount + i.require(itemFieldPurchaseAccount) +} + +// SetSalesAccount sets the SalesAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetSalesAccount(salesAccount *ItemSalesAccount) { + i.SalesAccount = salesAccount + i.require(itemFieldSalesAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetCompany(company *ItemCompany) { + i.Company = company + i.require(itemFieldCompany) +} + +// SetPurchaseTaxRate sets the PurchaseTaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetPurchaseTaxRate(purchaseTaxRate *ItemPurchaseTaxRate) { + i.PurchaseTaxRate = purchaseTaxRate + i.require(itemFieldPurchaseTaxRate) +} + +// SetSalesTaxRate sets the SalesTaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetSalesTaxRate(salesTaxRate *ItemSalesTaxRate) { + i.SalesTaxRate = salesTaxRate + i.require(itemFieldSalesTaxRate) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + i.RemoteUpdatedAt = remoteUpdatedAt + i.require(itemFieldRemoteUpdatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetRemoteWasDeleted(remoteWasDeleted *bool) { + i.RemoteWasDeleted = remoteWasDeleted + i.require(itemFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetFieldMappings(fieldMappings map[string]interface{}) { + i.FieldMappings = fieldMappings + i.require(itemFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Item) SetRemoteData(remoteData []*RemoteData) { + i.RemoteData = remoteData + i.require(itemFieldRemoteData) +} + +func (i *Item) UnmarshalJSON(data []byte) error { + type embed Item + var unmarshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at,omitempty"` + ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` + RemoteUpdatedAt *internal.DateTime `json:"remote_updated_at,omitempty"` + }{ + embed: embed(*i), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *i = Item(unmarshaler.embed) + i.CreatedAt = unmarshaler.CreatedAt.TimePtr() + i.ModifiedAt = unmarshaler.ModifiedAt.TimePtr() + i.RemoteUpdatedAt = unmarshaler.RemoteUpdatedAt.TimePtr() + extraProperties, err := internal.ExtractExtraProperties(data, *i) + if err != nil { + return err + } + i.extraProperties = extraProperties + i.rawJSON = json.RawMessage(data) + return nil +} + +func (i *Item) MarshalJSON() ([]byte, error) { + type embed Item + var marshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at,omitempty"` + ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` + RemoteUpdatedAt *internal.DateTime `json:"remote_updated_at,omitempty"` + }{ embed: embed(*i), CreatedAt: internal.NewOptionalDateTime(i.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(i.ModifiedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(i.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *Item) String() string { @@ -13169,11 +15852,20 @@ func (i *ItemSalesTaxRate) Accept(visitor ItemSalesTaxRateVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", i) } +var ( + itemSchemaFieldItemType = big.NewInt(1 << 0) + itemSchemaFieldItemFormat = big.NewInt(1 << 1) + itemSchemaFieldItemChoices = big.NewInt(1 << 2) +) + type ItemSchema struct { ItemType *ItemTypeEnum `json:"item_type,omitempty" url:"item_type,omitempty"` ItemFormat *ItemFormatEnum `json:"item_format,omitempty" url:"item_format,omitempty"` ItemChoices []string `json:"item_choices,omitempty" url:"item_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -13203,6 +15895,34 @@ func (i *ItemSchema) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *ItemSchema) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetItemType sets the ItemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemSchema) SetItemType(itemType *ItemTypeEnum) { + i.ItemType = itemType + i.require(itemSchemaFieldItemType) +} + +// SetItemFormat sets the ItemFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemSchema) SetItemFormat(itemFormat *ItemFormatEnum) { + i.ItemFormat = itemFormat + i.require(itemSchemaFieldItemFormat) +} + +// SetItemChoices sets the ItemChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemSchema) SetItemChoices(itemChoices []string) { + i.ItemChoices = itemChoices + i.require(itemSchemaFieldItemChoices) +} + func (i *ItemSchema) UnmarshalJSON(data []byte) error { type unmarshaler ItemSchema var value unmarshaler @@ -13219,6 +15939,17 @@ func (i *ItemSchema) UnmarshalJSON(data []byte) error { return nil } +func (i *ItemSchema) MarshalJSON() ([]byte, error) { + type embed ItemSchema + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *ItemSchema) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -13445,10 +16176,18 @@ func (l LastSyncResultEnum) Ptr() *LastSyncResultEnum { return &l } +var ( + linkedAccountStatusFieldLinkedAccountStatus = big.NewInt(1 << 0) + linkedAccountStatusFieldCanMakeRequest = big.NewInt(1 << 1) +) + type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status" url:"linked_account_status"` CanMakeRequest bool `json:"can_make_request" url:"can_make_request"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -13471,6 +16210,27 @@ func (l *LinkedAccountStatus) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkedAccountStatus) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkedAccountStatus sets the LinkedAccountStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetLinkedAccountStatus(linkedAccountStatus string) { + l.LinkedAccountStatus = linkedAccountStatus + l.require(linkedAccountStatusFieldLinkedAccountStatus) +} + +// SetCanMakeRequest sets the CanMakeRequest field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetCanMakeRequest(canMakeRequest bool) { + l.CanMakeRequest = canMakeRequest + l.require(linkedAccountStatusFieldCanMakeRequest) +} + func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { type unmarshaler LinkedAccountStatus var value unmarshaler @@ -13487,6 +16247,17 @@ func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkedAccountStatus) MarshalJSON() ([]byte, error) { + type embed LinkedAccountStatus + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkedAccountStatus) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { @@ -13499,6 +16270,14 @@ func (l *LinkedAccountStatus) String() string { return fmt.Sprintf("%#v", l) } +var ( + metaResponseFieldRequestSchema = big.NewInt(1 << 0) + metaResponseFieldRemoteFieldClasses = big.NewInt(1 << 1) + metaResponseFieldStatus = big.NewInt(1 << 2) + metaResponseFieldHasConditionalParams = big.NewInt(1 << 3) + metaResponseFieldHasRequiredLinkedAccountParams = big.NewInt(1 << 4) +) + type MetaResponse struct { RequestSchema map[string]interface{} `json:"request_schema" url:"request_schema"` RemoteFieldClasses map[string]interface{} `json:"remote_field_classes,omitempty" url:"remote_field_classes,omitempty"` @@ -13506,6 +16285,9 @@ type MetaResponse struct { HasConditionalParams bool `json:"has_conditional_params" url:"has_conditional_params"` HasRequiredLinkedAccountParams bool `json:"has_required_linked_account_params" url:"has_required_linked_account_params"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -13549,6 +16331,48 @@ func (m *MetaResponse) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *MetaResponse) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetRequestSchema sets the RequestSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRequestSchema(requestSchema map[string]interface{}) { + m.RequestSchema = requestSchema + m.require(metaResponseFieldRequestSchema) +} + +// SetRemoteFieldClasses sets the RemoteFieldClasses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRemoteFieldClasses(remoteFieldClasses map[string]interface{}) { + m.RemoteFieldClasses = remoteFieldClasses + m.require(metaResponseFieldRemoteFieldClasses) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetStatus(status *LinkedAccountStatus) { + m.Status = status + m.require(metaResponseFieldStatus) +} + +// SetHasConditionalParams sets the HasConditionalParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasConditionalParams(hasConditionalParams bool) { + m.HasConditionalParams = hasConditionalParams + m.require(metaResponseFieldHasConditionalParams) +} + +// SetHasRequiredLinkedAccountParams sets the HasRequiredLinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasRequiredLinkedAccountParams(hasRequiredLinkedAccountParams bool) { + m.HasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams + m.require(metaResponseFieldHasRequiredLinkedAccountParams) +} + func (m *MetaResponse) UnmarshalJSON(data []byte) error { type unmarshaler MetaResponse var value unmarshaler @@ -13565,6 +16389,17 @@ func (m *MetaResponse) UnmarshalJSON(data []byte) error { return nil } +func (m *MetaResponse) MarshalJSON() ([]byte, error) { + type embed MetaResponse + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MetaResponse) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -13663,12 +16498,22 @@ func (m MethodTypeEnum) Ptr() *MethodTypeEnum { // // ### Usage Example // View what operations are supported for the `Candidate` endpoint. +var ( + modelOperationFieldModelName = big.NewInt(1 << 0) + modelOperationFieldAvailableOperations = big.NewInt(1 << 1) + modelOperationFieldRequiredPostParameters = big.NewInt(1 << 2) + modelOperationFieldSupportedFields = big.NewInt(1 << 3) +) + type ModelOperation struct { ModelName string `json:"model_name" url:"model_name"` AvailableOperations []string `json:"available_operations" url:"available_operations"` RequiredPostParameters []string `json:"required_post_parameters" url:"required_post_parameters"` SupportedFields []string `json:"supported_fields" url:"supported_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -13705,6 +16550,41 @@ func (m *ModelOperation) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *ModelOperation) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetModelName(modelName string) { + m.ModelName = modelName + m.require(modelOperationFieldModelName) +} + +// SetAvailableOperations sets the AvailableOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetAvailableOperations(availableOperations []string) { + m.AvailableOperations = availableOperations + m.require(modelOperationFieldAvailableOperations) +} + +// SetRequiredPostParameters sets the RequiredPostParameters field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetRequiredPostParameters(requiredPostParameters []string) { + m.RequiredPostParameters = requiredPostParameters + m.require(modelOperationFieldRequiredPostParameters) +} + +// SetSupportedFields sets the SupportedFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetSupportedFields(supportedFields []string) { + m.SupportedFields = supportedFields + m.require(modelOperationFieldSupportedFields) +} + func (m *ModelOperation) UnmarshalJSON(data []byte) error { type unmarshaler ModelOperation var value unmarshaler @@ -13721,6 +16601,17 @@ func (m *ModelOperation) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelOperation) MarshalJSON() ([]byte, error) { + type embed ModelOperation + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelOperation) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -13733,9 +16624,16 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +var ( + modelPermissionDeserializerRequestFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializerRequest struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -13751,6 +16649,20 @@ func (m *ModelPermissionDeserializerRequest) GetExtraProperties() map[string]int return m.extraProperties } +func (m *ModelPermissionDeserializerRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializerRequest) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerRequestFieldIsEnabled) +} + func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializerRequest var value unmarshaler @@ -13767,6 +16679,17 @@ func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializerRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -13785,6 +16708,14 @@ func (m *ModelPermissionDeserializerRequest) String() string { // // ### Usage Example // Create a `MultipartFormField` to define a multipart form entry. +var ( + multipartFormFieldRequestFieldName = big.NewInt(1 << 0) + multipartFormFieldRequestFieldData = big.NewInt(1 << 1) + multipartFormFieldRequestFieldEncoding = big.NewInt(1 << 2) + multipartFormFieldRequestFieldFileName = big.NewInt(1 << 3) + multipartFormFieldRequestFieldContentType = big.NewInt(1 << 4) +) + type MultipartFormFieldRequest struct { // The name of the form field Name string `json:"name" url:"name"` @@ -13801,6 +16732,9 @@ type MultipartFormFieldRequest struct { // The MIME type of the file, if the field is for a file. ContentType *string `json:"content_type,omitempty" url:"content_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -13844,6 +16778,48 @@ func (m *MultipartFormFieldRequest) GetExtraProperties() map[string]interface{} return m.extraProperties } +func (m *MultipartFormFieldRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetName(name string) { + m.Name = name + m.require(multipartFormFieldRequestFieldName) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetData(data string) { + m.Data = data + m.require(multipartFormFieldRequestFieldData) +} + +// SetEncoding sets the Encoding field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetEncoding(encoding *EncodingEnum) { + m.Encoding = encoding + m.require(multipartFormFieldRequestFieldEncoding) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetFileName(fileName *string) { + m.FileName = fileName + m.require(multipartFormFieldRequestFieldFileName) +} + +// SetContentType sets the ContentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetContentType(contentType *string) { + m.ContentType = contentType + m.require(multipartFormFieldRequestFieldContentType) +} + func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { type unmarshaler MultipartFormFieldRequest var value unmarshaler @@ -13860,6 +16836,17 @@ func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *MultipartFormFieldRequest) MarshalJSON() ([]byte, error) { + type embed MultipartFormFieldRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MultipartFormFieldRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -13872,11 +16859,20 @@ func (m *MultipartFormFieldRequest) String() string { return fmt.Sprintf("%#v", m) } +var ( + paginatedRemoteFieldClassListFieldNext = big.NewInt(1 << 0) + paginatedRemoteFieldClassListFieldPrevious = big.NewInt(1 << 1) + paginatedRemoteFieldClassListFieldResults = big.NewInt(1 << 2) +) + type PaginatedRemoteFieldClassList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*RemoteFieldClass `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -13906,6 +16902,34 @@ func (p *PaginatedRemoteFieldClassList) GetExtraProperties() map[string]interfac return p.extraProperties } +func (p *PaginatedRemoteFieldClassList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteFieldClassList) SetNext(next *string) { + p.Next = next + p.require(paginatedRemoteFieldClassListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteFieldClassList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedRemoteFieldClassListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteFieldClassList) SetResults(results []*RemoteFieldClass) { + p.Results = results + p.require(paginatedRemoteFieldClassListFieldResults) +} + func (p *PaginatedRemoteFieldClassList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedRemoteFieldClassList var value unmarshaler @@ -13922,6 +16946,17 @@ func (p *PaginatedRemoteFieldClassList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedRemoteFieldClassList) MarshalJSON() ([]byte, error) { + type embed PaginatedRemoteFieldClassList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedRemoteFieldClassList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -13940,6 +16975,30 @@ func (p *PaginatedRemoteFieldClassList) String() string { // // ### Usage Example // Fetch from the `GET Payment` endpoint and view an invoice's payment. +var ( + paymentFieldId = big.NewInt(1 << 0) + paymentFieldRemoteId = big.NewInt(1 << 1) + paymentFieldCreatedAt = big.NewInt(1 << 2) + paymentFieldModifiedAt = big.NewInt(1 << 3) + paymentFieldTransactionDate = big.NewInt(1 << 4) + paymentFieldContact = big.NewInt(1 << 5) + paymentFieldAccount = big.NewInt(1 << 6) + paymentFieldPaymentMethod = big.NewInt(1 << 7) + paymentFieldCurrency = big.NewInt(1 << 8) + paymentFieldExchangeRate = big.NewInt(1 << 9) + paymentFieldCompany = big.NewInt(1 << 10) + paymentFieldTotalAmount = big.NewInt(1 << 11) + paymentFieldType = big.NewInt(1 << 12) + paymentFieldTrackingCategories = big.NewInt(1 << 13) + paymentFieldAccountingPeriod = big.NewInt(1 << 14) + paymentFieldAppliedToLines = big.NewInt(1 << 15) + paymentFieldRemoteUpdatedAt = big.NewInt(1 << 16) + paymentFieldRemoteWasDeleted = big.NewInt(1 << 17) + paymentFieldFieldMappings = big.NewInt(1 << 18) + paymentFieldRemoteData = big.NewInt(1 << 19) + paymentFieldRemoteFields = big.NewInt(1 << 20) +) + type Payment struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -14289,6 +17348,9 @@ type Payment struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -14444,6 +17506,160 @@ func (p *Payment) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *Payment) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetId(id *string) { + p.Id = id + p.require(paymentFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(paymentFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(paymentFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(paymentFieldModifiedAt) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetTransactionDate(transactionDate *time.Time) { + p.TransactionDate = transactionDate + p.require(paymentFieldTransactionDate) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetContact(contact *PaymentContact) { + p.Contact = contact + p.require(paymentFieldContact) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetAccount(account *PaymentAccount) { + p.Account = account + p.require(paymentFieldAccount) +} + +// SetPaymentMethod sets the PaymentMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetPaymentMethod(paymentMethod *PaymentPaymentMethod) { + p.PaymentMethod = paymentMethod + p.require(paymentFieldPaymentMethod) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetCurrency(currency *PaymentCurrency) { + p.Currency = currency + p.require(paymentFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetExchangeRate(exchangeRate *string) { + p.ExchangeRate = exchangeRate + p.require(paymentFieldExchangeRate) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetCompany(company *PaymentCompany) { + p.Company = company + p.require(paymentFieldCompany) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetTotalAmount(totalAmount *float64) { + p.TotalAmount = totalAmount + p.require(paymentFieldTotalAmount) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetType(type_ *PaymentType) { + p.Type = type_ + p.require(paymentFieldType) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetTrackingCategories(trackingCategories []*PaymentTrackingCategoriesItem) { + p.TrackingCategories = trackingCategories + p.require(paymentFieldTrackingCategories) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetAccountingPeriod(accountingPeriod *PaymentAccountingPeriod) { + p.AccountingPeriod = accountingPeriod + p.require(paymentFieldAccountingPeriod) +} + +// SetAppliedToLines sets the AppliedToLines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetAppliedToLines(appliedToLines []*PaymentAppliedToLinesItem) { + p.AppliedToLines = appliedToLines + p.require(paymentFieldAppliedToLines) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + p.RemoteUpdatedAt = remoteUpdatedAt + p.require(paymentFieldRemoteUpdatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetRemoteWasDeleted(remoteWasDeleted *bool) { + p.RemoteWasDeleted = remoteWasDeleted + p.require(paymentFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetFieldMappings(fieldMappings map[string]interface{}) { + p.FieldMappings = fieldMappings + p.require(paymentFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetRemoteData(remoteData []*RemoteData) { + p.RemoteData = remoteData + p.require(paymentFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Payment) SetRemoteFields(remoteFields []*RemoteField) { + p.RemoteFields = remoteFields + p.require(paymentFieldRemoteFields) +} + func (p *Payment) UnmarshalJSON(data []byte) error { type embed Payment var unmarshaler = struct { @@ -14487,7 +17703,8 @@ func (p *Payment) MarshalJSON() ([]byte, error) { TransactionDate: internal.NewOptionalDateTime(p.TransactionDate), RemoteUpdatedAt: internal.NewOptionalDateTime(p.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *Payment) String() string { @@ -15192,6 +18409,17 @@ func (p *PaymentCurrency) Accept(visitor PaymentCurrencyVisitor) error { // // ### 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`. +var ( + paymentLineItemFieldId = big.NewInt(1 << 0) + paymentLineItemFieldRemoteId = big.NewInt(1 << 1) + paymentLineItemFieldCreatedAt = big.NewInt(1 << 2) + paymentLineItemFieldModifiedAt = big.NewInt(1 << 3) + paymentLineItemFieldAppliedAmount = big.NewInt(1 << 4) + paymentLineItemFieldAppliedDate = big.NewInt(1 << 5) + paymentLineItemFieldRelatedObjectId = big.NewInt(1 << 6) + paymentLineItemFieldRelatedObjectType = big.NewInt(1 << 7) +) + type PaymentLineItem struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -15209,6 +18437,9 @@ type PaymentLineItem struct { // The type of transaction the payment portion is being applied to. Possible values include: INVOICE, JOURNAL_ENTRY, or CREDIT_NOTE. RelatedObjectType *string `json:"related_object_type,omitempty" url:"related_object_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -15273,9 +18504,72 @@ func (p *PaymentLineItem) GetExtraProperties() map[string]interface{} { return p.extraProperties } -func (p *PaymentLineItem) UnmarshalJSON(data []byte) error { - type embed PaymentLineItem - var unmarshaler = struct { +func (p *PaymentLineItem) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItem) SetId(id *string) { + p.Id = id + p.require(paymentLineItemFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItem) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(paymentLineItemFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItem) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(paymentLineItemFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItem) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(paymentLineItemFieldModifiedAt) +} + +// SetAppliedAmount sets the AppliedAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItem) SetAppliedAmount(appliedAmount *string) { + p.AppliedAmount = appliedAmount + p.require(paymentLineItemFieldAppliedAmount) +} + +// SetAppliedDate sets the AppliedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItem) SetAppliedDate(appliedDate *time.Time) { + p.AppliedDate = appliedDate + p.require(paymentLineItemFieldAppliedDate) +} + +// SetRelatedObjectId sets the RelatedObjectId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItem) SetRelatedObjectId(relatedObjectId *string) { + p.RelatedObjectId = relatedObjectId + p.require(paymentLineItemFieldRelatedObjectId) +} + +// SetRelatedObjectType sets the RelatedObjectType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentLineItem) SetRelatedObjectType(relatedObjectType *string) { + p.RelatedObjectType = relatedObjectType + p.require(paymentLineItemFieldRelatedObjectType) +} + +func (p *PaymentLineItem) UnmarshalJSON(data []byte) error { + type embed PaymentLineItem + var unmarshaler = struct { embed CreatedAt *internal.DateTime `json:"created_at,omitempty"` ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` @@ -15312,7 +18606,8 @@ func (p *PaymentLineItem) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), AppliedDate: internal.NewOptionalDateTime(p.AppliedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PaymentLineItem) String() string { @@ -15333,6 +18628,19 @@ func (p *PaymentLineItem) String() string { // // ### Usage Example // Fetch from the `GET PaymentMethod` endpoint and view payment method information. +var ( + paymentMethodFieldId = big.NewInt(1 << 0) + paymentMethodFieldRemoteId = big.NewInt(1 << 1) + paymentMethodFieldCreatedAt = big.NewInt(1 << 2) + paymentMethodFieldModifiedAt = big.NewInt(1 << 3) + paymentMethodFieldMethodType = big.NewInt(1 << 4) + paymentMethodFieldName = big.NewInt(1 << 5) + paymentMethodFieldIsActive = big.NewInt(1 << 6) + paymentMethodFieldRemoteUpdatedAt = big.NewInt(1 << 7) + paymentMethodFieldFieldMappings = big.NewInt(1 << 8) + paymentMethodFieldRemoteData = big.NewInt(1 << 9) +) + type PaymentMethod struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -15358,6 +18666,9 @@ type PaymentMethod struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -15436,6 +18747,83 @@ func (p *PaymentMethod) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaymentMethod) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetId(id *string) { + p.Id = id + p.require(paymentMethodFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(paymentMethodFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(paymentMethodFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(paymentMethodFieldModifiedAt) +} + +// SetMethodType sets the MethodType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetMethodType(methodType *PaymentMethodMethodType) { + p.MethodType = methodType + p.require(paymentMethodFieldMethodType) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetName(name string) { + p.Name = name + p.require(paymentMethodFieldName) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetIsActive(isActive *bool) { + p.IsActive = isActive + p.require(paymentMethodFieldIsActive) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + p.RemoteUpdatedAt = remoteUpdatedAt + p.require(paymentMethodFieldRemoteUpdatedAt) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetFieldMappings(fieldMappings map[string]interface{}) { + p.FieldMappings = fieldMappings + p.require(paymentMethodFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentMethod) SetRemoteData(remoteData []*RemoteData) { + p.RemoteData = remoteData + p.require(paymentMethodFieldRemoteData) +} + func (p *PaymentMethod) UnmarshalJSON(data []byte) error { type embed PaymentMethod var unmarshaler = struct { @@ -15475,7 +18863,8 @@ func (p *PaymentMethod) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(p.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PaymentMethod) String() string { @@ -15629,6 +19018,21 @@ func (p *PaymentPaymentMethod) Accept(visitor PaymentPaymentMethodVisitor) error // // ### Usage Example // Fetch from the `GET PaymentTerm` endpoint and view payment term information. +var ( + paymentTermFieldId = big.NewInt(1 << 0) + paymentTermFieldRemoteId = big.NewInt(1 << 1) + paymentTermFieldCreatedAt = big.NewInt(1 << 2) + paymentTermFieldModifiedAt = big.NewInt(1 << 3) + paymentTermFieldName = big.NewInt(1 << 4) + paymentTermFieldIsActive = big.NewInt(1 << 5) + paymentTermFieldCompany = big.NewInt(1 << 6) + paymentTermFieldDaysUntilDue = big.NewInt(1 << 7) + paymentTermFieldDiscountDays = big.NewInt(1 << 8) + paymentTermFieldRemoteLastModifiedAt = big.NewInt(1 << 9) + paymentTermFieldFieldMappings = big.NewInt(1 << 10) + paymentTermFieldRemoteData = big.NewInt(1 << 11) +) + type PaymentTerm struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -15652,6 +19056,9 @@ type PaymentTerm struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -15744,6 +19151,97 @@ func (p *PaymentTerm) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaymentTerm) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetId(id *string) { + p.Id = id + p.require(paymentTermFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(paymentTermFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(paymentTermFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(paymentTermFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetName(name string) { + p.Name = name + p.require(paymentTermFieldName) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetIsActive(isActive *bool) { + p.IsActive = isActive + p.require(paymentTermFieldIsActive) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetCompany(company *PaymentTermCompany) { + p.Company = company + p.require(paymentTermFieldCompany) +} + +// SetDaysUntilDue sets the DaysUntilDue field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetDaysUntilDue(daysUntilDue *int) { + p.DaysUntilDue = daysUntilDue + p.require(paymentTermFieldDaysUntilDue) +} + +// SetDiscountDays sets the DiscountDays field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetDiscountDays(discountDays *int) { + p.DiscountDays = discountDays + p.require(paymentTermFieldDiscountDays) +} + +// SetRemoteLastModifiedAt sets the RemoteLastModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetRemoteLastModifiedAt(remoteLastModifiedAt *time.Time) { + p.RemoteLastModifiedAt = remoteLastModifiedAt + p.require(paymentTermFieldRemoteLastModifiedAt) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetFieldMappings(fieldMappings map[string]interface{}) { + p.FieldMappings = fieldMappings + p.require(paymentTermFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaymentTerm) SetRemoteData(remoteData []*RemoteData) { + p.RemoteData = remoteData + p.require(paymentTermFieldRemoteData) +} + func (p *PaymentTerm) UnmarshalJSON(data []byte) error { type embed PaymentTerm var unmarshaler = struct { @@ -15783,7 +19281,8 @@ func (p *PaymentTerm) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), RemoteLastModifiedAt: internal.NewOptionalDateTime(p.RemoteLastModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PaymentTerm) String() string { @@ -16020,6 +19519,19 @@ func (p PaymentTypeEnum) Ptr() *PaymentTypeEnum { // // ### Usage Example // Fetch from the `GET Project` endpoint and view project information. +var ( + projectFieldId = big.NewInt(1 << 0) + projectFieldRemoteId = big.NewInt(1 << 1) + projectFieldCreatedAt = big.NewInt(1 << 2) + projectFieldModifiedAt = big.NewInt(1 << 3) + projectFieldName = big.NewInt(1 << 4) + projectFieldIsActive = big.NewInt(1 << 5) + projectFieldCompany = big.NewInt(1 << 6) + projectFieldContact = big.NewInt(1 << 7) + projectFieldFieldMappings = big.NewInt(1 << 8) + projectFieldRemoteData = big.NewInt(1 << 9) +) + type Project struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -16039,6 +19551,9 @@ type Project struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -16117,6 +19632,83 @@ func (p *Project) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *Project) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetId(id *string) { + p.Id = id + p.require(projectFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(projectFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(projectFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(projectFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetName(name string) { + p.Name = name + p.require(projectFieldName) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetIsActive(isActive *bool) { + p.IsActive = isActive + p.require(projectFieldIsActive) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetCompany(company *ProjectCompany) { + p.Company = company + p.require(projectFieldCompany) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetContact(contact *ProjectContact) { + p.Contact = contact + p.require(projectFieldContact) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetFieldMappings(fieldMappings map[string]interface{}) { + p.FieldMappings = fieldMappings + p.require(projectFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetRemoteData(remoteData []*RemoteData) { + p.RemoteData = remoteData + p.require(projectFieldRemoteData) +} + func (p *Project) UnmarshalJSON(data []byte) error { type embed Project var unmarshaler = struct { @@ -16152,7 +19744,8 @@ func (p *Project) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(p.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *Project) String() string { @@ -16301,6 +19894,36 @@ func (p *ProjectContact) Accept(visitor ProjectContactVisitor) error { // // ### Usage Example // Fetch from the `LIST PurchaseOrders` endpoint and view a company's purchase orders. +var ( + purchaseOrderFieldId = big.NewInt(1 << 0) + purchaseOrderFieldRemoteId = big.NewInt(1 << 1) + purchaseOrderFieldCreatedAt = big.NewInt(1 << 2) + purchaseOrderFieldModifiedAt = big.NewInt(1 << 3) + purchaseOrderFieldStatus = big.NewInt(1 << 4) + purchaseOrderFieldIssueDate = big.NewInt(1 << 5) + purchaseOrderFieldPurchaseOrderNumber = big.NewInt(1 << 6) + purchaseOrderFieldDeliveryDate = big.NewInt(1 << 7) + purchaseOrderFieldDeliveryAddress = big.NewInt(1 << 8) + purchaseOrderFieldCustomer = big.NewInt(1 << 9) + purchaseOrderFieldVendor = big.NewInt(1 << 10) + purchaseOrderFieldMemo = big.NewInt(1 << 11) + purchaseOrderFieldCompany = big.NewInt(1 << 12) + purchaseOrderFieldTotalAmount = big.NewInt(1 << 13) + purchaseOrderFieldCurrency = big.NewInt(1 << 14) + purchaseOrderFieldExchangeRate = big.NewInt(1 << 15) + purchaseOrderFieldPaymentTerm = big.NewInt(1 << 16) + purchaseOrderFieldLineItems = big.NewInt(1 << 17) + purchaseOrderFieldInclusiveOfTax = big.NewInt(1 << 18) + purchaseOrderFieldTrackingCategories = big.NewInt(1 << 19) + purchaseOrderFieldAccountingPeriod = big.NewInt(1 << 20) + purchaseOrderFieldRemoteCreatedAt = big.NewInt(1 << 21) + purchaseOrderFieldRemoteUpdatedAt = big.NewInt(1 << 22) + purchaseOrderFieldRemoteWasDeleted = big.NewInt(1 << 23) + purchaseOrderFieldFieldMappings = big.NewInt(1 << 24) + purchaseOrderFieldRemoteData = big.NewInt(1 << 25) + purchaseOrderFieldRemoteFields = big.NewInt(1 << 26) +) + type PurchaseOrder struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -16664,6 +20287,9 @@ type PurchaseOrder struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -16861,6 +20487,202 @@ func (p *PurchaseOrder) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PurchaseOrder) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetId(id *string) { + p.Id = id + p.require(purchaseOrderFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(purchaseOrderFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(purchaseOrderFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(purchaseOrderFieldModifiedAt) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetStatus(status *PurchaseOrderStatus) { + p.Status = status + p.require(purchaseOrderFieldStatus) +} + +// SetIssueDate sets the IssueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetIssueDate(issueDate *time.Time) { + p.IssueDate = issueDate + p.require(purchaseOrderFieldIssueDate) +} + +// SetPurchaseOrderNumber sets the PurchaseOrderNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetPurchaseOrderNumber(purchaseOrderNumber *string) { + p.PurchaseOrderNumber = purchaseOrderNumber + p.require(purchaseOrderFieldPurchaseOrderNumber) +} + +// SetDeliveryDate sets the DeliveryDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetDeliveryDate(deliveryDate *time.Time) { + p.DeliveryDate = deliveryDate + p.require(purchaseOrderFieldDeliveryDate) +} + +// SetDeliveryAddress sets the DeliveryAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetDeliveryAddress(deliveryAddress *PurchaseOrderDeliveryAddress) { + p.DeliveryAddress = deliveryAddress + p.require(purchaseOrderFieldDeliveryAddress) +} + +// SetCustomer sets the Customer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetCustomer(customer *string) { + p.Customer = customer + p.require(purchaseOrderFieldCustomer) +} + +// SetVendor sets the Vendor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetVendor(vendor_ *PurchaseOrderVendor) { + p.Vendor = vendor_ + p.require(purchaseOrderFieldVendor) +} + +// SetMemo sets the Memo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetMemo(memo *string) { + p.Memo = memo + p.require(purchaseOrderFieldMemo) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetCompany(company *PurchaseOrderCompany) { + p.Company = company + p.require(purchaseOrderFieldCompany) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetTotalAmount(totalAmount *float64) { + p.TotalAmount = totalAmount + p.require(purchaseOrderFieldTotalAmount) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetCurrency(currency *PurchaseOrderCurrency) { + p.Currency = currency + p.require(purchaseOrderFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetExchangeRate(exchangeRate *string) { + p.ExchangeRate = exchangeRate + p.require(purchaseOrderFieldExchangeRate) +} + +// SetPaymentTerm sets the PaymentTerm field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetPaymentTerm(paymentTerm *PurchaseOrderPaymentTerm) { + p.PaymentTerm = paymentTerm + p.require(purchaseOrderFieldPaymentTerm) +} + +// SetLineItems sets the LineItems field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetLineItems(lineItems []*PurchaseOrderLineItem) { + p.LineItems = lineItems + p.require(purchaseOrderFieldLineItems) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetInclusiveOfTax(inclusiveOfTax *bool) { + p.InclusiveOfTax = inclusiveOfTax + p.require(purchaseOrderFieldInclusiveOfTax) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetTrackingCategories(trackingCategories []*PurchaseOrderTrackingCategoriesItem) { + p.TrackingCategories = trackingCategories + p.require(purchaseOrderFieldTrackingCategories) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetAccountingPeriod(accountingPeriod *PurchaseOrderAccountingPeriod) { + p.AccountingPeriod = accountingPeriod + p.require(purchaseOrderFieldAccountingPeriod) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + p.RemoteCreatedAt = remoteCreatedAt + p.require(purchaseOrderFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + p.RemoteUpdatedAt = remoteUpdatedAt + p.require(purchaseOrderFieldRemoteUpdatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetRemoteWasDeleted(remoteWasDeleted *bool) { + p.RemoteWasDeleted = remoteWasDeleted + p.require(purchaseOrderFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetFieldMappings(fieldMappings map[string]interface{}) { + p.FieldMappings = fieldMappings + p.require(purchaseOrderFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetRemoteData(remoteData []*RemoteData) { + p.RemoteData = remoteData + p.require(purchaseOrderFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrder) SetRemoteFields(remoteFields []*RemoteField) { + p.RemoteFields = remoteFields + p.require(purchaseOrderFieldRemoteFields) +} + func (p *PurchaseOrder) UnmarshalJSON(data []byte) error { type embed PurchaseOrder var unmarshaler = struct { @@ -16912,7 +20734,8 @@ func (p *PurchaseOrder) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(p.RemoteCreatedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(p.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PurchaseOrder) String() string { @@ -17492,6 +21315,28 @@ func (p *PurchaseOrderDeliveryAddress) Accept(visitor PurchaseOrderDeliveryAddre // // ### Usage Example // Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase orders. +var ( + purchaseOrderLineItemFieldId = big.NewInt(1 << 0) + purchaseOrderLineItemFieldRemoteId = big.NewInt(1 << 1) + purchaseOrderLineItemFieldCreatedAt = big.NewInt(1 << 2) + purchaseOrderLineItemFieldModifiedAt = big.NewInt(1 << 3) + purchaseOrderLineItemFieldDescription = big.NewInt(1 << 4) + purchaseOrderLineItemFieldUnitPrice = big.NewInt(1 << 5) + purchaseOrderLineItemFieldQuantity = big.NewInt(1 << 6) + purchaseOrderLineItemFieldItem = big.NewInt(1 << 7) + purchaseOrderLineItemFieldAccount = big.NewInt(1 << 8) + purchaseOrderLineItemFieldTrackingCategory = big.NewInt(1 << 9) + purchaseOrderLineItemFieldTrackingCategories = big.NewInt(1 << 10) + purchaseOrderLineItemFieldTaxAmount = big.NewInt(1 << 11) + purchaseOrderLineItemFieldTotalLineAmount = big.NewInt(1 << 12) + purchaseOrderLineItemFieldCurrency = big.NewInt(1 << 13) + purchaseOrderLineItemFieldTaxRate = big.NewInt(1 << 14) + purchaseOrderLineItemFieldExchangeRate = big.NewInt(1 << 15) + purchaseOrderLineItemFieldCompany = big.NewInt(1 << 16) + purchaseOrderLineItemFieldRemoteWasDeleted = big.NewInt(1 << 17) + purchaseOrderLineItemFieldRemoteFields = big.NewInt(1 << 18) +) + type PurchaseOrderLineItem struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -17836,6 +21681,9 @@ type PurchaseOrderLineItem struct { RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -17977,6 +21825,146 @@ func (p *PurchaseOrderLineItem) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PurchaseOrderLineItem) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetId(id *string) { + p.Id = id + p.require(purchaseOrderLineItemFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(purchaseOrderLineItemFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(purchaseOrderLineItemFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(purchaseOrderLineItemFieldModifiedAt) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetDescription(description *string) { + p.Description = description + p.require(purchaseOrderLineItemFieldDescription) +} + +// SetUnitPrice sets the UnitPrice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetUnitPrice(unitPrice *float64) { + p.UnitPrice = unitPrice + p.require(purchaseOrderLineItemFieldUnitPrice) +} + +// SetQuantity sets the Quantity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetQuantity(quantity *float64) { + p.Quantity = quantity + p.require(purchaseOrderLineItemFieldQuantity) +} + +// SetItem sets the Item field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetItem(item *PurchaseOrderLineItemItem) { + p.Item = item + p.require(purchaseOrderLineItemFieldItem) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetAccount(account *string) { + p.Account = account + p.require(purchaseOrderLineItemFieldAccount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetTrackingCategory(trackingCategory *string) { + p.TrackingCategory = trackingCategory + p.require(purchaseOrderLineItemFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetTrackingCategories(trackingCategories []*string) { + p.TrackingCategories = trackingCategories + p.require(purchaseOrderLineItemFieldTrackingCategories) +} + +// SetTaxAmount sets the TaxAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetTaxAmount(taxAmount *string) { + p.TaxAmount = taxAmount + p.require(purchaseOrderLineItemFieldTaxAmount) +} + +// SetTotalLineAmount sets the TotalLineAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetTotalLineAmount(totalLineAmount *string) { + p.TotalLineAmount = totalLineAmount + p.require(purchaseOrderLineItemFieldTotalLineAmount) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetCurrency(currency *PurchaseOrderLineItemCurrency) { + p.Currency = currency + p.require(purchaseOrderLineItemFieldCurrency) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetTaxRate(taxRate *string) { + p.TaxRate = taxRate + p.require(purchaseOrderLineItemFieldTaxRate) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetExchangeRate(exchangeRate *string) { + p.ExchangeRate = exchangeRate + p.require(purchaseOrderLineItemFieldExchangeRate) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetCompany(company *string) { + p.Company = company + p.require(purchaseOrderLineItemFieldCompany) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetRemoteWasDeleted(remoteWasDeleted *bool) { + p.RemoteWasDeleted = remoteWasDeleted + p.require(purchaseOrderLineItemFieldRemoteWasDeleted) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PurchaseOrderLineItem) SetRemoteFields(remoteFields []*RemoteField) { + p.RemoteFields = remoteFields + p.require(purchaseOrderLineItemFieldRemoteFields) +} + func (p *PurchaseOrderLineItem) UnmarshalJSON(data []byte) error { type embed PurchaseOrderLineItem var unmarshaler = struct { @@ -18012,7 +22000,8 @@ func (p *PurchaseOrderLineItem) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(p.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PurchaseOrderLineItem) String() string { @@ -18758,11 +22747,19 @@ func (p *PurchaseOrderVendor) Accept(visitor PurchaseOrderVendorVisitor) error { // // ### Usage Example // TODO +var ( + remoteDataFieldPath = big.NewInt(1 << 0) + remoteDataFieldData = big.NewInt(1 << 1) +) + type RemoteData struct { // The third-party API path that is being called. Path string `json:"path" url:"path"` Data interface{} `json:"data,omitempty" url:"data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -18785,6 +22782,27 @@ func (r *RemoteData) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteData) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetPath(path string) { + r.Path = path + r.require(remoteDataFieldPath) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetData(data interface{}) { + r.Data = data + r.require(remoteDataFieldData) +} + func (r *RemoteData) UnmarshalJSON(data []byte) error { type unmarshaler RemoteData var value unmarshaler @@ -18801,6 +22819,17 @@ func (r *RemoteData) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteData) MarshalJSON() ([]byte, error) { + type embed RemoteData + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteData) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -18813,10 +22842,18 @@ func (r *RemoteData) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldFieldRemoteFieldClass = big.NewInt(1 << 0) + remoteFieldFieldValue = big.NewInt(1 << 1) +) + type RemoteField struct { RemoteFieldClass *RemoteFieldRemoteFieldClass `json:"remote_field_class" url:"remote_field_class"` Value interface{} `json:"value,omitempty" url:"value,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -18839,6 +22876,27 @@ func (r *RemoteField) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteField) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetRemoteFieldClass sets the RemoteFieldClass field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteField) SetRemoteFieldClass(remoteFieldClass *RemoteFieldRemoteFieldClass) { + r.RemoteFieldClass = remoteFieldClass + r.require(remoteFieldFieldRemoteFieldClass) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteField) SetValue(value interface{}) { + r.Value = value + r.require(remoteFieldFieldValue) +} + func (r *RemoteField) UnmarshalJSON(data []byte) error { type unmarshaler RemoteField var value unmarshaler @@ -18855,6 +22913,17 @@ func (r *RemoteField) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteField) MarshalJSON() ([]byte, error) { + type embed RemoteField + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteField) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -18867,6 +22936,19 @@ func (r *RemoteField) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldClassFieldId = big.NewInt(1 << 0) + remoteFieldClassFieldDisplayName = big.NewInt(1 << 1) + remoteFieldClassFieldRemoteKeyName = big.NewInt(1 << 2) + remoteFieldClassFieldDescription = big.NewInt(1 << 3) + remoteFieldClassFieldIsCustom = big.NewInt(1 << 4) + remoteFieldClassFieldIsRequired = big.NewInt(1 << 5) + remoteFieldClassFieldFieldType = big.NewInt(1 << 6) + remoteFieldClassFieldFieldFormat = big.NewInt(1 << 7) + remoteFieldClassFieldFieldChoices = big.NewInt(1 << 8) + remoteFieldClassFieldItemSchema = big.NewInt(1 << 9) +) + type RemoteFieldClass struct { Id *string `json:"id,omitempty" url:"id,omitempty"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` @@ -18879,6 +22961,9 @@ type RemoteFieldClass struct { FieldChoices []string `json:"field_choices,omitempty" url:"field_choices,omitempty"` ItemSchema *ItemSchema `json:"item_schema,omitempty" url:"item_schema,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -18957,6 +23042,83 @@ func (r *RemoteFieldClass) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldClass) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetId(id *string) { + r.Id = id + r.require(remoteFieldClassFieldId) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetDisplayName(displayName *string) { + r.DisplayName = displayName + r.require(remoteFieldClassFieldDisplayName) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetRemoteKeyName(remoteKeyName *string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldClassFieldRemoteKeyName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetDescription(description *string) { + r.Description = description + r.require(remoteFieldClassFieldDescription) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetIsCustom(isCustom *bool) { + r.IsCustom = isCustom + r.require(remoteFieldClassFieldIsCustom) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetIsRequired(isRequired *bool) { + r.IsRequired = isRequired + r.require(remoteFieldClassFieldIsRequired) +} + +// SetFieldType sets the FieldType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetFieldType(fieldType *FieldTypeEnum) { + r.FieldType = fieldType + r.require(remoteFieldClassFieldFieldType) +} + +// SetFieldFormat sets the FieldFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetFieldFormat(fieldFormat *FieldFormatEnum) { + r.FieldFormat = fieldFormat + r.require(remoteFieldClassFieldFieldFormat) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetFieldChoices(fieldChoices []string) { + r.FieldChoices = fieldChoices + r.require(remoteFieldClassFieldFieldChoices) +} + +// SetItemSchema sets the ItemSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetItemSchema(itemSchema *ItemSchema) { + r.ItemSchema = itemSchema + r.require(remoteFieldClassFieldItemSchema) +} + func (r *RemoteFieldClass) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldClass var value unmarshaler @@ -18973,6 +23135,17 @@ func (r *RemoteFieldClass) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldClass) MarshalJSON() ([]byte, error) { + type embed RemoteFieldClass + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldClass) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -19047,10 +23220,18 @@ func (r *RemoteFieldRemoteFieldClass) Accept(visitor RemoteFieldRemoteFieldClass return fmt.Errorf("type %T does not include a non-empty union type", r) } +var ( + remoteFieldRequestFieldRemoteFieldClass = big.NewInt(1 << 0) + remoteFieldRequestFieldValue = big.NewInt(1 << 1) +) + type RemoteFieldRequest struct { RemoteFieldClass *RemoteFieldRequestRemoteFieldClass `json:"remote_field_class" url:"remote_field_class"` Value interface{} `json:"value,omitempty" url:"value,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -19073,6 +23254,27 @@ func (r *RemoteFieldRequest) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetRemoteFieldClass sets the RemoteFieldClass field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldRequest) SetRemoteFieldClass(remoteFieldClass *RemoteFieldRequestRemoteFieldClass) { + r.RemoteFieldClass = remoteFieldClass + r.require(remoteFieldRequestFieldRemoteFieldClass) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldRequest) SetValue(value interface{}) { + r.Value = value + r.require(remoteFieldRequestFieldValue) +} + func (r *RemoteFieldRequest) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldRequest var value unmarshaler @@ -19089,6 +23291,17 @@ func (r *RemoteFieldRequest) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldRequest) MarshalJSON() ([]byte, error) { + type embed RemoteFieldRequest + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldRequest) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -19169,10 +23382,18 @@ func (r *RemoteFieldRequestRemoteFieldClass) Accept(visitor RemoteFieldRequestRe // // ### Usage Example // Post a `GenerateRemoteKey` to receive a new `RemoteKey`. +var ( + remoteKeyFieldName = big.NewInt(1 << 0) + remoteKeyFieldKey = big.NewInt(1 << 1) +) + type RemoteKey struct { Name string `json:"name" url:"name"` Key string `json:"key" url:"key"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -19195,6 +23416,27 @@ func (r *RemoteKey) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteKey) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetName(name string) { + r.Name = name + r.require(remoteKeyFieldName) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetKey(key string) { + r.Key = key + r.require(remoteKeyFieldKey) +} + func (r *RemoteKey) UnmarshalJSON(data []byte) error { type unmarshaler RemoteKey var value unmarshaler @@ -19211,6 +23453,17 @@ func (r *RemoteKey) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteKey) MarshalJSON() ([]byte, error) { + type embed RemoteKey + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteKey) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -19229,6 +23482,16 @@ func (r *RemoteKey) String() string { // // ### Usage Example // View the `RemoteResponse` returned from your `DataPassthrough`. +var ( + remoteResponseFieldMethod = big.NewInt(1 << 0) + remoteResponseFieldPath = big.NewInt(1 << 1) + remoteResponseFieldStatus = big.NewInt(1 << 2) + remoteResponseFieldResponse = big.NewInt(1 << 3) + remoteResponseFieldResponseHeaders = big.NewInt(1 << 4) + remoteResponseFieldResponseType = big.NewInt(1 << 5) + remoteResponseFieldHeaders = big.NewInt(1 << 6) +) + type RemoteResponse struct { Method string `json:"method" url:"method"` Path string `json:"path" url:"path"` @@ -19238,6 +23501,9 @@ type RemoteResponse struct { ResponseType *ResponseTypeEnum `json:"response_type,omitempty" url:"response_type,omitempty"` Headers map[string]interface{} `json:"headers,omitempty" url:"headers,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -19295,6 +23561,62 @@ func (r *RemoteResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetMethod(method string) { + r.Method = method + r.require(remoteResponseFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetPath(path string) { + r.Path = path + r.require(remoteResponseFieldPath) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetStatus(status int) { + r.Status = status + r.require(remoteResponseFieldStatus) +} + +// SetResponse sets the Response field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponse(response interface{}) { + r.Response = response + r.require(remoteResponseFieldResponse) +} + +// SetResponseHeaders sets the ResponseHeaders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseHeaders(responseHeaders map[string]interface{}) { + r.ResponseHeaders = responseHeaders + r.require(remoteResponseFieldResponseHeaders) +} + +// SetResponseType sets the ResponseType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseType(responseType *ResponseTypeEnum) { + r.ResponseType = responseType + r.require(remoteResponseFieldResponseType) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetHeaders(headers map[string]interface{}) { + r.Headers = headers + r.require(remoteResponseFieldHeaders) +} + func (r *RemoteResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteResponse var value unmarshaler @@ -19311,6 +23633,17 @@ func (r *RemoteResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteResponse) MarshalJSON() ([]byte, error) { + type embed RemoteResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -19329,6 +23662,17 @@ func (r *RemoteResponse) String() string { // // ### Usage Example // Fetch from the `GET BalanceSheet` endpoint and view the balance sheet's report items. +var ( + reportItemFieldRemoteId = big.NewInt(1 << 0) + reportItemFieldCreatedAt = big.NewInt(1 << 1) + reportItemFieldModifiedAt = big.NewInt(1 << 2) + reportItemFieldName = big.NewInt(1 << 3) + reportItemFieldValue = big.NewInt(1 << 4) + reportItemFieldSubItems = big.NewInt(1 << 5) + reportItemFieldCompany = big.NewInt(1 << 6) + reportItemFieldRemoteWasDeleted = big.NewInt(1 << 7) +) + type ReportItem struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -19346,6 +23690,9 @@ type ReportItem struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -19410,6 +23757,69 @@ func (r *ReportItem) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *ReportItem) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReportItem) SetRemoteId(remoteId *string) { + r.RemoteId = remoteId + r.require(reportItemFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReportItem) SetCreatedAt(createdAt *time.Time) { + r.CreatedAt = createdAt + r.require(reportItemFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReportItem) SetModifiedAt(modifiedAt *time.Time) { + r.ModifiedAt = modifiedAt + r.require(reportItemFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReportItem) SetName(name *string) { + r.Name = name + r.require(reportItemFieldName) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReportItem) SetValue(value *float64) { + r.Value = value + r.require(reportItemFieldValue) +} + +// SetSubItems sets the SubItems field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReportItem) SetSubItems(subItems []map[string]interface{}) { + r.SubItems = subItems + r.require(reportItemFieldSubItems) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReportItem) SetCompany(company *string) { + r.Company = company + r.require(reportItemFieldCompany) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReportItem) SetRemoteWasDeleted(remoteWasDeleted *bool) { + r.RemoteWasDeleted = remoteWasDeleted + r.require(reportItemFieldRemoteWasDeleted) +} + func (r *ReportItem) UnmarshalJSON(data []byte) error { type embed ReportItem var unmarshaler = struct { @@ -19445,7 +23855,8 @@ func (r *ReportItem) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(r.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(r.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) } func (r *ReportItem) String() string { @@ -19630,6 +24041,18 @@ func (s StatusFd5Enum) Ptr() *StatusFd5Enum { // // ### Usage Example // View the `SyncStatus` for an account to see how recently its models were synced. +var ( + syncStatusFieldModelName = big.NewInt(1 << 0) + syncStatusFieldModelId = big.NewInt(1 << 1) + syncStatusFieldLastSyncStart = big.NewInt(1 << 2) + syncStatusFieldNextSyncStart = big.NewInt(1 << 3) + syncStatusFieldLastSyncResult = big.NewInt(1 << 4) + syncStatusFieldLastSyncFinished = big.NewInt(1 << 5) + syncStatusFieldStatus = big.NewInt(1 << 6) + syncStatusFieldIsInitialSync = big.NewInt(1 << 7) + syncStatusFieldSelectiveSyncConfigurationsUsage = big.NewInt(1 << 8) +) + type SyncStatus struct { ModelName string `json:"model_name" url:"model_name"` ModelId string `json:"model_id" url:"model_id"` @@ -19641,6 +24064,9 @@ type SyncStatus struct { IsInitialSync bool `json:"is_initial_sync" url:"is_initial_sync"` SelectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum `json:"selective_sync_configurations_usage,omitempty" url:"selective_sync_configurations_usage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -19712,6 +24138,76 @@ func (s *SyncStatus) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *SyncStatus) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelName(modelName string) { + s.ModelName = modelName + s.require(syncStatusFieldModelName) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelId(modelId string) { + s.ModelId = modelId + s.require(syncStatusFieldModelId) +} + +// SetLastSyncStart sets the LastSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncStart(lastSyncStart *time.Time) { + s.LastSyncStart = lastSyncStart + s.require(syncStatusFieldLastSyncStart) +} + +// SetNextSyncStart sets the NextSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetNextSyncStart(nextSyncStart *time.Time) { + s.NextSyncStart = nextSyncStart + s.require(syncStatusFieldNextSyncStart) +} + +// SetLastSyncResult sets the LastSyncResult field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncResult(lastSyncResult *SyncStatusLastSyncResult) { + s.LastSyncResult = lastSyncResult + s.require(syncStatusFieldLastSyncResult) +} + +// SetLastSyncFinished sets the LastSyncFinished field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncFinished(lastSyncFinished *time.Time) { + s.LastSyncFinished = lastSyncFinished + s.require(syncStatusFieldLastSyncFinished) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetStatus(status *SyncStatusStatus) { + s.Status = status + s.require(syncStatusFieldStatus) +} + +// SetIsInitialSync sets the IsInitialSync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetIsInitialSync(isInitialSync bool) { + s.IsInitialSync = isInitialSync + s.require(syncStatusFieldIsInitialSync) +} + +// SetSelectiveSyncConfigurationsUsage sets the SelectiveSyncConfigurationsUsage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetSelectiveSyncConfigurationsUsage(selectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum) { + s.SelectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage + s.require(syncStatusFieldSelectiveSyncConfigurationsUsage) +} + func (s *SyncStatus) UnmarshalJSON(data []byte) error { type embed SyncStatus var unmarshaler = struct { @@ -19751,7 +24247,8 @@ func (s *SyncStatus) MarshalJSON() ([]byte, error) { NextSyncStart: internal.NewOptionalDateTime(s.NextSyncStart), LastSyncFinished: internal.NewOptionalDateTime(s.LastSyncFinished), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *SyncStatus) String() string { @@ -19896,6 +24393,18 @@ func (s *SyncStatusStatus) Accept(visitor SyncStatusStatusVisitor) error { // // ### Usage Example // Fetch from the `LIST TaxRates` endpoint and view tax components relevant to a tax rate. +var ( + taxComponentFieldId = big.NewInt(1 << 0) + taxComponentFieldRemoteId = big.NewInt(1 << 1) + taxComponentFieldCreatedAt = big.NewInt(1 << 2) + taxComponentFieldModifiedAt = big.NewInt(1 << 3) + taxComponentFieldName = big.NewInt(1 << 4) + taxComponentFieldRate = big.NewInt(1 << 5) + taxComponentFieldIsCompound = big.NewInt(1 << 6) + taxComponentFieldComponentType = big.NewInt(1 << 7) + taxComponentFieldRemoteWasDeleted = big.NewInt(1 << 8) +) + type TaxComponent struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -19918,6 +24427,9 @@ type TaxComponent struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -19989,6 +24501,76 @@ func (t *TaxComponent) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TaxComponent) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxComponent) SetId(id *string) { + t.Id = id + t.require(taxComponentFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxComponent) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(taxComponentFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxComponent) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(taxComponentFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxComponent) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(taxComponentFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxComponent) SetName(name *string) { + t.Name = name + t.require(taxComponentFieldName) +} + +// SetRate sets the Rate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxComponent) SetRate(rate *string) { + t.Rate = rate + t.require(taxComponentFieldRate) +} + +// SetIsCompound sets the IsCompound field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxComponent) SetIsCompound(isCompound *bool) { + t.IsCompound = isCompound + t.require(taxComponentFieldIsCompound) +} + +// SetComponentType sets the ComponentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxComponent) SetComponentType(componentType *TaxComponentComponentType) { + t.ComponentType = componentType + t.require(taxComponentFieldComponentType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxComponent) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(taxComponentFieldRemoteWasDeleted) +} + func (t *TaxComponent) UnmarshalJSON(data []byte) error { type embed TaxComponent var unmarshaler = struct { @@ -20024,7 +24606,8 @@ func (t *TaxComponent) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TaxComponent) String() string { @@ -20111,6 +24694,25 @@ func (t *TaxComponentComponentType) Accept(visitor TaxComponentComponentTypeVisi // // ### Usage Example // Fetch from the `LIST TaxRates` endpoint and view tax rates relevant to a company. +var ( + taxRateFieldId = big.NewInt(1 << 0) + taxRateFieldRemoteId = big.NewInt(1 << 1) + taxRateFieldCreatedAt = big.NewInt(1 << 2) + taxRateFieldModifiedAt = big.NewInt(1 << 3) + taxRateFieldCompany = big.NewInt(1 << 4) + taxRateFieldCode = big.NewInt(1 << 5) + taxRateFieldName = big.NewInt(1 << 6) + taxRateFieldDescription = big.NewInt(1 << 7) + taxRateFieldStatus = big.NewInt(1 << 8) + taxRateFieldCountry = big.NewInt(1 << 9) + taxRateFieldTotalTaxRate = big.NewInt(1 << 10) + taxRateFieldEffectiveTaxRate = big.NewInt(1 << 11) + taxRateFieldTaxComponents = big.NewInt(1 << 12) + taxRateFieldRemoteWasDeleted = big.NewInt(1 << 13) + taxRateFieldFieldMappings = big.NewInt(1 << 14) + taxRateFieldRemoteData = big.NewInt(1 << 15) +) + type TaxRate struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -20145,6 +24747,9 @@ type TaxRate struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -20219,50 +24824,169 @@ func (t *TaxRate) GetCountry() *string { return t.Country } -func (t *TaxRate) GetTotalTaxRate() *float64 { - if t == nil { - return nil - } - return t.TotalTaxRate +func (t *TaxRate) GetTotalTaxRate() *float64 { + if t == nil { + return nil + } + return t.TotalTaxRate +} + +func (t *TaxRate) GetEffectiveTaxRate() *float64 { + if t == nil { + return nil + } + return t.EffectiveTaxRate +} + +func (t *TaxRate) GetTaxComponents() []*TaxRateTaxComponentsItem { + if t == nil { + return nil + } + return t.TaxComponents +} + +func (t *TaxRate) GetRemoteWasDeleted() *bool { + if t == nil { + return nil + } + return t.RemoteWasDeleted +} + +func (t *TaxRate) GetFieldMappings() map[string]interface{} { + if t == nil { + return nil + } + return t.FieldMappings +} + +func (t *TaxRate) GetRemoteData() []*RemoteData { + if t == nil { + return nil + } + return t.RemoteData +} + +func (t *TaxRate) GetExtraProperties() map[string]interface{} { + return t.extraProperties +} + +func (t *TaxRate) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetId(id *string) { + t.Id = id + t.require(taxRateFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(taxRateFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(taxRateFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(taxRateFieldModifiedAt) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetCompany(company *TaxRateCompany) { + t.Company = company + t.require(taxRateFieldCompany) +} + +// SetCode sets the Code field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetCode(code *string) { + t.Code = code + t.require(taxRateFieldCode) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetName(name *string) { + t.Name = name + t.require(taxRateFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetDescription(description *string) { + t.Description = description + t.require(taxRateFieldDescription) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetStatus(status *TaxRateStatus) { + t.Status = status + t.require(taxRateFieldStatus) } -func (t *TaxRate) GetEffectiveTaxRate() *float64 { - if t == nil { - return nil - } - return t.EffectiveTaxRate +// SetCountry sets the Country field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetCountry(country *string) { + t.Country = country + t.require(taxRateFieldCountry) } -func (t *TaxRate) GetTaxComponents() []*TaxRateTaxComponentsItem { - if t == nil { - return nil - } - return t.TaxComponents +// SetTotalTaxRate sets the TotalTaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetTotalTaxRate(totalTaxRate *float64) { + t.TotalTaxRate = totalTaxRate + t.require(taxRateFieldTotalTaxRate) } -func (t *TaxRate) GetRemoteWasDeleted() *bool { - if t == nil { - return nil - } - return t.RemoteWasDeleted +// SetEffectiveTaxRate sets the EffectiveTaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetEffectiveTaxRate(effectiveTaxRate *float64) { + t.EffectiveTaxRate = effectiveTaxRate + t.require(taxRateFieldEffectiveTaxRate) } -func (t *TaxRate) GetFieldMappings() map[string]interface{} { - if t == nil { - return nil - } - return t.FieldMappings +// SetTaxComponents sets the TaxComponents field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetTaxComponents(taxComponents []*TaxRateTaxComponentsItem) { + t.TaxComponents = taxComponents + t.require(taxRateFieldTaxComponents) } -func (t *TaxRate) GetRemoteData() []*RemoteData { - if t == nil { - return nil - } - return t.RemoteData +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(taxRateFieldRemoteWasDeleted) } -func (t *TaxRate) GetExtraProperties() map[string]interface{} { - return t.extraProperties +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(taxRateFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaxRate) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(taxRateFieldRemoteData) } func (t *TaxRate) UnmarshalJSON(data []byte) error { @@ -20300,7 +25024,8 @@ func (t *TaxRate) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TaxRate) String() string { @@ -20512,6 +25237,20 @@ func (t *TaxRateTaxComponentsItem) Accept(visitor TaxRateTaxComponentsItemVisito // // ### Usage Example // Fetch from the `GET TrackingCategory` endpoint and view a company's tracking category. +var ( + trackingCategoryFieldId = big.NewInt(1 << 0) + trackingCategoryFieldRemoteId = big.NewInt(1 << 1) + trackingCategoryFieldCreatedAt = big.NewInt(1 << 2) + trackingCategoryFieldModifiedAt = big.NewInt(1 << 3) + trackingCategoryFieldName = big.NewInt(1 << 4) + trackingCategoryFieldStatus = big.NewInt(1 << 5) + trackingCategoryFieldCategoryType = big.NewInt(1 << 6) + trackingCategoryFieldParentCategory = big.NewInt(1 << 7) + trackingCategoryFieldCompany = big.NewInt(1 << 8) + trackingCategoryFieldRemoteWasDeleted = big.NewInt(1 << 9) + trackingCategoryFieldFieldMappings = big.NewInt(1 << 10) +) + type TrackingCategory struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -20539,6 +25278,9 @@ type TrackingCategory struct { RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -20624,6 +25366,90 @@ func (t *TrackingCategory) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TrackingCategory) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetId(id *string) { + t.Id = id + t.require(trackingCategoryFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(trackingCategoryFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(trackingCategoryFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(trackingCategoryFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetName(name *string) { + t.Name = name + t.require(trackingCategoryFieldName) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetStatus(status *TrackingCategoryStatus) { + t.Status = status + t.require(trackingCategoryFieldStatus) +} + +// SetCategoryType sets the CategoryType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetCategoryType(categoryType *TrackingCategoryCategoryType) { + t.CategoryType = categoryType + t.require(trackingCategoryFieldCategoryType) +} + +// SetParentCategory sets the ParentCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetParentCategory(parentCategory *string) { + t.ParentCategory = parentCategory + t.require(trackingCategoryFieldParentCategory) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetCompany(company *TrackingCategoryCompany) { + t.Company = company + t.require(trackingCategoryFieldCompany) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(trackingCategoryFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TrackingCategory) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(trackingCategoryFieldFieldMappings) +} + func (t *TrackingCategory) UnmarshalJSON(data []byte) error { type embed TrackingCategory var unmarshaler = struct { @@ -20659,7 +25485,8 @@ func (t *TrackingCategory) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TrackingCategory) String() string { @@ -22141,9 +26968,16 @@ func (t Type2BbEnum) Ptr() *Type2BbEnum { return &t } +var ( + validationProblemSourceFieldPointer = big.NewInt(1 << 0) +) + type ValidationProblemSource struct { Pointer string `json:"pointer" url:"pointer"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -22159,6 +26993,20 @@ func (v *ValidationProblemSource) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *ValidationProblemSource) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetPointer sets the Pointer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *ValidationProblemSource) SetPointer(pointer string) { + v.Pointer = pointer + v.require(validationProblemSourceFieldPointer) +} + func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { type unmarshaler ValidationProblemSource var value unmarshaler @@ -22175,6 +27023,17 @@ func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { return nil } +func (v *ValidationProblemSource) MarshalJSON() ([]byte, error) { + type embed ValidationProblemSource + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (v *ValidationProblemSource) String() string { if len(v.rawJSON) > 0 { if value, err := internal.StringifyJSON(v.rawJSON); err == nil { @@ -22193,6 +27052,28 @@ func (v *ValidationProblemSource) String() string { // // ### Usage Example // Fetch from the `GET VendorCredit` endpoint and view a company's vendor credits. +var ( + vendorCreditFieldId = big.NewInt(1 << 0) + vendorCreditFieldRemoteId = big.NewInt(1 << 1) + vendorCreditFieldCreatedAt = big.NewInt(1 << 2) + vendorCreditFieldModifiedAt = big.NewInt(1 << 3) + vendorCreditFieldNumber = big.NewInt(1 << 4) + vendorCreditFieldTransactionDate = big.NewInt(1 << 5) + vendorCreditFieldVendor = big.NewInt(1 << 6) + vendorCreditFieldTotalAmount = big.NewInt(1 << 7) + vendorCreditFieldCurrency = big.NewInt(1 << 8) + vendorCreditFieldExchangeRate = big.NewInt(1 << 9) + vendorCreditFieldInclusiveOfTax = big.NewInt(1 << 10) + vendorCreditFieldCompany = big.NewInt(1 << 11) + vendorCreditFieldLines = big.NewInt(1 << 12) + vendorCreditFieldTrackingCategories = big.NewInt(1 << 13) + vendorCreditFieldAppliedToLines = big.NewInt(1 << 14) + vendorCreditFieldRemoteWasDeleted = big.NewInt(1 << 15) + vendorCreditFieldAccountingPeriod = big.NewInt(1 << 16) + vendorCreditFieldFieldMappings = big.NewInt(1 << 17) + vendorCreditFieldRemoteData = big.NewInt(1 << 18) +) + type VendorCredit struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -22535,6 +27416,9 @@ type VendorCredit struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -22676,6 +27560,146 @@ func (v *VendorCredit) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *VendorCredit) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetId(id *string) { + v.Id = id + v.require(vendorCreditFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetRemoteId(remoteId *string) { + v.RemoteId = remoteId + v.require(vendorCreditFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetCreatedAt(createdAt *time.Time) { + v.CreatedAt = createdAt + v.require(vendorCreditFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetModifiedAt(modifiedAt *time.Time) { + v.ModifiedAt = modifiedAt + v.require(vendorCreditFieldModifiedAt) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetNumber(number *string) { + v.Number = number + v.require(vendorCreditFieldNumber) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetTransactionDate(transactionDate *time.Time) { + v.TransactionDate = transactionDate + v.require(vendorCreditFieldTransactionDate) +} + +// SetVendor sets the Vendor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetVendor(vendor_ *VendorCreditVendor) { + v.Vendor = vendor_ + v.require(vendorCreditFieldVendor) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetTotalAmount(totalAmount *float64) { + v.TotalAmount = totalAmount + v.require(vendorCreditFieldTotalAmount) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetCurrency(currency *VendorCreditCurrency) { + v.Currency = currency + v.require(vendorCreditFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetExchangeRate(exchangeRate *string) { + v.ExchangeRate = exchangeRate + v.require(vendorCreditFieldExchangeRate) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetInclusiveOfTax(inclusiveOfTax *bool) { + v.InclusiveOfTax = inclusiveOfTax + v.require(vendorCreditFieldInclusiveOfTax) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetCompany(company *VendorCreditCompany) { + v.Company = company + v.require(vendorCreditFieldCompany) +} + +// SetLines sets the Lines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetLines(lines []*VendorCreditLine) { + v.Lines = lines + v.require(vendorCreditFieldLines) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetTrackingCategories(trackingCategories []*VendorCreditTrackingCategoriesItem) { + v.TrackingCategories = trackingCategories + v.require(vendorCreditFieldTrackingCategories) +} + +// SetAppliedToLines sets the AppliedToLines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetAppliedToLines(appliedToLines []*VendorCreditApplyLineForVendorCredit) { + v.AppliedToLines = appliedToLines + v.require(vendorCreditFieldAppliedToLines) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetRemoteWasDeleted(remoteWasDeleted *bool) { + v.RemoteWasDeleted = remoteWasDeleted + v.require(vendorCreditFieldRemoteWasDeleted) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetAccountingPeriod(accountingPeriod *VendorCreditAccountingPeriod) { + v.AccountingPeriod = accountingPeriod + v.require(vendorCreditFieldAccountingPeriod) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetFieldMappings(fieldMappings map[string]interface{}) { + v.FieldMappings = fieldMappings + v.require(vendorCreditFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCredit) SetRemoteData(remoteData []*RemoteData) { + v.RemoteData = remoteData + v.require(vendorCreditFieldRemoteData) +} + func (v *VendorCredit) UnmarshalJSON(data []byte) error { type embed VendorCredit var unmarshaler = struct { @@ -22715,7 +27739,8 @@ func (v *VendorCredit) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(v.ModifiedAt), TransactionDate: internal.NewOptionalDateTime(v.TransactionDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) } func (v *VendorCredit) String() string { @@ -22799,6 +27824,16 @@ func (v *VendorCreditAccountingPeriod) Accept(visitor VendorCreditAccountingPeri // // ### Usage Example // Fetch from the `GET VendorCredit` endpoint and view the vendor credit's applied to lines. +var ( + vendorCreditApplyLineForInvoiceFieldRemoteId = big.NewInt(1 << 0) + vendorCreditApplyLineForInvoiceFieldCreatedAt = big.NewInt(1 << 1) + vendorCreditApplyLineForInvoiceFieldModifiedAt = big.NewInt(1 << 2) + vendorCreditApplyLineForInvoiceFieldVendorCredit = big.NewInt(1 << 3) + vendorCreditApplyLineForInvoiceFieldAppliedDate = big.NewInt(1 << 4) + vendorCreditApplyLineForInvoiceFieldAppliedAmount = big.NewInt(1 << 5) + vendorCreditApplyLineForInvoiceFieldRemoteWasDeleted = big.NewInt(1 << 6) +) + type VendorCreditApplyLineForInvoice struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -22814,6 +27849,9 @@ type VendorCreditApplyLineForInvoice struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -22871,6 +27909,62 @@ func (v *VendorCreditApplyLineForInvoice) GetExtraProperties() map[string]interf return v.extraProperties } +func (v *VendorCreditApplyLineForInvoice) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForInvoice) SetRemoteId(remoteId *string) { + v.RemoteId = remoteId + v.require(vendorCreditApplyLineForInvoiceFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForInvoice) SetCreatedAt(createdAt *time.Time) { + v.CreatedAt = createdAt + v.require(vendorCreditApplyLineForInvoiceFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForInvoice) SetModifiedAt(modifiedAt *time.Time) { + v.ModifiedAt = modifiedAt + v.require(vendorCreditApplyLineForInvoiceFieldModifiedAt) +} + +// SetVendorCredit sets the VendorCredit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForInvoice) SetVendorCredit(vendorCredit *VendorCreditApplyLineForInvoiceVendorCredit) { + v.VendorCredit = vendorCredit + v.require(vendorCreditApplyLineForInvoiceFieldVendorCredit) +} + +// SetAppliedDate sets the AppliedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForInvoice) SetAppliedDate(appliedDate *time.Time) { + v.AppliedDate = appliedDate + v.require(vendorCreditApplyLineForInvoiceFieldAppliedDate) +} + +// SetAppliedAmount sets the AppliedAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForInvoice) SetAppliedAmount(appliedAmount *string) { + v.AppliedAmount = appliedAmount + v.require(vendorCreditApplyLineForInvoiceFieldAppliedAmount) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForInvoice) SetRemoteWasDeleted(remoteWasDeleted *bool) { + v.RemoteWasDeleted = remoteWasDeleted + v.require(vendorCreditApplyLineForInvoiceFieldRemoteWasDeleted) +} + func (v *VendorCreditApplyLineForInvoice) UnmarshalJSON(data []byte) error { type embed VendorCreditApplyLineForInvoice var unmarshaler = struct { @@ -22910,7 +28004,8 @@ func (v *VendorCreditApplyLineForInvoice) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(v.ModifiedAt), AppliedDate: internal.NewOptionalDateTime(v.AppliedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) } func (v *VendorCreditApplyLineForInvoice) String() string { @@ -22993,6 +28088,16 @@ func (v *VendorCreditApplyLineForInvoiceVendorCredit) Accept(visitor VendorCredi // // ### Usage Example // Fetch from the `GET VendorCredit` endpoint and view the vendor credit's applied to lines. +var ( + vendorCreditApplyLineForVendorCreditFieldRemoteId = big.NewInt(1 << 0) + vendorCreditApplyLineForVendorCreditFieldCreatedAt = big.NewInt(1 << 1) + vendorCreditApplyLineForVendorCreditFieldModifiedAt = big.NewInt(1 << 2) + vendorCreditApplyLineForVendorCreditFieldInvoice = big.NewInt(1 << 3) + vendorCreditApplyLineForVendorCreditFieldAppliedDate = big.NewInt(1 << 4) + vendorCreditApplyLineForVendorCreditFieldAppliedAmount = big.NewInt(1 << 5) + vendorCreditApplyLineForVendorCreditFieldRemoteWasDeleted = big.NewInt(1 << 6) +) + type VendorCreditApplyLineForVendorCredit struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -23008,6 +28113,9 @@ type VendorCreditApplyLineForVendorCredit struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -23065,6 +28173,62 @@ func (v *VendorCreditApplyLineForVendorCredit) GetExtraProperties() map[string]i return v.extraProperties } +func (v *VendorCreditApplyLineForVendorCredit) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCredit) SetRemoteId(remoteId *string) { + v.RemoteId = remoteId + v.require(vendorCreditApplyLineForVendorCreditFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCredit) SetCreatedAt(createdAt *time.Time) { + v.CreatedAt = createdAt + v.require(vendorCreditApplyLineForVendorCreditFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCredit) SetModifiedAt(modifiedAt *time.Time) { + v.ModifiedAt = modifiedAt + v.require(vendorCreditApplyLineForVendorCreditFieldModifiedAt) +} + +// SetInvoice sets the Invoice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCredit) SetInvoice(invoice *VendorCreditApplyLineForVendorCreditInvoice) { + v.Invoice = invoice + v.require(vendorCreditApplyLineForVendorCreditFieldInvoice) +} + +// SetAppliedDate sets the AppliedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCredit) SetAppliedDate(appliedDate *time.Time) { + v.AppliedDate = appliedDate + v.require(vendorCreditApplyLineForVendorCreditFieldAppliedDate) +} + +// SetAppliedAmount sets the AppliedAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCredit) SetAppliedAmount(appliedAmount *string) { + v.AppliedAmount = appliedAmount + v.require(vendorCreditApplyLineForVendorCreditFieldAppliedAmount) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCredit) SetRemoteWasDeleted(remoteWasDeleted *bool) { + v.RemoteWasDeleted = remoteWasDeleted + v.require(vendorCreditApplyLineForVendorCreditFieldRemoteWasDeleted) +} + func (v *VendorCreditApplyLineForVendorCredit) UnmarshalJSON(data []byte) error { type embed VendorCreditApplyLineForVendorCredit var unmarshaler = struct { @@ -23104,7 +28268,8 @@ func (v *VendorCreditApplyLineForVendorCredit) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(v.ModifiedAt), AppliedDate: internal.NewOptionalDateTime(v.AppliedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) } func (v *VendorCreditApplyLineForVendorCredit) String() string { @@ -23620,6 +28785,24 @@ func (v *VendorCreditCurrency) Accept(visitor VendorCreditCurrencyVisitor) error // // ### Usage Example // Fetch from the `GET VendorCredit` endpoint and view the vendor credit's line items. +var ( + vendorCreditLineFieldId = big.NewInt(1 << 0) + vendorCreditLineFieldRemoteId = big.NewInt(1 << 1) + vendorCreditLineFieldCreatedAt = big.NewInt(1 << 2) + vendorCreditLineFieldModifiedAt = big.NewInt(1 << 3) + vendorCreditLineFieldNetAmount = big.NewInt(1 << 4) + vendorCreditLineFieldTrackingCategory = big.NewInt(1 << 5) + vendorCreditLineFieldTrackingCategories = big.NewInt(1 << 6) + vendorCreditLineFieldDescription = big.NewInt(1 << 7) + vendorCreditLineFieldAccount = big.NewInt(1 << 8) + vendorCreditLineFieldCompany = big.NewInt(1 << 9) + vendorCreditLineFieldProject = big.NewInt(1 << 10) + vendorCreditLineFieldContact = big.NewInt(1 << 11) + vendorCreditLineFieldTaxRate = big.NewInt(1 << 12) + vendorCreditLineFieldExchangeRate = big.NewInt(1 << 13) + vendorCreditLineFieldRemoteWasDeleted = big.NewInt(1 << 14) +) + type VendorCreditLine struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -23649,6 +28832,9 @@ type VendorCreditLine struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -23762,6 +28948,118 @@ func (v *VendorCreditLine) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *VendorCreditLine) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetId(id *string) { + v.Id = id + v.require(vendorCreditLineFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetRemoteId(remoteId *string) { + v.RemoteId = remoteId + v.require(vendorCreditLineFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetCreatedAt(createdAt *time.Time) { + v.CreatedAt = createdAt + v.require(vendorCreditLineFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetModifiedAt(modifiedAt *time.Time) { + v.ModifiedAt = modifiedAt + v.require(vendorCreditLineFieldModifiedAt) +} + +// SetNetAmount sets the NetAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetNetAmount(netAmount *float64) { + v.NetAmount = netAmount + v.require(vendorCreditLineFieldNetAmount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetTrackingCategory(trackingCategory *string) { + v.TrackingCategory = trackingCategory + v.require(vendorCreditLineFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetTrackingCategories(trackingCategories []*string) { + v.TrackingCategories = trackingCategories + v.require(vendorCreditLineFieldTrackingCategories) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetDescription(description *string) { + v.Description = description + v.require(vendorCreditLineFieldDescription) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetAccount(account *VendorCreditLineAccount) { + v.Account = account + v.require(vendorCreditLineFieldAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetCompany(company *string) { + v.Company = company + v.require(vendorCreditLineFieldCompany) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetProject(project *VendorCreditLineProject) { + v.Project = project + v.require(vendorCreditLineFieldProject) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetContact(contact *VendorCreditLineContact) { + v.Contact = contact + v.require(vendorCreditLineFieldContact) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetTaxRate(taxRate *string) { + v.TaxRate = taxRate + v.require(vendorCreditLineFieldTaxRate) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetExchangeRate(exchangeRate *string) { + v.ExchangeRate = exchangeRate + v.require(vendorCreditLineFieldExchangeRate) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLine) SetRemoteWasDeleted(remoteWasDeleted *bool) { + v.RemoteWasDeleted = remoteWasDeleted + v.require(vendorCreditLineFieldRemoteWasDeleted) +} + func (v *VendorCreditLine) UnmarshalJSON(data []byte) error { type embed VendorCreditLine var unmarshaler = struct { @@ -23797,7 +29095,8 @@ func (v *VendorCreditLine) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(v.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(v.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) } func (v *VendorCreditLine) String() string { @@ -24005,6 +29304,22 @@ func (v *VendorCreditLineProject) Accept(visitor VendorCreditLineProjectVisitor) // // ### Usage Example // Fetch from the `GET VendorCredit` endpoint and view the vendor credit's line items. +var ( + vendorCreditLineRequestFieldRemoteId = big.NewInt(1 << 0) + vendorCreditLineRequestFieldNetAmount = big.NewInt(1 << 1) + vendorCreditLineRequestFieldTrackingCategory = big.NewInt(1 << 2) + vendorCreditLineRequestFieldTrackingCategories = big.NewInt(1 << 3) + vendorCreditLineRequestFieldDescription = big.NewInt(1 << 4) + vendorCreditLineRequestFieldAccount = big.NewInt(1 << 5) + vendorCreditLineRequestFieldCompany = big.NewInt(1 << 6) + vendorCreditLineRequestFieldProject = big.NewInt(1 << 7) + vendorCreditLineRequestFieldContact = big.NewInt(1 << 8) + vendorCreditLineRequestFieldTaxRate = big.NewInt(1 << 9) + vendorCreditLineRequestFieldExchangeRate = big.NewInt(1 << 10) + vendorCreditLineRequestFieldIntegrationParams = big.NewInt(1 << 11) + vendorCreditLineRequestFieldLinkedAccountParams = big.NewInt(1 << 12) +) + type VendorCreditLineRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -24029,6 +29344,9 @@ type VendorCreditLineRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -24128,6 +29446,104 @@ func (v *VendorCreditLineRequest) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *VendorCreditLineRequest) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetRemoteId(remoteId *string) { + v.RemoteId = remoteId + v.require(vendorCreditLineRequestFieldRemoteId) +} + +// SetNetAmount sets the NetAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetNetAmount(netAmount *float64) { + v.NetAmount = netAmount + v.require(vendorCreditLineRequestFieldNetAmount) +} + +// SetTrackingCategory sets the TrackingCategory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetTrackingCategory(trackingCategory *string) { + v.TrackingCategory = trackingCategory + v.require(vendorCreditLineRequestFieldTrackingCategory) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetTrackingCategories(trackingCategories []*string) { + v.TrackingCategories = trackingCategories + v.require(vendorCreditLineRequestFieldTrackingCategories) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetDescription(description *string) { + v.Description = description + v.require(vendorCreditLineRequestFieldDescription) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetAccount(account *VendorCreditLineRequestAccount) { + v.Account = account + v.require(vendorCreditLineRequestFieldAccount) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetCompany(company *string) { + v.Company = company + v.require(vendorCreditLineRequestFieldCompany) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetProject(project *VendorCreditLineRequestProject) { + v.Project = project + v.require(vendorCreditLineRequestFieldProject) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetContact(contact *VendorCreditLineRequestContact) { + v.Contact = contact + v.require(vendorCreditLineRequestFieldContact) +} + +// SetTaxRate sets the TaxRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetTaxRate(taxRate *string) { + v.TaxRate = taxRate + v.require(vendorCreditLineRequestFieldTaxRate) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetExchangeRate(exchangeRate *string) { + v.ExchangeRate = exchangeRate + v.require(vendorCreditLineRequestFieldExchangeRate) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + v.IntegrationParams = integrationParams + v.require(vendorCreditLineRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditLineRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + v.LinkedAccountParams = linkedAccountParams + v.require(vendorCreditLineRequestFieldLinkedAccountParams) +} + func (v *VendorCreditLineRequest) UnmarshalJSON(data []byte) error { type unmarshaler VendorCreditLineRequest var value unmarshaler @@ -24144,6 +29560,17 @@ func (v *VendorCreditLineRequest) UnmarshalJSON(data []byte) error { return nil } +func (v *VendorCreditLineRequest) MarshalJSON() ([]byte, error) { + type embed VendorCreditLineRequest + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (v *VendorCreditLineRequest) String() string { if len(v.rawJSON) > 0 { if value, err := internal.StringifyJSON(v.rawJSON); err == nil { @@ -24468,12 +29895,22 @@ func (v *VendorCreditVendor) Accept(visitor VendorCreditVendorVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", v) } +var ( + warningValidationProblemFieldSource = big.NewInt(1 << 0) + warningValidationProblemFieldTitle = big.NewInt(1 << 1) + warningValidationProblemFieldDetail = big.NewInt(1 << 2) + warningValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type WarningValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -24510,6 +29947,41 @@ func (w *WarningValidationProblem) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WarningValidationProblem) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetSource(source *ValidationProblemSource) { + w.Source = source + w.require(warningValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetTitle(title string) { + w.Title = title + w.require(warningValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetDetail(detail string) { + w.Detail = detail + w.require(warningValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetProblemType(problemType string) { + w.ProblemType = problemType + w.require(warningValidationProblemFieldProblemType) +} + func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler WarningValidationProblem var value unmarshaler @@ -24526,6 +29998,17 @@ func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (w *WarningValidationProblem) MarshalJSON() ([]byte, error) { + type embed WarningValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WarningValidationProblem) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/accounting/vendor_credits.go b/accounting/vendor_credits.go index 80f4b87..2316dea 100644 --- a/accounting/vendor_credits.go +++ b/accounting/vendor_credits.go @@ -6,17 +6,72 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + vendorCreditEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + vendorCreditEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + vendorCreditEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type VendorCreditEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *VendorCreditRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (v *VendorCreditEndpointRequest) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + v.IsDebugMode = isDebugMode + v.require(vendorCreditEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditEndpointRequest) SetRunAsync(runAsync *bool) { + v.RunAsync = runAsync + v.require(vendorCreditEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditEndpointRequest) SetModel(model *VendorCreditRequest) { + v.Model = model + v.require(vendorCreditEndpointRequestFieldModel) +} + +var ( + vendorCreditsListRequestFieldCompanyId = big.NewInt(1 << 0) + vendorCreditsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + vendorCreditsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + vendorCreditsListRequestFieldCursor = big.NewInt(1 << 3) + vendorCreditsListRequestFieldExpand = big.NewInt(1 << 4) + vendorCreditsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + vendorCreditsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + vendorCreditsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + vendorCreditsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + vendorCreditsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + vendorCreditsListRequestFieldPageSize = big.NewInt(1 << 10) + vendorCreditsListRequestFieldRemoteId = big.NewInt(1 << 11) + vendorCreditsListRequestFieldTransactionDateAfter = big.NewInt(1 << 12) + vendorCreditsListRequestFieldTransactionDateBefore = big.NewInt(1 << 13) +) + type VendorCreditsListRequest struct { // If provided, will only return vendor credits for this company. CompanyId *string `json:"-" url:"company_id,omitempty"` @@ -46,8 +101,122 @@ type VendorCreditsListRequest struct { TransactionDateAfter *time.Time `json:"-" url:"transaction_date_after,omitempty"` // If provided, will only return objects created before this datetime. TransactionDateBefore *time.Time `json:"-" url:"transaction_date_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (v *VendorCreditsListRequest) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetCompanyId(companyId *string) { + v.CompanyId = companyId + v.require(vendorCreditsListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetCreatedAfter(createdAfter *time.Time) { + v.CreatedAfter = createdAfter + v.require(vendorCreditsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetCreatedBefore(createdBefore *time.Time) { + v.CreatedBefore = createdBefore + v.require(vendorCreditsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetCursor(cursor *string) { + v.Cursor = cursor + v.require(vendorCreditsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetExpand(expand []*VendorCreditsListRequestExpandItem) { + v.Expand = expand + v.require(vendorCreditsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + v.IncludeDeletedData = includeDeletedData + v.require(vendorCreditsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + v.IncludeRemoteData = includeRemoteData + v.require(vendorCreditsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetIncludeShellData(includeShellData *bool) { + v.IncludeShellData = includeShellData + v.require(vendorCreditsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + v.ModifiedAfter = modifiedAfter + v.require(vendorCreditsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + v.ModifiedBefore = modifiedBefore + v.require(vendorCreditsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetPageSize(pageSize *int) { + v.PageSize = pageSize + v.require(vendorCreditsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetRemoteId(remoteId *string) { + v.RemoteId = remoteId + v.require(vendorCreditsListRequestFieldRemoteId) } +// SetTransactionDateAfter sets the TransactionDateAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetTransactionDateAfter(transactionDateAfter *time.Time) { + v.TransactionDateAfter = transactionDateAfter + v.require(vendorCreditsListRequestFieldTransactionDateAfter) +} + +// SetTransactionDateBefore sets the TransactionDateBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsListRequest) SetTransactionDateBefore(transactionDateBefore *time.Time) { + v.TransactionDateBefore = transactionDateBefore + v.require(vendorCreditsListRequestFieldTransactionDateBefore) +} + +var ( + vendorCreditsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + vendorCreditsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + vendorCreditsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type VendorCreditsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*VendorCreditsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -55,6 +224,37 @@ type VendorCreditsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (v *VendorCreditsRetrieveRequest) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsRetrieveRequest) SetExpand(expand []*VendorCreditsRetrieveRequestExpandItem) { + v.Expand = expand + v.require(vendorCreditsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + v.IncludeRemoteData = includeRemoteData + v.require(vendorCreditsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + v.IncludeShellData = includeShellData + v.require(vendorCreditsRetrieveRequestFieldIncludeShellData) } type VendorCreditsListRequestExpandItem string @@ -119,11 +319,20 @@ func (v VendorCreditsRetrieveRequestExpandItem) Ptr() *VendorCreditsRetrieveRequ return &v } +var ( + paginatedVendorCreditListFieldNext = big.NewInt(1 << 0) + paginatedVendorCreditListFieldPrevious = big.NewInt(1 << 1) + paginatedVendorCreditListFieldResults = big.NewInt(1 << 2) +) + type PaginatedVendorCreditList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*VendorCredit `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -153,6 +362,34 @@ func (p *PaginatedVendorCreditList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedVendorCreditList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedVendorCreditList) SetNext(next *string) { + p.Next = next + p.require(paginatedVendorCreditListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedVendorCreditList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedVendorCreditListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedVendorCreditList) SetResults(results []*VendorCredit) { + p.Results = results + p.require(paginatedVendorCreditListFieldResults) +} + func (p *PaginatedVendorCreditList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedVendorCreditList var value unmarshaler @@ -169,6 +406,17 @@ func (p *PaginatedVendorCreditList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedVendorCreditList) MarshalJSON() ([]byte, error) { + type embed PaginatedVendorCreditList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedVendorCreditList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -187,6 +435,15 @@ func (p *PaginatedVendorCreditList) String() string { // // ### Usage Example // Fetch from the `GET VendorCredit` endpoint and view the vendor credit's applied to lines. +var ( + vendorCreditApplyLineForVendorCreditRequestFieldRemoteId = big.NewInt(1 << 0) + vendorCreditApplyLineForVendorCreditRequestFieldInvoice = big.NewInt(1 << 1) + vendorCreditApplyLineForVendorCreditRequestFieldAppliedDate = big.NewInt(1 << 2) + vendorCreditApplyLineForVendorCreditRequestFieldAppliedAmount = big.NewInt(1 << 3) + vendorCreditApplyLineForVendorCreditRequestFieldIntegrationParams = big.NewInt(1 << 4) + vendorCreditApplyLineForVendorCreditRequestFieldLinkedAccountParams = big.NewInt(1 << 5) +) + type VendorCreditApplyLineForVendorCreditRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -198,6 +455,9 @@ type VendorCreditApplyLineForVendorCreditRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -248,6 +508,55 @@ func (v *VendorCreditApplyLineForVendorCreditRequest) GetExtraProperties() map[s return v.extraProperties } +func (v *VendorCreditApplyLineForVendorCreditRequest) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCreditRequest) SetRemoteId(remoteId *string) { + v.RemoteId = remoteId + v.require(vendorCreditApplyLineForVendorCreditRequestFieldRemoteId) +} + +// SetInvoice sets the Invoice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCreditRequest) SetInvoice(invoice *VendorCreditApplyLineForVendorCreditRequestInvoice) { + v.Invoice = invoice + v.require(vendorCreditApplyLineForVendorCreditRequestFieldInvoice) +} + +// SetAppliedDate sets the AppliedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCreditRequest) SetAppliedDate(appliedDate *time.Time) { + v.AppliedDate = appliedDate + v.require(vendorCreditApplyLineForVendorCreditRequestFieldAppliedDate) +} + +// SetAppliedAmount sets the AppliedAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCreditRequest) SetAppliedAmount(appliedAmount *string) { + v.AppliedAmount = appliedAmount + v.require(vendorCreditApplyLineForVendorCreditRequestFieldAppliedAmount) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCreditRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + v.IntegrationParams = integrationParams + v.require(vendorCreditApplyLineForVendorCreditRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditApplyLineForVendorCreditRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + v.LinkedAccountParams = linkedAccountParams + v.require(vendorCreditApplyLineForVendorCreditRequestFieldLinkedAccountParams) +} + func (v *VendorCreditApplyLineForVendorCreditRequest) UnmarshalJSON(data []byte) error { type embed VendorCreditApplyLineForVendorCreditRequest var unmarshaler = struct { @@ -279,7 +588,8 @@ func (v *VendorCreditApplyLineForVendorCreditRequest) MarshalJSON() ([]byte, err embed: embed(*v), AppliedDate: internal.NewOptionalDateTime(v.AppliedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) } func (v *VendorCreditApplyLineForVendorCreditRequest) String() string { @@ -362,6 +672,22 @@ func (v *VendorCreditApplyLineForVendorCreditRequestInvoice) Accept(visitor Vend // // ### Usage Example // Fetch from the `GET VendorCredit` endpoint and view a company's vendor credits. +var ( + vendorCreditRequestFieldNumber = big.NewInt(1 << 0) + vendorCreditRequestFieldTransactionDate = big.NewInt(1 << 1) + vendorCreditRequestFieldVendor = big.NewInt(1 << 2) + vendorCreditRequestFieldTotalAmount = big.NewInt(1 << 3) + vendorCreditRequestFieldCurrency = big.NewInt(1 << 4) + vendorCreditRequestFieldExchangeRate = big.NewInt(1 << 5) + vendorCreditRequestFieldInclusiveOfTax = big.NewInt(1 << 6) + vendorCreditRequestFieldCompany = big.NewInt(1 << 7) + vendorCreditRequestFieldTrackingCategories = big.NewInt(1 << 8) + vendorCreditRequestFieldAppliedToLines = big.NewInt(1 << 9) + vendorCreditRequestFieldAccountingPeriod = big.NewInt(1 << 10) + vendorCreditRequestFieldIntegrationParams = big.NewInt(1 << 11) + vendorCreditRequestFieldLinkedAccountParams = big.NewInt(1 << 12) +) + type VendorCreditRequest struct { // The vendor credit's number. Number *string `json:"number,omitempty" url:"number,omitempty"` @@ -694,6 +1020,9 @@ type VendorCreditRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -793,6 +1122,104 @@ func (v *VendorCreditRequest) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *VendorCreditRequest) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetNumber(number *string) { + v.Number = number + v.require(vendorCreditRequestFieldNumber) +} + +// SetTransactionDate sets the TransactionDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetTransactionDate(transactionDate *time.Time) { + v.TransactionDate = transactionDate + v.require(vendorCreditRequestFieldTransactionDate) +} + +// SetVendor sets the Vendor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetVendor(vendor_ *VendorCreditRequestVendor) { + v.Vendor = vendor_ + v.require(vendorCreditRequestFieldVendor) +} + +// SetTotalAmount sets the TotalAmount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetTotalAmount(totalAmount *float64) { + v.TotalAmount = totalAmount + v.require(vendorCreditRequestFieldTotalAmount) +} + +// SetCurrency sets the Currency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetCurrency(currency *VendorCreditRequestCurrency) { + v.Currency = currency + v.require(vendorCreditRequestFieldCurrency) +} + +// SetExchangeRate sets the ExchangeRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetExchangeRate(exchangeRate *string) { + v.ExchangeRate = exchangeRate + v.require(vendorCreditRequestFieldExchangeRate) +} + +// SetInclusiveOfTax sets the InclusiveOfTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetInclusiveOfTax(inclusiveOfTax *bool) { + v.InclusiveOfTax = inclusiveOfTax + v.require(vendorCreditRequestFieldInclusiveOfTax) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetCompany(company *VendorCreditRequestCompany) { + v.Company = company + v.require(vendorCreditRequestFieldCompany) +} + +// SetTrackingCategories sets the TrackingCategories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetTrackingCategories(trackingCategories []*VendorCreditRequestTrackingCategoriesItem) { + v.TrackingCategories = trackingCategories + v.require(vendorCreditRequestFieldTrackingCategories) +} + +// SetAppliedToLines sets the AppliedToLines field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetAppliedToLines(appliedToLines []*VendorCreditApplyLineForVendorCreditRequest) { + v.AppliedToLines = appliedToLines + v.require(vendorCreditRequestFieldAppliedToLines) +} + +// SetAccountingPeriod sets the AccountingPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetAccountingPeriod(accountingPeriod *VendorCreditRequestAccountingPeriod) { + v.AccountingPeriod = accountingPeriod + v.require(vendorCreditRequestFieldAccountingPeriod) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + v.IntegrationParams = integrationParams + v.require(vendorCreditRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + v.LinkedAccountParams = linkedAccountParams + v.require(vendorCreditRequestFieldLinkedAccountParams) +} + func (v *VendorCreditRequest) UnmarshalJSON(data []byte) error { type embed VendorCreditRequest var unmarshaler = struct { @@ -824,7 +1251,8 @@ func (v *VendorCreditRequest) MarshalJSON() ([]byte, error) { embed: embed(*v), TransactionDate: internal.NewOptionalDateTime(v.TransactionDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) } func (v *VendorCreditRequest) String() string { @@ -1460,12 +1888,22 @@ func (v *VendorCreditRequestVendor) Accept(visitor VendorCreditRequestVendorVisi return fmt.Errorf("type %T does not include a non-empty union type", v) } +var ( + vendorCreditResponseFieldModel = big.NewInt(1 << 0) + vendorCreditResponseFieldWarnings = big.NewInt(1 << 1) + vendorCreditResponseFieldErrors = big.NewInt(1 << 2) + vendorCreditResponseFieldLogs = big.NewInt(1 << 3) +) + type VendorCreditResponse struct { Model *VendorCredit `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1502,6 +1940,41 @@ func (v *VendorCreditResponse) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *VendorCreditResponse) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditResponse) SetModel(model *VendorCredit) { + v.Model = model + v.require(vendorCreditResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditResponse) SetWarnings(warnings []*WarningValidationProblem) { + v.Warnings = warnings + v.require(vendorCreditResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditResponse) SetErrors(errors []*ErrorValidationProblem) { + v.Errors = errors + v.require(vendorCreditResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *VendorCreditResponse) SetLogs(logs []*DebugModeLog) { + v.Logs = logs + v.require(vendorCreditResponseFieldLogs) +} + func (v *VendorCreditResponse) UnmarshalJSON(data []byte) error { type unmarshaler VendorCreditResponse var value unmarshaler @@ -1518,6 +1991,17 @@ func (v *VendorCreditResponse) UnmarshalJSON(data []byte) error { return nil } +func (v *VendorCreditResponse) MarshalJSON() ([]byte, error) { + type embed VendorCreditResponse + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (v *VendorCreditResponse) String() string { if len(v.rawJSON) > 0 { if value, err := internal.StringifyJSON(v.rawJSON); err == nil { diff --git a/accounting/vendorcredits/accounting_vendor_credits_test/accounting_vendor_credits_test.go b/accounting/vendorcredits/accounting_vendor_credits_test/accounting_vendor_credits_test.go new file mode 100644 index 0000000..303d5f4 --- /dev/null +++ b/accounting/vendorcredits/accounting_vendor_credits_test/accounting_vendor_credits_test.go @@ -0,0 +1,209 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_vendor_credits_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingVendorCreditsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.VendorCreditsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Accounting.VendorCredits.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/vendor-credits", map[string]string{"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"}, 1) +} + +func TestAccountingVendorCreditsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.VendorCreditEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.VendorCreditRequest{}, + } + _, invocationErr := client.Accounting.VendorCredits.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/vendor-credits", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAccountingVendorCreditsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.VendorCreditsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Accounting.VendorCredits.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/vendor-credits/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestAccountingVendorCreditsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.VendorCredits.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/vendor-credits/meta/post", nil, 1) +} diff --git a/accounting/vendorcredits/client.go b/accounting/vendorcredits/client.go index b06e485..99d0671 100644 --- a/accounting/vendorcredits/client.go +++ b/accounting/vendorcredits/client.go @@ -4,7 +4,6 @@ package vendorcredits import ( context "context" - fmt "fmt" accounting "github.com/merge-api/merge-go-client/v2/accounting" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *accounting.VendorCreditsListRequest, opts ...option.RequestOption, -) (*core.Page[*accounting.VendorCredit], error) { +) (*core.Page[*string, *accounting.VendorCredit], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *accounting.PaginatedVendorCreditList) *internal.PageResponse[*string, *accounting.VendorCredit] { + readPageResponse := func(response *accounting.PaginatedVendorCreditList) *core.PageResponse[*string, *accounting.VendorCredit] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *accounting.VendorCredit]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *accounting.VendorCredit]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *accounting.VendorCreditEndpointRequest, opts ...option.RequestOption, ) (*accounting.VendorCreditResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/accounting/v1/vendor-credits" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.VendorCreditResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `VendorCredit` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *accounting.VendorCreditsRetrieveRequest, opts ...option.RequestOption, ) (*accounting.VendorCredit, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/accounting/v1/vendor-credits/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.VendorCredit - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `VendorCredit` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*accounting.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/vendor-credits/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *accounting.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/vendorcredits/raw_client.go b/accounting/vendorcredits/raw_client.go new file mode 100644 index 0000000..11d2791 --- /dev/null +++ b/accounting/vendorcredits/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package vendorcredits + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.VendorCreditEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.VendorCreditResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/vendor-credits" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.VendorCreditResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.VendorCreditResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *accounting.VendorCreditsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.VendorCredit], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/accounting/v1/vendor-credits/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.VendorCredit + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.VendorCredit]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*accounting.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/vendor-credits/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *accounting.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/accounting/webhook_receivers.go b/accounting/webhook_receivers.go index 0c8e352..fcc1cfd 100644 --- a/accounting/webhook_receivers.go +++ b/accounting/webhook_receivers.go @@ -6,19 +6,66 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + webhookReceiverRequestFieldEvent = big.NewInt(1 << 0) + webhookReceiverRequestFieldIsActive = big.NewInt(1 << 1) + webhookReceiverRequestFieldKey = big.NewInt(1 << 2) ) type WebhookReceiverRequest struct { Event string `json:"event" url:"-"` IsActive bool `json:"is_active" url:"-"` Key *string `json:"key,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (w *WebhookReceiverRequest) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverRequestFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverRequestFieldIsActive) } +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverRequestFieldKey) +} + +var ( + webhookReceiverFieldEvent = big.NewInt(1 << 0) + webhookReceiverFieldIsActive = big.NewInt(1 << 1) + webhookReceiverFieldKey = big.NewInt(1 << 2) +) + type WebhookReceiver struct { Event string `json:"event" url:"event"` IsActive bool `json:"is_active" url:"is_active"` Key *string `json:"key,omitempty" url:"key,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +95,34 @@ func (w *WebhookReceiver) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WebhookReceiver) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverFieldIsActive) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverFieldKey) +} + func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { type unmarshaler WebhookReceiver var value unmarshaler @@ -64,6 +139,17 @@ func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { return nil } +func (w *WebhookReceiver) MarshalJSON() ([]byte, error) { + type embed WebhookReceiver + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WebhookReceiver) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/accounting/webhookreceivers/accounting_webhook_receivers_test/accounting_webhook_receivers_test.go b/accounting/webhookreceivers/accounting_webhook_receivers_test/accounting_webhook_receivers_test.go new file mode 100644 index 0000000..8380cbe --- /dev/null +++ b/accounting/webhookreceivers/accounting_webhook_receivers_test/accounting_webhook_receivers_test.go @@ -0,0 +1,103 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounting_webhook_receivers_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAccountingWebhookReceiversListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Accounting.WebhookReceivers.List( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/accounting/v1/webhook-receivers", nil, 1) +} + +func TestAccountingWebhookReceiversCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &accounting.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } + _, invocationErr := client.Accounting.WebhookReceivers.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/accounting/v1/webhook-receivers", nil, 1) +} diff --git a/accounting/webhookreceivers/client.go b/accounting/webhookreceivers/client.go index 2cab927..19e91c2 100644 --- a/accounting/webhookreceivers/client.go +++ b/accounting/webhookreceivers/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) List( ctx context.Context, opts ...option.RequestOption, ) ([]*accounting.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*accounting.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.List( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Creates a `WebhookReceiver` object with the given values. @@ -73,35 +53,13 @@ func (c *Client) Create( request *accounting.WebhookReceiverRequest, opts ...option.RequestOption, ) (*accounting.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/accounting/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *accounting.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/accounting/webhookreceivers/raw_client.go b/accounting/webhookreceivers/raw_client.go new file mode 100644 index 0000000..976a874 --- /dev/null +++ b/accounting/webhookreceivers/raw_client.go @@ -0,0 +1,112 @@ +// Code generated by Fern. DO NOT EDIT. + +package webhookreceivers + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/v2/accounting" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*accounting.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*accounting.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*accounting.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *accounting.WebhookReceiverRequest, + opts ...option.RequestOption, +) (*core.Response[*accounting.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/accounting/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *accounting.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*accounting.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/account_details.go b/ats/account_details.go index b198be6..1a8a1d2 100644 --- a/ats/account_details.go +++ b/ats/account_details.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountDetailsFieldId = big.NewInt(1 << 0) + accountDetailsFieldIntegration = big.NewInt(1 << 1) + accountDetailsFieldIntegrationSlug = big.NewInt(1 << 2) + accountDetailsFieldCategory = big.NewInt(1 << 3) + accountDetailsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsFieldStatus = big.NewInt(1 << 7) + accountDetailsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsFieldAccountType = big.NewInt(1 << 10) + accountDetailsFieldCompletedAt = big.NewInt(1 << 11) +) + type AccountDetails struct { Id *string `json:"id,omitempty" url:"id,omitempty"` Integration *string `json:"integration,omitempty" url:"integration,omitempty"` @@ -25,6 +41,9 @@ type AccountDetails struct { // The time at which account completes the linking flow. CompletedAt *time.Time `json:"completed_at,omitempty" url:"completed_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -117,6 +136,97 @@ func (a *AccountDetails) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetails) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetId(id *string) { + a.Id = id + a.require(accountDetailsFieldId) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegration(integration *string) { + a.Integration = integration + a.require(accountDetailsFieldIntegration) +} + +// SetIntegrationSlug sets the IntegrationSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegrationSlug(integrationSlug *string) { + a.IntegrationSlug = integrationSlug + a.require(accountDetailsFieldIntegrationSlug) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCategory(category *AccountDetailsCategory) { + a.Category = category + a.require(accountDetailsFieldCategory) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOrganizationName(endUserOrganizationName *string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserEmailAddress(endUserEmailAddress *string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsFieldEndUserEmailAddress) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetStatus(status *string) { + a.Status = status + a.require(accountDetailsFieldStatus) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetWebhookListenerUrl(webhookListenerUrl *string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsFieldIsDuplicate) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetAccountType(accountType *string) { + a.AccountType = accountType + a.require(accountDetailsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCompletedAt(completedAt *time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsFieldCompletedAt) +} + func (a *AccountDetails) UnmarshalJSON(data []byte) error { type embed AccountDetails var unmarshaler = struct { @@ -148,7 +258,8 @@ func (a *AccountDetails) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewOptionalDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetails) String() string { diff --git a/ats/account_token.go b/ats/account_token.go index 9610736..861c863 100644 --- a/ats/account_token.go +++ b/ats/account_token.go @@ -6,6 +6,13 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + accountTokenFieldAccountToken = big.NewInt(1 << 0) + accountTokenFieldIntegration = big.NewInt(1 << 1) + accountTokenFieldId = big.NewInt(1 << 2) ) type AccountToken struct { @@ -13,6 +20,9 @@ type AccountToken struct { Integration *AccountIntegration `json:"integration" url:"integration"` Id string `json:"id" url:"id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -42,6 +52,34 @@ func (a *AccountToken) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountToken) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetAccountToken(accountToken string) { + a.AccountToken = accountToken + a.require(accountTokenFieldAccountToken) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(accountTokenFieldIntegration) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetId(id string) { + a.Id = id + a.require(accountTokenFieldId) +} + func (a *AccountToken) UnmarshalJSON(data []byte) error { type unmarshaler AccountToken var value unmarshaler @@ -58,6 +96,17 @@ func (a *AccountToken) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountToken) MarshalJSON() ([]byte, error) { + type embed AccountToken + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountToken) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/ats/accountdetails/ats_account_details_test/ats_account_details_test.go b/ats/accountdetails/ats_account_details_test/ats_account_details_test.go new file mode 100644 index 0000000..398b82b --- /dev/null +++ b/ats/accountdetails/ats_account_details_test/ats_account_details_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_account_details_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsAccountDetailsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.AccountDetails.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/account-details", nil, 1) +} diff --git a/ats/accountdetails/client.go b/ats/accountdetails/client.go index d5b129b..60203f0 100644 --- a/ats/accountdetails/client.go +++ b/ats/accountdetails/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*ats.AccountDetails, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/account-details" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.AccountDetails - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/accountdetails/raw_client.go b/ats/accountdetails/raw_client.go new file mode 100644 index 0000000..fcb1b12 --- /dev/null +++ b/ats/accountdetails/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package accountdetails + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ats.AccountDetails], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/account-details" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.AccountDetails + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.AccountDetails]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/accounttoken/ats_account_token_test/ats_account_token_test.go b/ats/accounttoken/ats_account_token_test/ats_account_token_test.go new file mode 100644 index 0000000..87324ad --- /dev/null +++ b/ats/accounttoken/ats_account_token_test/ats_account_token_test.go @@ -0,0 +1,80 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_account_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsAccountTokenRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/account-token/public_token", nil, 1) +} diff --git a/ats/accounttoken/client.go b/ats/accounttoken/client.go index c59fb9c..b8f8da6 100644 --- a/ats/accounttoken/client.go +++ b/ats/accounttoken/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,36 +38,13 @@ func (c *Client) Retrieve( publicToken string, opts ...option.RequestOption, ) (*ats.AccountToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/account-token/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, publicToken, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.AccountToken - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/accounttoken/raw_client.go b/ats/accounttoken/raw_client.go new file mode 100644 index 0000000..d5d0c1d --- /dev/null +++ b/ats/accounttoken/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounttoken + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + publicToken string, + opts ...option.RequestOption, +) (*core.Response[*ats.AccountToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/account-token/%v", + publicToken, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.AccountToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.AccountToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/activities.go b/ats/activities.go index 0101433..87a59d8 100644 --- a/ats/activities.go +++ b/ats/activities.go @@ -6,9 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + activityEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + activityEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + activityEndpointRequestFieldModel = big.NewInt(1 << 2) + activityEndpointRequestFieldRemoteUserId = big.NewInt(1 << 3) +) + type ActivityEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` @@ -16,8 +24,63 @@ type ActivityEndpointRequest struct { RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *ActivityRequest `json:"model,omitempty" url:"-"` RemoteUserId string `json:"remote_user_id" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *ActivityEndpointRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) } +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + a.IsDebugMode = isDebugMode + a.require(activityEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityEndpointRequest) SetRunAsync(runAsync *bool) { + a.RunAsync = runAsync + a.require(activityEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityEndpointRequest) SetModel(model *ActivityRequest) { + a.Model = model + a.require(activityEndpointRequestFieldModel) +} + +// SetRemoteUserId sets the RemoteUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityEndpointRequest) SetRemoteUserId(remoteUserId string) { + a.RemoteUserId = remoteUserId + a.require(activityEndpointRequestFieldRemoteUserId) +} + +var ( + activitiesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + activitiesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + activitiesListRequestFieldCursor = big.NewInt(1 << 2) + activitiesListRequestFieldExpand = big.NewInt(1 << 3) + activitiesListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + activitiesListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + activitiesListRequestFieldIncludeShellData = big.NewInt(1 << 6) + activitiesListRequestFieldModifiedAfter = big.NewInt(1 << 7) + activitiesListRequestFieldModifiedBefore = big.NewInt(1 << 8) + activitiesListRequestFieldPageSize = big.NewInt(1 << 9) + activitiesListRequestFieldRemoteFields = big.NewInt(1 << 10) + activitiesListRequestFieldRemoteId = big.NewInt(1 << 11) + activitiesListRequestFieldShowEnumOrigins = big.NewInt(1 << 12) + activitiesListRequestFieldUserId = big.NewInt(1 << 13) +) + type ActivitiesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -47,8 +110,124 @@ type ActivitiesListRequest struct { ShowEnumOrigins *ActivitiesListRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` // If provided, will only return activities done by this user. UserId *string `json:"-" url:"user_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *ActivitiesListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetCreatedAfter(createdAfter *time.Time) { + a.CreatedAfter = createdAfter + a.require(activitiesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetCreatedBefore(createdBefore *time.Time) { + a.CreatedBefore = createdBefore + a.require(activitiesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(activitiesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(activitiesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(activitiesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(activitiesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(activitiesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + a.ModifiedAfter = modifiedAfter + a.require(activitiesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + a.ModifiedBefore = modifiedBefore + a.require(activitiesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(activitiesListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetRemoteFields(remoteFields *ActivitiesListRequestRemoteFields) { + a.RemoteFields = remoteFields + a.require(activitiesListRequestFieldRemoteFields) } +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(activitiesListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetShowEnumOrigins(showEnumOrigins *ActivitiesListRequestShowEnumOrigins) { + a.ShowEnumOrigins = showEnumOrigins + a.require(activitiesListRequestFieldShowEnumOrigins) +} + +// SetUserId sets the UserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesListRequest) SetUserId(userId *string) { + a.UserId = userId + a.require(activitiesListRequestFieldUserId) +} + +var ( + activitiesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + activitiesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + activitiesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + activitiesRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + activitiesRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type ActivitiesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -60,6 +239,51 @@ type ActivitiesRetrieveRequest struct { RemoteFields *ActivitiesRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *ActivitiesRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *ActivitiesRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesRetrieveRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(activitiesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(activitiesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(activitiesRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesRetrieveRequest) SetRemoteFields(remoteFields *ActivitiesRetrieveRequestRemoteFields) { + a.RemoteFields = remoteFields + a.require(activitiesRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivitiesRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *ActivitiesRetrieveRequestShowEnumOrigins) { + a.ShowEnumOrigins = showEnumOrigins + a.require(activitiesRetrieveRequestFieldShowEnumOrigins) } type ActivitiesListRequestRemoteFields string @@ -167,6 +391,23 @@ func (a ActivitiesRetrieveRequestShowEnumOrigins) Ptr() *ActivitiesRetrieveReque // 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. +var ( + activityFieldId = big.NewInt(1 << 0) + activityFieldRemoteId = big.NewInt(1 << 1) + activityFieldCreatedAt = big.NewInt(1 << 2) + activityFieldModifiedAt = big.NewInt(1 << 3) + activityFieldUser = big.NewInt(1 << 4) + activityFieldRemoteCreatedAt = big.NewInt(1 << 5) + activityFieldActivityType = big.NewInt(1 << 6) + activityFieldSubject = big.NewInt(1 << 7) + activityFieldBody = big.NewInt(1 << 8) + activityFieldVisibility = big.NewInt(1 << 9) + activityFieldCandidate = big.NewInt(1 << 10) + activityFieldRemoteWasDeleted = big.NewInt(1 << 11) + activityFieldFieldMappings = big.NewInt(1 << 12) + activityFieldRemoteData = big.NewInt(1 << 13) +) + type Activity struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -201,6 +442,9 @@ type Activity struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -307,6 +551,111 @@ func (a *Activity) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Activity) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetId(id *string) { + a.Id = id + a.require(activityFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(activityFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(activityFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(activityFieldModifiedAt) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetUser(user *ActivityUser) { + a.User = user + a.require(activityFieldUser) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + a.RemoteCreatedAt = remoteCreatedAt + a.require(activityFieldRemoteCreatedAt) +} + +// SetActivityType sets the ActivityType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetActivityType(activityType *ActivityActivityType) { + a.ActivityType = activityType + a.require(activityFieldActivityType) +} + +// SetSubject sets the Subject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetSubject(subject *string) { + a.Subject = subject + a.require(activityFieldSubject) +} + +// SetBody sets the Body field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetBody(body *string) { + a.Body = body + a.require(activityFieldBody) +} + +// SetVisibility sets the Visibility field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetVisibility(visibility *ActivityVisibility) { + a.Visibility = visibility + a.require(activityFieldVisibility) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetCandidate(candidate *string) { + a.Candidate = candidate + a.require(activityFieldCandidate) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetRemoteWasDeleted(remoteWasDeleted *bool) { + a.RemoteWasDeleted = remoteWasDeleted + a.require(activityFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetFieldMappings(fieldMappings map[string]interface{}) { + a.FieldMappings = fieldMappings + a.require(activityFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Activity) SetRemoteData(remoteData []*RemoteData) { + a.RemoteData = remoteData + a.require(activityFieldRemoteData) +} + func (a *Activity) UnmarshalJSON(data []byte) error { type embed Activity var unmarshaler = struct { @@ -346,7 +695,8 @@ func (a *Activity) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), RemoteCreatedAt: internal.NewOptionalDateTime(a.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Activity) String() string { @@ -433,6 +783,17 @@ func (a *ActivityActivityType) Accept(visitor ActivityActivityTypeVisitor) error // 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. +var ( + activityRequestFieldUser = big.NewInt(1 << 0) + activityRequestFieldActivityType = big.NewInt(1 << 1) + activityRequestFieldSubject = big.NewInt(1 << 2) + activityRequestFieldBody = big.NewInt(1 << 3) + activityRequestFieldVisibility = big.NewInt(1 << 4) + activityRequestFieldCandidate = big.NewInt(1 << 5) + activityRequestFieldIntegrationParams = big.NewInt(1 << 6) + activityRequestFieldLinkedAccountParams = big.NewInt(1 << 7) +) + type ActivityRequest struct { // The user that performed the action. User *ActivityRequestUser `json:"user,omitempty" url:"user,omitempty"` @@ -456,6 +817,9 @@ type ActivityRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -520,6 +884,69 @@ func (a *ActivityRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *ActivityRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityRequest) SetUser(user *ActivityRequestUser) { + a.User = user + a.require(activityRequestFieldUser) +} + +// SetActivityType sets the ActivityType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityRequest) SetActivityType(activityType *ActivityTypeEnum) { + a.ActivityType = activityType + a.require(activityRequestFieldActivityType) +} + +// SetSubject sets the Subject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityRequest) SetSubject(subject *string) { + a.Subject = subject + a.require(activityRequestFieldSubject) +} + +// SetBody sets the Body field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityRequest) SetBody(body *string) { + a.Body = body + a.require(activityRequestFieldBody) +} + +// SetVisibility sets the Visibility field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityRequest) SetVisibility(visibility *ActivityRequestVisibility) { + a.Visibility = visibility + a.require(activityRequestFieldVisibility) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityRequest) SetCandidate(candidate *string) { + a.Candidate = candidate + a.require(activityRequestFieldCandidate) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(activityRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(activityRequestFieldLinkedAccountParams) +} + func (a *ActivityRequest) UnmarshalJSON(data []byte) error { type unmarshaler ActivityRequest var value unmarshaler @@ -536,6 +963,17 @@ func (a *ActivityRequest) UnmarshalJSON(data []byte) error { return nil } +func (a *ActivityRequest) MarshalJSON() ([]byte, error) { + type embed ActivityRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *ActivityRequest) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -678,12 +1116,22 @@ func (a *ActivityRequestVisibility) Accept(visitor ActivityRequestVisibilityVisi return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + activityResponseFieldModel = big.NewInt(1 << 0) + activityResponseFieldWarnings = big.NewInt(1 << 1) + activityResponseFieldErrors = big.NewInt(1 << 2) + activityResponseFieldLogs = big.NewInt(1 << 3) +) + type ActivityResponse struct { Model *Activity `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -720,6 +1168,41 @@ func (a *ActivityResponse) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *ActivityResponse) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityResponse) SetModel(model *Activity) { + a.Model = model + a.require(activityResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityResponse) SetWarnings(warnings []*WarningValidationProblem) { + a.Warnings = warnings + a.require(activityResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityResponse) SetErrors(errors []*ErrorValidationProblem) { + a.Errors = errors + a.require(activityResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ActivityResponse) SetLogs(logs []*DebugModeLog) { + a.Logs = logs + a.require(activityResponseFieldLogs) +} + func (a *ActivityResponse) UnmarshalJSON(data []byte) error { type unmarshaler ActivityResponse var value unmarshaler @@ -736,6 +1219,17 @@ func (a *ActivityResponse) UnmarshalJSON(data []byte) error { return nil } +func (a *ActivityResponse) MarshalJSON() ([]byte, error) { + type embed ActivityResponse + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *ActivityResponse) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -906,11 +1400,20 @@ func (a *ActivityVisibility) Accept(visitor ActivityVisibilityVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + paginatedActivityListFieldNext = big.NewInt(1 << 0) + paginatedActivityListFieldPrevious = big.NewInt(1 << 1) + paginatedActivityListFieldResults = big.NewInt(1 << 2) +) + type PaginatedActivityList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Activity `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -940,6 +1443,34 @@ func (p *PaginatedActivityList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedActivityList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedActivityList) SetNext(next *string) { + p.Next = next + p.require(paginatedActivityListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedActivityList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedActivityListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedActivityList) SetResults(results []*Activity) { + p.Results = results + p.require(paginatedActivityListFieldResults) +} + func (p *PaginatedActivityList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedActivityList var value unmarshaler @@ -956,6 +1487,17 @@ func (p *PaginatedActivityList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedActivityList) MarshalJSON() ([]byte, error) { + type embed PaginatedActivityList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedActivityList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/activities/ats_activities_test/ats_activities_test.go b/ats/activities/ats_activities_test/ats_activities_test.go new file mode 100644 index 0000000..c70c9e7 --- /dev/null +++ b/ats/activities/ats_activities_test/ats_activities_test.go @@ -0,0 +1,204 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_activities_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsActivitiesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ActivitiesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: ats.ActivitiesListRequestRemoteFieldsActivityType.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: ats.ActivitiesListRequestShowEnumOriginsActivityType.Ptr(), + UserId: merge.String( + "user_id", + ), + } + _, invocationErr := client.Ats.Activities.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/activities", map[string]string{"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"}, 1) +} + +func TestAtsActivitiesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ActivityEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.ActivityRequest{}, + RemoteUserId: "remote_user_id", + } + _, invocationErr := client.Ats.Activities.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/activities", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAtsActivitiesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ActivitiesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: ats.ActivitiesRetrieveRequestRemoteFieldsActivityType.Ptr(), + ShowEnumOrigins: ats.ActivitiesRetrieveRequestShowEnumOriginsActivityType.Ptr(), + } + _, invocationErr := client.Ats.Activities.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/activities/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "activity_type", "show_enum_origins": "activity_type"}, 1) +} + +func TestAtsActivitiesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.Activities.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/activities/meta/post", nil, 1) +} diff --git a/ats/activities/client.go b/ats/activities/client.go index 647f297..5fb4132 100644 --- a/ats/activities/client.go +++ b/ats/activities/client.go @@ -4,7 +4,6 @@ package activities import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.ActivitiesListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Activity], error) { +) (*core.Page[*string, *ats.Activity], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedActivityList) *internal.PageResponse[*string, *ats.Activity] { + readPageResponse := func(response *ats.PaginatedActivityList) *core.PageResponse[*string, *ats.Activity] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Activity]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Activity]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *ats.ActivityEndpointRequest, opts ...option.RequestOption, ) (*ats.ActivityResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ats/v1/activities" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.ActivityResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Activity` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *ats.ActivitiesRetrieveRequest, opts ...option.RequestOption, ) (*ats.Activity, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/activities/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Activity - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Activity` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ats.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/activities/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/activities/raw_client.go b/ats/activities/raw_client.go new file mode 100644 index 0000000..0d52b77 --- /dev/null +++ b/ats/activities/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package activities + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.ActivityEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.ActivityResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/activities" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.ActivityResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.ActivityResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.ActivitiesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Activity], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/activities/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Activity + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Activity]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ats.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/activities/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/applications.go b/ats/applications.go index 4bd685e..60bee7b 100644 --- a/ats/applications.go +++ b/ats/applications.go @@ -6,9 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + updateApplicationStageRequestFieldIsDebugMode = big.NewInt(1 << 0) + updateApplicationStageRequestFieldRunAsync = big.NewInt(1 << 1) + updateApplicationStageRequestFieldJobInterviewStage = big.NewInt(1 << 2) + updateApplicationStageRequestFieldRemoteUserId = big.NewInt(1 << 3) +) + type UpdateApplicationStageRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` @@ -17,8 +25,53 @@ type UpdateApplicationStageRequest struct { // The interview stage to move the application to. JobInterviewStage *string `json:"job_interview_stage,omitempty" url:"-"` RemoteUserId *string `json:"remote_user_id,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UpdateApplicationStageRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateApplicationStageRequest) SetIsDebugMode(isDebugMode *bool) { + u.IsDebugMode = isDebugMode + u.require(updateApplicationStageRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateApplicationStageRequest) SetRunAsync(runAsync *bool) { + u.RunAsync = runAsync + u.require(updateApplicationStageRequestFieldRunAsync) +} + +// SetJobInterviewStage sets the JobInterviewStage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateApplicationStageRequest) SetJobInterviewStage(jobInterviewStage *string) { + u.JobInterviewStage = jobInterviewStage + u.require(updateApplicationStageRequestFieldJobInterviewStage) } +// SetRemoteUserId sets the RemoteUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateApplicationStageRequest) SetRemoteUserId(remoteUserId *string) { + u.RemoteUserId = remoteUserId + u.require(updateApplicationStageRequestFieldRemoteUserId) +} + +var ( + applicationEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + applicationEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + applicationEndpointRequestFieldModel = big.NewInt(1 << 2) + applicationEndpointRequestFieldRemoteUserId = big.NewInt(1 << 3) +) + type ApplicationEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` @@ -26,8 +79,66 @@ type ApplicationEndpointRequest struct { RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *ApplicationRequest `json:"model,omitempty" url:"-"` RemoteUserId string `json:"remote_user_id" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *ApplicationEndpointRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + a.IsDebugMode = isDebugMode + a.require(applicationEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationEndpointRequest) SetRunAsync(runAsync *bool) { + a.RunAsync = runAsync + a.require(applicationEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationEndpointRequest) SetModel(model *ApplicationRequest) { + a.Model = model + a.require(applicationEndpointRequestFieldModel) } +// SetRemoteUserId sets the RemoteUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationEndpointRequest) SetRemoteUserId(remoteUserId string) { + a.RemoteUserId = remoteUserId + a.require(applicationEndpointRequestFieldRemoteUserId) +} + +var ( + applicationsListRequestFieldCandidateId = big.NewInt(1 << 0) + applicationsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + applicationsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + applicationsListRequestFieldCreditedToId = big.NewInt(1 << 3) + applicationsListRequestFieldCurrentStageId = big.NewInt(1 << 4) + applicationsListRequestFieldCursor = big.NewInt(1 << 5) + applicationsListRequestFieldExpand = big.NewInt(1 << 6) + applicationsListRequestFieldIncludeDeletedData = big.NewInt(1 << 7) + applicationsListRequestFieldIncludeRemoteData = big.NewInt(1 << 8) + applicationsListRequestFieldIncludeShellData = big.NewInt(1 << 9) + applicationsListRequestFieldJobId = big.NewInt(1 << 10) + applicationsListRequestFieldModifiedAfter = big.NewInt(1 << 11) + applicationsListRequestFieldModifiedBefore = big.NewInt(1 << 12) + applicationsListRequestFieldPageSize = big.NewInt(1 << 13) + applicationsListRequestFieldRejectReasonId = big.NewInt(1 << 14) + applicationsListRequestFieldRemoteId = big.NewInt(1 << 15) + applicationsListRequestFieldSource = big.NewInt(1 << 16) +) + type ApplicationsListRequest struct { // If provided, will only return applications for this candidate. CandidateId *string `json:"-" url:"candidate_id,omitempty"` @@ -63,13 +174,169 @@ type ApplicationsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // If provided, will only return applications with this source. Source *string `json:"-" url:"source,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *ApplicationsListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCandidateId sets the CandidateId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetCandidateId(candidateId *string) { + a.CandidateId = candidateId + a.require(applicationsListRequestFieldCandidateId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetCreatedAfter(createdAfter *time.Time) { + a.CreatedAfter = createdAfter + a.require(applicationsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetCreatedBefore(createdBefore *time.Time) { + a.CreatedBefore = createdBefore + a.require(applicationsListRequestFieldCreatedBefore) +} + +// SetCreditedToId sets the CreditedToId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetCreditedToId(creditedToId *string) { + a.CreditedToId = creditedToId + a.require(applicationsListRequestFieldCreditedToId) +} + +// SetCurrentStageId sets the CurrentStageId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetCurrentStageId(currentStageId *string) { + a.CurrentStageId = currentStageId + a.require(applicationsListRequestFieldCurrentStageId) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(applicationsListRequestFieldCursor) } +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetExpand(expand []*ApplicationsListRequestExpandItem) { + a.Expand = expand + a.require(applicationsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(applicationsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(applicationsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(applicationsListRequestFieldIncludeShellData) +} + +// SetJobId sets the JobId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetJobId(jobId *string) { + a.JobId = jobId + a.require(applicationsListRequestFieldJobId) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + a.ModifiedAfter = modifiedAfter + a.require(applicationsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + a.ModifiedBefore = modifiedBefore + a.require(applicationsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(applicationsListRequestFieldPageSize) +} + +// SetRejectReasonId sets the RejectReasonId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetRejectReasonId(rejectReasonId *string) { + a.RejectReasonId = rejectReasonId + a.require(applicationsListRequestFieldRejectReasonId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(applicationsListRequestFieldRemoteId) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsListRequest) SetSource(source *string) { + a.Source = source + a.require(applicationsListRequestFieldSource) +} + +var ( + applicationsMetaPostRetrieveRequestFieldApplicationRemoteTemplateId = big.NewInt(1 << 0) +) + type ApplicationsMetaPostRetrieveRequest struct { // The template ID associated with the nested application in the request. ApplicationRemoteTemplateId *string `json:"-" url:"application_remote_template_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *ApplicationsMetaPostRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) } +// SetApplicationRemoteTemplateId sets the ApplicationRemoteTemplateId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsMetaPostRetrieveRequest) SetApplicationRemoteTemplateId(applicationRemoteTemplateId *string) { + a.ApplicationRemoteTemplateId = applicationRemoteTemplateId + a.require(applicationsMetaPostRetrieveRequestFieldApplicationRemoteTemplateId) +} + +var ( + applicationsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + applicationsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + applicationsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type ApplicationsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*ApplicationsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -77,6 +344,37 @@ type ApplicationsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *ApplicationsRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsRetrieveRequest) SetExpand(expand []*ApplicationsRetrieveRequestExpandItem) { + a.Expand = expand + a.require(applicationsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(applicationsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(applicationsRetrieveRequestFieldIncludeShellData) } type ApplicationsListRequestExpandItem string @@ -165,6 +463,22 @@ func (a ApplicationsRetrieveRequestExpandItem) Ptr() *ApplicationsRetrieveReques // // ### Usage Example // Fetch from the `LIST Applications` endpoint and filter by `ID` to show all applications. +var ( + applicationRequestFieldCandidate = big.NewInt(1 << 0) + applicationRequestFieldJob = big.NewInt(1 << 1) + applicationRequestFieldAppliedAt = big.NewInt(1 << 2) + applicationRequestFieldRejectedAt = big.NewInt(1 << 3) + applicationRequestFieldOffers = big.NewInt(1 << 4) + applicationRequestFieldSource = big.NewInt(1 << 5) + applicationRequestFieldCreditedTo = big.NewInt(1 << 6) + applicationRequestFieldScreeningQuestionAnswers = big.NewInt(1 << 7) + applicationRequestFieldCurrentStage = big.NewInt(1 << 8) + applicationRequestFieldRejectReason = big.NewInt(1 << 9) + applicationRequestFieldRemoteTemplateId = big.NewInt(1 << 10) + applicationRequestFieldIntegrationParams = big.NewInt(1 << 11) + applicationRequestFieldLinkedAccountParams = big.NewInt(1 << 12) +) + type ApplicationRequest struct { // The candidate applying. Candidate *ApplicationRequestCandidate `json:"candidate,omitempty" url:"candidate,omitempty"` @@ -188,6 +502,9 @@ type ApplicationRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -287,6 +604,104 @@ func (a *ApplicationRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *ApplicationRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetCandidate(candidate *ApplicationRequestCandidate) { + a.Candidate = candidate + a.require(applicationRequestFieldCandidate) +} + +// SetJob sets the Job field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetJob(job *ApplicationRequestJob) { + a.Job = job + a.require(applicationRequestFieldJob) +} + +// SetAppliedAt sets the AppliedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetAppliedAt(appliedAt *time.Time) { + a.AppliedAt = appliedAt + a.require(applicationRequestFieldAppliedAt) +} + +// SetRejectedAt sets the RejectedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetRejectedAt(rejectedAt *time.Time) { + a.RejectedAt = rejectedAt + a.require(applicationRequestFieldRejectedAt) +} + +// SetOffers sets the Offers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetOffers(offers []*ApplicationRequestOffersItem) { + a.Offers = offers + a.require(applicationRequestFieldOffers) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetSource(source *string) { + a.Source = source + a.require(applicationRequestFieldSource) +} + +// SetCreditedTo sets the CreditedTo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetCreditedTo(creditedTo *ApplicationRequestCreditedTo) { + a.CreditedTo = creditedTo + a.require(applicationRequestFieldCreditedTo) +} + +// SetScreeningQuestionAnswers sets the ScreeningQuestionAnswers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetScreeningQuestionAnswers(screeningQuestionAnswers []*ApplicationRequestScreeningQuestionAnswersItem) { + a.ScreeningQuestionAnswers = screeningQuestionAnswers + a.require(applicationRequestFieldScreeningQuestionAnswers) +} + +// SetCurrentStage sets the CurrentStage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetCurrentStage(currentStage *ApplicationRequestCurrentStage) { + a.CurrentStage = currentStage + a.require(applicationRequestFieldCurrentStage) +} + +// SetRejectReason sets the RejectReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetRejectReason(rejectReason *ApplicationRequestRejectReason) { + a.RejectReason = rejectReason + a.require(applicationRequestFieldRejectReason) +} + +// SetRemoteTemplateId sets the RemoteTemplateId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetRemoteTemplateId(remoteTemplateId *string) { + a.RemoteTemplateId = remoteTemplateId + a.require(applicationRequestFieldRemoteTemplateId) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(applicationRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(applicationRequestFieldLinkedAccountParams) +} + func (a *ApplicationRequest) UnmarshalJSON(data []byte) error { type embed ApplicationRequest var unmarshaler = struct { @@ -322,7 +737,8 @@ func (a *ApplicationRequest) MarshalJSON() ([]byte, error) { AppliedAt: internal.NewOptionalDateTime(a.AppliedAt), RejectedAt: internal.NewOptionalDateTime(a.RejectedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *ApplicationRequest) String() string { @@ -776,12 +1192,22 @@ func (a *ApplicationRequestScreeningQuestionAnswersItem) Accept(visitor Applicat return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + applicationResponseFieldModel = big.NewInt(1 << 0) + applicationResponseFieldWarnings = big.NewInt(1 << 1) + applicationResponseFieldErrors = big.NewInt(1 << 2) + applicationResponseFieldLogs = big.NewInt(1 << 3) +) + type ApplicationResponse struct { Model *Application `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -818,6 +1244,41 @@ func (a *ApplicationResponse) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *ApplicationResponse) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationResponse) SetModel(model *Application) { + a.Model = model + a.require(applicationResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationResponse) SetWarnings(warnings []*WarningValidationProblem) { + a.Warnings = warnings + a.require(applicationResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationResponse) SetErrors(errors []*ErrorValidationProblem) { + a.Errors = errors + a.require(applicationResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *ApplicationResponse) SetLogs(logs []*DebugModeLog) { + a.Logs = logs + a.require(applicationResponseFieldLogs) +} + func (a *ApplicationResponse) UnmarshalJSON(data []byte) error { type unmarshaler ApplicationResponse var value unmarshaler @@ -834,6 +1295,17 @@ func (a *ApplicationResponse) UnmarshalJSON(data []byte) error { return nil } +func (a *ApplicationResponse) MarshalJSON() ([]byte, error) { + type embed ApplicationResponse + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *ApplicationResponse) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -846,11 +1318,20 @@ func (a *ApplicationResponse) String() string { return fmt.Sprintf("%#v", a) } +var ( + paginatedApplicationListFieldNext = big.NewInt(1 << 0) + paginatedApplicationListFieldPrevious = big.NewInt(1 << 1) + paginatedApplicationListFieldResults = big.NewInt(1 << 2) +) + type PaginatedApplicationList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Application `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -880,6 +1361,34 @@ func (p *PaginatedApplicationList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedApplicationList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedApplicationList) SetNext(next *string) { + p.Next = next + p.require(paginatedApplicationListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedApplicationList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedApplicationListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedApplicationList) SetResults(results []*Application) { + p.Results = results + p.require(paginatedApplicationListFieldResults) +} + func (p *PaginatedApplicationList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedApplicationList var value unmarshaler @@ -896,6 +1405,17 @@ func (p *PaginatedApplicationList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedApplicationList) MarshalJSON() ([]byte, error) { + type embed PaginatedApplicationList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedApplicationList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -914,6 +1434,14 @@ func (p *PaginatedApplicationList) String() string { // // ### Usage Example // TODO +var ( + screeningQuestionAnswerRequestFieldRemoteId = big.NewInt(1 << 0) + screeningQuestionAnswerRequestFieldQuestion = big.NewInt(1 << 1) + screeningQuestionAnswerRequestFieldAnswer = big.NewInt(1 << 2) + screeningQuestionAnswerRequestFieldIntegrationParams = big.NewInt(1 << 3) + screeningQuestionAnswerRequestFieldLinkedAccountParams = big.NewInt(1 << 4) +) + type ScreeningQuestionAnswerRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -924,6 +1452,9 @@ type ScreeningQuestionAnswerRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -967,6 +1498,48 @@ func (s *ScreeningQuestionAnswerRequest) GetExtraProperties() map[string]interfa return s.extraProperties } +func (s *ScreeningQuestionAnswerRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswerRequest) SetRemoteId(remoteId *string) { + s.RemoteId = remoteId + s.require(screeningQuestionAnswerRequestFieldRemoteId) +} + +// SetQuestion sets the Question field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswerRequest) SetQuestion(question *ScreeningQuestionAnswerRequestQuestion) { + s.Question = question + s.require(screeningQuestionAnswerRequestFieldQuestion) +} + +// SetAnswer sets the Answer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswerRequest) SetAnswer(answer *string) { + s.Answer = answer + s.require(screeningQuestionAnswerRequestFieldAnswer) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswerRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + s.IntegrationParams = integrationParams + s.require(screeningQuestionAnswerRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswerRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + s.LinkedAccountParams = linkedAccountParams + s.require(screeningQuestionAnswerRequestFieldLinkedAccountParams) +} + func (s *ScreeningQuestionAnswerRequest) UnmarshalJSON(data []byte) error { type unmarshaler ScreeningQuestionAnswerRequest var value unmarshaler @@ -983,6 +1556,17 @@ func (s *ScreeningQuestionAnswerRequest) UnmarshalJSON(data []byte) error { return nil } +func (s *ScreeningQuestionAnswerRequest) MarshalJSON() ([]byte, error) { + type embed ScreeningQuestionAnswerRequest + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (s *ScreeningQuestionAnswerRequest) String() string { if len(s.rawJSON) > 0 { if value, err := internal.StringifyJSON(s.rawJSON); err == nil { diff --git a/ats/applications/ats_applications_test/ats_applications_test.go b/ats/applications/ats_applications_test/ats_applications_test.go new file mode 100644 index 0000000..2c2e38b --- /dev/null +++ b/ats/applications/ats_applications_test/ats_applications_test.go @@ -0,0 +1,249 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_applications_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsApplicationsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ApplicationsListRequest{ + CandidateId: merge.String( + "candidate_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreditedToId: merge.String( + "credited_to_id", + ), + CurrentStageId: merge.String( + "current_stage_id", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + JobId: merge.String( + "job_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RejectReasonId: merge.String( + "reject_reason_id", + ), + RemoteId: merge.String( + "remote_id", + ), + Source: merge.String( + "source", + ), + } + _, invocationErr := client.Ats.Applications.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/applications", map[string]string{"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"}, 1) +} + +func TestAtsApplicationsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ApplicationEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.ApplicationRequest{}, + RemoteUserId: "remote_user_id", + } + _, invocationErr := client.Ats.Applications.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/applications", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAtsApplicationsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ApplicationsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Applications.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/applications/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestAtsApplicationsChangeStageCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.UpdateApplicationStageRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Applications.ChangeStageCreate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/applications/id/change-stage", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAtsApplicationsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ApplicationsMetaPostRetrieveRequest{ + ApplicationRemoteTemplateId: merge.String( + "application_remote_template_id", + ), + } + _, invocationErr := client.Ats.Applications.MetaPostRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/applications/meta/post", map[string]string{"application_remote_template_id": "application_remote_template_id"}, 1) +} diff --git a/ats/applications/client.go b/ats/applications/client.go index 485c359..2f2c121 100644 --- a/ats/applications/client.go +++ b/ats/applications/client.go @@ -4,7 +4,6 @@ package applications import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.ApplicationsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Application], error) { +) (*core.Page[*string, *ats.Application], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedApplicationList) *internal.PageResponse[*string, *ats.Application] { + readPageResponse := func(response *ats.PaginatedApplicationList) *core.PageResponse[*string, *ats.Application] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Application]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Application]{ Next: next, Results: results, Done: next == zeroValue, @@ -100,44 +100,15 @@ func (c *Client) Create( request *ats.ApplicationEndpointRequest, opts ...option.RequestOption, ) (*ats.ApplicationResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ats/v1/applications" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.ApplicationResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Application` object with the given `id`. @@ -147,45 +118,16 @@ func (c *Client) Retrieve( request *ats.ApplicationsRetrieveRequest, opts ...option.RequestOption, ) (*ats.Application, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/applications/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Application - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates the `current_stage` field of an `Application` object @@ -195,47 +137,16 @@ func (c *Client) ChangeStageCreate( request *ats.UpdateApplicationStageRequest, opts ...option.RequestOption, ) (*ats.ApplicationResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/applications/%v/change-stage", + response, err := c.WithRawResponse.ChangeStageCreate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.ApplicationResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Application` POSTs. @@ -244,40 +155,13 @@ func (c *Client) MetaPostRetrieve( request *ats.ApplicationsMetaPostRetrieveRequest, opts ...option.RequestOption, ) (*ats.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.MetaPostRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ats/v1/applications/meta/post" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/applications/raw_client.go b/ats/applications/raw_client.go new file mode 100644 index 0000000..f8ad162 --- /dev/null +++ b/ats/applications/raw_client.go @@ -0,0 +1,231 @@ +// Code generated by Fern. DO NOT EDIT. + +package applications + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.ApplicationEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.ApplicationResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/applications" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.ApplicationResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.ApplicationResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.ApplicationsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Application], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/applications/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Application + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Application]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) ChangeStageCreate( + ctx context.Context, + id string, + request *ats.UpdateApplicationStageRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.ApplicationResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/applications/%v/change-stage", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.ApplicationResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.ApplicationResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + request *ats.ApplicationsMetaPostRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/applications/meta/post" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/async_passthrough.go b/ats/async_passthrough.go index 2d5b0db..4f6d8ae 100644 --- a/ats/async_passthrough.go +++ b/ats/async_passthrough.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) type AsyncPassthroughRetrieveResponse struct { @@ -70,9 +71,16 @@ func (a *AsyncPassthroughRetrieveResponse) Accept(visitor AsyncPassthroughRetrie return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + asyncPassthroughRecieptFieldAsyncPassthroughReceiptId = big.NewInt(1 << 0) +) + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id" url:"async_passthrough_receipt_id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -88,6 +96,20 @@ func (a *AsyncPassthroughReciept) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AsyncPassthroughReciept) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAsyncPassthroughReceiptId sets the AsyncPassthroughReceiptId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPassthroughReciept) SetAsyncPassthroughReceiptId(asyncPassthroughReceiptId string) { + a.AsyncPassthroughReceiptId = asyncPassthroughReceiptId + a.require(asyncPassthroughRecieptFieldAsyncPassthroughReceiptId) +} + func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { type unmarshaler AsyncPassthroughReciept var value unmarshaler @@ -104,6 +126,17 @@ func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { return nil } +func (a *AsyncPassthroughReciept) MarshalJSON() ([]byte, error) { + type embed AsyncPassthroughReciept + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AsyncPassthroughReciept) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/ats/asyncpassthrough/ats_async_passthrough_test/ats_async_passthrough_test.go b/ats/asyncpassthrough/ats_async_passthrough_test/ats_async_passthrough_test.go new file mode 100644 index 0000000..f12980c --- /dev/null +++ b/ats/asyncpassthrough/ats_async_passthrough_test/ats_async_passthrough_test.go @@ -0,0 +1,104 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_async_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsAsyncPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.DataPassthroughRequest{ + Method: ats.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Ats.AsyncPassthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/async-passthrough", nil, 1) +} + +func TestAtsAsyncPassthroughRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/async-passthrough/async_passthrough_receipt_id", nil, 1) +} diff --git a/ats/asyncpassthrough/client.go b/ats/asyncpassthrough/client.go index f5ff409..baccfb8 100644 --- a/ats/asyncpassthrough/client.go +++ b/ats/asyncpassthrough/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,37 +38,15 @@ func (c *Client) Create( request *ats.DataPassthroughRequest, opts ...option.RequestOption, ) (*ats.AsyncPassthroughReciept, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/async-passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.AsyncPassthroughReciept - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Retrieves data from earlier async-passthrough POST request @@ -76,36 +55,13 @@ func (c *Client) Retrieve( asyncPassthroughReceiptId string, opts ...option.RequestOption, ) (*ats.AsyncPassthroughRetrieveResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/async-passthrough/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, asyncPassthroughReceiptId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.AsyncPassthroughRetrieveResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/asyncpassthrough/raw_client.go b/ats/asyncpassthrough/raw_client.go new file mode 100644 index 0000000..2fe8c71 --- /dev/null +++ b/ats/asyncpassthrough/raw_client.go @@ -0,0 +1,115 @@ +// Code generated by Fern. DO NOT EDIT. + +package asyncpassthrough + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.AsyncPassthroughReciept], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/async-passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.AsyncPassthroughReciept + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.AsyncPassthroughReciept]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + asyncPassthroughReceiptId string, + opts ...option.RequestOption, +) (*core.Response[*ats.AsyncPassthroughRetrieveResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/async-passthrough/%v", + asyncPassthroughReceiptId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.AsyncPassthroughRetrieveResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.AsyncPassthroughRetrieveResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/attachments.go b/ats/attachments.go index d6677c7..4961ef3 100644 --- a/ats/attachments.go +++ b/ats/attachments.go @@ -6,9 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + attachmentEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + attachmentEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + attachmentEndpointRequestFieldModel = big.NewInt(1 << 2) + attachmentEndpointRequestFieldRemoteUserId = big.NewInt(1 << 3) +) + type AttachmentEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` @@ -16,8 +24,63 @@ type AttachmentEndpointRequest struct { RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *AttachmentRequest `json:"model,omitempty" url:"-"` RemoteUserId string `json:"remote_user_id" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AttachmentEndpointRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + a.IsDebugMode = isDebugMode + a.require(attachmentEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentEndpointRequest) SetRunAsync(runAsync *bool) { + a.RunAsync = runAsync + a.require(attachmentEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentEndpointRequest) SetModel(model *AttachmentRequest) { + a.Model = model + a.require(attachmentEndpointRequestFieldModel) +} + +// SetRemoteUserId sets the RemoteUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentEndpointRequest) SetRemoteUserId(remoteUserId string) { + a.RemoteUserId = remoteUserId + a.require(attachmentEndpointRequestFieldRemoteUserId) +} + +var ( + attachmentsListRequestFieldCandidateId = big.NewInt(1 << 0) + attachmentsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + attachmentsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + attachmentsListRequestFieldCursor = big.NewInt(1 << 3) + attachmentsListRequestFieldExpand = big.NewInt(1 << 4) + attachmentsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + attachmentsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + attachmentsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + attachmentsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + attachmentsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + attachmentsListRequestFieldPageSize = big.NewInt(1 << 10) + attachmentsListRequestFieldRemoteFields = big.NewInt(1 << 11) + attachmentsListRequestFieldRemoteId = big.NewInt(1 << 12) + attachmentsListRequestFieldShowEnumOrigins = big.NewInt(1 << 13) +) + type AttachmentsListRequest struct { // If provided, will only return attachments for this candidate. CandidateId *string `json:"-" url:"candidate_id,omitempty"` @@ -47,8 +110,124 @@ type AttachmentsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AttachmentsListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCandidateId sets the CandidateId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCandidateId(candidateId *string) { + a.CandidateId = candidateId + a.require(attachmentsListRequestFieldCandidateId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCreatedAfter(createdAfter *time.Time) { + a.CreatedAfter = createdAfter + a.require(attachmentsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCreatedBefore(createdBefore *time.Time) { + a.CreatedBefore = createdBefore + a.require(attachmentsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(attachmentsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(attachmentsListRequestFieldExpand) } +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(attachmentsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(attachmentsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(attachmentsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + a.ModifiedAfter = modifiedAfter + a.require(attachmentsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + a.ModifiedBefore = modifiedBefore + a.require(attachmentsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(attachmentsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetRemoteFields(remoteFields *string) { + a.RemoteFields = remoteFields + a.require(attachmentsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(attachmentsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + a.ShowEnumOrigins = showEnumOrigins + a.require(attachmentsListRequestFieldShowEnumOrigins) +} + +var ( + attachmentsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + attachmentsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + attachmentsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + attachmentsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + attachmentsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type AttachmentsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -60,6 +239,51 @@ type AttachmentsRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AttachmentsRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(attachmentsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(attachmentsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(attachmentsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetRemoteFields(remoteFields *string) { + a.RemoteFields = remoteFields + a.require(attachmentsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + a.ShowEnumOrigins = showEnumOrigins + a.require(attachmentsRetrieveRequestFieldShowEnumOrigins) } // # The Attachment Object @@ -67,6 +291,15 @@ type AttachmentsRetrieveRequest struct { // 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. +var ( + attachmentRequestFieldFileName = big.NewInt(1 << 0) + attachmentRequestFieldFileUrl = big.NewInt(1 << 1) + attachmentRequestFieldCandidate = big.NewInt(1 << 2) + attachmentRequestFieldAttachmentType = big.NewInt(1 << 3) + attachmentRequestFieldIntegrationParams = big.NewInt(1 << 4) + attachmentRequestFieldLinkedAccountParams = big.NewInt(1 << 5) +) + type AttachmentRequest struct { // The attachment's name. FileName *string `json:"file_name,omitempty" url:"file_name,omitempty"` @@ -83,6 +316,9 @@ type AttachmentRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -133,6 +369,55 @@ func (a *AttachmentRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AttachmentRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetFileName(fileName *string) { + a.FileName = fileName + a.require(attachmentRequestFieldFileName) +} + +// SetFileUrl sets the FileUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetFileUrl(fileUrl *string) { + a.FileUrl = fileUrl + a.require(attachmentRequestFieldFileUrl) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetCandidate(candidate *string) { + a.Candidate = candidate + a.require(attachmentRequestFieldCandidate) +} + +// SetAttachmentType sets the AttachmentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetAttachmentType(attachmentType *AttachmentRequestAttachmentType) { + a.AttachmentType = attachmentType + a.require(attachmentRequestFieldAttachmentType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(attachmentRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(attachmentRequestFieldLinkedAccountParams) +} + func (a *AttachmentRequest) UnmarshalJSON(data []byte) error { type unmarshaler AttachmentRequest var value unmarshaler @@ -149,6 +434,17 @@ func (a *AttachmentRequest) UnmarshalJSON(data []byte) error { return nil } +func (a *AttachmentRequest) MarshalJSON() ([]byte, error) { + type embed AttachmentRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AttachmentRequest) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -229,12 +525,22 @@ func (a *AttachmentRequestAttachmentType) Accept(visitor AttachmentRequestAttach return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + attachmentResponseFieldModel = big.NewInt(1 << 0) + attachmentResponseFieldWarnings = big.NewInt(1 << 1) + attachmentResponseFieldErrors = big.NewInt(1 << 2) + attachmentResponseFieldLogs = big.NewInt(1 << 3) +) + type AttachmentResponse struct { Model *Attachment `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -271,6 +577,41 @@ func (a *AttachmentResponse) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AttachmentResponse) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentResponse) SetModel(model *Attachment) { + a.Model = model + a.require(attachmentResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentResponse) SetWarnings(warnings []*WarningValidationProblem) { + a.Warnings = warnings + a.require(attachmentResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentResponse) SetErrors(errors []*ErrorValidationProblem) { + a.Errors = errors + a.require(attachmentResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentResponse) SetLogs(logs []*DebugModeLog) { + a.Logs = logs + a.require(attachmentResponseFieldLogs) +} + func (a *AttachmentResponse) UnmarshalJSON(data []byte) error { type unmarshaler AttachmentResponse var value unmarshaler @@ -287,6 +628,17 @@ func (a *AttachmentResponse) UnmarshalJSON(data []byte) error { return nil } +func (a *AttachmentResponse) MarshalJSON() ([]byte, error) { + type embed AttachmentResponse + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AttachmentResponse) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -299,11 +651,20 @@ func (a *AttachmentResponse) String() string { return fmt.Sprintf("%#v", a) } +var ( + paginatedAttachmentListFieldNext = big.NewInt(1 << 0) + paginatedAttachmentListFieldPrevious = big.NewInt(1 << 1) + paginatedAttachmentListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAttachmentList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Attachment `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -333,6 +694,34 @@ func (p *PaginatedAttachmentList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedAttachmentList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAttachmentList) SetNext(next *string) { + p.Next = next + p.require(paginatedAttachmentListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAttachmentList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAttachmentListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAttachmentList) SetResults(results []*Attachment) { + p.Results = results + p.require(paginatedAttachmentListFieldResults) +} + func (p *PaginatedAttachmentList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAttachmentList var value unmarshaler @@ -349,6 +738,17 @@ func (p *PaginatedAttachmentList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAttachmentList) MarshalJSON() ([]byte, error) { + type embed PaginatedAttachmentList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAttachmentList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/attachments/ats_attachments_test/ats_attachments_test.go b/ats/attachments/ats_attachments_test/ats_attachments_test.go new file mode 100644 index 0000000..f48eb1c --- /dev/null +++ b/ats/attachments/ats_attachments_test/ats_attachments_test.go @@ -0,0 +1,200 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_attachments_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsAttachmentsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.AttachmentsListRequest{ + CandidateId: merge.String( + "candidate_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.Attachments.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/attachments", map[string]string{"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"}, 1) +} + +func TestAtsAttachmentsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.AttachmentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.AttachmentRequest{}, + RemoteUserId: "remote_user_id", + } + _, invocationErr := client.Ats.Attachments.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/attachments", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAtsAttachmentsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.AttachmentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Attachments.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/attachments/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "attachment_type", "show_enum_origins": "attachment_type"}, 1) +} + +func TestAtsAttachmentsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.Attachments.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/attachments/meta/post", nil, 1) +} diff --git a/ats/attachments/client.go b/ats/attachments/client.go index ea5742a..78ee619 100644 --- a/ats/attachments/client.go +++ b/ats/attachments/client.go @@ -4,7 +4,6 @@ package attachments import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.AttachmentsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Attachment], error) { +) (*core.Page[*string, *ats.Attachment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedAttachmentList) *internal.PageResponse[*string, *ats.Attachment] { + readPageResponse := func(response *ats.PaginatedAttachmentList) *core.PageResponse[*string, *ats.Attachment] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Attachment]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Attachment]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *ats.AttachmentEndpointRequest, opts ...option.RequestOption, ) (*ats.AttachmentResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ats/v1/attachments" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.AttachmentResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Attachment` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *ats.AttachmentsRetrieveRequest, opts ...option.RequestOption, ) (*ats.Attachment, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/attachments/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Attachment - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Attachment` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ats.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/attachments/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/attachments/raw_client.go b/ats/attachments/raw_client.go new file mode 100644 index 0000000..6eee51e --- /dev/null +++ b/ats/attachments/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package attachments + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.AttachmentEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.AttachmentResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/attachments" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.AttachmentResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.AttachmentResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.AttachmentsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Attachment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/attachments/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Attachment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Attachment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ats.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/attachments/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/audit_trail.go b/ats/audit_trail.go index d9817a3..7f49df1 100644 --- a/ats/audit_trail.go +++ b/ats/audit_trail.go @@ -6,9 +6,19 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + auditTrailListRequestFieldCursor = big.NewInt(1 << 0) + auditTrailListRequestFieldEndDate = big.NewInt(1 << 1) + auditTrailListRequestFieldEventType = big.NewInt(1 << 2) + auditTrailListRequestFieldPageSize = big.NewInt(1 << 3) + auditTrailListRequestFieldStartDate = big.NewInt(1 << 4) + auditTrailListRequestFieldUserEmail = big.NewInt(1 << 5) +) + type AuditTrailListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -22,8 +32,71 @@ type AuditTrailListRequest struct { StartDate *string `json:"-" url:"start_date,omitempty"` // 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. UserEmail *string `json:"-" url:"user_email,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AuditTrailListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(auditTrailListRequestFieldCursor) } +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEndDate(endDate *string) { + a.EndDate = endDate + a.require(auditTrailListRequestFieldEndDate) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEventType(eventType *string) { + a.EventType = eventType + a.require(auditTrailListRequestFieldEventType) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(auditTrailListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetStartDate(startDate *string) { + a.StartDate = startDate + a.require(auditTrailListRequestFieldStartDate) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditTrailListRequestFieldUserEmail) +} + +var ( + auditLogEventFieldId = big.NewInt(1 << 0) + auditLogEventFieldUserName = big.NewInt(1 << 1) + auditLogEventFieldUserEmail = big.NewInt(1 << 2) + auditLogEventFieldRole = big.NewInt(1 << 3) + auditLogEventFieldIpAddress = big.NewInt(1 << 4) + auditLogEventFieldEventType = big.NewInt(1 << 5) + auditLogEventFieldEventDescription = big.NewInt(1 << 6) + auditLogEventFieldCreatedAt = big.NewInt(1 << 7) +) + type AuditLogEvent struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The User's full name at the time of this Event occurring. @@ -89,6 +162,9 @@ type AuditLogEvent struct { EventDescription string `json:"event_description" url:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -153,6 +229,69 @@ func (a *AuditLogEvent) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AuditLogEvent) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetId(id *string) { + a.Id = id + a.require(auditLogEventFieldId) +} + +// SetUserName sets the UserName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserName(userName *string) { + a.UserName = userName + a.require(auditLogEventFieldUserName) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditLogEventFieldUserEmail) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetRole(role *AuditLogEventRole) { + a.Role = role + a.require(auditLogEventFieldRole) +} + +// SetIpAddress sets the IpAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetIpAddress(ipAddress string) { + a.IpAddress = ipAddress + a.require(auditLogEventFieldIpAddress) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventType(eventType *AuditLogEventEventType) { + a.EventType = eventType + a.require(auditLogEventFieldEventType) +} + +// SetEventDescription sets the EventDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventDescription(eventDescription string) { + a.EventDescription = eventDescription + a.require(auditLogEventFieldEventDescription) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(auditLogEventFieldCreatedAt) +} + func (a *AuditLogEvent) UnmarshalJSON(data []byte) error { type embed AuditLogEvent var unmarshaler = struct { @@ -184,7 +323,8 @@ func (a *AuditLogEvent) MarshalJSON() ([]byte, error) { embed: embed(*a), CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AuditLogEvent) String() string { @@ -564,11 +704,20 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +var ( + paginatedAuditLogEventListFieldNext = big.NewInt(1 << 0) + paginatedAuditLogEventListFieldPrevious = big.NewInt(1 << 1) + paginatedAuditLogEventListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAuditLogEventList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AuditLogEvent `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -598,6 +747,34 @@ func (p *PaginatedAuditLogEventList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedAuditLogEventList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetNext(next *string) { + p.Next = next + p.require(paginatedAuditLogEventListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAuditLogEventListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetResults(results []*AuditLogEvent) { + p.Results = results + p.require(paginatedAuditLogEventListFieldResults) +} + func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAuditLogEventList var value unmarshaler @@ -614,6 +791,17 @@ func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAuditLogEventList) MarshalJSON() ([]byte, error) { + type embed PaginatedAuditLogEventList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAuditLogEventList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/audittrail/ats_audit_trail_test/ats_audit_trail_test.go b/ats/audittrail/ats_audit_trail_test/ats_audit_trail_test.go new file mode 100644 index 0000000..6ad7341 --- /dev/null +++ b/ats/audittrail/ats_audit_trail_test/ats_audit_trail_test.go @@ -0,0 +1,102 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_audit_trail_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsAuditTrailListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } + _, invocationErr := client.Ats.AuditTrail.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/audit-trail", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "end_date": "end_date", "event_type": "event_type", "page_size": "1", "start_date": "start_date", "user_email": "user_email"}, 1) +} diff --git a/ats/audittrail/client.go b/ats/audittrail/client.go index 047f8e1..84c188b 100644 --- a/ats/audittrail/client.go +++ b/ats/audittrail/client.go @@ -4,7 +4,6 @@ package audittrail import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.AuditTrailListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.AuditLogEvent], error) { +) (*core.Page[*string, *ats.AuditLogEvent], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedAuditLogEventList) *internal.PageResponse[*string, *ats.AuditLogEvent] { + readPageResponse := func(response *ats.PaginatedAuditLogEventList) *core.PageResponse[*string, *ats.AuditLogEvent] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.AuditLogEvent]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.AuditLogEvent]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ats/audittrail/raw_client.go b/ats/audittrail/raw_client.go new file mode 100644 index 0000000..cce0cac --- /dev/null +++ b/ats/audittrail/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package audittrail + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/ats/available_actions.go b/ats/available_actions.go index 1622d35..b6567aa 100644 --- a/ats/available_actions.go +++ b/ats/available_actions.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) // # The AvailableActions Object @@ -14,11 +15,20 @@ import ( // // ### Usage Example // Fetch all the actions available for the `Zenefits` integration. +var ( + availableActionsFieldIntegration = big.NewInt(1 << 0) + availableActionsFieldPassthroughAvailable = big.NewInt(1 << 1) + availableActionsFieldAvailableModelOperations = big.NewInt(1 << 2) +) + type AvailableActions struct { Integration *AccountIntegration `json:"integration" url:"integration"` PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +58,34 @@ func (a *AvailableActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AvailableActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(availableActionsFieldIntegration) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(availableActionsFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(availableActionsFieldAvailableModelOperations) +} + func (a *AvailableActions) UnmarshalJSON(data []byte) error { type unmarshaler AvailableActions var value unmarshaler @@ -64,6 +102,17 @@ func (a *AvailableActions) UnmarshalJSON(data []byte) error { return nil } +func (a *AvailableActions) MarshalJSON() ([]byte, error) { + type embed AvailableActions + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AvailableActions) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/ats/availableactions/ats_available_actions_test/ats_available_actions_test.go b/ats/availableactions/ats_available_actions_test/ats_available_actions_test.go new file mode 100644 index 0000000..c104ccc --- /dev/null +++ b/ats/availableactions/ats_available_actions_test/ats_available_actions_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_available_actions_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsAvailableActionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.AvailableActions.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/available-actions", nil, 1) +} diff --git a/ats/availableactions/client.go b/ats/availableactions/client.go index 12468a5..f40e02b 100644 --- a/ats/availableactions/client.go +++ b/ats/availableactions/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*ats.AvailableActions, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/available-actions" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.AvailableActions - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/availableactions/raw_client.go b/ats/availableactions/raw_client.go new file mode 100644 index 0000000..2d36197 --- /dev/null +++ b/ats/availableactions/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package availableactions + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ats.AvailableActions], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/available-actions" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.AvailableActions + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.AvailableActions]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/candidates.go b/ats/candidates.go index a14e6f3..9360dcc 100644 --- a/ats/candidates.go +++ b/ats/candidates.go @@ -6,9 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + candidateEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + candidateEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + candidateEndpointRequestFieldModel = big.NewInt(1 << 2) + candidateEndpointRequestFieldRemoteUserId = big.NewInt(1 << 3) +) + type CandidateEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` @@ -16,8 +24,64 @@ type CandidateEndpointRequest struct { RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *CandidateRequest `json:"model,omitempty" url:"-"` RemoteUserId string `json:"remote_user_id" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CandidateEndpointRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + c.IsDebugMode = isDebugMode + c.require(candidateEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateEndpointRequest) SetRunAsync(runAsync *bool) { + c.RunAsync = runAsync + c.require(candidateEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateEndpointRequest) SetModel(model *CandidateRequest) { + c.Model = model + c.require(candidateEndpointRequestFieldModel) +} + +// SetRemoteUserId sets the RemoteUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateEndpointRequest) SetRemoteUserId(remoteUserId string) { + c.RemoteUserId = remoteUserId + c.require(candidateEndpointRequestFieldRemoteUserId) } +var ( + candidatesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + candidatesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + candidatesListRequestFieldCursor = big.NewInt(1 << 2) + candidatesListRequestFieldEmailAddresses = big.NewInt(1 << 3) + candidatesListRequestFieldExpand = big.NewInt(1 << 4) + candidatesListRequestFieldFirstName = big.NewInt(1 << 5) + candidatesListRequestFieldIncludeDeletedData = big.NewInt(1 << 6) + candidatesListRequestFieldIncludeRemoteData = big.NewInt(1 << 7) + candidatesListRequestFieldIncludeShellData = big.NewInt(1 << 8) + candidatesListRequestFieldLastName = big.NewInt(1 << 9) + candidatesListRequestFieldModifiedAfter = big.NewInt(1 << 10) + candidatesListRequestFieldModifiedBefore = big.NewInt(1 << 11) + candidatesListRequestFieldPageSize = big.NewInt(1 << 12) + candidatesListRequestFieldRemoteId = big.NewInt(1 << 13) + candidatesListRequestFieldTags = big.NewInt(1 << 14) +) + type CandidatesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -49,8 +113,130 @@ type CandidatesListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // If provided, will only return candidates with these tags; multiple tags can be separated by commas. Tags *string `json:"-" url:"tags,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (c *CandidatesListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(candidatesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(candidatesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(candidatesListRequestFieldCursor) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetEmailAddresses(emailAddresses *string) { + c.EmailAddresses = emailAddresses + c.require(candidatesListRequestFieldEmailAddresses) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetExpand(expand []*CandidatesListRequestExpandItem) { + c.Expand = expand + c.require(candidatesListRequestFieldExpand) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetFirstName(firstName *string) { + c.FirstName = firstName + c.require(candidatesListRequestFieldFirstName) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(candidatesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(candidatesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(candidatesListRequestFieldIncludeShellData) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetLastName(lastName *string) { + c.LastName = lastName + c.require(candidatesListRequestFieldLastName) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(candidatesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(candidatesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(candidatesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(candidatesListRequestFieldRemoteId) +} + +// SetTags sets the Tags field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesListRequest) SetTags(tags *string) { + c.Tags = tags + c.require(candidatesListRequestFieldTags) +} + +var ( + patchedCandidateEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedCandidateEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedCandidateEndpointRequestFieldModel = big.NewInt(1 << 2) + patchedCandidateEndpointRequestFieldRemoteUserId = big.NewInt(1 << 3) +) + type PatchedCandidateEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` @@ -58,8 +244,52 @@ type PatchedCandidateEndpointRequest struct { RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PatchedCandidateRequest `json:"model,omitempty" url:"-"` RemoteUserId string `json:"remote_user_id" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (p *PatchedCandidateEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedCandidateEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedCandidateEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateEndpointRequest) SetModel(model *PatchedCandidateRequest) { + p.Model = model + p.require(patchedCandidateEndpointRequestFieldModel) +} + +// SetRemoteUserId sets the RemoteUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateEndpointRequest) SetRemoteUserId(remoteUserId string) { + p.RemoteUserId = remoteUserId + p.require(patchedCandidateEndpointRequestFieldRemoteUserId) +} + +var ( + candidatesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + candidatesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + candidatesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type CandidatesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*CandidatesRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -67,6 +297,37 @@ type CandidatesRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CandidatesRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesRetrieveRequest) SetExpand(expand []*CandidatesRetrieveRequestExpandItem) { + c.Expand = expand + c.require(candidatesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(candidatesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidatesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(candidatesRetrieveRequestFieldIncludeShellData) } type CandidatesListRequestExpandItem string @@ -118,6 +379,26 @@ func (c CandidatesRetrieveRequestExpandItem) Ptr() *CandidatesRetrieveRequestExp // 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. +var ( + candidateRequestFieldFirstName = big.NewInt(1 << 0) + candidateRequestFieldLastName = big.NewInt(1 << 1) + candidateRequestFieldCompany = big.NewInt(1 << 2) + candidateRequestFieldTitle = big.NewInt(1 << 3) + candidateRequestFieldLastInteractionAt = big.NewInt(1 << 4) + candidateRequestFieldIsPrivate = big.NewInt(1 << 5) + candidateRequestFieldCanEmail = big.NewInt(1 << 6) + candidateRequestFieldLocations = big.NewInt(1 << 7) + candidateRequestFieldPhoneNumbers = big.NewInt(1 << 8) + candidateRequestFieldEmailAddresses = big.NewInt(1 << 9) + candidateRequestFieldUrls = big.NewInt(1 << 10) + candidateRequestFieldTags = big.NewInt(1 << 11) + candidateRequestFieldApplications = big.NewInt(1 << 12) + candidateRequestFieldAttachments = big.NewInt(1 << 13) + candidateRequestFieldRemoteTemplateId = big.NewInt(1 << 14) + candidateRequestFieldIntegrationParams = big.NewInt(1 << 15) + candidateRequestFieldLinkedAccountParams = big.NewInt(1 << 16) +) + type CandidateRequest struct { // The candidate's first name. FirstName *string `json:"first_name,omitempty" url:"first_name,omitempty"` @@ -148,6 +429,9 @@ type CandidateRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -275,6 +559,132 @@ func (c *CandidateRequest) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CandidateRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetFirstName(firstName *string) { + c.FirstName = firstName + c.require(candidateRequestFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetLastName(lastName *string) { + c.LastName = lastName + c.require(candidateRequestFieldLastName) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetCompany(company *string) { + c.Company = company + c.require(candidateRequestFieldCompany) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetTitle(title *string) { + c.Title = title + c.require(candidateRequestFieldTitle) +} + +// SetLastInteractionAt sets the LastInteractionAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetLastInteractionAt(lastInteractionAt *time.Time) { + c.LastInteractionAt = lastInteractionAt + c.require(candidateRequestFieldLastInteractionAt) +} + +// SetIsPrivate sets the IsPrivate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetIsPrivate(isPrivate *bool) { + c.IsPrivate = isPrivate + c.require(candidateRequestFieldIsPrivate) +} + +// SetCanEmail sets the CanEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetCanEmail(canEmail *bool) { + c.CanEmail = canEmail + c.require(candidateRequestFieldCanEmail) +} + +// SetLocations sets the Locations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetLocations(locations []*string) { + c.Locations = locations + c.require(candidateRequestFieldLocations) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetPhoneNumbers(phoneNumbers []*PhoneNumberRequest) { + c.PhoneNumbers = phoneNumbers + c.require(candidateRequestFieldPhoneNumbers) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetEmailAddresses(emailAddresses []*EmailAddressRequest) { + c.EmailAddresses = emailAddresses + c.require(candidateRequestFieldEmailAddresses) +} + +// SetUrls sets the Urls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetUrls(urls []*UrlRequest) { + c.Urls = urls + c.require(candidateRequestFieldUrls) +} + +// SetTags sets the Tags field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetTags(tags []*string) { + c.Tags = tags + c.require(candidateRequestFieldTags) +} + +// SetApplications sets the Applications field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetApplications(applications []*CandidateRequestApplicationsItem) { + c.Applications = applications + c.require(candidateRequestFieldApplications) +} + +// SetAttachments sets the Attachments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetAttachments(attachments []*CandidateRequestAttachmentsItem) { + c.Attachments = attachments + c.require(candidateRequestFieldAttachments) +} + +// SetRemoteTemplateId sets the RemoteTemplateId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetRemoteTemplateId(remoteTemplateId *string) { + c.RemoteTemplateId = remoteTemplateId + c.require(candidateRequestFieldRemoteTemplateId) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + c.IntegrationParams = integrationParams + c.require(candidateRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + c.LinkedAccountParams = linkedAccountParams + c.require(candidateRequestFieldLinkedAccountParams) +} + func (c *CandidateRequest) UnmarshalJSON(data []byte) error { type embed CandidateRequest var unmarshaler = struct { @@ -306,7 +716,8 @@ func (c *CandidateRequest) MarshalJSON() ([]byte, error) { embed: embed(*c), LastInteractionAt: internal.NewOptionalDateTime(c.LastInteractionAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CandidateRequest) String() string { @@ -445,12 +856,22 @@ func (c *CandidateRequestAttachmentsItem) Accept(visitor CandidateRequestAttachm return fmt.Errorf("type %T does not include a non-empty union type", c) } +var ( + candidateResponseFieldModel = big.NewInt(1 << 0) + candidateResponseFieldWarnings = big.NewInt(1 << 1) + candidateResponseFieldErrors = big.NewInt(1 << 2) + candidateResponseFieldLogs = big.NewInt(1 << 3) +) + type CandidateResponse struct { Model *Candidate `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -487,6 +908,41 @@ func (c *CandidateResponse) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CandidateResponse) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateResponse) SetModel(model *Candidate) { + c.Model = model + c.require(candidateResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateResponse) SetWarnings(warnings []*WarningValidationProblem) { + c.Warnings = warnings + c.require(candidateResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateResponse) SetErrors(errors []*ErrorValidationProblem) { + c.Errors = errors + c.require(candidateResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CandidateResponse) SetLogs(logs []*DebugModeLog) { + c.Logs = logs + c.require(candidateResponseFieldLogs) +} + func (c *CandidateResponse) UnmarshalJSON(data []byte) error { type unmarshaler CandidateResponse var value unmarshaler @@ -503,6 +959,17 @@ func (c *CandidateResponse) UnmarshalJSON(data []byte) error { return nil } +func (c *CandidateResponse) MarshalJSON() ([]byte, error) { + type embed CandidateResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CandidateResponse) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -520,6 +987,13 @@ func (c *CandidateResponse) String() string { // 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. +var ( + emailAddressRequestFieldValue = big.NewInt(1 << 0) + emailAddressRequestFieldEmailAddressType = big.NewInt(1 << 1) + emailAddressRequestFieldIntegrationParams = big.NewInt(1 << 2) + emailAddressRequestFieldLinkedAccountParams = big.NewInt(1 << 3) +) + type EmailAddressRequest struct { // The email address. Value *string `json:"value,omitempty" url:"value,omitempty"` @@ -532,6 +1006,9 @@ type EmailAddressRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -568,6 +1045,41 @@ func (e *EmailAddressRequest) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EmailAddressRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddressRequest) SetValue(value *string) { + e.Value = value + e.require(emailAddressRequestFieldValue) +} + +// SetEmailAddressType sets the EmailAddressType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddressRequest) SetEmailAddressType(emailAddressType *EmailAddressRequestEmailAddressType) { + e.EmailAddressType = emailAddressType + e.require(emailAddressRequestFieldEmailAddressType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddressRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + e.IntegrationParams = integrationParams + e.require(emailAddressRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddressRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + e.LinkedAccountParams = linkedAccountParams + e.require(emailAddressRequestFieldLinkedAccountParams) +} + func (e *EmailAddressRequest) UnmarshalJSON(data []byte) error { type unmarshaler EmailAddressRequest var value unmarshaler @@ -584,6 +1096,17 @@ func (e *EmailAddressRequest) UnmarshalJSON(data []byte) error { return nil } +func (e *EmailAddressRequest) MarshalJSON() ([]byte, error) { + type embed EmailAddressRequest + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *EmailAddressRequest) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -663,10 +1186,18 @@ func (e *EmailAddressRequestEmailAddressType) Accept(visitor EmailAddressRequest return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + ignoreCommonModelRequestFieldReason = big.NewInt(1 << 0) + ignoreCommonModelRequestFieldMessage = big.NewInt(1 << 1) +) + type IgnoreCommonModelRequest struct { Reason *IgnoreCommonModelRequestReason `json:"reason" url:"reason"` Message *string `json:"message,omitempty" url:"message,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -689,6 +1220,27 @@ func (i *IgnoreCommonModelRequest) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *IgnoreCommonModelRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IgnoreCommonModelRequest) SetReason(reason *IgnoreCommonModelRequestReason) { + i.Reason = reason + i.require(ignoreCommonModelRequestFieldReason) +} + +// SetMessage sets the Message field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IgnoreCommonModelRequest) SetMessage(message *string) { + i.Message = message + i.require(ignoreCommonModelRequestFieldMessage) +} + func (i *IgnoreCommonModelRequest) UnmarshalJSON(data []byte) error { type unmarshaler IgnoreCommonModelRequest var value unmarshaler @@ -705,6 +1257,17 @@ func (i *IgnoreCommonModelRequest) UnmarshalJSON(data []byte) error { return nil } +func (i *IgnoreCommonModelRequest) MarshalJSON() ([]byte, error) { + type embed IgnoreCommonModelRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IgnoreCommonModelRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -779,11 +1342,20 @@ func (i *IgnoreCommonModelRequestReason) Accept(visitor IgnoreCommonModelRequest return fmt.Errorf("type %T does not include a non-empty union type", i) } +var ( + paginatedCandidateListFieldNext = big.NewInt(1 << 0) + paginatedCandidateListFieldPrevious = big.NewInt(1 << 1) + paginatedCandidateListFieldResults = big.NewInt(1 << 2) +) + type PaginatedCandidateList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Candidate `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -813,6 +1385,34 @@ func (p *PaginatedCandidateList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedCandidateList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCandidateList) SetNext(next *string) { + p.Next = next + p.require(paginatedCandidateListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCandidateList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedCandidateListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCandidateList) SetResults(results []*Candidate) { + p.Results = results + p.require(paginatedCandidateListFieldResults) +} + func (p *PaginatedCandidateList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedCandidateList var value unmarshaler @@ -829,6 +1429,17 @@ func (p *PaginatedCandidateList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedCandidateList) MarshalJSON() ([]byte, error) { + type embed PaginatedCandidateList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedCandidateList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -846,6 +1457,26 @@ func (p *PaginatedCandidateList) String() string { // 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. +var ( + patchedCandidateRequestFieldFirstName = big.NewInt(1 << 0) + patchedCandidateRequestFieldLastName = big.NewInt(1 << 1) + patchedCandidateRequestFieldCompany = big.NewInt(1 << 2) + patchedCandidateRequestFieldTitle = big.NewInt(1 << 3) + patchedCandidateRequestFieldLastInteractionAt = big.NewInt(1 << 4) + patchedCandidateRequestFieldIsPrivate = big.NewInt(1 << 5) + patchedCandidateRequestFieldCanEmail = big.NewInt(1 << 6) + patchedCandidateRequestFieldLocations = big.NewInt(1 << 7) + patchedCandidateRequestFieldPhoneNumbers = big.NewInt(1 << 8) + patchedCandidateRequestFieldEmailAddresses = big.NewInt(1 << 9) + patchedCandidateRequestFieldUrls = big.NewInt(1 << 10) + patchedCandidateRequestFieldTags = big.NewInt(1 << 11) + patchedCandidateRequestFieldApplications = big.NewInt(1 << 12) + patchedCandidateRequestFieldAttachments = big.NewInt(1 << 13) + patchedCandidateRequestFieldRemoteTemplateId = big.NewInt(1 << 14) + patchedCandidateRequestFieldIntegrationParams = big.NewInt(1 << 15) + patchedCandidateRequestFieldLinkedAccountParams = big.NewInt(1 << 16) +) + type PatchedCandidateRequest struct { // The candidate's first name. FirstName *string `json:"first_name,omitempty" url:"first_name,omitempty"` @@ -876,6 +1507,9 @@ type PatchedCandidateRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1003,6 +1637,132 @@ func (p *PatchedCandidateRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PatchedCandidateRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetFirstName(firstName *string) { + p.FirstName = firstName + p.require(patchedCandidateRequestFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetLastName(lastName *string) { + p.LastName = lastName + p.require(patchedCandidateRequestFieldLastName) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetCompany(company *string) { + p.Company = company + p.require(patchedCandidateRequestFieldCompany) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetTitle(title *string) { + p.Title = title + p.require(patchedCandidateRequestFieldTitle) +} + +// SetLastInteractionAt sets the LastInteractionAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetLastInteractionAt(lastInteractionAt *time.Time) { + p.LastInteractionAt = lastInteractionAt + p.require(patchedCandidateRequestFieldLastInteractionAt) +} + +// SetIsPrivate sets the IsPrivate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetIsPrivate(isPrivate *bool) { + p.IsPrivate = isPrivate + p.require(patchedCandidateRequestFieldIsPrivate) +} + +// SetCanEmail sets the CanEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetCanEmail(canEmail *bool) { + p.CanEmail = canEmail + p.require(patchedCandidateRequestFieldCanEmail) +} + +// SetLocations sets the Locations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetLocations(locations []*string) { + p.Locations = locations + p.require(patchedCandidateRequestFieldLocations) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetPhoneNumbers(phoneNumbers []*PhoneNumberRequest) { + p.PhoneNumbers = phoneNumbers + p.require(patchedCandidateRequestFieldPhoneNumbers) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetEmailAddresses(emailAddresses []*EmailAddressRequest) { + p.EmailAddresses = emailAddresses + p.require(patchedCandidateRequestFieldEmailAddresses) +} + +// SetUrls sets the Urls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetUrls(urls []*UrlRequest) { + p.Urls = urls + p.require(patchedCandidateRequestFieldUrls) +} + +// SetTags sets the Tags field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetTags(tags []*string) { + p.Tags = tags + p.require(patchedCandidateRequestFieldTags) +} + +// SetApplications sets the Applications field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetApplications(applications []*string) { + p.Applications = applications + p.require(patchedCandidateRequestFieldApplications) +} + +// SetAttachments sets the Attachments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetAttachments(attachments []*string) { + p.Attachments = attachments + p.require(patchedCandidateRequestFieldAttachments) +} + +// SetRemoteTemplateId sets the RemoteTemplateId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetRemoteTemplateId(remoteTemplateId *string) { + p.RemoteTemplateId = remoteTemplateId + p.require(patchedCandidateRequestFieldRemoteTemplateId) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(patchedCandidateRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCandidateRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(patchedCandidateRequestFieldLinkedAccountParams) +} + func (p *PatchedCandidateRequest) UnmarshalJSON(data []byte) error { type embed PatchedCandidateRequest var unmarshaler = struct { @@ -1034,7 +1794,8 @@ func (p *PatchedCandidateRequest) MarshalJSON() ([]byte, error) { embed: embed(*p), LastInteractionAt: internal.NewOptionalDateTime(p.LastInteractionAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PatchedCandidateRequest) String() string { @@ -1054,6 +1815,13 @@ func (p *PatchedCandidateRequest) String() string { // 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. +var ( + phoneNumberRequestFieldValue = big.NewInt(1 << 0) + phoneNumberRequestFieldPhoneNumberType = big.NewInt(1 << 1) + phoneNumberRequestFieldIntegrationParams = big.NewInt(1 << 2) + phoneNumberRequestFieldLinkedAccountParams = big.NewInt(1 << 3) +) + type PhoneNumberRequest struct { // The phone number. Value *string `json:"value,omitempty" url:"value,omitempty"` @@ -1068,6 +1836,9 @@ type PhoneNumberRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1104,6 +1875,41 @@ func (p *PhoneNumberRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PhoneNumberRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumberRequest) SetValue(value *string) { + p.Value = value + p.require(phoneNumberRequestFieldValue) +} + +// SetPhoneNumberType sets the PhoneNumberType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumberRequest) SetPhoneNumberType(phoneNumberType *PhoneNumberRequestPhoneNumberType) { + p.PhoneNumberType = phoneNumberType + p.require(phoneNumberRequestFieldPhoneNumberType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumberRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(phoneNumberRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumberRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(phoneNumberRequestFieldLinkedAccountParams) +} + func (p *PhoneNumberRequest) UnmarshalJSON(data []byte) error { type unmarshaler PhoneNumberRequest var value unmarshaler @@ -1120,6 +1926,17 @@ func (p *PhoneNumberRequest) UnmarshalJSON(data []byte) error { return nil } +func (p *PhoneNumberRequest) MarshalJSON() ([]byte, error) { + type embed PhoneNumberRequest + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PhoneNumberRequest) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -1234,6 +2051,13 @@ func (r ReasonEnum) Ptr() *ReasonEnum { // 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. +var ( + urlRequestFieldValue = big.NewInt(1 << 0) + urlRequestFieldUrlType = big.NewInt(1 << 1) + urlRequestFieldIntegrationParams = big.NewInt(1 << 2) + urlRequestFieldLinkedAccountParams = big.NewInt(1 << 3) +) + type UrlRequest struct { // The site's url. Value *string `json:"value,omitempty" url:"value,omitempty"` @@ -1250,6 +2074,9 @@ type UrlRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1286,6 +2113,41 @@ func (u *UrlRequest) GetExtraProperties() map[string]interface{} { return u.extraProperties } +func (u *UrlRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UrlRequest) SetValue(value *string) { + u.Value = value + u.require(urlRequestFieldValue) +} + +// SetUrlType sets the UrlType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UrlRequest) SetUrlType(urlType *UrlRequestUrlType) { + u.UrlType = urlType + u.require(urlRequestFieldUrlType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UrlRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + u.IntegrationParams = integrationParams + u.require(urlRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UrlRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + u.LinkedAccountParams = linkedAccountParams + u.require(urlRequestFieldLinkedAccountParams) +} + func (u *UrlRequest) UnmarshalJSON(data []byte) error { type unmarshaler UrlRequest var value unmarshaler @@ -1302,6 +2164,17 @@ func (u *UrlRequest) UnmarshalJSON(data []byte) error { return nil } +func (u *UrlRequest) MarshalJSON() ([]byte, error) { + type embed UrlRequest + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (u *UrlRequest) String() string { if len(u.rawJSON) > 0 { if value, err := internal.StringifyJSON(u.rawJSON); err == nil { diff --git a/ats/candidates/ats_candidates_test/ats_candidates_test.go b/ats/candidates/ats_candidates_test/ats_candidates_test.go new file mode 100644 index 0000000..a0ce2c3 --- /dev/null +++ b/ats/candidates/ats_candidates_test/ats_candidates_test.go @@ -0,0 +1,283 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_candidates_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsCandidatesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.CandidatesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddresses: merge.String( + "email_addresses", + ), + FirstName: merge.String( + "first_name", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + LastName: merge.String( + "last_name", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Tags: merge.String( + "tags", + ), + } + _, invocationErr := client.Ats.Candidates.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/candidates", map[string]string{"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"}, 1) +} + +func TestAtsCandidatesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.CandidateEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.CandidateRequest{}, + RemoteUserId: "remote_user_id", + } + _, invocationErr := client.Ats.Candidates.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/candidates", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAtsCandidatesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.CandidatesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Candidates.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/candidates/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestAtsCandidatesPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.PatchedCandidateEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.PatchedCandidateRequest{}, + RemoteUserId: "remote_user_id", + } + _, invocationErr := client.Ats.Candidates.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/ats/v1/candidates/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAtsCandidatesIgnoreCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.IgnoreCommonModelRequest{ + Reason: &ats.IgnoreCommonModelRequestReason{ + ReasonEnum: ats.ReasonEnumGeneralCustomerRequest, + }, + } + invocationErr := client.Ats.Candidates.IgnoreCreate( + context.TODO(), + "model_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/candidates/ignore/model_id", nil, 1) +} + +func TestAtsCandidatesMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.Candidates.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/candidates/meta/patch/id", nil, 1) +} + +func TestAtsCandidatesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.Candidates.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/candidates/meta/post", nil, 1) +} diff --git a/ats/candidates/client.go b/ats/candidates/client.go index 6b1c6cd..605d57f 100644 --- a/ats/candidates/client.go +++ b/ats/candidates/client.go @@ -4,7 +4,6 @@ package candidates import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.CandidatesListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Candidate], error) { +) (*core.Page[*string, *ats.Candidate], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedCandidateList) *internal.PageResponse[*string, *ats.Candidate] { + readPageResponse := func(response *ats.PaginatedCandidateList) *core.PageResponse[*string, *ats.Candidate] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Candidate]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Candidate]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *ats.CandidateEndpointRequest, opts ...option.RequestOption, ) (*ats.CandidateResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ats/v1/candidates" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.CandidateResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Candidate` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *ats.CandidatesRetrieveRequest, opts ...option.RequestOption, ) (*ats.Candidate, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/candidates/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Candidate - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates a `Candidate` object with the given `id`. @@ -192,47 +134,16 @@ func (c *Client) PartialUpdate( request *ats.PatchedCandidateEndpointRequest, opts ...option.RequestOption, ) (*ats.CandidateResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/candidates/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.CandidateResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -242,35 +153,13 @@ func (c *Client) IgnoreCreate( request *ats.IgnoreCommonModelRequest, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/candidates/ignore/%v", + _, err := c.WithRawResponse.IgnoreCreate( + ctx, modelId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - }, - ); err != nil { + if err != nil { return err } return nil @@ -282,38 +171,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*ats.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/candidates/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `Candidate` POSTs. @@ -321,33 +187,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ats.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/candidates/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/candidates/raw_client.go b/ats/candidates/raw_client.go new file mode 100644 index 0000000..473fb9d --- /dev/null +++ b/ats/candidates/raw_client.go @@ -0,0 +1,309 @@ +// Code generated by Fern. DO NOT EDIT. + +package candidates + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.CandidateEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.CandidateResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/candidates" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.CandidateResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.CandidateResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.CandidatesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Candidate], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/candidates/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Candidate + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Candidate]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *ats.PatchedCandidateEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.CandidateResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/candidates/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.CandidateResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.CandidateResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) IgnoreCreate( + ctx context.Context, + modelId string, + request *ats.IgnoreCommonModelRequest, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/candidates/ignore/%v", + modelId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*ats.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/candidates/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ats.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/candidates/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/client/client.go b/ats/client/client.go index 6b44413..7b4b85f 100644 --- a/ats/client/client.go +++ b/ats/client/client.go @@ -38,15 +38,9 @@ import ( webhookreceivers "github.com/merge-api/merge-go-client/v2/ats/webhookreceivers" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" - option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { - baseURL string - caller *internal.Caller - header http.Header - AccountDetails *accountdetails.Client AccountToken *accounttoken.Client Activities *activities.Client @@ -80,51 +74,54 @@ type Client struct { Tags *tags.Client Users *users.Client WebhookReceivers *webhookreceivers.Client + + options *core.RequestOptions + baseURL string + caller *internal.Caller } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + AccountDetails: accountdetails.NewClient(options), + AccountToken: accounttoken.NewClient(options), + Activities: activities.NewClient(options), + Applications: applications.NewClient(options), + AsyncPassthrough: asyncpassthrough.NewClient(options), + Attachments: attachments.NewClient(options), + AuditTrail: audittrail.NewClient(options), + AvailableActions: availableactions.NewClient(options), + Candidates: candidates.NewClient(options), + Scopes: scopes.NewClient(options), + DeleteAccount: deleteaccount.NewClient(options), + Departments: departments.NewClient(options), + Eeocs: eeocs.NewClient(options), + FieldMapping: fieldmapping.NewClient(options), + GenerateKey: generatekey.NewClient(options), + Interviews: interviews.NewClient(options), + Issues: issues.NewClient(options), + JobInterviewStages: jobinterviewstages.NewClient(options), + JobPostings: jobpostings.NewClient(options), + Jobs: jobs.NewClient(options), + LinkToken: linktoken.NewClient(options), + LinkedAccounts: linkedaccounts.NewClient(options), + Offers: offers.NewClient(options), + Offices: offices.NewClient(options), + Passthrough: passthrough.NewClient(options), + RegenerateKey: regeneratekey.NewClient(options), + RejectReasons: rejectreasons.NewClient(options), + Scorecards: scorecards.NewClient(options), + SyncStatus: syncstatus.NewClient(options), + ForceResync: forceresync.NewClient(options), + Tags: tags.NewClient(options), + Users: users.NewClient(options), + WebhookReceivers: webhookreceivers.NewClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), - AccountDetails: accountdetails.NewClient(opts...), - AccountToken: accounttoken.NewClient(opts...), - Activities: activities.NewClient(opts...), - Applications: applications.NewClient(opts...), - AsyncPassthrough: asyncpassthrough.NewClient(opts...), - Attachments: attachments.NewClient(opts...), - AuditTrail: audittrail.NewClient(opts...), - AvailableActions: availableactions.NewClient(opts...), - Candidates: candidates.NewClient(opts...), - Scopes: scopes.NewClient(opts...), - DeleteAccount: deleteaccount.NewClient(opts...), - Departments: departments.NewClient(opts...), - Eeocs: eeocs.NewClient(opts...), - FieldMapping: fieldmapping.NewClient(opts...), - GenerateKey: generatekey.NewClient(opts...), - Interviews: interviews.NewClient(opts...), - Issues: issues.NewClient(opts...), - JobInterviewStages: jobinterviewstages.NewClient(opts...), - JobPostings: jobpostings.NewClient(opts...), - Jobs: jobs.NewClient(opts...), - LinkToken: linktoken.NewClient(opts...), - LinkedAccounts: linkedaccounts.NewClient(opts...), - Offers: offers.NewClient(opts...), - Offices: offices.NewClient(opts...), - Passthrough: passthrough.NewClient(opts...), - RegenerateKey: regeneratekey.NewClient(opts...), - RejectReasons: rejectreasons.NewClient(opts...), - Scorecards: scorecards.NewClient(opts...), - SyncStatus: syncstatus.NewClient(opts...), - ForceResync: forceresync.NewClient(opts...), - Tags: tags.NewClient(opts...), - Users: users.NewClient(opts...), - WebhookReceivers: webhookreceivers.NewClient(opts...), } } diff --git a/ats/deleteaccount/ats_delete_account_test/ats_delete_account_test.go b/ats/deleteaccount/ats_delete_account_test/ats_delete_account_test.go new file mode 100644 index 0000000..fac4838 --- /dev/null +++ b/ats/deleteaccount/ats_delete_account_test/ats_delete_account_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_delete_account_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsDeleteAccountDeleteWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + invocationErr := client.Ats.DeleteAccount.Delete( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/delete-account", nil, 1) +} diff --git a/ats/deleteaccount/client.go b/ats/deleteaccount/client.go index 718d73c..9f2d80e 100644 --- a/ats/deleteaccount/client.go +++ b/ats/deleteaccount/client.go @@ -7,26 +7,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -35,30 +36,11 @@ func (c *Client) Delete( ctx context.Context, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/delete-account" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - if err := c.caller.Call( + _, err := c.WithRawResponse.Delete( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - }, - ); err != nil { + opts..., + ) + if err != nil { return err } return nil diff --git a/ats/deleteaccount/raw_client.go b/ats/deleteaccount/raw_client.go new file mode 100644 index 0000000..6733db4 --- /dev/null +++ b/ats/deleteaccount/raw_client.go @@ -0,0 +1,67 @@ +// Code generated by Fern. DO NOT EDIT. + +package deleteaccount + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Delete( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/delete-account" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} diff --git a/ats/departments.go b/ats/departments.go index 79c58cb..939b5c8 100644 --- a/ats/departments.go +++ b/ats/departments.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + departmentsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + departmentsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + departmentsListRequestFieldCursor = big.NewInt(1 << 2) + departmentsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + departmentsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + departmentsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + departmentsListRequestFieldModifiedAfter = big.NewInt(1 << 6) + departmentsListRequestFieldModifiedBefore = big.NewInt(1 << 7) + departmentsListRequestFieldPageSize = big.NewInt(1 << 8) + departmentsListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type DepartmentsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,20 +44,138 @@ type DepartmentsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (d *DepartmentsListRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetCreatedAfter(createdAfter *time.Time) { + d.CreatedAfter = createdAfter + d.require(departmentsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetCreatedBefore(createdBefore *time.Time) { + d.CreatedBefore = createdBefore + d.require(departmentsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetCursor(cursor *string) { + d.Cursor = cursor + d.require(departmentsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + d.IncludeDeletedData = includeDeletedData + d.require(departmentsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + d.IncludeRemoteData = includeRemoteData + d.require(departmentsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetIncludeShellData(includeShellData *bool) { + d.IncludeShellData = includeShellData + d.require(departmentsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + d.ModifiedAfter = modifiedAfter + d.require(departmentsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + d.ModifiedBefore = modifiedBefore + d.require(departmentsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetPageSize(pageSize *int) { + d.PageSize = pageSize + d.require(departmentsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsListRequest) SetRemoteId(remoteId *string) { + d.RemoteId = remoteId + d.require(departmentsListRequestFieldRemoteId) } +var ( + departmentsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + departmentsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type DepartmentsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (d *DepartmentsRetrieveRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + d.IncludeRemoteData = includeRemoteData + d.require(departmentsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DepartmentsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + d.IncludeShellData = includeShellData + d.require(departmentsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedDepartmentListFieldNext = big.NewInt(1 << 0) + paginatedDepartmentListFieldPrevious = big.NewInt(1 << 1) + paginatedDepartmentListFieldResults = big.NewInt(1 << 2) +) + type PaginatedDepartmentList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Department `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -73,6 +205,34 @@ func (p *PaginatedDepartmentList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedDepartmentList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDepartmentList) SetNext(next *string) { + p.Next = next + p.require(paginatedDepartmentListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDepartmentList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedDepartmentListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDepartmentList) SetResults(results []*Department) { + p.Results = results + p.require(paginatedDepartmentListFieldResults) +} + func (p *PaginatedDepartmentList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedDepartmentList var value unmarshaler @@ -89,6 +249,17 @@ func (p *PaginatedDepartmentList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedDepartmentList) MarshalJSON() ([]byte, error) { + type embed PaginatedDepartmentList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedDepartmentList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/departments/ats_departments_test/ats_departments_test.go b/ats/departments/ats_departments_test/ats_departments_test.go new file mode 100644 index 0000000..086abfe --- /dev/null +++ b/ats/departments/ats_departments_test/ats_departments_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_departments_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsDepartmentsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.DepartmentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.Departments.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/departments", map[string]string{"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"}, 1) +} + +func TestAtsDepartmentsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.DepartmentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Departments.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/departments/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ats/departments/client.go b/ats/departments/client.go index 347fe5c..0496415 100644 --- a/ats/departments/client.go +++ b/ats/departments/client.go @@ -4,7 +4,6 @@ package departments import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.DepartmentsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Department], error) { +) (*core.Page[*string, *ats.Department], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedDepartmentList) *internal.PageResponse[*string, *ats.Department] { + readPageResponse := func(response *ats.PaginatedDepartmentList) *core.PageResponse[*string, *ats.Department] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Department]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Department]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ats.DepartmentsRetrieveRequest, opts ...option.RequestOption, ) (*ats.Department, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/departments/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Department - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/departments/raw_client.go b/ats/departments/raw_client.go new file mode 100644 index 0000000..35c1b50 --- /dev/null +++ b/ats/departments/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package departments + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.DepartmentsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Department], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/departments/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Department + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Department]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/eeocs.go b/ats/eeocs.go index 4eb6602..bd1d7a6 100644 --- a/ats/eeocs.go +++ b/ats/eeocs.go @@ -6,9 +6,27 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + eeocsListRequestFieldCandidateId = big.NewInt(1 << 0) + eeocsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + eeocsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + eeocsListRequestFieldCursor = big.NewInt(1 << 3) + eeocsListRequestFieldExpand = big.NewInt(1 << 4) + eeocsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + eeocsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + eeocsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + eeocsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + eeocsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + eeocsListRequestFieldPageSize = big.NewInt(1 << 10) + eeocsListRequestFieldRemoteFields = big.NewInt(1 << 11) + eeocsListRequestFieldRemoteId = big.NewInt(1 << 12) + eeocsListRequestFieldShowEnumOrigins = big.NewInt(1 << 13) +) + type EeocsListRequest struct { // If provided, will only return EEOC info for this candidate. CandidateId *string `json:"-" url:"candidate_id,omitempty"` @@ -38,8 +56,124 @@ type EeocsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *EeocsListRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EeocsListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCandidateId sets the CandidateId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetCandidateId(candidateId *string) { + e.CandidateId = candidateId + e.require(eeocsListRequestFieldCandidateId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetCreatedAfter(createdAfter *time.Time) { + e.CreatedAfter = createdAfter + e.require(eeocsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetCreatedBefore(createdBefore *time.Time) { + e.CreatedBefore = createdBefore + e.require(eeocsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(eeocsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetExpand(expand []*string) { + e.Expand = expand + e.require(eeocsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(eeocsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(eeocsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(eeocsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + e.ModifiedAfter = modifiedAfter + e.require(eeocsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + e.ModifiedBefore = modifiedBefore + e.require(eeocsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(eeocsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetRemoteFields(remoteFields *EeocsListRequestRemoteFields) { + e.RemoteFields = remoteFields + e.require(eeocsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(eeocsListRequestFieldRemoteId) } +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsListRequest) SetShowEnumOrigins(showEnumOrigins *EeocsListRequestShowEnumOrigins) { + e.ShowEnumOrigins = showEnumOrigins + e.require(eeocsListRequestFieldShowEnumOrigins) +} + +var ( + eeocsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + eeocsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + eeocsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + eeocsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + eeocsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type EeocsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -51,6 +185,51 @@ type EeocsRetrieveRequest struct { RemoteFields *EeocsRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *EeocsRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EeocsRetrieveRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsRetrieveRequest) SetExpand(expand []*string) { + e.Expand = expand + e.require(eeocsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(eeocsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(eeocsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsRetrieveRequest) SetRemoteFields(remoteFields *EeocsRetrieveRequestRemoteFields) { + e.RemoteFields = remoteFields + e.require(eeocsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EeocsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *EeocsRetrieveRequestShowEnumOrigins) { + e.ShowEnumOrigins = showEnumOrigins + e.require(eeocsRetrieveRequestFieldShowEnumOrigins) } type EeocsListRequestRemoteFields string @@ -330,6 +509,22 @@ func (d DisabilityStatusEnum) Ptr() *DisabilityStatusEnum { // 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. +var ( + eeocFieldId = big.NewInt(1 << 0) + eeocFieldRemoteId = big.NewInt(1 << 1) + eeocFieldCreatedAt = big.NewInt(1 << 2) + eeocFieldModifiedAt = big.NewInt(1 << 3) + eeocFieldCandidate = big.NewInt(1 << 4) + eeocFieldSubmittedAt = big.NewInt(1 << 5) + eeocFieldRace = big.NewInt(1 << 6) + eeocFieldGender = big.NewInt(1 << 7) + eeocFieldVeteranStatus = big.NewInt(1 << 8) + eeocFieldDisabilityStatus = big.NewInt(1 << 9) + eeocFieldRemoteWasDeleted = big.NewInt(1 << 10) + eeocFieldFieldMappings = big.NewInt(1 << 11) + eeocFieldRemoteData = big.NewInt(1 << 12) +) + type Eeoc struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -378,6 +573,9 @@ type Eeoc struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -477,6 +675,104 @@ func (e *Eeoc) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *Eeoc) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetId(id *string) { + e.Id = id + e.require(eeocFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(eeocFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(eeocFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(eeocFieldModifiedAt) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetCandidate(candidate *EeocCandidate) { + e.Candidate = candidate + e.require(eeocFieldCandidate) +} + +// SetSubmittedAt sets the SubmittedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetSubmittedAt(submittedAt *time.Time) { + e.SubmittedAt = submittedAt + e.require(eeocFieldSubmittedAt) +} + +// SetRace sets the Race field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetRace(race *EeocRace) { + e.Race = race + e.require(eeocFieldRace) +} + +// SetGender sets the Gender field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetGender(gender *EeocGender) { + e.Gender = gender + e.require(eeocFieldGender) +} + +// SetVeteranStatus sets the VeteranStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetVeteranStatus(veteranStatus *EeocVeteranStatus) { + e.VeteranStatus = veteranStatus + e.require(eeocFieldVeteranStatus) +} + +// SetDisabilityStatus sets the DisabilityStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetDisabilityStatus(disabilityStatus *EeocDisabilityStatus) { + e.DisabilityStatus = disabilityStatus + e.require(eeocFieldDisabilityStatus) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(eeocFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetFieldMappings(fieldMappings map[string]interface{}) { + e.FieldMappings = fieldMappings + e.require(eeocFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Eeoc) SetRemoteData(remoteData []*RemoteData) { + e.RemoteData = remoteData + e.require(eeocFieldRemoteData) +} + func (e *Eeoc) UnmarshalJSON(data []byte) error { type embed Eeoc var unmarshaler = struct { @@ -516,7 +812,8 @@ func (e *Eeoc) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(e.ModifiedAt), SubmittedAt: internal.NewOptionalDateTime(e.SubmittedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *Eeoc) String() string { @@ -905,11 +1202,20 @@ func (g GenderEnum) Ptr() *GenderEnum { return &g } +var ( + paginatedEeocListFieldNext = big.NewInt(1 << 0) + paginatedEeocListFieldPrevious = big.NewInt(1 << 1) + paginatedEeocListFieldResults = big.NewInt(1 << 2) +) + type PaginatedEeocList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Eeoc `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -939,6 +1245,34 @@ func (p *PaginatedEeocList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedEeocList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEeocList) SetNext(next *string) { + p.Next = next + p.require(paginatedEeocListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEeocList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedEeocListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEeocList) SetResults(results []*Eeoc) { + p.Results = results + p.require(paginatedEeocListFieldResults) +} + func (p *PaginatedEeocList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedEeocList var value unmarshaler @@ -955,6 +1289,17 @@ func (p *PaginatedEeocList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedEeocList) MarshalJSON() ([]byte, error) { + type embed PaginatedEeocList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedEeocList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/eeocs/ats_eeocs_test/ats_eeocs_test.go b/ats/eeocs/ats_eeocs_test/ats_eeocs_test.go new file mode 100644 index 0000000..6dc2522 --- /dev/null +++ b/ats/eeocs/ats_eeocs_test/ats_eeocs_test.go @@ -0,0 +1,157 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_eeocs_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsEeocsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.EeocsListRequest{ + CandidateId: merge.String( + "candidate_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: ats.EeocsListRequestRemoteFieldsDisabilityStatus.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: ats.EeocsListRequestShowEnumOriginsDisabilityStatus.Ptr(), + } + _, invocationErr := client.Ats.Eeocs.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/eeocs", map[string]string{"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"}, 1) +} + +func TestAtsEeocsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.EeocsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: ats.EeocsRetrieveRequestRemoteFieldsDisabilityStatus.Ptr(), + ShowEnumOrigins: ats.EeocsRetrieveRequestShowEnumOriginsDisabilityStatus.Ptr(), + } + _, invocationErr := client.Ats.Eeocs.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/eeocs/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "disability_status", "show_enum_origins": "disability_status"}, 1) +} diff --git a/ats/eeocs/client.go b/ats/eeocs/client.go index 270b1d2..3c5e48e 100644 --- a/ats/eeocs/client.go +++ b/ats/eeocs/client.go @@ -4,7 +4,6 @@ package eeocs import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.EeocsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Eeoc], error) { +) (*core.Page[*string, *ats.Eeoc], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedEeocList) *internal.PageResponse[*string, *ats.Eeoc] { + readPageResponse := func(response *ats.PaginatedEeocList) *core.PageResponse[*string, *ats.Eeoc] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Eeoc]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Eeoc]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ats.EeocsRetrieveRequest, opts ...option.RequestOption, ) (*ats.Eeoc, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/eeocs/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Eeoc - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/eeocs/raw_client.go b/ats/eeocs/raw_client.go new file mode 100644 index 0000000..4483bf0 --- /dev/null +++ b/ats/eeocs/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package eeocs + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.EeocsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Eeoc], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/eeocs/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Eeoc + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Eeoc]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/field_mapping.go b/ats/field_mapping.go index c67269f..62da15f 100644 --- a/ats/field_mapping.go +++ b/ats/field_mapping.go @@ -6,6 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + createFieldMappingRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) + createFieldMappingRequestFieldTargetFieldName = big.NewInt(1 << 1) + createFieldMappingRequestFieldTargetFieldDescription = big.NewInt(1 << 2) + createFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 3) + createFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 4) + createFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 5) + createFieldMappingRequestFieldCommonModelName = big.NewInt(1 << 6) ) type CreateFieldMappingRequest struct { @@ -23,8 +34,73 @@ type CreateFieldMappingRequest struct { RemoteUrlPath string `json:"remote_url_path" url:"-"` // The name of the Common Model that the remote field corresponds to in a given category. CommonModelName string `json:"common_model_name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreateFieldMappingRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) } +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + c.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + c.require(createFieldMappingRequestFieldExcludeRemoteFieldMetadata) +} + +// SetTargetFieldName sets the TargetFieldName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldName(targetFieldName string) { + c.TargetFieldName = targetFieldName + c.require(createFieldMappingRequestFieldTargetFieldName) +} + +// SetTargetFieldDescription sets the TargetFieldDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldDescription(targetFieldDescription string) { + c.TargetFieldDescription = targetFieldDescription + c.require(createFieldMappingRequestFieldTargetFieldDescription) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + c.RemoteFieldTraversalPath = remoteFieldTraversalPath + c.require(createFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteMethod(remoteMethod string) { + c.RemoteMethod = remoteMethod + c.require(createFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath string) { + c.RemoteUrlPath = remoteUrlPath + c.require(createFieldMappingRequestFieldRemoteUrlPath) +} + +// SetCommonModelName sets the CommonModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetCommonModelName(commonModelName string) { + c.CommonModelName = commonModelName + c.require(createFieldMappingRequestFieldCommonModelName) +} + +var ( + patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 0) + patchedEditFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 1) + patchedEditFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 2) +) + type PatchedEditFieldMappingRequest struct { // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty" url:"-"` @@ -32,20 +108,110 @@ type PatchedEditFieldMappingRequest struct { RemoteMethod *string `json:"remote_method,omitempty" url:"-"` // The path of the remote endpoint where the remote field is coming from. RemoteUrlPath *string `json:"remote_url_path,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedEditFieldMappingRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + p.RemoteFieldTraversalPath = remoteFieldTraversalPath + p.require(patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteMethod(remoteMethod *string) { + p.RemoteMethod = remoteMethod + p.require(patchedEditFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath *string) { + p.RemoteUrlPath = remoteUrlPath + p.require(patchedEditFieldMappingRequestFieldRemoteUrlPath) } +var ( + fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) +) + type FieldMappingsRetrieveRequest struct { // 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. ExcludeRemoteFieldMetadata *bool `json:"-" url:"exclude_remote_field_metadata,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FieldMappingsRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) } +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingsRetrieveRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + f.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + f.require(fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata) +} + +var ( + remoteFieldsRetrieveRequestFieldCommonModels = big.NewInt(1 << 0) + remoteFieldsRetrieveRequestFieldIncludeExampleValues = big.NewInt(1 << 1) +) + type RemoteFieldsRetrieveRequest struct { // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. CommonModels *string `json:"-" url:"common_models,omitempty"` // 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. IncludeExampleValues *string `json:"-" url:"include_example_values,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteFieldsRetrieveRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) } +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetCommonModels(commonModels *string) { + r.CommonModels = commonModels + r.require(remoteFieldsRetrieveRequestFieldCommonModels) +} + +// SetIncludeExampleValues sets the IncludeExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetIncludeExampleValues(includeExampleValues *string) { + r.IncludeExampleValues = includeExampleValues + r.require(remoteFieldsRetrieveRequestFieldIncludeExampleValues) +} + +var ( + advancedMetadataFieldId = big.NewInt(1 << 0) + advancedMetadataFieldDisplayName = big.NewInt(1 << 1) + advancedMetadataFieldDescription = big.NewInt(1 << 2) + advancedMetadataFieldIsRequired = big.NewInt(1 << 3) + advancedMetadataFieldIsCustom = big.NewInt(1 << 4) + advancedMetadataFieldFieldChoices = big.NewInt(1 << 5) +) + type AdvancedMetadata struct { Id string `json:"id" url:"id"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` @@ -54,6 +220,9 @@ type AdvancedMetadata struct { IsCustom *bool `json:"is_custom,omitempty" url:"is_custom,omitempty"` FieldChoices []interface{} `json:"field_choices,omitempty" url:"field_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -104,6 +273,55 @@ func (a *AdvancedMetadata) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AdvancedMetadata) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetId(id string) { + a.Id = id + a.require(advancedMetadataFieldId) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDisplayName(displayName *string) { + a.DisplayName = displayName + a.require(advancedMetadataFieldDisplayName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDescription(description *string) { + a.Description = description + a.require(advancedMetadataFieldDescription) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsRequired(isRequired *bool) { + a.IsRequired = isRequired + a.require(advancedMetadataFieldIsRequired) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsCustom(isCustom *bool) { + a.IsCustom = isCustom + a.require(advancedMetadataFieldIsCustom) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetFieldChoices(fieldChoices []interface{}) { + a.FieldChoices = fieldChoices + a.require(advancedMetadataFieldFieldChoices) +} + func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { type unmarshaler AdvancedMetadata var value unmarshaler @@ -120,6 +338,17 @@ func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { return nil } +func (a *AdvancedMetadata) MarshalJSON() ([]byte, error) { + type embed AdvancedMetadata + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AdvancedMetadata) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -132,11 +361,20 @@ func (a *AdvancedMetadata) String() string { return fmt.Sprintf("%#v", a) } +var ( + externalTargetFieldApiFieldName = big.NewInt(1 << 0) + externalTargetFieldApiFieldDescription = big.NewInt(1 << 1) + externalTargetFieldApiFieldIsMapped = big.NewInt(1 << 2) +) + type ExternalTargetFieldApi struct { Name *string `json:"name,omitempty" url:"name,omitempty"` Description *string `json:"description,omitempty" url:"description,omitempty"` IsMapped *string `json:"is_mapped,omitempty" url:"is_mapped,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -166,6 +404,34 @@ func (e *ExternalTargetFieldApi) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExternalTargetFieldApi) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetName(name *string) { + e.Name = name + e.require(externalTargetFieldApiFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetDescription(description *string) { + e.Description = description + e.require(externalTargetFieldApiFieldDescription) +} + +// SetIsMapped sets the IsMapped field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetIsMapped(isMapped *string) { + e.IsMapped = isMapped + e.require(externalTargetFieldApiFieldIsMapped) +} + func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApi var value unmarshaler @@ -182,6 +448,17 @@ func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApi) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApi) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -194,6 +471,25 @@ func (e *ExternalTargetFieldApi) String() string { return fmt.Sprintf("%#v", e) } +var ( + externalTargetFieldApiResponseFieldActivity = big.NewInt(1 << 0) + externalTargetFieldApiResponseFieldApplication = big.NewInt(1 << 1) + externalTargetFieldApiResponseFieldAttachment = big.NewInt(1 << 2) + externalTargetFieldApiResponseFieldCandidate = big.NewInt(1 << 3) + externalTargetFieldApiResponseFieldDepartment = big.NewInt(1 << 4) + externalTargetFieldApiResponseFieldEeoc = big.NewInt(1 << 5) + externalTargetFieldApiResponseFieldScheduledInterview = big.NewInt(1 << 6) + externalTargetFieldApiResponseFieldJob = big.NewInt(1 << 7) + externalTargetFieldApiResponseFieldJobPosting = big.NewInt(1 << 8) + externalTargetFieldApiResponseFieldJobInterviewStage = big.NewInt(1 << 9) + externalTargetFieldApiResponseFieldOffer = big.NewInt(1 << 10) + externalTargetFieldApiResponseFieldOffice = big.NewInt(1 << 11) + externalTargetFieldApiResponseFieldRejectReason = big.NewInt(1 << 12) + externalTargetFieldApiResponseFieldScorecard = big.NewInt(1 << 13) + externalTargetFieldApiResponseFieldTag = big.NewInt(1 << 14) + externalTargetFieldApiResponseFieldRemoteUser = big.NewInt(1 << 15) +) + type ExternalTargetFieldApiResponse struct { Activity []*ExternalTargetFieldApi `json:"Activity,omitempty" url:"Activity,omitempty"` Application []*ExternalTargetFieldApi `json:"Application,omitempty" url:"Application,omitempty"` @@ -212,6 +508,9 @@ type ExternalTargetFieldApiResponse struct { Tag []*ExternalTargetFieldApi `json:"Tag,omitempty" url:"Tag,omitempty"` RemoteUser []*ExternalTargetFieldApi `json:"RemoteUser,omitempty" url:"RemoteUser,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -332,6 +631,125 @@ func (e *ExternalTargetFieldApiResponse) GetExtraProperties() map[string]interfa return e.extraProperties } +func (e *ExternalTargetFieldApiResponse) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetActivity sets the Activity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetActivity(activity []*ExternalTargetFieldApi) { + e.Activity = activity + e.require(externalTargetFieldApiResponseFieldActivity) +} + +// SetApplication sets the Application field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetApplication(application []*ExternalTargetFieldApi) { + e.Application = application + e.require(externalTargetFieldApiResponseFieldApplication) +} + +// SetAttachment sets the Attachment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetAttachment(attachment []*ExternalTargetFieldApi) { + e.Attachment = attachment + e.require(externalTargetFieldApiResponseFieldAttachment) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetCandidate(candidate []*ExternalTargetFieldApi) { + e.Candidate = candidate + e.require(externalTargetFieldApiResponseFieldCandidate) +} + +// SetDepartment sets the Department field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetDepartment(department []*ExternalTargetFieldApi) { + e.Department = department + e.require(externalTargetFieldApiResponseFieldDepartment) +} + +// SetEeoc sets the Eeoc field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetEeoc(eeoc []*ExternalTargetFieldApi) { + e.Eeoc = eeoc + e.require(externalTargetFieldApiResponseFieldEeoc) +} + +// SetScheduledInterview sets the ScheduledInterview field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetScheduledInterview(scheduledInterview []*ExternalTargetFieldApi) { + e.ScheduledInterview = scheduledInterview + e.require(externalTargetFieldApiResponseFieldScheduledInterview) +} + +// SetJob sets the Job field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetJob(job []*ExternalTargetFieldApi) { + e.Job = job + e.require(externalTargetFieldApiResponseFieldJob) +} + +// SetJobPosting sets the JobPosting field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetJobPosting(jobPosting []*ExternalTargetFieldApi) { + e.JobPosting = jobPosting + e.require(externalTargetFieldApiResponseFieldJobPosting) +} + +// SetJobInterviewStage sets the JobInterviewStage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetJobInterviewStage(jobInterviewStage []*ExternalTargetFieldApi) { + e.JobInterviewStage = jobInterviewStage + e.require(externalTargetFieldApiResponseFieldJobInterviewStage) +} + +// SetOffer sets the Offer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetOffer(offer []*ExternalTargetFieldApi) { + e.Offer = offer + e.require(externalTargetFieldApiResponseFieldOffer) +} + +// SetOffice sets the Office field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetOffice(office []*ExternalTargetFieldApi) { + e.Office = office + e.require(externalTargetFieldApiResponseFieldOffice) +} + +// SetRejectReason sets the RejectReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetRejectReason(rejectReason []*ExternalTargetFieldApi) { + e.RejectReason = rejectReason + e.require(externalTargetFieldApiResponseFieldRejectReason) +} + +// SetScorecard sets the Scorecard field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetScorecard(scorecard []*ExternalTargetFieldApi) { + e.Scorecard = scorecard + e.require(externalTargetFieldApiResponseFieldScorecard) +} + +// SetTag sets the Tag field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTag(tag []*ExternalTargetFieldApi) { + e.Tag = tag + e.require(externalTargetFieldApiResponseFieldTag) +} + +// SetRemoteUser sets the RemoteUser field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetRemoteUser(remoteUser []*ExternalTargetFieldApi) { + e.RemoteUser = remoteUser + e.require(externalTargetFieldApiResponseFieldRemoteUser) +} + func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApiResponse var value unmarshaler @@ -348,6 +766,17 @@ func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApiResponse) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -360,12 +789,22 @@ func (e *ExternalTargetFieldApiResponse) String() string { return fmt.Sprintf("%#v", e) } +var ( + fieldMappingApiInstanceFieldId = big.NewInt(1 << 0) + fieldMappingApiInstanceFieldIsIntegrationWide = big.NewInt(1 << 1) + fieldMappingApiInstanceFieldTargetField = big.NewInt(1 << 2) + fieldMappingApiInstanceFieldRemoteField = big.NewInt(1 << 3) +) + type FieldMappingApiInstance struct { Id *string `json:"id,omitempty" url:"id,omitempty"` IsIntegrationWide *bool `json:"is_integration_wide,omitempty" url:"is_integration_wide,omitempty"` TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty" url:"target_field,omitempty"` RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty" url:"remote_field,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -402,6 +841,41 @@ func (f *FieldMappingApiInstance) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *FieldMappingApiInstance) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetId(id *string) { + f.Id = id + f.require(fieldMappingApiInstanceFieldId) +} + +// SetIsIntegrationWide sets the IsIntegrationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetIsIntegrationWide(isIntegrationWide *bool) { + f.IsIntegrationWide = isIntegrationWide + f.require(fieldMappingApiInstanceFieldIsIntegrationWide) +} + +// SetTargetField sets the TargetField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetTargetField(targetField *FieldMappingApiInstanceTargetField) { + f.TargetField = targetField + f.require(fieldMappingApiInstanceFieldTargetField) +} + +// SetRemoteField sets the RemoteField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetRemoteField(remoteField *FieldMappingApiInstanceRemoteField) { + f.RemoteField = remoteField + f.require(fieldMappingApiInstanceFieldRemoteField) +} + func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstance var value unmarshaler @@ -418,6 +892,17 @@ func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstance) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstance + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstance) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -430,11 +915,20 @@ func (f *FieldMappingApiInstance) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldFieldSchema = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteField struct { RemoteKeyName *string `json:"remote_key_name,omitempty" url:"remote_key_name,omitempty"` Schema map[string]interface{} `json:"schema,omitempty" url:"schema,omitempty"` RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info" url:"remote_endpoint_info"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -464,6 +958,34 @@ func (f *FieldMappingApiInstanceRemoteField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteKeyName(remoteKeyName *string) { + f.RemoteKeyName = remoteKeyName + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetSchema(schema map[string]interface{}) { + f.Schema = schema + f.require(fieldMappingApiInstanceRemoteFieldFieldSchema) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteEndpointInfo(remoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) { + f.RemoteEndpointInfo = remoteEndpointInfo + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo) +} + func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteField var value unmarshaler @@ -480,6 +1002,17 @@ func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceRemoteField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -492,11 +1025,20 @@ func (f *FieldMappingApiInstanceRemoteField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { Method *string `json:"method,omitempty" url:"method,omitempty"` UrlPath *string `json:"url_path,omitempty" url:"url_path,omitempty"` FieldTraversalPath []string `json:"field_traversal_path,omitempty" url:"field_traversal_path,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -526,6 +1068,34 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) GetExtraPropertie return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetMethod(method *string) { + f.Method = method + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetUrlPath(urlPath *string) { + f.UrlPath = urlPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []string) { + f.FieldTraversalPath = fieldTraversalPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo var value unmarshaler @@ -542,6 +1112,17 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(dat return nil } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -554,6 +1135,25 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceResponseFieldActivity = big.NewInt(1 << 0) + fieldMappingApiInstanceResponseFieldApplication = big.NewInt(1 << 1) + fieldMappingApiInstanceResponseFieldAttachment = big.NewInt(1 << 2) + fieldMappingApiInstanceResponseFieldCandidate = big.NewInt(1 << 3) + fieldMappingApiInstanceResponseFieldDepartment = big.NewInt(1 << 4) + fieldMappingApiInstanceResponseFieldEeoc = big.NewInt(1 << 5) + fieldMappingApiInstanceResponseFieldScheduledInterview = big.NewInt(1 << 6) + fieldMappingApiInstanceResponseFieldJob = big.NewInt(1 << 7) + fieldMappingApiInstanceResponseFieldJobPosting = big.NewInt(1 << 8) + fieldMappingApiInstanceResponseFieldJobInterviewStage = big.NewInt(1 << 9) + fieldMappingApiInstanceResponseFieldOffer = big.NewInt(1 << 10) + fieldMappingApiInstanceResponseFieldOffice = big.NewInt(1 << 11) + fieldMappingApiInstanceResponseFieldRejectReason = big.NewInt(1 << 12) + fieldMappingApiInstanceResponseFieldScorecard = big.NewInt(1 << 13) + fieldMappingApiInstanceResponseFieldTag = big.NewInt(1 << 14) + fieldMappingApiInstanceResponseFieldRemoteUser = big.NewInt(1 << 15) +) + type FieldMappingApiInstanceResponse struct { Activity []*FieldMappingApiInstance `json:"Activity,omitempty" url:"Activity,omitempty"` Application []*FieldMappingApiInstance `json:"Application,omitempty" url:"Application,omitempty"` @@ -572,6 +1172,9 @@ type FieldMappingApiInstanceResponse struct { Tag []*FieldMappingApiInstance `json:"Tag,omitempty" url:"Tag,omitempty"` RemoteUser []*FieldMappingApiInstance `json:"RemoteUser,omitempty" url:"RemoteUser,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -692,6 +1295,125 @@ func (f *FieldMappingApiInstanceResponse) GetExtraProperties() map[string]interf return f.extraProperties } +func (f *FieldMappingApiInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetActivity sets the Activity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetActivity(activity []*FieldMappingApiInstance) { + f.Activity = activity + f.require(fieldMappingApiInstanceResponseFieldActivity) +} + +// SetApplication sets the Application field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetApplication(application []*FieldMappingApiInstance) { + f.Application = application + f.require(fieldMappingApiInstanceResponseFieldApplication) +} + +// SetAttachment sets the Attachment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetAttachment(attachment []*FieldMappingApiInstance) { + f.Attachment = attachment + f.require(fieldMappingApiInstanceResponseFieldAttachment) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetCandidate(candidate []*FieldMappingApiInstance) { + f.Candidate = candidate + f.require(fieldMappingApiInstanceResponseFieldCandidate) +} + +// SetDepartment sets the Department field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetDepartment(department []*FieldMappingApiInstance) { + f.Department = department + f.require(fieldMappingApiInstanceResponseFieldDepartment) +} + +// SetEeoc sets the Eeoc field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetEeoc(eeoc []*FieldMappingApiInstance) { + f.Eeoc = eeoc + f.require(fieldMappingApiInstanceResponseFieldEeoc) +} + +// SetScheduledInterview sets the ScheduledInterview field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetScheduledInterview(scheduledInterview []*FieldMappingApiInstance) { + f.ScheduledInterview = scheduledInterview + f.require(fieldMappingApiInstanceResponseFieldScheduledInterview) +} + +// SetJob sets the Job field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetJob(job []*FieldMappingApiInstance) { + f.Job = job + f.require(fieldMappingApiInstanceResponseFieldJob) +} + +// SetJobPosting sets the JobPosting field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetJobPosting(jobPosting []*FieldMappingApiInstance) { + f.JobPosting = jobPosting + f.require(fieldMappingApiInstanceResponseFieldJobPosting) +} + +// SetJobInterviewStage sets the JobInterviewStage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetJobInterviewStage(jobInterviewStage []*FieldMappingApiInstance) { + f.JobInterviewStage = jobInterviewStage + f.require(fieldMappingApiInstanceResponseFieldJobInterviewStage) +} + +// SetOffer sets the Offer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetOffer(offer []*FieldMappingApiInstance) { + f.Offer = offer + f.require(fieldMappingApiInstanceResponseFieldOffer) +} + +// SetOffice sets the Office field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetOffice(office []*FieldMappingApiInstance) { + f.Office = office + f.require(fieldMappingApiInstanceResponseFieldOffice) +} + +// SetRejectReason sets the RejectReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetRejectReason(rejectReason []*FieldMappingApiInstance) { + f.RejectReason = rejectReason + f.require(fieldMappingApiInstanceResponseFieldRejectReason) +} + +// SetScorecard sets the Scorecard field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetScorecard(scorecard []*FieldMappingApiInstance) { + f.Scorecard = scorecard + f.require(fieldMappingApiInstanceResponseFieldScorecard) +} + +// SetTag sets the Tag field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTag(tag []*FieldMappingApiInstance) { + f.Tag = tag + f.require(fieldMappingApiInstanceResponseFieldTag) +} + +// SetRemoteUser sets the RemoteUser field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetRemoteUser(remoteUser []*FieldMappingApiInstance) { + f.RemoteUser = remoteUser + f.require(fieldMappingApiInstanceResponseFieldRemoteUser) +} + func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceResponse var value unmarshaler @@ -708,6 +1430,17 @@ func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -720,11 +1453,20 @@ func (f *FieldMappingApiInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceTargetFieldFieldName = big.NewInt(1 << 0) + fieldMappingApiInstanceTargetFieldFieldDescription = big.NewInt(1 << 1) + fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceTargetField struct { Name string `json:"name" url:"name"` Description string `json:"description" url:"description"` IsOrganizationWide bool `json:"is_organization_wide" url:"is_organization_wide"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -754,6 +1496,34 @@ func (f *FieldMappingApiInstanceTargetField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceTargetField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetName(name string) { + f.Name = name + f.require(fieldMappingApiInstanceTargetFieldFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetDescription(description string) { + f.Description = description + f.require(fieldMappingApiInstanceTargetFieldFieldDescription) +} + +// SetIsOrganizationWide sets the IsOrganizationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetIsOrganizationWide(isOrganizationWide bool) { + f.IsOrganizationWide = isOrganizationWide + f.require(fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide) +} + func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceTargetField var value unmarshaler @@ -770,6 +1540,17 @@ func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceTargetField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceTargetField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceTargetField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -782,12 +1563,22 @@ func (f *FieldMappingApiInstanceTargetField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingInstanceResponseFieldModel = big.NewInt(1 << 0) + fieldMappingInstanceResponseFieldWarnings = big.NewInt(1 << 1) + fieldMappingInstanceResponseFieldErrors = big.NewInt(1 << 2) + fieldMappingInstanceResponseFieldLogs = big.NewInt(1 << 3) +) + type FieldMappingInstanceResponse struct { Model *FieldMappingApiInstance `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -824,6 +1615,41 @@ func (f *FieldMappingInstanceResponse) GetExtraProperties() map[string]interface return f.extraProperties } +func (f *FieldMappingInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetModel(model *FieldMappingApiInstance) { + f.Model = model + f.require(fieldMappingInstanceResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetWarnings(warnings []*WarningValidationProblem) { + f.Warnings = warnings + f.require(fieldMappingInstanceResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetErrors(errors []*ErrorValidationProblem) { + f.Errors = errors + f.require(fieldMappingInstanceResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetLogs(logs []*DebugModeLog) { + f.Logs = logs + f.require(fieldMappingInstanceResponseFieldLogs) +} + func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingInstanceResponse var value unmarshaler @@ -840,6 +1666,17 @@ func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -852,11 +1689,20 @@ func (f *FieldMappingInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + remoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + remoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + remoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type RemoteEndpointInfo struct { Method string `json:"method" url:"method"` UrlPath string `json:"url_path" url:"url_path"` FieldTraversalPath []interface{} `json:"field_traversal_path" url:"field_traversal_path"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -886,6 +1732,34 @@ func (r *RemoteEndpointInfo) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteEndpointInfo) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetMethod(method string) { + r.Method = method + r.require(remoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetUrlPath(urlPath string) { + r.UrlPath = urlPath + r.require(remoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []interface{}) { + r.FieldTraversalPath = fieldTraversalPath + r.require(remoteEndpointInfoFieldFieldTraversalPath) +} + func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler RemoteEndpointInfo var value unmarshaler @@ -902,6 +1776,17 @@ func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed RemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteEndpointInfo) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -914,6 +1799,15 @@ func (r *RemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldApiFieldSchema = big.NewInt(1 << 0) + remoteFieldApiFieldRemoteKeyName = big.NewInt(1 << 1) + remoteFieldApiFieldRemoteEndpointInfo = big.NewInt(1 << 2) + remoteFieldApiFieldExampleValues = big.NewInt(1 << 3) + remoteFieldApiFieldAdvancedMetadata = big.NewInt(1 << 4) + remoteFieldApiFieldCoverage = big.NewInt(1 << 5) +) + type RemoteFieldApi struct { Schema map[string]interface{} `json:"schema" url:"schema"` RemoteKeyName string `json:"remote_key_name" url:"remote_key_name"` @@ -922,6 +1816,9 @@ type RemoteFieldApi struct { AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty" url:"advanced_metadata,omitempty"` Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty" url:"coverage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -972,6 +1869,55 @@ func (r *RemoteFieldApi) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApi) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetSchema(schema map[string]interface{}) { + r.Schema = schema + r.require(remoteFieldApiFieldSchema) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteKeyName(remoteKeyName string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldApiFieldRemoteKeyName) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteEndpointInfo(remoteEndpointInfo *RemoteEndpointInfo) { + r.RemoteEndpointInfo = remoteEndpointInfo + r.require(remoteFieldApiFieldRemoteEndpointInfo) +} + +// SetExampleValues sets the ExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetExampleValues(exampleValues []interface{}) { + r.ExampleValues = exampleValues + r.require(remoteFieldApiFieldExampleValues) +} + +// SetAdvancedMetadata sets the AdvancedMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetAdvancedMetadata(advancedMetadata *AdvancedMetadata) { + r.AdvancedMetadata = advancedMetadata + r.require(remoteFieldApiFieldAdvancedMetadata) +} + +// SetCoverage sets the Coverage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetCoverage(coverage *RemoteFieldApiCoverage) { + r.Coverage = coverage + r.require(remoteFieldApiFieldCoverage) +} + func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApi var value unmarshaler @@ -988,6 +1934,17 @@ func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApi) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApi) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -1062,6 +2019,25 @@ func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) e return fmt.Errorf("type %T does not include a non-empty union type", r) } +var ( + remoteFieldApiResponseFieldActivity = big.NewInt(1 << 0) + remoteFieldApiResponseFieldApplication = big.NewInt(1 << 1) + remoteFieldApiResponseFieldAttachment = big.NewInt(1 << 2) + remoteFieldApiResponseFieldCandidate = big.NewInt(1 << 3) + remoteFieldApiResponseFieldDepartment = big.NewInt(1 << 4) + remoteFieldApiResponseFieldEeoc = big.NewInt(1 << 5) + remoteFieldApiResponseFieldScheduledInterview = big.NewInt(1 << 6) + remoteFieldApiResponseFieldJob = big.NewInt(1 << 7) + remoteFieldApiResponseFieldJobPosting = big.NewInt(1 << 8) + remoteFieldApiResponseFieldJobInterviewStage = big.NewInt(1 << 9) + remoteFieldApiResponseFieldOffer = big.NewInt(1 << 10) + remoteFieldApiResponseFieldOffice = big.NewInt(1 << 11) + remoteFieldApiResponseFieldRejectReason = big.NewInt(1 << 12) + remoteFieldApiResponseFieldScorecard = big.NewInt(1 << 13) + remoteFieldApiResponseFieldTag = big.NewInt(1 << 14) + remoteFieldApiResponseFieldRemoteUser = big.NewInt(1 << 15) +) + type RemoteFieldApiResponse struct { Activity []*RemoteFieldApi `json:"Activity,omitempty" url:"Activity,omitempty"` Application []*RemoteFieldApi `json:"Application,omitempty" url:"Application,omitempty"` @@ -1080,6 +2056,9 @@ type RemoteFieldApiResponse struct { Tag []*RemoteFieldApi `json:"Tag,omitempty" url:"Tag,omitempty"` RemoteUser []*RemoteFieldApi `json:"RemoteUser,omitempty" url:"RemoteUser,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1200,6 +2179,125 @@ func (r *RemoteFieldApiResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApiResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetActivity sets the Activity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetActivity(activity []*RemoteFieldApi) { + r.Activity = activity + r.require(remoteFieldApiResponseFieldActivity) +} + +// SetApplication sets the Application field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetApplication(application []*RemoteFieldApi) { + r.Application = application + r.require(remoteFieldApiResponseFieldApplication) +} + +// SetAttachment sets the Attachment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetAttachment(attachment []*RemoteFieldApi) { + r.Attachment = attachment + r.require(remoteFieldApiResponseFieldAttachment) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetCandidate(candidate []*RemoteFieldApi) { + r.Candidate = candidate + r.require(remoteFieldApiResponseFieldCandidate) +} + +// SetDepartment sets the Department field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetDepartment(department []*RemoteFieldApi) { + r.Department = department + r.require(remoteFieldApiResponseFieldDepartment) +} + +// SetEeoc sets the Eeoc field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetEeoc(eeoc []*RemoteFieldApi) { + r.Eeoc = eeoc + r.require(remoteFieldApiResponseFieldEeoc) +} + +// SetScheduledInterview sets the ScheduledInterview field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetScheduledInterview(scheduledInterview []*RemoteFieldApi) { + r.ScheduledInterview = scheduledInterview + r.require(remoteFieldApiResponseFieldScheduledInterview) +} + +// SetJob sets the Job field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetJob(job []*RemoteFieldApi) { + r.Job = job + r.require(remoteFieldApiResponseFieldJob) +} + +// SetJobPosting sets the JobPosting field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetJobPosting(jobPosting []*RemoteFieldApi) { + r.JobPosting = jobPosting + r.require(remoteFieldApiResponseFieldJobPosting) +} + +// SetJobInterviewStage sets the JobInterviewStage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetJobInterviewStage(jobInterviewStage []*RemoteFieldApi) { + r.JobInterviewStage = jobInterviewStage + r.require(remoteFieldApiResponseFieldJobInterviewStage) +} + +// SetOffer sets the Offer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetOffer(offer []*RemoteFieldApi) { + r.Offer = offer + r.require(remoteFieldApiResponseFieldOffer) +} + +// SetOffice sets the Office field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetOffice(office []*RemoteFieldApi) { + r.Office = office + r.require(remoteFieldApiResponseFieldOffice) +} + +// SetRejectReason sets the RejectReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetRejectReason(rejectReason []*RemoteFieldApi) { + r.RejectReason = rejectReason + r.require(remoteFieldApiResponseFieldRejectReason) +} + +// SetScorecard sets the Scorecard field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetScorecard(scorecard []*RemoteFieldApi) { + r.Scorecard = scorecard + r.require(remoteFieldApiResponseFieldScorecard) +} + +// SetTag sets the Tag field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTag(tag []*RemoteFieldApi) { + r.Tag = tag + r.require(remoteFieldApiResponseFieldTag) +} + +// SetRemoteUser sets the RemoteUser field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetRemoteUser(remoteUser []*RemoteFieldApi) { + r.RemoteUser = remoteUser + r.require(remoteFieldApiResponseFieldRemoteUser) +} + func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApiResponse var value unmarshaler @@ -1216,6 +2314,17 @@ func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApiResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { diff --git a/ats/fieldmapping/ats_field_mapping_test/ats_field_mapping_test.go b/ats/fieldmapping/ats_field_mapping_test/ats_field_mapping_test.go new file mode 100644 index 0000000..3d79ee7 --- /dev/null +++ b/ats/fieldmapping/ats_field_mapping_test/ats_field_mapping_test.go @@ -0,0 +1,210 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_field_mapping_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsFieldMappingFieldMappingsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestAtsFieldMappingFieldMappingsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } + _, invocationErr := client.Ats.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestAtsFieldMappingFieldMappingsDestroyWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + response, invocationErr := client.Ats.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) + + // DELETE operations may return nil response body, which is acceptable + if invocationErr != nil && response == nil { + // This is expected for DELETE operations that return 204 No Content + require.Contains(t, invocationErr.Error(), "but the server responded with nothing", "Expected empty response error") + } else { + require.NoError(t, invocationErr, "Client method call should succeed") + } + VerifyRequestCount(t, "DELETE", "/ats/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestAtsFieldMappingFieldMappingsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.PatchedEditFieldMappingRequest{} + _, invocationErr := client.Ats.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/ats/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestAtsFieldMappingRemoteFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } + _, invocationErr := client.Ats.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/remote-fields", map[string]string{"common_models": "common_models", "include_example_values": "include_example_values"}, 1) +} + +func TestAtsFieldMappingTargetFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/target-fields", nil, 1) +} diff --git a/ats/fieldmapping/client.go b/ats/fieldmapping/client.go index a98fcff..c2199e4 100644 --- a/ats/fieldmapping/client.go +++ b/ats/fieldmapping/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,42 +38,15 @@ func (c *Client) FieldMappingsRetrieve( request *ats.FieldMappingsRetrieveRequest, opts ...option.RequestOption, ) (*ats.FieldMappingApiInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ats/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.FieldMappingApiInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -81,44 +55,15 @@ func (c *Client) FieldMappingsCreate( request *ats.CreateFieldMappingRequest, opts ...option.RequestOption, ) (*ats.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsCreate( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ats/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -127,38 +72,15 @@ func (c *Client) FieldMappingsDestroy( fieldMappingId string, opts ...option.RequestOption, ) (*ats.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsDestroy( + ctx, fieldMappingId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodDelete, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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. @@ -168,40 +90,16 @@ func (c *Client) FieldMappingsPartialUpdate( request *ats.PatchedEditFieldMappingRequest, opts ...option.RequestOption, ) (*ats.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsPartialUpdate( + ctx, fieldMappingId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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/). @@ -210,42 +108,15 @@ func (c *Client) RemoteFieldsRetrieve( request *ats.RemoteFieldsRetrieveRequest, opts ...option.RequestOption, ) (*ats.RemoteFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.RemoteFieldsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ats/v1/remote-fields" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.RemoteFieldApiResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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/). @@ -253,33 +124,12 @@ func (c *Client) TargetFieldsRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ats.ExternalTargetFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/target-fields" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.ExternalTargetFieldApiResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.TargetFieldsRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/fieldmapping/raw_client.go b/ats/fieldmapping/raw_client.go new file mode 100644 index 0000000..7fb2d6f --- /dev/null +++ b/ats/fieldmapping/raw_client.go @@ -0,0 +1,302 @@ +// Code generated by Fern. DO NOT EDIT. + +package fieldmapping + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) FieldMappingsRetrieve( + ctx context.Context, + request *ats.FieldMappingsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.FieldMappingApiInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.FieldMappingApiInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.FieldMappingApiInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsCreate( + ctx context.Context, + request *ats.CreateFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsDestroy( + ctx context.Context, + fieldMappingId string, + opts ...option.RequestOption, +) (*core.Response[*ats.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsPartialUpdate( + ctx context.Context, + fieldMappingId string, + request *ats.PatchedEditFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) RemoteFieldsRetrieve( + ctx context.Context, + request *ats.RemoteFieldsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.RemoteFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/remote-fields" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.RemoteFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.RemoteFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) TargetFieldsRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ats.ExternalTargetFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/target-fields" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.ExternalTargetFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.ExternalTargetFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/forceresync/ats_force_resync_test/ats_force_resync_test.go b/ats/forceresync/ats_force_resync_test/ats_force_resync_test.go new file mode 100644 index 0000000..cfd04ec --- /dev/null +++ b/ats/forceresync/ats_force_resync_test/ats_force_resync_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_force_resync_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsForceResyncSyncStatusResyncCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/sync-status/resync", nil, 1) +} diff --git a/ats/forceresync/client.go b/ats/forceresync/client.go index 94b7030..14216aa 100644 --- a/ats/forceresync/client.go +++ b/ats/forceresync/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) SyncStatusResyncCreate( ctx context.Context, opts ...option.RequestOption, ) ([]*ats.SyncStatus, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/sync-status/resync" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*ats.SyncStatus - if err := c.caller.Call( + response, err := c.WithRawResponse.SyncStatusResyncCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/forceresync/raw_client.go b/ats/forceresync/raw_client.go new file mode 100644 index 0000000..77245f2 --- /dev/null +++ b/ats/forceresync/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package forceresync + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) SyncStatusResyncCreate( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*ats.SyncStatus], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/sync-status/resync" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*ats.SyncStatus + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*ats.SyncStatus]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/generate_key.go b/ats/generate_key.go index f024c4c..b33f393 100644 --- a/ats/generate_key.go +++ b/ats/generate_key.go @@ -2,7 +2,32 @@ package ats +import ( + big "math/big" +) + +var ( + generateRemoteKeyRequestFieldName = big.NewInt(1 << 0) +) + type GenerateRemoteKeyRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GenerateRemoteKeyRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GenerateRemoteKeyRequest) SetName(name string) { + g.Name = name + g.require(generateRemoteKeyRequestFieldName) } diff --git a/ats/generatekey/ats_generate_key_test/ats_generate_key_test.go b/ats/generatekey/ats_generate_key_test/ats_generate_key_test.go new file mode 100644 index 0000000..d215c06 --- /dev/null +++ b/ats/generatekey/ats_generate_key_test/ats_generate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_generate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsGenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Ats.GenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/generate-key", nil, 1) +} diff --git a/ats/generatekey/client.go b/ats/generatekey/client.go index 39ff710..e8a1929 100644 --- a/ats/generatekey/client.go +++ b/ats/generatekey/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *ats.GenerateRemoteKeyRequest, opts ...option.RequestOption, ) (*ats.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/generate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/generatekey/raw_client.go b/ats/generatekey/raw_client.go new file mode 100644 index 0000000..81cd50e --- /dev/null +++ b/ats/generatekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package generatekey + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.GenerateRemoteKeyRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/generate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/interviews.go b/ats/interviews.go index 517c725..feccfc0 100644 --- a/ats/interviews.go +++ b/ats/interviews.go @@ -6,9 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + scheduledInterviewEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + scheduledInterviewEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + scheduledInterviewEndpointRequestFieldModel = big.NewInt(1 << 2) + scheduledInterviewEndpointRequestFieldRemoteUserId = big.NewInt(1 << 3) +) + type ScheduledInterviewEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` @@ -16,8 +24,66 @@ type ScheduledInterviewEndpointRequest struct { RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *ScheduledInterviewRequest `json:"model,omitempty" url:"-"` RemoteUserId string `json:"remote_user_id" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (s *ScheduledInterviewEndpointRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + s.IsDebugMode = isDebugMode + s.require(scheduledInterviewEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewEndpointRequest) SetRunAsync(runAsync *bool) { + s.RunAsync = runAsync + s.require(scheduledInterviewEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewEndpointRequest) SetModel(model *ScheduledInterviewRequest) { + s.Model = model + s.require(scheduledInterviewEndpointRequestFieldModel) +} + +// SetRemoteUserId sets the RemoteUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewEndpointRequest) SetRemoteUserId(remoteUserId string) { + s.RemoteUserId = remoteUserId + s.require(scheduledInterviewEndpointRequestFieldRemoteUserId) +} + +var ( + interviewsListRequestFieldApplicationId = big.NewInt(1 << 0) + interviewsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + interviewsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + interviewsListRequestFieldCursor = big.NewInt(1 << 3) + interviewsListRequestFieldExpand = big.NewInt(1 << 4) + interviewsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + interviewsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + interviewsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + interviewsListRequestFieldJobId = big.NewInt(1 << 8) + interviewsListRequestFieldJobInterviewStageId = big.NewInt(1 << 9) + interviewsListRequestFieldModifiedAfter = big.NewInt(1 << 10) + interviewsListRequestFieldModifiedBefore = big.NewInt(1 << 11) + interviewsListRequestFieldOrganizerId = big.NewInt(1 << 12) + interviewsListRequestFieldPageSize = big.NewInt(1 << 13) + interviewsListRequestFieldRemoteFields = big.NewInt(1 << 14) + interviewsListRequestFieldRemoteId = big.NewInt(1 << 15) + interviewsListRequestFieldShowEnumOrigins = big.NewInt(1 << 16) +) + type InterviewsListRequest struct { // If provided, will only return interviews for this application. ApplicationId *string `json:"-" url:"application_id,omitempty"` @@ -53,8 +119,145 @@ type InterviewsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *InterviewsListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetApplicationId sets the ApplicationId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetApplicationId(applicationId *string) { + i.ApplicationId = applicationId + i.require(interviewsListRequestFieldApplicationId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetCreatedAfter(createdAfter *time.Time) { + i.CreatedAfter = createdAfter + i.require(interviewsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetCreatedBefore(createdBefore *time.Time) { + i.CreatedBefore = createdBefore + i.require(interviewsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(interviewsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetExpand(expand []*InterviewsListRequestExpandItem) { + i.Expand = expand + i.require(interviewsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + i.IncludeDeletedData = includeDeletedData + i.require(interviewsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(interviewsListRequestFieldIncludeRemoteData) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(interviewsListRequestFieldIncludeShellData) +} + +// SetJobId sets the JobId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetJobId(jobId *string) { + i.JobId = jobId + i.require(interviewsListRequestFieldJobId) +} + +// SetJobInterviewStageId sets the JobInterviewStageId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetJobInterviewStageId(jobInterviewStageId *string) { + i.JobInterviewStageId = jobInterviewStageId + i.require(interviewsListRequestFieldJobInterviewStageId) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + i.ModifiedAfter = modifiedAfter + i.require(interviewsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + i.ModifiedBefore = modifiedBefore + i.require(interviewsListRequestFieldModifiedBefore) +} + +// SetOrganizerId sets the OrganizerId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetOrganizerId(organizerId *string) { + i.OrganizerId = organizerId + i.require(interviewsListRequestFieldOrganizerId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(interviewsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetRemoteFields(remoteFields *string) { + i.RemoteFields = remoteFields + i.require(interviewsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetRemoteId(remoteId *string) { + i.RemoteId = remoteId + i.require(interviewsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + i.ShowEnumOrigins = showEnumOrigins + i.require(interviewsListRequestFieldShowEnumOrigins) +} + +var ( + interviewsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + interviewsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + interviewsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + interviewsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + interviewsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type InterviewsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*InterviewsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -66,6 +269,51 @@ type InterviewsRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *InterviewsRetrieveRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsRetrieveRequest) SetExpand(expand []*InterviewsRetrieveRequestExpandItem) { + i.Expand = expand + i.require(interviewsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + i.IncludeRemoteData = includeRemoteData + i.require(interviewsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + i.IncludeShellData = includeShellData + i.require(interviewsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsRetrieveRequest) SetRemoteFields(remoteFields *string) { + i.RemoteFields = remoteFields + i.require(interviewsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *InterviewsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + i.ShowEnumOrigins = showEnumOrigins + i.require(interviewsRetrieveRequestFieldShowEnumOrigins) } type InterviewsListRequestExpandItem string @@ -124,11 +372,20 @@ func (i InterviewsRetrieveRequestExpandItem) Ptr() *InterviewsRetrieveRequestExp return &i } +var ( + paginatedScheduledInterviewListFieldNext = big.NewInt(1 << 0) + paginatedScheduledInterviewListFieldPrevious = big.NewInt(1 << 1) + paginatedScheduledInterviewListFieldResults = big.NewInt(1 << 2) +) + type PaginatedScheduledInterviewList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*ScheduledInterview `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -158,6 +415,34 @@ func (p *PaginatedScheduledInterviewList) GetExtraProperties() map[string]interf return p.extraProperties } +func (p *PaginatedScheduledInterviewList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedScheduledInterviewList) SetNext(next *string) { + p.Next = next + p.require(paginatedScheduledInterviewListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedScheduledInterviewList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedScheduledInterviewListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedScheduledInterviewList) SetResults(results []*ScheduledInterview) { + p.Results = results + p.require(paginatedScheduledInterviewListFieldResults) +} + func (p *PaginatedScheduledInterviewList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedScheduledInterviewList var value unmarshaler @@ -174,6 +459,17 @@ func (p *PaginatedScheduledInterviewList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedScheduledInterviewList) MarshalJSON() ([]byte, error) { + type embed PaginatedScheduledInterviewList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedScheduledInterviewList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -191,6 +487,19 @@ func (p *PaginatedScheduledInterviewList) String() string { // 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. +var ( + scheduledInterviewRequestFieldApplication = big.NewInt(1 << 0) + scheduledInterviewRequestFieldJobInterviewStage = big.NewInt(1 << 1) + scheduledInterviewRequestFieldOrganizer = big.NewInt(1 << 2) + scheduledInterviewRequestFieldInterviewers = big.NewInt(1 << 3) + scheduledInterviewRequestFieldLocation = big.NewInt(1 << 4) + scheduledInterviewRequestFieldStartAt = big.NewInt(1 << 5) + scheduledInterviewRequestFieldEndAt = big.NewInt(1 << 6) + scheduledInterviewRequestFieldStatus = big.NewInt(1 << 7) + scheduledInterviewRequestFieldIntegrationParams = big.NewInt(1 << 8) + scheduledInterviewRequestFieldLinkedAccountParams = big.NewInt(1 << 9) +) + type ScheduledInterviewRequest struct { // The application being interviewed. Application *ScheduledInterviewRequestApplication `json:"application,omitempty" url:"application,omitempty"` @@ -215,6 +524,9 @@ type ScheduledInterviewRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -293,6 +605,83 @@ func (s *ScheduledInterviewRequest) GetExtraProperties() map[string]interface{} return s.extraProperties } +func (s *ScheduledInterviewRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetApplication sets the Application field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetApplication(application *ScheduledInterviewRequestApplication) { + s.Application = application + s.require(scheduledInterviewRequestFieldApplication) +} + +// SetJobInterviewStage sets the JobInterviewStage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetJobInterviewStage(jobInterviewStage *ScheduledInterviewRequestJobInterviewStage) { + s.JobInterviewStage = jobInterviewStage + s.require(scheduledInterviewRequestFieldJobInterviewStage) +} + +// SetOrganizer sets the Organizer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetOrganizer(organizer *ScheduledInterviewRequestOrganizer) { + s.Organizer = organizer + s.require(scheduledInterviewRequestFieldOrganizer) +} + +// SetInterviewers sets the Interviewers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetInterviewers(interviewers []*ScheduledInterviewRequestInterviewersItem) { + s.Interviewers = interviewers + s.require(scheduledInterviewRequestFieldInterviewers) +} + +// SetLocation sets the Location field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetLocation(location *string) { + s.Location = location + s.require(scheduledInterviewRequestFieldLocation) +} + +// SetStartAt sets the StartAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetStartAt(startAt *time.Time) { + s.StartAt = startAt + s.require(scheduledInterviewRequestFieldStartAt) +} + +// SetEndAt sets the EndAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetEndAt(endAt *time.Time) { + s.EndAt = endAt + s.require(scheduledInterviewRequestFieldEndAt) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetStatus(status *ScheduledInterviewRequestStatus) { + s.Status = status + s.require(scheduledInterviewRequestFieldStatus) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + s.IntegrationParams = integrationParams + s.require(scheduledInterviewRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + s.LinkedAccountParams = linkedAccountParams + s.require(scheduledInterviewRequestFieldLinkedAccountParams) +} + func (s *ScheduledInterviewRequest) UnmarshalJSON(data []byte) error { type embed ScheduledInterviewRequest var unmarshaler = struct { @@ -328,7 +717,8 @@ func (s *ScheduledInterviewRequest) MarshalJSON() ([]byte, error) { StartAt: internal.NewOptionalDateTime(s.StartAt), EndAt: internal.NewOptionalDateTime(s.EndAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *ScheduledInterviewRequest) String() string { @@ -661,12 +1051,22 @@ func (s *ScheduledInterviewRequestStatus) Accept(visitor ScheduledInterviewReque return fmt.Errorf("type %T does not include a non-empty union type", s) } +var ( + scheduledInterviewResponseFieldModel = big.NewInt(1 << 0) + scheduledInterviewResponseFieldWarnings = big.NewInt(1 << 1) + scheduledInterviewResponseFieldErrors = big.NewInt(1 << 2) + scheduledInterviewResponseFieldLogs = big.NewInt(1 << 3) +) + type ScheduledInterviewResponse struct { Model *ScheduledInterview `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -703,6 +1103,41 @@ func (s *ScheduledInterviewResponse) GetExtraProperties() map[string]interface{} return s.extraProperties } +func (s *ScheduledInterviewResponse) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewResponse) SetModel(model *ScheduledInterview) { + s.Model = model + s.require(scheduledInterviewResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewResponse) SetWarnings(warnings []*WarningValidationProblem) { + s.Warnings = warnings + s.require(scheduledInterviewResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewResponse) SetErrors(errors []*ErrorValidationProblem) { + s.Errors = errors + s.require(scheduledInterviewResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterviewResponse) SetLogs(logs []*DebugModeLog) { + s.Logs = logs + s.require(scheduledInterviewResponseFieldLogs) +} + func (s *ScheduledInterviewResponse) UnmarshalJSON(data []byte) error { type unmarshaler ScheduledInterviewResponse var value unmarshaler @@ -719,6 +1154,17 @@ func (s *ScheduledInterviewResponse) UnmarshalJSON(data []byte) error { return nil } +func (s *ScheduledInterviewResponse) MarshalJSON() ([]byte, error) { + type embed ScheduledInterviewResponse + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (s *ScheduledInterviewResponse) String() string { if len(s.rawJSON) > 0 { if value, err := internal.StringifyJSON(s.rawJSON); err == nil { diff --git a/ats/interviews/ats_interviews_test/ats_interviews_test.go b/ats/interviews/ats_interviews_test/ats_interviews_test.go new file mode 100644 index 0000000..da71c3a --- /dev/null +++ b/ats/interviews/ats_interviews_test/ats_interviews_test.go @@ -0,0 +1,209 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_interviews_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsInterviewsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.InterviewsListRequest{ + ApplicationId: merge.String( + "application_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + JobId: merge.String( + "job_id", + ), + JobInterviewStageId: merge.String( + "job_interview_stage_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OrganizerId: merge.String( + "organizer_id", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.Interviews.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/interviews", map[string]string{"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"}, 1) +} + +func TestAtsInterviewsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ScheduledInterviewEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.ScheduledInterviewRequest{}, + RemoteUserId: "remote_user_id", + } + _, invocationErr := client.Ats.Interviews.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/interviews", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestAtsInterviewsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.InterviewsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Interviews.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/interviews/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "status", "show_enum_origins": "status"}, 1) +} + +func TestAtsInterviewsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.Interviews.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/interviews/meta/post", nil, 1) +} diff --git a/ats/interviews/client.go b/ats/interviews/client.go index f487323..cf18e26 100644 --- a/ats/interviews/client.go +++ b/ats/interviews/client.go @@ -4,7 +4,6 @@ package interviews import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.InterviewsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.ScheduledInterview], error) { +) (*core.Page[*string, *ats.ScheduledInterview], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedScheduledInterviewList) *internal.PageResponse[*string, *ats.ScheduledInterview] { + readPageResponse := func(response *ats.PaginatedScheduledInterviewList) *core.PageResponse[*string, *ats.ScheduledInterview] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.ScheduledInterview]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.ScheduledInterview]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *ats.ScheduledInterviewEndpointRequest, opts ...option.RequestOption, ) (*ats.ScheduledInterviewResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ats/v1/interviews" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.ScheduledInterviewResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `ScheduledInterview` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *ats.InterviewsRetrieveRequest, opts ...option.RequestOption, ) (*ats.ScheduledInterview, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/interviews/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.ScheduledInterview - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `ScheduledInterview` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ats.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/interviews/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/interviews/raw_client.go b/ats/interviews/raw_client.go new file mode 100644 index 0000000..fe69764 --- /dev/null +++ b/ats/interviews/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package interviews + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.ScheduledInterviewEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.ScheduledInterviewResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/interviews" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.ScheduledInterviewResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.ScheduledInterviewResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.InterviewsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.ScheduledInterview], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/interviews/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.ScheduledInterview + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.ScheduledInterview]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ats.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/interviews/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/issues.go b/ats/issues.go index 0309633..48ce538 100644 --- a/ats/issues.go +++ b/ats/issues.go @@ -6,9 +6,27 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + issuesListRequestFieldAccountToken = big.NewInt(1 << 0) + issuesListRequestFieldCursor = big.NewInt(1 << 1) + issuesListRequestFieldEndDate = big.NewInt(1 << 2) + issuesListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + issuesListRequestFieldFirstIncidentTimeAfter = big.NewInt(1 << 4) + issuesListRequestFieldFirstIncidentTimeBefore = big.NewInt(1 << 5) + issuesListRequestFieldIncludeMuted = big.NewInt(1 << 6) + issuesListRequestFieldIntegrationName = big.NewInt(1 << 7) + issuesListRequestFieldLastIncidentTimeAfter = big.NewInt(1 << 8) + issuesListRequestFieldLastIncidentTimeBefore = big.NewInt(1 << 9) + issuesListRequestFieldLinkedAccountId = big.NewInt(1 << 10) + issuesListRequestFieldPageSize = big.NewInt(1 << 11) + issuesListRequestFieldStartDate = big.NewInt(1 << 12) + issuesListRequestFieldStatus = big.NewInt(1 << 13) +) + type IssuesListRequest struct { AccountToken *string `json:"-" url:"account_token,omitempty"` // The pagination cursor value. @@ -38,6 +56,114 @@ type IssuesListRequest struct { // * `ONGOING` - ONGOING // * `RESOLVED` - RESOLVED Status *IssuesListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *IssuesListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetAccountToken(accountToken *string) { + i.AccountToken = accountToken + i.require(issuesListRequestFieldAccountToken) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(issuesListRequestFieldCursor) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndDate(endDate *string) { + i.EndDate = endDate + i.require(issuesListRequestFieldEndDate) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + i.EndUserOrganizationName = endUserOrganizationName + i.require(issuesListRequestFieldEndUserOrganizationName) +} + +// SetFirstIncidentTimeAfter sets the FirstIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeAfter(firstIncidentTimeAfter *time.Time) { + i.FirstIncidentTimeAfter = firstIncidentTimeAfter + i.require(issuesListRequestFieldFirstIncidentTimeAfter) +} + +// SetFirstIncidentTimeBefore sets the FirstIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeBefore(firstIncidentTimeBefore *time.Time) { + i.FirstIncidentTimeBefore = firstIncidentTimeBefore + i.require(issuesListRequestFieldFirstIncidentTimeBefore) +} + +// SetIncludeMuted sets the IncludeMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIncludeMuted(includeMuted *string) { + i.IncludeMuted = includeMuted + i.require(issuesListRequestFieldIncludeMuted) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIntegrationName(integrationName *string) { + i.IntegrationName = integrationName + i.require(issuesListRequestFieldIntegrationName) +} + +// SetLastIncidentTimeAfter sets the LastIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeAfter(lastIncidentTimeAfter *time.Time) { + i.LastIncidentTimeAfter = lastIncidentTimeAfter + i.require(issuesListRequestFieldLastIncidentTimeAfter) +} + +// SetLastIncidentTimeBefore sets the LastIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeBefore(lastIncidentTimeBefore *time.Time) { + i.LastIncidentTimeBefore = lastIncidentTimeBefore + i.require(issuesListRequestFieldLastIncidentTimeBefore) +} + +// SetLinkedAccountId sets the LinkedAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLinkedAccountId(linkedAccountId *string) { + i.LinkedAccountId = linkedAccountId + i.require(issuesListRequestFieldLinkedAccountId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(issuesListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStartDate(startDate *string) { + i.StartDate = startDate + i.require(issuesListRequestFieldStartDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStatus(status *IssuesListRequestStatus) { + i.Status = status + i.require(issuesListRequestFieldStatus) } type IssuesListRequestStatus string @@ -62,6 +188,17 @@ func (i IssuesListRequestStatus) Ptr() *IssuesListRequestStatus { return &i } +var ( + issueFieldId = big.NewInt(1 << 0) + issueFieldStatus = big.NewInt(1 << 1) + issueFieldErrorDescription = big.NewInt(1 << 2) + issueFieldEndUser = big.NewInt(1 << 3) + issueFieldFirstIncidentTime = big.NewInt(1 << 4) + issueFieldLastIncidentTime = big.NewInt(1 << 5) + issueFieldIsMuted = big.NewInt(1 << 6) + issueFieldErrorDetails = big.NewInt(1 << 7) +) + type Issue struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -76,6 +213,9 @@ type Issue struct { IsMuted *bool `json:"is_muted,omitempty" url:"is_muted,omitempty"` ErrorDetails []string `json:"error_details,omitempty" url:"error_details,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +280,69 @@ func (i *Issue) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *Issue) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetId(id *string) { + i.Id = id + i.require(issueFieldId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetStatus(status *IssueStatus) { + i.Status = status + i.require(issueFieldStatus) +} + +// SetErrorDescription sets the ErrorDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDescription(errorDescription string) { + i.ErrorDescription = errorDescription + i.require(issueFieldErrorDescription) +} + +// SetEndUser sets the EndUser field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetEndUser(endUser map[string]interface{}) { + i.EndUser = endUser + i.require(issueFieldEndUser) +} + +// SetFirstIncidentTime sets the FirstIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetFirstIncidentTime(firstIncidentTime *time.Time) { + i.FirstIncidentTime = firstIncidentTime + i.require(issueFieldFirstIncidentTime) +} + +// SetLastIncidentTime sets the LastIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetLastIncidentTime(lastIncidentTime *time.Time) { + i.LastIncidentTime = lastIncidentTime + i.require(issueFieldLastIncidentTime) +} + +// SetIsMuted sets the IsMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetIsMuted(isMuted *bool) { + i.IsMuted = isMuted + i.require(issueFieldIsMuted) +} + +// SetErrorDetails sets the ErrorDetails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDetails(errorDetails []string) { + i.ErrorDetails = errorDetails + i.require(issueFieldErrorDetails) +} + func (i *Issue) UnmarshalJSON(data []byte) error { type embed Issue var unmarshaler = struct { @@ -175,7 +378,8 @@ func (i *Issue) MarshalJSON() ([]byte, error) { FirstIncidentTime: internal.NewOptionalDateTime(i.FirstIncidentTime), LastIncidentTime: internal.NewOptionalDateTime(i.LastIncidentTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *Issue) String() string { @@ -280,11 +484,20 @@ func (i IssueStatusEnum) Ptr() *IssueStatusEnum { return &i } +var ( + paginatedIssueListFieldNext = big.NewInt(1 << 0) + paginatedIssueListFieldPrevious = big.NewInt(1 << 1) + paginatedIssueListFieldResults = big.NewInt(1 << 2) +) + type PaginatedIssueList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Issue `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -314,6 +527,34 @@ func (p *PaginatedIssueList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedIssueList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetNext(next *string) { + p.Next = next + p.require(paginatedIssueListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedIssueListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetResults(results []*Issue) { + p.Results = results + p.require(paginatedIssueListFieldResults) +} + func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedIssueList var value unmarshaler @@ -330,6 +571,17 @@ func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedIssueList) MarshalJSON() ([]byte, error) { + type embed PaginatedIssueList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedIssueList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/issues/ats_issues_test/ats_issues_test.go b/ats/issues/ats_issues_test/ats_issues_test.go new file mode 100644 index 0000000..5737729 --- /dev/null +++ b/ats/issues/ats_issues_test/ats_issues_test.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_issues_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsIssuesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: ats.IssuesListRequestStatusOngoing.Ptr(), + } + _, invocationErr := client.Ats.Issues.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/issues", map[string]string{"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"}, 1) +} + +func TestAtsIssuesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.Issues.Retrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/issues/id", nil, 1) +} diff --git a/ats/issues/client.go b/ats/issues/client.go index 83202d7..5c95f12 100644 --- a/ats/issues/client.go +++ b/ats/issues/client.go @@ -4,7 +4,6 @@ package issues import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.IssuesListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Issue], error) { +) (*core.Page[*string, *ats.Issue], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedIssueList) *internal.PageResponse[*string, *ats.Issue] { + readPageResponse := func(response *ats.PaginatedIssueList) *core.PageResponse[*string, *ats.Issue] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Issue]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Issue]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,36 +97,13 @@ func (c *Client) Retrieve( id string, opts ...option.RequestOption, ) (*ats.Issue, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/issues/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Issue - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/issues/raw_client.go b/ats/issues/raw_client.go new file mode 100644 index 0000000..ca6b9db --- /dev/null +++ b/ats/issues/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package issues + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*ats.Issue], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/issues/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Issue + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Issue]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/job_interview_stages.go b/ats/job_interview_stages.go index 8a38519..373022d 100644 --- a/ats/job_interview_stages.go +++ b/ats/job_interview_stages.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + jobInterviewStagesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + jobInterviewStagesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + jobInterviewStagesListRequestFieldCursor = big.NewInt(1 << 2) + jobInterviewStagesListRequestFieldExpand = big.NewInt(1 << 3) + jobInterviewStagesListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + jobInterviewStagesListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + jobInterviewStagesListRequestFieldIncludeShellData = big.NewInt(1 << 6) + jobInterviewStagesListRequestFieldJobId = big.NewInt(1 << 7) + jobInterviewStagesListRequestFieldModifiedAfter = big.NewInt(1 << 8) + jobInterviewStagesListRequestFieldModifiedBefore = big.NewInt(1 << 9) + jobInterviewStagesListRequestFieldPageSize = big.NewInt(1 << 10) + jobInterviewStagesListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type JobInterviewStagesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -34,8 +50,108 @@ type JobInterviewStagesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JobInterviewStagesListRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetCreatedAfter(createdAfter *time.Time) { + j.CreatedAfter = createdAfter + j.require(jobInterviewStagesListRequestFieldCreatedAfter) } +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetCreatedBefore(createdBefore *time.Time) { + j.CreatedBefore = createdBefore + j.require(jobInterviewStagesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetCursor(cursor *string) { + j.Cursor = cursor + j.require(jobInterviewStagesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetExpand(expand []*string) { + j.Expand = expand + j.require(jobInterviewStagesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + j.IncludeDeletedData = includeDeletedData + j.require(jobInterviewStagesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(jobInterviewStagesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(jobInterviewStagesListRequestFieldIncludeShellData) +} + +// SetJobId sets the JobId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetJobId(jobId *string) { + j.JobId = jobId + j.require(jobInterviewStagesListRequestFieldJobId) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + j.ModifiedAfter = modifiedAfter + j.require(jobInterviewStagesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + j.ModifiedBefore = modifiedBefore + j.require(jobInterviewStagesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetPageSize(pageSize *int) { + j.PageSize = pageSize + j.require(jobInterviewStagesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesListRequest) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(jobInterviewStagesListRequestFieldRemoteId) +} + +var ( + jobInterviewStagesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + jobInterviewStagesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + jobInterviewStagesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type JobInterviewStagesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -43,13 +159,53 @@ type JobInterviewStagesRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JobInterviewStagesRetrieveRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) } +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesRetrieveRequest) SetExpand(expand []*string) { + j.Expand = expand + j.require(jobInterviewStagesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(jobInterviewStagesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStagesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(jobInterviewStagesRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedJobInterviewStageListFieldNext = big.NewInt(1 << 0) + paginatedJobInterviewStageListFieldPrevious = big.NewInt(1 << 1) + paginatedJobInterviewStageListFieldResults = big.NewInt(1 << 2) +) + type PaginatedJobInterviewStageList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*JobInterviewStage `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -79,6 +235,34 @@ func (p *PaginatedJobInterviewStageList) GetExtraProperties() map[string]interfa return p.extraProperties } +func (p *PaginatedJobInterviewStageList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJobInterviewStageList) SetNext(next *string) { + p.Next = next + p.require(paginatedJobInterviewStageListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJobInterviewStageList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedJobInterviewStageListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJobInterviewStageList) SetResults(results []*JobInterviewStage) { + p.Results = results + p.require(paginatedJobInterviewStageListFieldResults) +} + func (p *PaginatedJobInterviewStageList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedJobInterviewStageList var value unmarshaler @@ -95,6 +279,17 @@ func (p *PaginatedJobInterviewStageList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedJobInterviewStageList) MarshalJSON() ([]byte, error) { + type embed PaginatedJobInterviewStageList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedJobInterviewStageList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/job_postings.go b/ats/job_postings.go index b680819..c5cdc6f 100644 --- a/ats/job_postings.go +++ b/ats/job_postings.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + jobPostingsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + jobPostingsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + jobPostingsListRequestFieldCursor = big.NewInt(1 << 2) + jobPostingsListRequestFieldExpand = big.NewInt(1 << 3) + jobPostingsListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + jobPostingsListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + jobPostingsListRequestFieldIncludeShellData = big.NewInt(1 << 6) + jobPostingsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + jobPostingsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + jobPostingsListRequestFieldPageSize = big.NewInt(1 << 9) + jobPostingsListRequestFieldRemoteId = big.NewInt(1 << 10) + jobPostingsListRequestFieldStatus = big.NewInt(1 << 11) +) + type JobPostingsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -40,8 +56,108 @@ type JobPostingsListRequest struct { // * `INTERNAL` - INTERNAL // * `PENDING` - PENDING Status *JobPostingsListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JobPostingsListRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetCreatedAfter(createdAfter *time.Time) { + j.CreatedAfter = createdAfter + j.require(jobPostingsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetCreatedBefore(createdBefore *time.Time) { + j.CreatedBefore = createdBefore + j.require(jobPostingsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetCursor(cursor *string) { + j.Cursor = cursor + j.require(jobPostingsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetExpand(expand []*string) { + j.Expand = expand + j.require(jobPostingsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + j.IncludeDeletedData = includeDeletedData + j.require(jobPostingsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(jobPostingsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(jobPostingsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + j.ModifiedAfter = modifiedAfter + j.require(jobPostingsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + j.ModifiedBefore = modifiedBefore + j.require(jobPostingsListRequestFieldModifiedBefore) } +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetPageSize(pageSize *int) { + j.PageSize = pageSize + j.require(jobPostingsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(jobPostingsListRequestFieldRemoteId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsListRequest) SetStatus(status *JobPostingsListRequestStatus) { + j.Status = status + j.require(jobPostingsListRequestFieldStatus) +} + +var ( + jobPostingsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + jobPostingsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + jobPostingsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type JobPostingsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -49,6 +165,37 @@ type JobPostingsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JobPostingsRetrieveRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsRetrieveRequest) SetExpand(expand []*string) { + j.Expand = expand + j.require(jobPostingsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(jobPostingsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPostingsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(jobPostingsRetrieveRequestFieldIncludeShellData) } type JobPostingsListRequestStatus string @@ -87,6 +234,24 @@ func (j JobPostingsListRequestStatus) Ptr() *JobPostingsListRequestStatus { // 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. +var ( + jobPostingFieldId = big.NewInt(1 << 0) + jobPostingFieldRemoteId = big.NewInt(1 << 1) + jobPostingFieldCreatedAt = big.NewInt(1 << 2) + jobPostingFieldModifiedAt = big.NewInt(1 << 3) + jobPostingFieldTitle = big.NewInt(1 << 4) + jobPostingFieldJobPostingUrls = big.NewInt(1 << 5) + jobPostingFieldJob = big.NewInt(1 << 6) + jobPostingFieldStatus = big.NewInt(1 << 7) + jobPostingFieldContent = big.NewInt(1 << 8) + jobPostingFieldRemoteCreatedAt = big.NewInt(1 << 9) + jobPostingFieldRemoteUpdatedAt = big.NewInt(1 << 10) + jobPostingFieldIsInternal = big.NewInt(1 << 11) + jobPostingFieldRemoteWasDeleted = big.NewInt(1 << 12) + jobPostingFieldFieldMappings = big.NewInt(1 << 13) + jobPostingFieldRemoteData = big.NewInt(1 << 14) +) + type JobPosting struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -122,6 +287,9 @@ type JobPosting struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -235,6 +403,118 @@ func (j *JobPosting) GetExtraProperties() map[string]interface{} { return j.extraProperties } +func (j *JobPosting) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetId(id *string) { + j.Id = id + j.require(jobPostingFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(jobPostingFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetCreatedAt(createdAt *time.Time) { + j.CreatedAt = createdAt + j.require(jobPostingFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetModifiedAt(modifiedAt *time.Time) { + j.ModifiedAt = modifiedAt + j.require(jobPostingFieldModifiedAt) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetTitle(title *string) { + j.Title = title + j.require(jobPostingFieldTitle) +} + +// SetJobPostingUrls sets the JobPostingUrls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetJobPostingUrls(jobPostingUrls []*JobPostingJobPostingUrlsItem) { + j.JobPostingUrls = jobPostingUrls + j.require(jobPostingFieldJobPostingUrls) +} + +// SetJob sets the Job field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetJob(job *JobPostingJob) { + j.Job = job + j.require(jobPostingFieldJob) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetStatus(status *JobPostingStatus) { + j.Status = status + j.require(jobPostingFieldStatus) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetContent(content *string) { + j.Content = content + j.require(jobPostingFieldContent) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + j.RemoteCreatedAt = remoteCreatedAt + j.require(jobPostingFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + j.RemoteUpdatedAt = remoteUpdatedAt + j.require(jobPostingFieldRemoteUpdatedAt) +} + +// SetIsInternal sets the IsInternal field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetIsInternal(isInternal *bool) { + j.IsInternal = isInternal + j.require(jobPostingFieldIsInternal) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetRemoteWasDeleted(remoteWasDeleted *bool) { + j.RemoteWasDeleted = remoteWasDeleted + j.require(jobPostingFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetFieldMappings(fieldMappings map[string]interface{}) { + j.FieldMappings = fieldMappings + j.require(jobPostingFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobPosting) SetRemoteData(remoteData []*RemoteData) { + j.RemoteData = remoteData + j.require(jobPostingFieldRemoteData) +} + func (j *JobPosting) UnmarshalJSON(data []byte) error { type embed JobPosting var unmarshaler = struct { @@ -278,7 +558,8 @@ func (j *JobPosting) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(j.RemoteCreatedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(j.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) } func (j *JobPosting) String() string { @@ -523,11 +804,20 @@ func (j JobPostingStatusEnum) Ptr() *JobPostingStatusEnum { return &j } +var ( + paginatedJobPostingListFieldNext = big.NewInt(1 << 0) + paginatedJobPostingListFieldPrevious = big.NewInt(1 << 1) + paginatedJobPostingListFieldResults = big.NewInt(1 << 2) +) + type PaginatedJobPostingList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*JobPosting `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -557,6 +847,34 @@ func (p *PaginatedJobPostingList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedJobPostingList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJobPostingList) SetNext(next *string) { + p.Next = next + p.require(paginatedJobPostingListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJobPostingList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedJobPostingListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJobPostingList) SetResults(results []*JobPosting) { + p.Results = results + p.require(paginatedJobPostingListFieldResults) +} + func (p *PaginatedJobPostingList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedJobPostingList var value unmarshaler @@ -573,6 +891,17 @@ func (p *PaginatedJobPostingList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedJobPostingList) MarshalJSON() ([]byte, error) { + type embed PaginatedJobPostingList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedJobPostingList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/jobinterviewstages/ats_job_interview_stages_test/ats_job_interview_stages_test.go b/ats/jobinterviewstages/ats_job_interview_stages_test/ats_job_interview_stages_test.go new file mode 100644 index 0000000..9b800a8 --- /dev/null +++ b/ats/jobinterviewstages/ats_job_interview_stages_test/ats_job_interview_stages_test.go @@ -0,0 +1,153 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_job_interview_stages_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsJobInterviewStagesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.JobInterviewStagesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + JobId: merge.String( + "job_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.JobInterviewStages.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/job-interview-stages", map[string]string{"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"}, 1) +} + +func TestAtsJobInterviewStagesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.JobInterviewStagesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.JobInterviewStages.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/job-interview-stages/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ats/jobinterviewstages/client.go b/ats/jobinterviewstages/client.go index d7cda0e..ea34e94 100644 --- a/ats/jobinterviewstages/client.go +++ b/ats/jobinterviewstages/client.go @@ -4,7 +4,6 @@ package jobinterviewstages import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.JobInterviewStagesListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.JobInterviewStage], error) { +) (*core.Page[*string, *ats.JobInterviewStage], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedJobInterviewStageList) *internal.PageResponse[*string, *ats.JobInterviewStage] { + readPageResponse := func(response *ats.PaginatedJobInterviewStageList) *core.PageResponse[*string, *ats.JobInterviewStage] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.JobInterviewStage]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.JobInterviewStage]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ats.JobInterviewStagesRetrieveRequest, opts ...option.RequestOption, ) (*ats.JobInterviewStage, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/job-interview-stages/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.JobInterviewStage - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/jobinterviewstages/raw_client.go b/ats/jobinterviewstages/raw_client.go new file mode 100644 index 0000000..745389e --- /dev/null +++ b/ats/jobinterviewstages/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package jobinterviewstages + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.JobInterviewStagesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.JobInterviewStage], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/job-interview-stages/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.JobInterviewStage + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.JobInterviewStage]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/jobpostings/ats_job_postings_test/ats_job_postings_test.go b/ats/jobpostings/ats_job_postings_test/ats_job_postings_test.go new file mode 100644 index 0000000..1ca318a --- /dev/null +++ b/ats/jobpostings/ats_job_postings_test/ats_job_postings_test.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_job_postings_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsJobPostingsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.JobPostingsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: ats.JobPostingsListRequestStatusClosed.Ptr(), + } + _, invocationErr := client.Ats.JobPostings.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/job-postings", map[string]string{"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"}, 1) +} + +func TestAtsJobPostingsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.JobPostingsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.JobPostings.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/job-postings/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ats/jobpostings/client.go b/ats/jobpostings/client.go index 960be64..2dd2c82 100644 --- a/ats/jobpostings/client.go +++ b/ats/jobpostings/client.go @@ -4,7 +4,6 @@ package jobpostings import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.JobPostingsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.JobPosting], error) { +) (*core.Page[*string, *ats.JobPosting], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedJobPostingList) *internal.PageResponse[*string, *ats.JobPosting] { + readPageResponse := func(response *ats.PaginatedJobPostingList) *core.PageResponse[*string, *ats.JobPosting] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.JobPosting]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.JobPosting]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ats.JobPostingsRetrieveRequest, opts ...option.RequestOption, ) (*ats.JobPosting, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/job-postings/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.JobPosting - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/jobpostings/raw_client.go b/ats/jobpostings/raw_client.go new file mode 100644 index 0000000..de4361f --- /dev/null +++ b/ats/jobpostings/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package jobpostings + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.JobPostingsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.JobPosting], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/job-postings/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.JobPosting + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.JobPosting]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/jobs.go b/ats/jobs.go index abbf6ff..8837d3e 100644 --- a/ats/jobs.go +++ b/ats/jobs.go @@ -6,9 +6,29 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + jobsListRequestFieldCode = big.NewInt(1 << 0) + jobsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + jobsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + jobsListRequestFieldCursor = big.NewInt(1 << 3) + jobsListRequestFieldExpand = big.NewInt(1 << 4) + jobsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + jobsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + jobsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + jobsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + jobsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + jobsListRequestFieldOffices = big.NewInt(1 << 10) + jobsListRequestFieldPageSize = big.NewInt(1 << 11) + jobsListRequestFieldRemoteFields = big.NewInt(1 << 12) + jobsListRequestFieldRemoteId = big.NewInt(1 << 13) + jobsListRequestFieldShowEnumOrigins = big.NewInt(1 << 14) + jobsListRequestFieldStatus = big.NewInt(1 << 15) +) + type JobsListRequest struct { // If provided, will only return jobs with this code. Code *string `json:"-" url:"code,omitempty"` @@ -48,8 +68,138 @@ type JobsListRequest struct { // * `ARCHIVED` - ARCHIVED // * `PENDING` - PENDING Status *JobsListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JobsListRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetCode sets the Code field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetCode(code *string) { + j.Code = code + j.require(jobsListRequestFieldCode) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetCreatedAfter(createdAfter *time.Time) { + j.CreatedAfter = createdAfter + j.require(jobsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetCreatedBefore(createdBefore *time.Time) { + j.CreatedBefore = createdBefore + j.require(jobsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetCursor(cursor *string) { + j.Cursor = cursor + j.require(jobsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetExpand(expand []*JobsListRequestExpandItem) { + j.Expand = expand + j.require(jobsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + j.IncludeDeletedData = includeDeletedData + j.require(jobsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(jobsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(jobsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + j.ModifiedAfter = modifiedAfter + j.require(jobsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + j.ModifiedBefore = modifiedBefore + j.require(jobsListRequestFieldModifiedBefore) } +// SetOffices sets the Offices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetOffices(offices *string) { + j.Offices = offices + j.require(jobsListRequestFieldOffices) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetPageSize(pageSize *int) { + j.PageSize = pageSize + j.require(jobsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetRemoteFields(remoteFields *string) { + j.RemoteFields = remoteFields + j.require(jobsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(jobsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + j.ShowEnumOrigins = showEnumOrigins + j.require(jobsListRequestFieldShowEnumOrigins) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsListRequest) SetStatus(status *JobsListRequestStatus) { + j.Status = status + j.require(jobsListRequestFieldStatus) +} + +var ( + jobsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + jobsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + jobsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + jobsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + jobsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type JobsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*JobsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -61,8 +211,62 @@ type JobsRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JobsRetrieveRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsRetrieveRequest) SetExpand(expand []*JobsRetrieveRequestExpandItem) { + j.Expand = expand + j.require(jobsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(jobsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(jobsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsRetrieveRequest) SetRemoteFields(remoteFields *string) { + j.RemoteFields = remoteFields + j.require(jobsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + j.ShowEnumOrigins = showEnumOrigins + j.require(jobsRetrieveRequestFieldShowEnumOrigins) } +var ( + jobsScreeningQuestionsListRequestFieldCursor = big.NewInt(1 << 0) + jobsScreeningQuestionsListRequestFieldExpand = big.NewInt(1 << 1) + jobsScreeningQuestionsListRequestFieldIncludeDeletedData = big.NewInt(1 << 2) + jobsScreeningQuestionsListRequestFieldIncludeRemoteData = big.NewInt(1 << 3) + jobsScreeningQuestionsListRequestFieldIncludeShellData = big.NewInt(1 << 4) + jobsScreeningQuestionsListRequestFieldPageSize = big.NewInt(1 << 5) +) + type JobsScreeningQuestionsListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -76,6 +280,58 @@ type JobsScreeningQuestionsListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (j *JobsScreeningQuestionsListRequest) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsScreeningQuestionsListRequest) SetCursor(cursor *string) { + j.Cursor = cursor + j.require(jobsScreeningQuestionsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsScreeningQuestionsListRequest) SetExpand(expand []*JobsScreeningQuestionsListRequestExpandItem) { + j.Expand = expand + j.require(jobsScreeningQuestionsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsScreeningQuestionsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + j.IncludeDeletedData = includeDeletedData + j.require(jobsScreeningQuestionsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsScreeningQuestionsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + j.IncludeRemoteData = includeRemoteData + j.require(jobsScreeningQuestionsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsScreeningQuestionsListRequest) SetIncludeShellData(includeShellData *bool) { + j.IncludeShellData = includeShellData + j.require(jobsScreeningQuestionsListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobsScreeningQuestionsListRequest) SetPageSize(pageSize *int) { + j.PageSize = pageSize + j.require(jobsScreeningQuestionsListRequestFieldPageSize) } type JobsListRequestExpandItem string @@ -193,11 +449,20 @@ func (j JobsScreeningQuestionsListRequestExpandItem) Ptr() *JobsScreeningQuestio return &j } +var ( + paginatedJobListFieldNext = big.NewInt(1 << 0) + paginatedJobListFieldPrevious = big.NewInt(1 << 1) + paginatedJobListFieldResults = big.NewInt(1 << 2) +) + type PaginatedJobList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Job `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -227,6 +492,34 @@ func (p *PaginatedJobList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedJobList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJobList) SetNext(next *string) { + p.Next = next + p.require(paginatedJobListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJobList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedJobListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedJobList) SetResults(results []*Job) { + p.Results = results + p.require(paginatedJobListFieldResults) +} + func (p *PaginatedJobList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedJobList var value unmarshaler @@ -243,6 +536,17 @@ func (p *PaginatedJobList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedJobList) MarshalJSON() ([]byte, error) { + type embed PaginatedJobList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedJobList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -255,11 +559,20 @@ func (p *PaginatedJobList) String() string { return fmt.Sprintf("%#v", p) } +var ( + paginatedScreeningQuestionListFieldNext = big.NewInt(1 << 0) + paginatedScreeningQuestionListFieldPrevious = big.NewInt(1 << 1) + paginatedScreeningQuestionListFieldResults = big.NewInt(1 << 2) +) + type PaginatedScreeningQuestionList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*ScreeningQuestion `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -289,6 +602,34 @@ func (p *PaginatedScreeningQuestionList) GetExtraProperties() map[string]interfa return p.extraProperties } +func (p *PaginatedScreeningQuestionList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedScreeningQuestionList) SetNext(next *string) { + p.Next = next + p.require(paginatedScreeningQuestionListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedScreeningQuestionList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedScreeningQuestionListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedScreeningQuestionList) SetResults(results []*ScreeningQuestion) { + p.Results = results + p.require(paginatedScreeningQuestionListFieldResults) +} + func (p *PaginatedScreeningQuestionList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedScreeningQuestionList var value unmarshaler @@ -305,6 +646,17 @@ func (p *PaginatedScreeningQuestionList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedScreeningQuestionList) MarshalJSON() ([]byte, error) { + type embed PaginatedScreeningQuestionList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedScreeningQuestionList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/jobs/ats_jobs_test/ats_jobs_test.go b/ats/jobs/ats_jobs_test/ats_jobs_test.go new file mode 100644 index 0000000..202915e --- /dev/null +++ b/ats/jobs/ats_jobs_test/ats_jobs_test.go @@ -0,0 +1,194 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_jobs_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsJobsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.JobsListRequest{ + Code: merge.String( + "code", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Offices: merge.String( + "offices", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: ats.JobsListRequestStatusArchived.Ptr(), + } + _, invocationErr := client.Ats.Jobs.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/jobs", map[string]string{"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"}, 1) +} + +func TestAtsJobsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.JobsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Jobs.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/jobs/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "status", "show_enum_origins": "status"}, 1) +} + +func TestAtsJobsScreeningQuestionsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.JobsScreeningQuestionsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Ats.Jobs.ScreeningQuestionsList( + context.TODO(), + "job_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/jobs/job_id/screening-questions", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} diff --git a/ats/jobs/client.go b/ats/jobs/client.go index b3457b7..e7ddeed 100644 --- a/ats/jobs/client.go +++ b/ats/jobs/client.go @@ -4,7 +4,6 @@ package jobs import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.JobsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Job], error) { +) (*core.Page[*string, *ats.Job], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedJobList) *internal.PageResponse[*string, *ats.Job] { + readPageResponse := func(response *ats.PaginatedJobList) *core.PageResponse[*string, *ats.Job] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Job]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Job]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,45 +98,16 @@ func (c *Client) Retrieve( request *ats.JobsRetrieveRequest, opts ...option.RequestOption, ) (*ats.Job, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/jobs/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Job - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `ScreeningQuestion` objects. @@ -145,7 +116,7 @@ func (c *Client) ScreeningQuestionsList( jobId string, request *ats.JobsScreeningQuestionsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.ScreeningQuestion], error) { +) (*core.Page[*string, *ats.ScreeningQuestion], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -161,13 +132,12 @@ func (c *Client) ScreeningQuestionsList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -184,11 +154,11 @@ func (c *Client) ScreeningQuestionsList( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedScreeningQuestionList) *internal.PageResponse[*string, *ats.ScreeningQuestion] { + readPageResponse := func(response *ats.PaginatedScreeningQuestionList) *core.PageResponse[*string, *ats.ScreeningQuestion] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.ScreeningQuestion]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.ScreeningQuestion]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ats/jobs/raw_client.go b/ats/jobs/raw_client.go new file mode 100644 index 0000000..f643f51 --- /dev/null +++ b/ats/jobs/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package jobs + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.JobsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Job], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/jobs/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Job + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Job]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/link_token.go b/ats/link_token.go index 6b6e45b..32472cc 100644 --- a/ats/link_token.go +++ b/ats/link_token.go @@ -6,6 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + endUserDetailsRequestFieldEndUserEmailAddress = big.NewInt(1 << 0) + endUserDetailsRequestFieldEndUserOrganizationName = big.NewInt(1 << 1) + endUserDetailsRequestFieldEndUserOriginId = big.NewInt(1 << 2) + endUserDetailsRequestFieldCategories = big.NewInt(1 << 3) + endUserDetailsRequestFieldIntegration = big.NewInt(1 << 4) + endUserDetailsRequestFieldLinkExpiryMins = big.NewInt(1 << 5) + endUserDetailsRequestFieldShouldCreateMagicLinkUrl = big.NewInt(1 << 6) + endUserDetailsRequestFieldHideAdminMagicLink = big.NewInt(1 << 7) + endUserDetailsRequestFieldCommonModels = big.NewInt(1 << 8) + endUserDetailsRequestFieldCategoryCommonModelScopes = big.NewInt(1 << 9) + endUserDetailsRequestFieldLanguage = big.NewInt(1 << 10) + endUserDetailsRequestFieldAreSyncsDisabled = big.NewInt(1 << 11) + endUserDetailsRequestFieldIntegrationSpecificConfig = big.NewInt(1 << 12) ) type EndUserDetailsRequest struct { @@ -38,6 +55,107 @@ type EndUserDetailsRequest struct { AreSyncsDisabled *bool `json:"are_syncs_disabled,omitempty" url:"-"` // A JSON object containing integration-specific configuration options. IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EndUserDetailsRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserEmailAddress(endUserEmailAddress string) { + e.EndUserEmailAddress = endUserEmailAddress + e.require(endUserDetailsRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOrganizationName(endUserOrganizationName string) { + e.EndUserOrganizationName = endUserOrganizationName + e.require(endUserDetailsRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOriginId(endUserOriginId string) { + e.EndUserOriginId = endUserOriginId + e.require(endUserDetailsRequestFieldEndUserOriginId) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategories(categories []CategoriesEnum) { + e.Categories = categories + e.require(endUserDetailsRequestFieldCategories) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegration(integration *string) { + e.Integration = integration + e.require(endUserDetailsRequestFieldIntegration) +} + +// SetLinkExpiryMins sets the LinkExpiryMins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLinkExpiryMins(linkExpiryMins *int) { + e.LinkExpiryMins = linkExpiryMins + e.require(endUserDetailsRequestFieldLinkExpiryMins) +} + +// SetShouldCreateMagicLinkUrl sets the ShouldCreateMagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetShouldCreateMagicLinkUrl(shouldCreateMagicLinkUrl *bool) { + e.ShouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl + e.require(endUserDetailsRequestFieldShouldCreateMagicLinkUrl) +} + +// SetHideAdminMagicLink sets the HideAdminMagicLink field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetHideAdminMagicLink(hideAdminMagicLink *bool) { + e.HideAdminMagicLink = hideAdminMagicLink + e.require(endUserDetailsRequestFieldHideAdminMagicLink) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCommonModels(commonModels []*CommonModelScopesBodyRequest) { + e.CommonModels = commonModels + e.require(endUserDetailsRequestFieldCommonModels) +} + +// SetCategoryCommonModelScopes sets the CategoryCommonModelScopes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategoryCommonModelScopes(categoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest) { + e.CategoryCommonModelScopes = categoryCommonModelScopes + e.require(endUserDetailsRequestFieldCategoryCommonModelScopes) +} + +// SetLanguage sets the Language field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLanguage(language *EndUserDetailsRequestLanguage) { + e.Language = language + e.require(endUserDetailsRequestFieldLanguage) +} + +// SetAreSyncsDisabled sets the AreSyncsDisabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetAreSyncsDisabled(areSyncsDisabled *bool) { + e.AreSyncsDisabled = areSyncsDisabled + e.require(endUserDetailsRequestFieldAreSyncsDisabled) +} + +// SetIntegrationSpecificConfig sets the IntegrationSpecificConfig field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegrationSpecificConfig(integrationSpecificConfig map[string]interface{}) { + e.IntegrationSpecificConfig = integrationSpecificConfig + e.require(endUserDetailsRequestFieldIntegrationSpecificConfig) } // The following subset of IETF language tags can be used to configure localization. @@ -106,11 +224,20 @@ func (e *EndUserDetailsRequestLanguage) Accept(visitor EndUserDetailsRequestLang return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + commonModelScopesBodyRequestFieldModelId = big.NewInt(1 << 0) + commonModelScopesBodyRequestFieldEnabledActions = big.NewInt(1 << 1) + commonModelScopesBodyRequestFieldDisabledFields = big.NewInt(1 << 2) +) + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id" url:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions" url:"enabled_actions"` DisabledFields []string `json:"disabled_fields" url:"disabled_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +267,34 @@ func (c *CommonModelScopesBodyRequest) GetExtraProperties() map[string]interface return c.extraProperties } +func (c *CommonModelScopesBodyRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetModelId(modelId string) { + c.ModelId = modelId + c.require(commonModelScopesBodyRequestFieldModelId) +} + +// SetEnabledActions sets the EnabledActions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetEnabledActions(enabledActions []EnabledActionsEnum) { + c.EnabledActions = enabledActions + c.require(commonModelScopesBodyRequestFieldEnabledActions) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetDisabledFields(disabledFields []string) { + c.DisabledFields = disabledFields + c.require(commonModelScopesBodyRequestFieldDisabledFields) +} + func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopesBodyRequest var value unmarshaler @@ -156,6 +311,17 @@ func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopesBodyRequest) MarshalJSON() ([]byte, error) { + type embed CommonModelScopesBodyRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopesBodyRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -216,11 +382,20 @@ func (l LanguageEnum) Ptr() *LanguageEnum { return &l } +var ( + linkTokenFieldLinkToken = big.NewInt(1 << 0) + linkTokenFieldIntegrationName = big.NewInt(1 << 1) + linkTokenFieldMagicLinkUrl = big.NewInt(1 << 2) +) + type LinkToken struct { LinkToken string `json:"link_token" url:"link_token"` IntegrationName *string `json:"integration_name,omitempty" url:"integration_name,omitempty"` MagicLinkUrl *string `json:"magic_link_url,omitempty" url:"magic_link_url,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -250,6 +425,34 @@ func (l *LinkToken) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkToken) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkToken sets the LinkToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetLinkToken(linkToken string) { + l.LinkToken = linkToken + l.require(linkTokenFieldLinkToken) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkTokenFieldIntegrationName) +} + +// SetMagicLinkUrl sets the MagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetMagicLinkUrl(magicLinkUrl *string) { + l.MagicLinkUrl = magicLinkUrl + l.require(linkTokenFieldMagicLinkUrl) +} + func (l *LinkToken) UnmarshalJSON(data []byte) error { type unmarshaler LinkToken var value unmarshaler @@ -266,6 +469,17 @@ func (l *LinkToken) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkToken) MarshalJSON() ([]byte, error) { + type embed LinkToken + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkToken) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { diff --git a/ats/linked_accounts.go b/ats/linked_accounts.go index 3bcad14..a6d3d4b 100644 --- a/ats/linked_accounts.go +++ b/ats/linked_accounts.go @@ -6,9 +6,26 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + linkedAccountsListRequestFieldCategory = big.NewInt(1 << 0) + linkedAccountsListRequestFieldCursor = big.NewInt(1 << 1) + linkedAccountsListRequestFieldEndUserEmailAddress = big.NewInt(1 << 2) + linkedAccountsListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + linkedAccountsListRequestFieldEndUserOriginId = big.NewInt(1 << 4) + linkedAccountsListRequestFieldEndUserOriginIds = big.NewInt(1 << 5) + linkedAccountsListRequestFieldId = big.NewInt(1 << 6) + linkedAccountsListRequestFieldIds = big.NewInt(1 << 7) + linkedAccountsListRequestFieldIncludeDuplicates = big.NewInt(1 << 8) + linkedAccountsListRequestFieldIntegrationName = big.NewInt(1 << 9) + linkedAccountsListRequestFieldIsTestAccount = big.NewInt(1 << 10) + linkedAccountsListRequestFieldPageSize = big.NewInt(1 << 11) + linkedAccountsListRequestFieldStatus = big.NewInt(1 << 12) +) + type LinkedAccountsListRequest struct { // Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` // @@ -43,6 +60,107 @@ type LinkedAccountsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` Status *string `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountsListRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCategory(category *LinkedAccountsListRequestCategory) { + l.Category = category + l.require(linkedAccountsListRequestFieldCategory) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCursor(cursor *string) { + l.Cursor = cursor + l.require(linkedAccountsListRequestFieldCursor) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserEmailAddress(endUserEmailAddress *string) { + l.EndUserEmailAddress = endUserEmailAddress + l.require(linkedAccountsListRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + l.EndUserOrganizationName = endUserOrganizationName + l.require(linkedAccountsListRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginId(endUserOriginId *string) { + l.EndUserOriginId = endUserOriginId + l.require(linkedAccountsListRequestFieldEndUserOriginId) +} + +// SetEndUserOriginIds sets the EndUserOriginIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginIds(endUserOriginIds *string) { + l.EndUserOriginIds = endUserOriginIds + l.require(linkedAccountsListRequestFieldEndUserOriginIds) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetId(id *string) { + l.Id = id + l.require(linkedAccountsListRequestFieldId) +} + +// SetIds sets the Ids field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIds(ids *string) { + l.Ids = ids + l.require(linkedAccountsListRequestFieldIds) +} + +// SetIncludeDuplicates sets the IncludeDuplicates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIncludeDuplicates(includeDuplicates *bool) { + l.IncludeDuplicates = includeDuplicates + l.require(linkedAccountsListRequestFieldIncludeDuplicates) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkedAccountsListRequestFieldIntegrationName) +} + +// SetIsTestAccount sets the IsTestAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIsTestAccount(isTestAccount *string) { + l.IsTestAccount = isTestAccount + l.require(linkedAccountsListRequestFieldIsTestAccount) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetPageSize(pageSize *int) { + l.PageSize = pageSize + l.require(linkedAccountsListRequestFieldPageSize) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetStatus(status *string) { + l.Status = status + l.require(linkedAccountsListRequestFieldStatus) } type LinkedAccountsListRequestCategory string @@ -88,6 +206,22 @@ func (l LinkedAccountsListRequestCategory) Ptr() *LinkedAccountsListRequestCateg // // ### Usage Example // View a list of your organization's `LinkedAccount` objects. +var ( + accountDetailsAndActionsFieldId = big.NewInt(1 << 0) + accountDetailsAndActionsFieldCategory = big.NewInt(1 << 1) + accountDetailsAndActionsFieldStatus = big.NewInt(1 << 2) + accountDetailsAndActionsFieldStatusDetail = big.NewInt(1 << 3) + accountDetailsAndActionsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsAndActionsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsAndActionsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsAndActionsFieldSubdomain = big.NewInt(1 << 7) + accountDetailsAndActionsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsAndActionsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsAndActionsFieldIntegration = big.NewInt(1 << 10) + accountDetailsAndActionsFieldAccountType = big.NewInt(1 << 11) + accountDetailsAndActionsFieldCompletedAt = big.NewInt(1 << 12) +) + type AccountDetailsAndActions struct { Id string `json:"id" url:"id"` Category *AccountDetailsAndActionsCategory `json:"category,omitempty" url:"category,omitempty"` @@ -105,6 +239,9 @@ type AccountDetailsAndActions struct { AccountType string `json:"account_type" url:"account_type"` CompletedAt time.Time `json:"completed_at" url:"completed_at"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -204,6 +341,104 @@ func (a *AccountDetailsAndActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetailsAndActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetId(id string) { + a.Id = id + a.require(accountDetailsAndActionsFieldId) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCategory(category *AccountDetailsAndActionsCategory) { + a.Category = category + a.require(accountDetailsAndActionsFieldCategory) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatus(status *AccountDetailsAndActionsStatus) { + a.Status = status + a.require(accountDetailsAndActionsFieldStatus) +} + +// SetStatusDetail sets the StatusDetail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatusDetail(statusDetail *string) { + a.StatusDetail = statusDetail + a.require(accountDetailsAndActionsFieldStatusDetail) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsAndActionsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOrganizationName(endUserOrganizationName string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsAndActionsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserEmailAddress(endUserEmailAddress string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsAndActionsFieldEndUserEmailAddress) +} + +// SetSubdomain sets the Subdomain field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetSubdomain(subdomain *string) { + a.Subdomain = subdomain + a.require(accountDetailsAndActionsFieldSubdomain) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetWebhookListenerUrl(webhookListenerUrl string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsAndActionsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsAndActionsFieldIsDuplicate) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIntegration(integration *AccountDetailsAndActionsIntegration) { + a.Integration = integration + a.require(accountDetailsAndActionsFieldIntegration) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetAccountType(accountType string) { + a.AccountType = accountType + a.require(accountDetailsAndActionsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCompletedAt(completedAt time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsAndActionsFieldCompletedAt) +} + func (a *AccountDetailsAndActions) UnmarshalJSON(data []byte) error { type embed AccountDetailsAndActions var unmarshaler = struct { @@ -235,7 +470,8 @@ func (a *AccountDetailsAndActions) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetailsAndActions) String() string { @@ -312,6 +548,17 @@ func (a *AccountDetailsAndActionsCategory) Accept(visitor AccountDetailsAndActio return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + accountDetailsAndActionsIntegrationFieldName = big.NewInt(1 << 0) + accountDetailsAndActionsIntegrationFieldCategories = big.NewInt(1 << 1) + accountDetailsAndActionsIntegrationFieldImage = big.NewInt(1 << 2) + accountDetailsAndActionsIntegrationFieldSquareImage = big.NewInt(1 << 3) + accountDetailsAndActionsIntegrationFieldColor = big.NewInt(1 << 4) + accountDetailsAndActionsIntegrationFieldSlug = big.NewInt(1 << 5) + accountDetailsAndActionsIntegrationFieldPassthroughAvailable = big.NewInt(1 << 6) + accountDetailsAndActionsIntegrationFieldAvailableModelOperations = big.NewInt(1 << 7) +) + type AccountDetailsAndActionsIntegration struct { Name string `json:"name" url:"name"` Categories []CategoriesEnum `json:"categories" url:"categories"` @@ -322,6 +569,9 @@ type AccountDetailsAndActionsIntegration struct { PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -386,6 +636,69 @@ func (a *AccountDetailsAndActionsIntegration) GetExtraProperties() map[string]in return a.extraProperties } +func (a *AccountDetailsAndActionsIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetName(name string) { + a.Name = name + a.require(accountDetailsAndActionsIntegrationFieldName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountDetailsAndActionsIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetImage(image *string) { + a.Image = image + a.require(accountDetailsAndActionsIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountDetailsAndActionsIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetColor(color string) { + a.Color = color + a.require(accountDetailsAndActionsIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSlug(slug string) { + a.Slug = slug + a.require(accountDetailsAndActionsIntegrationFieldSlug) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(accountDetailsAndActionsIntegrationFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(accountDetailsAndActionsIntegrationFieldAvailableModelOperations) +} + func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountDetailsAndActionsIntegration var value unmarshaler @@ -402,6 +715,17 @@ func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountDetailsAndActionsIntegration) MarshalJSON() ([]byte, error) { + type embed AccountDetailsAndActionsIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountDetailsAndActionsIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -508,11 +832,20 @@ func (a AccountDetailsAndActionsStatusEnum) Ptr() *AccountDetailsAndActionsStatu return &a } +var ( + paginatedAccountDetailsAndActionsListFieldNext = big.NewInt(1 << 0) + paginatedAccountDetailsAndActionsListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountDetailsAndActionsListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AccountDetailsAndActions `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -542,6 +875,34 @@ func (p *PaginatedAccountDetailsAndActionsList) GetExtraProperties() map[string] return p.extraProperties } +func (p *PaginatedAccountDetailsAndActionsList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountDetailsAndActionsListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountDetailsAndActionsListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetResults(results []*AccountDetailsAndActions) { + p.Results = results + p.require(paginatedAccountDetailsAndActionsListFieldResults) +} + func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountDetailsAndActionsList var value unmarshaler @@ -558,6 +919,17 @@ func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error return nil } +func (p *PaginatedAccountDetailsAndActionsList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountDetailsAndActionsList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountDetailsAndActionsList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/linkedaccounts/ats_linked_accounts_test/ats_linked_accounts_test.go b/ats/linkedaccounts/ats_linked_accounts_test/ats_linked_accounts_test.go new file mode 100644 index 0000000..09907d0 --- /dev/null +++ b/ats/linkedaccounts/ats_linked_accounts_test/ats_linked_accounts_test.go @@ -0,0 +1,121 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_linked_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsLinkedAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.LinkedAccountsListRequest{ + Category: ats.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } + _, invocationErr := client.Ats.LinkedAccounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/linked-accounts", map[string]string{"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"}, 1) +} diff --git a/ats/linkedaccounts/client.go b/ats/linkedaccounts/client.go index 48c46f4..c345e05 100644 --- a/ats/linkedaccounts/client.go +++ b/ats/linkedaccounts/client.go @@ -4,7 +4,6 @@ package linkedaccounts import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.LinkedAccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.AccountDetailsAndActions], error) { +) (*core.Page[*string, *ats.AccountDetailsAndActions], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedAccountDetailsAndActionsList) *internal.PageResponse[*string, *ats.AccountDetailsAndActions] { + readPageResponse := func(response *ats.PaginatedAccountDetailsAndActionsList) *core.PageResponse[*string, *ats.AccountDetailsAndActions] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.AccountDetailsAndActions]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.AccountDetailsAndActions]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ats/linkedaccounts/raw_client.go b/ats/linkedaccounts/raw_client.go new file mode 100644 index 0000000..cb54205 --- /dev/null +++ b/ats/linkedaccounts/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package linkedaccounts + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/ats/linktoken/ats_link_token_test/ats_link_token_test.go b/ats/linktoken/ats_link_token_test/ats_link_token_test.go new file mode 100644 index 0000000..116fce7 --- /dev/null +++ b/ats/linktoken/ats_link_token_test/ats_link_token_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_link_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsLinkTokenCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []ats.CategoriesEnum{ + ats.CategoriesEnumHris, + ats.CategoriesEnumAts, + }, + } + _, invocationErr := client.Ats.LinkToken.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/link-token", nil, 1) +} diff --git a/ats/linktoken/client.go b/ats/linktoken/client.go index 37f17df..b925248 100644 --- a/ats/linktoken/client.go +++ b/ats/linktoken/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *ats.EndUserDetailsRequest, opts ...option.RequestOption, ) (*ats.LinkToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/link-token" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.LinkToken - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/linktoken/raw_client.go b/ats/linktoken/raw_client.go new file mode 100644 index 0000000..f732655 --- /dev/null +++ b/ats/linktoken/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package linktoken + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.EndUserDetailsRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.LinkToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/link-token" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.LinkToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.LinkToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/offers.go b/ats/offers.go index 5677584..f41ebd2 100644 --- a/ats/offers.go +++ b/ats/offers.go @@ -6,9 +6,28 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + offersListRequestFieldApplicationId = big.NewInt(1 << 0) + offersListRequestFieldCreatedAfter = big.NewInt(1 << 1) + offersListRequestFieldCreatedBefore = big.NewInt(1 << 2) + offersListRequestFieldCreatorId = big.NewInt(1 << 3) + offersListRequestFieldCursor = big.NewInt(1 << 4) + offersListRequestFieldExpand = big.NewInt(1 << 5) + offersListRequestFieldIncludeDeletedData = big.NewInt(1 << 6) + offersListRequestFieldIncludeRemoteData = big.NewInt(1 << 7) + offersListRequestFieldIncludeShellData = big.NewInt(1 << 8) + offersListRequestFieldModifiedAfter = big.NewInt(1 << 9) + offersListRequestFieldModifiedBefore = big.NewInt(1 << 10) + offersListRequestFieldPageSize = big.NewInt(1 << 11) + offersListRequestFieldRemoteFields = big.NewInt(1 << 12) + offersListRequestFieldRemoteId = big.NewInt(1 << 13) + offersListRequestFieldShowEnumOrigins = big.NewInt(1 << 14) +) + type OffersListRequest struct { // If provided, will only return offers for this application. ApplicationId *string `json:"-" url:"application_id,omitempty"` @@ -40,8 +59,131 @@ type OffersListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (o *OffersListRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetApplicationId sets the ApplicationId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetApplicationId(applicationId *string) { + o.ApplicationId = applicationId + o.require(offersListRequestFieldApplicationId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetCreatedAfter(createdAfter *time.Time) { + o.CreatedAfter = createdAfter + o.require(offersListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetCreatedBefore(createdBefore *time.Time) { + o.CreatedBefore = createdBefore + o.require(offersListRequestFieldCreatedBefore) +} + +// SetCreatorId sets the CreatorId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetCreatorId(creatorId *string) { + o.CreatorId = creatorId + o.require(offersListRequestFieldCreatorId) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetCursor(cursor *string) { + o.Cursor = cursor + o.require(offersListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetExpand(expand []*OffersListRequestExpandItem) { + o.Expand = expand + o.require(offersListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + o.IncludeDeletedData = includeDeletedData + o.require(offersListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + o.IncludeRemoteData = includeRemoteData + o.require(offersListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetIncludeShellData(includeShellData *bool) { + o.IncludeShellData = includeShellData + o.require(offersListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + o.ModifiedAfter = modifiedAfter + o.require(offersListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + o.ModifiedBefore = modifiedBefore + o.require(offersListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetPageSize(pageSize *int) { + o.PageSize = pageSize + o.require(offersListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetRemoteFields(remoteFields *string) { + o.RemoteFields = remoteFields + o.require(offersListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetRemoteId(remoteId *string) { + o.RemoteId = remoteId + o.require(offersListRequestFieldRemoteId) } +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + o.ShowEnumOrigins = showEnumOrigins + o.require(offersListRequestFieldShowEnumOrigins) +} + +var ( + offersRetrieveRequestFieldExpand = big.NewInt(1 << 0) + offersRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + offersRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + offersRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + offersRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type OffersRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*OffersRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -53,6 +195,51 @@ type OffersRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (o *OffersRetrieveRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersRetrieveRequest) SetExpand(expand []*OffersRetrieveRequestExpandItem) { + o.Expand = expand + o.require(offersRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + o.IncludeRemoteData = includeRemoteData + o.require(offersRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + o.IncludeShellData = includeShellData + o.require(offersRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersRetrieveRequest) SetRemoteFields(remoteFields *string) { + o.RemoteFields = remoteFields + o.require(offersRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OffersRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + o.ShowEnumOrigins = showEnumOrigins + o.require(offersRetrieveRequestFieldShowEnumOrigins) } type OffersListRequestExpandItem string @@ -99,11 +286,20 @@ func (o OffersRetrieveRequestExpandItem) Ptr() *OffersRetrieveRequestExpandItem return &o } +var ( + paginatedOfferListFieldNext = big.NewInt(1 << 0) + paginatedOfferListFieldPrevious = big.NewInt(1 << 1) + paginatedOfferListFieldResults = big.NewInt(1 << 2) +) + type PaginatedOfferList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Offer `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -133,6 +329,34 @@ func (p *PaginatedOfferList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedOfferList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedOfferList) SetNext(next *string) { + p.Next = next + p.require(paginatedOfferListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedOfferList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedOfferListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedOfferList) SetResults(results []*Offer) { + p.Results = results + p.require(paginatedOfferListFieldResults) +} + func (p *PaginatedOfferList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedOfferList var value unmarshaler @@ -149,6 +373,17 @@ func (p *PaginatedOfferList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedOfferList) MarshalJSON() ([]byte, error) { + type embed PaginatedOfferList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedOfferList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/offers/ats_offers_test/ats_offers_test.go b/ats/offers/ats_offers_test/ats_offers_test.go new file mode 100644 index 0000000..7bcd8ab --- /dev/null +++ b/ats/offers/ats_offers_test/ats_offers_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_offers_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsOffersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.OffersListRequest{ + ApplicationId: merge.String( + "application_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatorId: merge.String( + "creator_id", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.Offers.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/offers", map[string]string{"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"}, 1) +} + +func TestAtsOffersRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.OffersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Offers.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/offers/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "status", "show_enum_origins": "status"}, 1) +} diff --git a/ats/offers/client.go b/ats/offers/client.go index f14b4ce..5d8114c 100644 --- a/ats/offers/client.go +++ b/ats/offers/client.go @@ -4,7 +4,6 @@ package offers import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.OffersListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Offer], error) { +) (*core.Page[*string, *ats.Offer], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedOfferList) *internal.PageResponse[*string, *ats.Offer] { + readPageResponse := func(response *ats.PaginatedOfferList) *core.PageResponse[*string, *ats.Offer] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Offer]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Offer]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ats.OffersRetrieveRequest, opts ...option.RequestOption, ) (*ats.Offer, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/offers/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Offer - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/offers/raw_client.go b/ats/offers/raw_client.go new file mode 100644 index 0000000..ffb4358 --- /dev/null +++ b/ats/offers/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package offers + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.OffersRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Offer], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/offers/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Offer + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Offer]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/offices.go b/ats/offices.go index f76720e..c621895 100644 --- a/ats/offices.go +++ b/ats/offices.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + officesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + officesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + officesListRequestFieldCursor = big.NewInt(1 << 2) + officesListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + officesListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + officesListRequestFieldIncludeShellData = big.NewInt(1 << 5) + officesListRequestFieldModifiedAfter = big.NewInt(1 << 6) + officesListRequestFieldModifiedBefore = big.NewInt(1 << 7) + officesListRequestFieldPageSize = big.NewInt(1 << 8) + officesListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type OfficesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,20 +44,138 @@ type OfficesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (o *OfficesListRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetCreatedAfter(createdAfter *time.Time) { + o.CreatedAfter = createdAfter + o.require(officesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetCreatedBefore(createdBefore *time.Time) { + o.CreatedBefore = createdBefore + o.require(officesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetCursor(cursor *string) { + o.Cursor = cursor + o.require(officesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + o.IncludeDeletedData = includeDeletedData + o.require(officesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + o.IncludeRemoteData = includeRemoteData + o.require(officesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetIncludeShellData(includeShellData *bool) { + o.IncludeShellData = includeShellData + o.require(officesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + o.ModifiedAfter = modifiedAfter + o.require(officesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + o.ModifiedBefore = modifiedBefore + o.require(officesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetPageSize(pageSize *int) { + o.PageSize = pageSize + o.require(officesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesListRequest) SetRemoteId(remoteId *string) { + o.RemoteId = remoteId + o.require(officesListRequestFieldRemoteId) } +var ( + officesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + officesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type OfficesRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (o *OfficesRetrieveRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + o.IncludeRemoteData = includeRemoteData + o.require(officesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OfficesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + o.IncludeShellData = includeShellData + o.require(officesRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedOfficeListFieldNext = big.NewInt(1 << 0) + paginatedOfficeListFieldPrevious = big.NewInt(1 << 1) + paginatedOfficeListFieldResults = big.NewInt(1 << 2) +) + type PaginatedOfficeList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Office `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -73,6 +205,34 @@ func (p *PaginatedOfficeList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedOfficeList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedOfficeList) SetNext(next *string) { + p.Next = next + p.require(paginatedOfficeListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedOfficeList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedOfficeListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedOfficeList) SetResults(results []*Office) { + p.Results = results + p.require(paginatedOfficeListFieldResults) +} + func (p *PaginatedOfficeList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedOfficeList var value unmarshaler @@ -89,6 +249,17 @@ func (p *PaginatedOfficeList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedOfficeList) MarshalJSON() ([]byte, error) { + type embed PaginatedOfficeList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedOfficeList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/offices/ats_offices_test/ats_offices_test.go b/ats/offices/ats_offices_test/ats_offices_test.go new file mode 100644 index 0000000..ee6013d --- /dev/null +++ b/ats/offices/ats_offices_test/ats_offices_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_offices_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsOfficesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.OfficesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.Offices.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/offices", map[string]string{"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"}, 1) +} + +func TestAtsOfficesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.OfficesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Offices.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/offices/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ats/offices/client.go b/ats/offices/client.go index 3ca414c..22aea93 100644 --- a/ats/offices/client.go +++ b/ats/offices/client.go @@ -4,7 +4,6 @@ package offices import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.OfficesListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Office], error) { +) (*core.Page[*string, *ats.Office], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedOfficeList) *internal.PageResponse[*string, *ats.Office] { + readPageResponse := func(response *ats.PaginatedOfficeList) *core.PageResponse[*string, *ats.Office] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Office]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Office]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ats.OfficesRetrieveRequest, opts ...option.RequestOption, ) (*ats.Office, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/offices/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Office - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/offices/raw_client.go b/ats/offices/raw_client.go new file mode 100644 index 0000000..04a7cee --- /dev/null +++ b/ats/offices/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package offices + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.OfficesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Office], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/offices/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Office + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Office]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/passthrough/ats_passthrough_test/ats_passthrough_test.go b/ats/passthrough/ats_passthrough_test/ats_passthrough_test.go new file mode 100644 index 0000000..a097ff8 --- /dev/null +++ b/ats/passthrough/ats_passthrough_test/ats_passthrough_test.go @@ -0,0 +1,85 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.DataPassthroughRequest{ + Method: ats.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Ats.Passthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/passthrough", nil, 1) +} diff --git a/ats/passthrough/client.go b/ats/passthrough/client.go index f30a0fe..41f553e 100644 --- a/ats/passthrough/client.go +++ b/ats/passthrough/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *ats.DataPassthroughRequest, opts ...option.RequestOption, ) (*ats.RemoteResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.RemoteResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/passthrough/raw_client.go b/ats/passthrough/raw_client.go new file mode 100644 index 0000000..ecbdd06 --- /dev/null +++ b/ats/passthrough/raw_client.go @@ -0,0 +1,72 @@ +// Code generated by Fern. DO NOT EDIT. + +package passthrough + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.RemoteResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.RemoteResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.RemoteResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/regenerate_key.go b/ats/regenerate_key.go index ee15ae1..52552a4 100644 --- a/ats/regenerate_key.go +++ b/ats/regenerate_key.go @@ -2,7 +2,32 @@ package ats +import ( + big "math/big" +) + +var ( + remoteKeyForRegenerationRequestFieldName = big.NewInt(1 << 0) +) + type RemoteKeyForRegenerationRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteKeyForRegenerationRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKeyForRegenerationRequest) SetName(name string) { + r.Name = name + r.require(remoteKeyForRegenerationRequestFieldName) } diff --git a/ats/regeneratekey/ats_regenerate_key_test/ats_regenerate_key_test.go b/ats/regeneratekey/ats_regenerate_key_test/ats_regenerate_key_test.go new file mode 100644 index 0000000..19dc727 --- /dev/null +++ b/ats/regeneratekey/ats_regenerate_key_test/ats_regenerate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_regenerate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsRegenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Ats.RegenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/regenerate-key", nil, 1) +} diff --git a/ats/regeneratekey/client.go b/ats/regeneratekey/client.go index 4f6dbbf..ae71d22 100644 --- a/ats/regeneratekey/client.go +++ b/ats/regeneratekey/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *ats.RemoteKeyForRegenerationRequest, opts ...option.RequestOption, ) (*ats.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/regenerate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/regeneratekey/raw_client.go b/ats/regeneratekey/raw_client.go new file mode 100644 index 0000000..ddf840a --- /dev/null +++ b/ats/regeneratekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package regeneratekey + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.RemoteKeyForRegenerationRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/regenerate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/reject_reasons.go b/ats/reject_reasons.go index e6b790b..dffcab0 100644 --- a/ats/reject_reasons.go +++ b/ats/reject_reasons.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + rejectReasonsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + rejectReasonsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + rejectReasonsListRequestFieldCursor = big.NewInt(1 << 2) + rejectReasonsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + rejectReasonsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + rejectReasonsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + rejectReasonsListRequestFieldModifiedAfter = big.NewInt(1 << 6) + rejectReasonsListRequestFieldModifiedBefore = big.NewInt(1 << 7) + rejectReasonsListRequestFieldPageSize = big.NewInt(1 << 8) + rejectReasonsListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type RejectReasonsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,20 +44,138 @@ type RejectReasonsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RejectReasonsListRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetCreatedAfter(createdAfter *time.Time) { + r.CreatedAfter = createdAfter + r.require(rejectReasonsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetCreatedBefore(createdBefore *time.Time) { + r.CreatedBefore = createdBefore + r.require(rejectReasonsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetCursor(cursor *string) { + r.Cursor = cursor + r.require(rejectReasonsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + r.IncludeDeletedData = includeDeletedData + r.require(rejectReasonsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + r.IncludeRemoteData = includeRemoteData + r.require(rejectReasonsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetIncludeShellData(includeShellData *bool) { + r.IncludeShellData = includeShellData + r.require(rejectReasonsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + r.ModifiedAfter = modifiedAfter + r.require(rejectReasonsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + r.ModifiedBefore = modifiedBefore + r.require(rejectReasonsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetPageSize(pageSize *int) { + r.PageSize = pageSize + r.require(rejectReasonsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsListRequest) SetRemoteId(remoteId *string) { + r.RemoteId = remoteId + r.require(rejectReasonsListRequestFieldRemoteId) } +var ( + rejectReasonsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + rejectReasonsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type RejectReasonsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (r *RejectReasonsRetrieveRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + r.IncludeRemoteData = includeRemoteData + r.require(rejectReasonsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReasonsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + r.IncludeShellData = includeShellData + r.require(rejectReasonsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedRejectReasonListFieldNext = big.NewInt(1 << 0) + paginatedRejectReasonListFieldPrevious = big.NewInt(1 << 1) + paginatedRejectReasonListFieldResults = big.NewInt(1 << 2) +) + type PaginatedRejectReasonList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*RejectReason `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -73,6 +205,34 @@ func (p *PaginatedRejectReasonList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedRejectReasonList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRejectReasonList) SetNext(next *string) { + p.Next = next + p.require(paginatedRejectReasonListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRejectReasonList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedRejectReasonListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRejectReasonList) SetResults(results []*RejectReason) { + p.Results = results + p.require(paginatedRejectReasonListFieldResults) +} + func (p *PaginatedRejectReasonList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedRejectReasonList var value unmarshaler @@ -89,6 +249,17 @@ func (p *PaginatedRejectReasonList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedRejectReasonList) MarshalJSON() ([]byte, error) { + type embed PaginatedRejectReasonList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedRejectReasonList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/rejectreasons/ats_reject_reasons_test/ats_reject_reasons_test.go b/ats/rejectreasons/ats_reject_reasons_test/ats_reject_reasons_test.go new file mode 100644 index 0000000..f0d6f3e --- /dev/null +++ b/ats/rejectreasons/ats_reject_reasons_test/ats_reject_reasons_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_reject_reasons_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsRejectReasonsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.RejectReasonsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.RejectReasons.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/reject-reasons", map[string]string{"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"}, 1) +} + +func TestAtsRejectReasonsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.RejectReasonsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.RejectReasons.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/reject-reasons/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ats/rejectreasons/client.go b/ats/rejectreasons/client.go index 884096a..28ceeb1 100644 --- a/ats/rejectreasons/client.go +++ b/ats/rejectreasons/client.go @@ -4,7 +4,6 @@ package rejectreasons import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.RejectReasonsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.RejectReason], error) { +) (*core.Page[*string, *ats.RejectReason], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedRejectReasonList) *internal.PageResponse[*string, *ats.RejectReason] { + readPageResponse := func(response *ats.PaginatedRejectReasonList) *core.PageResponse[*string, *ats.RejectReason] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.RejectReason]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.RejectReason]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ats.RejectReasonsRetrieveRequest, opts ...option.RequestOption, ) (*ats.RejectReason, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/reject-reasons/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.RejectReason - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/rejectreasons/raw_client.go b/ats/rejectreasons/raw_client.go new file mode 100644 index 0000000..97bef02 --- /dev/null +++ b/ats/rejectreasons/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package rejectreasons + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.RejectReasonsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.RejectReason], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/reject-reasons/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.RejectReason + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.RejectReason]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/scopes.go b/ats/scopes.go index 5bc15c2..ca734c6 100644 --- a/ats/scopes.go +++ b/ats/scopes.go @@ -6,17 +6,46 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels = big.NewInt(1 << 0) ) type LinkedAccountCommonModelScopeDeserializerRequest struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountCommonModelScopeDeserializerRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountCommonModelScopeDeserializerRequest) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializerRequest) { + l.CommonModels = commonModels + l.require(linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels) } +var ( + commonModelScopeApiFieldCommonModels = big.NewInt(1 << 0) +) + type CommonModelScopeApi struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models" url:"common_models"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -32,6 +61,20 @@ func (c *CommonModelScopeApi) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CommonModelScopeApi) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopeApi) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializer) { + c.CommonModels = commonModels + c.require(commonModelScopeApiFieldCommonModels) +} + func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopeApi var value unmarshaler @@ -48,6 +91,17 @@ func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopeApi) MarshalJSON() ([]byte, error) { + type embed CommonModelScopeApi + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopeApi) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -60,10 +114,18 @@ func (c *CommonModelScopeApi) String() string { return fmt.Sprintf("%#v", c) } +var ( + fieldPermissionDeserializerFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializer struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -86,6 +148,27 @@ func (f *FieldPermissionDeserializer) GetExtraProperties() map[string]interface{ return f.extraProperties } +func (f *FieldPermissionDeserializer) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerFieldDisabledFields) +} + func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializer var value unmarshaler @@ -102,6 +185,17 @@ func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializer) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -114,11 +208,20 @@ func (f *FieldPermissionDeserializer) String() string { return fmt.Sprintf("%#v", f) } +var ( + individualCommonModelScopeDeserializerFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializer struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -148,6 +251,34 @@ func (i *IndividualCommonModelScopeDeserializer) GetExtraProperties() map[string return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializer) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializer) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializer) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializer var value unmarshaler @@ -164,6 +295,17 @@ func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) erro return nil } +func (i *IndividualCommonModelScopeDeserializer) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializer) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -176,9 +318,16 @@ func (i *IndividualCommonModelScopeDeserializer) String() string { return fmt.Sprintf("%#v", i) } +var ( + modelPermissionDeserializerFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializer struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -194,6 +343,20 @@ func (m *ModelPermissionDeserializer) GetExtraProperties() map[string]interface{ return m.extraProperties } +func (m *ModelPermissionDeserializer) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializer) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerFieldIsEnabled) +} + func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializer var value unmarshaler @@ -210,6 +373,17 @@ func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializer) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { diff --git a/ats/scopes/ats_scopes_test/ats_scopes_test.go b/ats/scopes/ats_scopes_test/ats_scopes_test.go new file mode 100644 index 0000000..b22e0be --- /dev/null +++ b/ats/scopes/ats_scopes_test/ats_scopes_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_scopes_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsScopesDefaultScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/default-scopes", nil, 1) +} + +func TestAtsScopesLinkedAccountScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/linked-account-scopes", nil, 1) +} + +func TestAtsScopesLinkedAccountScopesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*ats.IndividualCommonModelScopeDeserializerRequest{ + &ats.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*ats.ModelPermissionDeserializerRequest{ + "READ": &ats.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &ats.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &ats.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &ats.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*ats.ModelPermissionDeserializerRequest{ + "WRITE": &ats.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } + _, invocationErr := client.Ats.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/linked-account-scopes", nil, 1) +} diff --git a/ats/scopes/client.go b/ats/scopes/client.go index 9c302d5..5627bfd 100644 --- a/ats/scopes/client.go +++ b/ats/scopes/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) DefaultScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ats.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/default-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.DefaultScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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). @@ -72,35 +52,14 @@ func (c *Client) LinkedAccountScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ats.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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) @@ -109,35 +68,13 @@ func (c *Client) LinkedAccountScopesCreate( request *ats.LinkedAccountCommonModelScopeDeserializerRequest, opts ...option.RequestOption, ) (*ats.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/scopes/raw_client.go b/ats/scopes/raw_client.go new file mode 100644 index 0000000..50a4425 --- /dev/null +++ b/ats/scopes/raw_client.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package scopes + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) DefaultScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ats.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/default-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ats.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesCreate( + ctx context.Context, + request *ats.LinkedAccountCommonModelScopeDeserializerRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/scorecards.go b/ats/scorecards.go index 0e3b15c..6b7c7fc 100644 --- a/ats/scorecards.go +++ b/ats/scorecards.go @@ -6,9 +6,29 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + scorecardsListRequestFieldApplicationId = big.NewInt(1 << 0) + scorecardsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + scorecardsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + scorecardsListRequestFieldCursor = big.NewInt(1 << 3) + scorecardsListRequestFieldExpand = big.NewInt(1 << 4) + scorecardsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + scorecardsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + scorecardsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + scorecardsListRequestFieldInterviewId = big.NewInt(1 << 8) + scorecardsListRequestFieldInterviewerId = big.NewInt(1 << 9) + scorecardsListRequestFieldModifiedAfter = big.NewInt(1 << 10) + scorecardsListRequestFieldModifiedBefore = big.NewInt(1 << 11) + scorecardsListRequestFieldPageSize = big.NewInt(1 << 12) + scorecardsListRequestFieldRemoteFields = big.NewInt(1 << 13) + scorecardsListRequestFieldRemoteId = big.NewInt(1 << 14) + scorecardsListRequestFieldShowEnumOrigins = big.NewInt(1 << 15) +) + type ScorecardsListRequest struct { // If provided, will only return scorecards for this application. ApplicationId *string `json:"-" url:"application_id,omitempty"` @@ -42,8 +62,138 @@ type ScorecardsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (s *ScorecardsListRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetApplicationId sets the ApplicationId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetApplicationId(applicationId *string) { + s.ApplicationId = applicationId + s.require(scorecardsListRequestFieldApplicationId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetCreatedAfter(createdAfter *time.Time) { + s.CreatedAfter = createdAfter + s.require(scorecardsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetCreatedBefore(createdBefore *time.Time) { + s.CreatedBefore = createdBefore + s.require(scorecardsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetCursor(cursor *string) { + s.Cursor = cursor + s.require(scorecardsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetExpand(expand []*ScorecardsListRequestExpandItem) { + s.Expand = expand + s.require(scorecardsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + s.IncludeDeletedData = includeDeletedData + s.require(scorecardsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + s.IncludeRemoteData = includeRemoteData + s.require(scorecardsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetIncludeShellData(includeShellData *bool) { + s.IncludeShellData = includeShellData + s.require(scorecardsListRequestFieldIncludeShellData) +} + +// SetInterviewId sets the InterviewId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetInterviewId(interviewId *string) { + s.InterviewId = interviewId + s.require(scorecardsListRequestFieldInterviewId) +} + +// SetInterviewerId sets the InterviewerId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetInterviewerId(interviewerId *string) { + s.InterviewerId = interviewerId + s.require(scorecardsListRequestFieldInterviewerId) } +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + s.ModifiedAfter = modifiedAfter + s.require(scorecardsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + s.ModifiedBefore = modifiedBefore + s.require(scorecardsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetPageSize(pageSize *int) { + s.PageSize = pageSize + s.require(scorecardsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetRemoteFields(remoteFields *string) { + s.RemoteFields = remoteFields + s.require(scorecardsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetRemoteId(remoteId *string) { + s.RemoteId = remoteId + s.require(scorecardsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + s.ShowEnumOrigins = showEnumOrigins + s.require(scorecardsListRequestFieldShowEnumOrigins) +} + +var ( + scorecardsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + scorecardsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + scorecardsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + scorecardsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + scorecardsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type ScorecardsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*ScorecardsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -55,6 +205,51 @@ type ScorecardsRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (s *ScorecardsRetrieveRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsRetrieveRequest) SetExpand(expand []*ScorecardsRetrieveRequestExpandItem) { + s.Expand = expand + s.require(scorecardsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + s.IncludeRemoteData = includeRemoteData + s.require(scorecardsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + s.IncludeShellData = includeShellData + s.require(scorecardsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsRetrieveRequest) SetRemoteFields(remoteFields *string) { + s.RemoteFields = remoteFields + s.require(scorecardsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScorecardsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + s.ShowEnumOrigins = showEnumOrigins + s.require(scorecardsRetrieveRequestFieldShowEnumOrigins) } type ScorecardsListRequestExpandItem string @@ -143,11 +338,20 @@ func (o OverallRecommendationEnum) Ptr() *OverallRecommendationEnum { return &o } +var ( + paginatedScorecardListFieldNext = big.NewInt(1 << 0) + paginatedScorecardListFieldPrevious = big.NewInt(1 << 1) + paginatedScorecardListFieldResults = big.NewInt(1 << 2) +) + type PaginatedScorecardList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Scorecard `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -177,6 +381,34 @@ func (p *PaginatedScorecardList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedScorecardList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedScorecardList) SetNext(next *string) { + p.Next = next + p.require(paginatedScorecardListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedScorecardList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedScorecardListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedScorecardList) SetResults(results []*Scorecard) { + p.Results = results + p.require(paginatedScorecardListFieldResults) +} + func (p *PaginatedScorecardList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedScorecardList var value unmarshaler @@ -193,6 +425,17 @@ func (p *PaginatedScorecardList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedScorecardList) MarshalJSON() ([]byte, error) { + type embed PaginatedScorecardList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedScorecardList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -210,6 +453,22 @@ func (p *PaginatedScorecardList) String() string { // 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. +var ( + scorecardFieldId = big.NewInt(1 << 0) + scorecardFieldRemoteId = big.NewInt(1 << 1) + scorecardFieldCreatedAt = big.NewInt(1 << 2) + scorecardFieldModifiedAt = big.NewInt(1 << 3) + scorecardFieldApplication = big.NewInt(1 << 4) + scorecardFieldInterview = big.NewInt(1 << 5) + scorecardFieldInterviewer = big.NewInt(1 << 6) + scorecardFieldRemoteCreatedAt = big.NewInt(1 << 7) + scorecardFieldSubmittedAt = big.NewInt(1 << 8) + scorecardFieldOverallRecommendation = big.NewInt(1 << 9) + scorecardFieldRemoteWasDeleted = big.NewInt(1 << 10) + scorecardFieldFieldMappings = big.NewInt(1 << 11) + scorecardFieldRemoteData = big.NewInt(1 << 12) +) + type Scorecard struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -241,6 +500,9 @@ type Scorecard struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -340,6 +602,104 @@ func (s *Scorecard) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *Scorecard) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetId(id *string) { + s.Id = id + s.require(scorecardFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetRemoteId(remoteId *string) { + s.RemoteId = remoteId + s.require(scorecardFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetCreatedAt(createdAt *time.Time) { + s.CreatedAt = createdAt + s.require(scorecardFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetModifiedAt(modifiedAt *time.Time) { + s.ModifiedAt = modifiedAt + s.require(scorecardFieldModifiedAt) +} + +// SetApplication sets the Application field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetApplication(application *ScorecardApplication) { + s.Application = application + s.require(scorecardFieldApplication) +} + +// SetInterview sets the Interview field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetInterview(interview *ScorecardInterview) { + s.Interview = interview + s.require(scorecardFieldInterview) +} + +// SetInterviewer sets the Interviewer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetInterviewer(interviewer *ScorecardInterviewer) { + s.Interviewer = interviewer + s.require(scorecardFieldInterviewer) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + s.RemoteCreatedAt = remoteCreatedAt + s.require(scorecardFieldRemoteCreatedAt) +} + +// SetSubmittedAt sets the SubmittedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetSubmittedAt(submittedAt *time.Time) { + s.SubmittedAt = submittedAt + s.require(scorecardFieldSubmittedAt) +} + +// SetOverallRecommendation sets the OverallRecommendation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetOverallRecommendation(overallRecommendation *ScorecardOverallRecommendation) { + s.OverallRecommendation = overallRecommendation + s.require(scorecardFieldOverallRecommendation) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetRemoteWasDeleted(remoteWasDeleted *bool) { + s.RemoteWasDeleted = remoteWasDeleted + s.require(scorecardFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetFieldMappings(fieldMappings map[string]interface{}) { + s.FieldMappings = fieldMappings + s.require(scorecardFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Scorecard) SetRemoteData(remoteData []*RemoteData) { + s.RemoteData = remoteData + s.require(scorecardFieldRemoteData) +} + func (s *Scorecard) UnmarshalJSON(data []byte) error { type embed Scorecard var unmarshaler = struct { @@ -383,7 +743,8 @@ func (s *Scorecard) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(s.RemoteCreatedAt), SubmittedAt: internal.NewOptionalDateTime(s.SubmittedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *Scorecard) String() string { diff --git a/ats/scorecards/ats_scorecards_test/ats_scorecards_test.go b/ats/scorecards/ats_scorecards_test/ats_scorecards_test.go new file mode 100644 index 0000000..5077e65 --- /dev/null +++ b/ats/scorecards/ats_scorecards_test/ats_scorecards_test.go @@ -0,0 +1,159 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_scorecards_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsScorecardsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ScorecardsListRequest{ + ApplicationId: merge.String( + "application_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + InterviewId: merge.String( + "interview_id", + ), + InterviewerId: merge.String( + "interviewer_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.Scorecards.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/scorecards", map[string]string{"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"}, 1) +} + +func TestAtsScorecardsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.ScorecardsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Scorecards.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/scorecards/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "overall_recommendation", "show_enum_origins": "overall_recommendation"}, 1) +} diff --git a/ats/scorecards/client.go b/ats/scorecards/client.go index edfa6cf..2dbc6e7 100644 --- a/ats/scorecards/client.go +++ b/ats/scorecards/client.go @@ -4,7 +4,6 @@ package scorecards import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.ScorecardsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Scorecard], error) { +) (*core.Page[*string, *ats.Scorecard], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedScorecardList) *internal.PageResponse[*string, *ats.Scorecard] { + readPageResponse := func(response *ats.PaginatedScorecardList) *core.PageResponse[*string, *ats.Scorecard] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Scorecard]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Scorecard]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ats.ScorecardsRetrieveRequest, opts ...option.RequestOption, ) (*ats.Scorecard, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/scorecards/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.Scorecard - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/scorecards/raw_client.go b/ats/scorecards/raw_client.go new file mode 100644 index 0000000..292594d --- /dev/null +++ b/ats/scorecards/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package scorecards + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.ScorecardsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.Scorecard], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/scorecards/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.Scorecard + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.Scorecard]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/sync_status.go b/ats/sync_status.go index db8af4a..b47ee73 100644 --- a/ats/sync_status.go +++ b/ats/sync_status.go @@ -6,6 +6,12 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + syncStatusListRequestFieldCursor = big.NewInt(1 << 0) + syncStatusListRequestFieldPageSize = big.NewInt(1 << 1) ) type SyncStatusListRequest struct { @@ -13,13 +19,46 @@ type SyncStatusListRequest struct { Cursor *string `json:"-" url:"cursor,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (s *SyncStatusListRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetCursor(cursor *string) { + s.Cursor = cursor + s.require(syncStatusListRequestFieldCursor) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetPageSize(pageSize *int) { + s.PageSize = pageSize + s.require(syncStatusListRequestFieldPageSize) +} + +var ( + paginatedSyncStatusListFieldNext = big.NewInt(1 << 0) + paginatedSyncStatusListFieldPrevious = big.NewInt(1 << 1) + paginatedSyncStatusListFieldResults = big.NewInt(1 << 2) +) + type PaginatedSyncStatusList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*SyncStatus `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -49,6 +88,34 @@ func (p *PaginatedSyncStatusList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedSyncStatusList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetNext(next *string) { + p.Next = next + p.require(paginatedSyncStatusListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedSyncStatusListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetResults(results []*SyncStatus) { + p.Results = results + p.require(paginatedSyncStatusListFieldResults) +} + func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedSyncStatusList var value unmarshaler @@ -65,6 +132,17 @@ func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedSyncStatusList) MarshalJSON() ([]byte, error) { + type embed PaginatedSyncStatusList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedSyncStatusList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/syncstatus/ats_sync_status_test/ats_sync_status_test.go b/ats/syncstatus/ats_sync_status_test/ats_sync_status_test.go new file mode 100644 index 0000000..7f0ba11 --- /dev/null +++ b/ats/syncstatus/ats_sync_status_test/ats_sync_status_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_sync_status_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsSyncStatusListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Ats.SyncStatus.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/sync-status", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "page_size": "1"}, 1) +} diff --git a/ats/syncstatus/client.go b/ats/syncstatus/client.go index 4bc370c..5f8d8de 100644 --- a/ats/syncstatus/client.go +++ b/ats/syncstatus/client.go @@ -4,7 +4,6 @@ package syncstatus import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.SyncStatusListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.SyncStatus], error) { +) (*core.Page[*string, *ats.SyncStatus], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedSyncStatusList) *internal.PageResponse[*string, *ats.SyncStatus] { + readPageResponse := func(response *ats.PaginatedSyncStatusList) *core.PageResponse[*string, *ats.SyncStatus] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.SyncStatus]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.SyncStatus]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ats/syncstatus/raw_client.go b/ats/syncstatus/raw_client.go new file mode 100644 index 0000000..bf7298f --- /dev/null +++ b/ats/syncstatus/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package syncstatus + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/ats/tags.go b/ats/tags.go index 6ccc90b..2de87d5 100644 --- a/ats/tags.go +++ b/ats/tags.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + tagsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + tagsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + tagsListRequestFieldCursor = big.NewInt(1 << 2) + tagsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + tagsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + tagsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + tagsListRequestFieldModifiedAfter = big.NewInt(1 << 6) + tagsListRequestFieldModifiedBefore = big.NewInt(1 << 7) + tagsListRequestFieldPageSize = big.NewInt(1 << 8) + tagsListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type TagsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,13 +44,102 @@ type TagsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TagsListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(tagsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(tagsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(tagsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(tagsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(tagsListRequestFieldIncludeRemoteData) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(tagsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(tagsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(tagsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(tagsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(tagsListRequestFieldRemoteId) +} + +var ( + paginatedTagListFieldNext = big.NewInt(1 << 0) + paginatedTagListFieldPrevious = big.NewInt(1 << 1) + paginatedTagListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTagList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Tag `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -66,6 +169,34 @@ func (p *PaginatedTagList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedTagList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTagList) SetNext(next *string) { + p.Next = next + p.require(paginatedTagListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTagList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTagListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTagList) SetResults(results []*Tag) { + p.Results = results + p.require(paginatedTagListFieldResults) +} + func (p *PaginatedTagList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTagList var value unmarshaler @@ -82,6 +213,17 @@ func (p *PaginatedTagList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTagList) MarshalJSON() ([]byte, error) { + type embed PaginatedTagList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTagList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -99,6 +241,16 @@ func (p *PaginatedTagList) String() string { // 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. +var ( + tagFieldRemoteId = big.NewInt(1 << 0) + tagFieldCreatedAt = big.NewInt(1 << 1) + tagFieldModifiedAt = big.NewInt(1 << 2) + tagFieldName = big.NewInt(1 << 3) + tagFieldRemoteWasDeleted = big.NewInt(1 << 4) + tagFieldFieldMappings = big.NewInt(1 << 5) + tagFieldRemoteData = big.NewInt(1 << 6) +) + type Tag struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -113,6 +265,9 @@ type Tag struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []map[string]interface{} `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -170,6 +325,62 @@ func (t *Tag) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *Tag) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(tagFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(tagFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(tagFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetName(name *string) { + t.Name = name + t.require(tagFieldName) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(tagFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(tagFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetRemoteData(remoteData []map[string]interface{}) { + t.RemoteData = remoteData + t.require(tagFieldRemoteData) +} + func (t *Tag) UnmarshalJSON(data []byte) error { type embed Tag var unmarshaler = struct { @@ -205,7 +416,8 @@ func (t *Tag) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *Tag) String() string { diff --git a/ats/tags/ats_tags_test/ats_tags_test.go b/ats/tags/ats_tags_test/ats_tags_test.go new file mode 100644 index 0000000..371d368 --- /dev/null +++ b/ats/tags/ats_tags_test/ats_tags_test.go @@ -0,0 +1,122 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_tags_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsTagsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.TagsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.Tags.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/tags", map[string]string{"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"}, 1) +} diff --git a/ats/tags/client.go b/ats/tags/client.go index 23623e8..531a964 100644 --- a/ats/tags/client.go +++ b/ats/tags/client.go @@ -4,7 +4,6 @@ package tags import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.TagsListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.Tag], error) { +) (*core.Page[*string, *ats.Tag], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedTagList) *internal.PageResponse[*string, *ats.Tag] { + readPageResponse := func(response *ats.PaginatedTagList) *core.PageResponse[*string, *ats.Tag] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.Tag]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.Tag]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ats/tags/raw_client.go b/ats/tags/raw_client.go new file mode 100644 index 0000000..e0faa79 --- /dev/null +++ b/ats/tags/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package tags + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/ats/types.go b/ats/types.go index 254aba0..a0c4eb5 100644 --- a/ats/types.go +++ b/ats/types.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) @@ -45,6 +46,19 @@ func (a AccessRoleEnum) Ptr() *AccessRoleEnum { return &a } +var ( + accountIntegrationFieldName = big.NewInt(1 << 0) + accountIntegrationFieldAbbreviatedName = big.NewInt(1 << 1) + accountIntegrationFieldCategories = big.NewInt(1 << 2) + accountIntegrationFieldImage = big.NewInt(1 << 3) + accountIntegrationFieldSquareImage = big.NewInt(1 << 4) + accountIntegrationFieldColor = big.NewInt(1 << 5) + accountIntegrationFieldSlug = big.NewInt(1 << 6) + accountIntegrationFieldApiEndpointsToDocumentationUrls = big.NewInt(1 << 7) + accountIntegrationFieldWebhookSetupGuideUrl = big.NewInt(1 << 8) + accountIntegrationFieldCategoryBetaStatus = big.NewInt(1 << 9) +) + type AccountIntegration struct { // Company name. Name string `json:"name" url:"name"` @@ -66,6 +80,9 @@ type AccountIntegration struct { // Category or categories this integration is in beta status for. CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty" url:"category_beta_status,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -144,6 +161,83 @@ func (a *AccountIntegration) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetName(name string) { + a.Name = name + a.require(accountIntegrationFieldName) +} + +// SetAbbreviatedName sets the AbbreviatedName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetAbbreviatedName(abbreviatedName *string) { + a.AbbreviatedName = abbreviatedName + a.require(accountIntegrationFieldAbbreviatedName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetImage(image *string) { + a.Image = image + a.require(accountIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetColor(color *string) { + a.Color = color + a.require(accountIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSlug(slug *string) { + a.Slug = slug + a.require(accountIntegrationFieldSlug) +} + +// SetApiEndpointsToDocumentationUrls sets the ApiEndpointsToDocumentationUrls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetApiEndpointsToDocumentationUrls(apiEndpointsToDocumentationUrls map[string]interface{}) { + a.ApiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls + a.require(accountIntegrationFieldApiEndpointsToDocumentationUrls) +} + +// SetWebhookSetupGuideUrl sets the WebhookSetupGuideUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetWebhookSetupGuideUrl(webhookSetupGuideUrl *string) { + a.WebhookSetupGuideUrl = webhookSetupGuideUrl + a.require(accountIntegrationFieldWebhookSetupGuideUrl) +} + +// SetCategoryBetaStatus sets the CategoryBetaStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategoryBetaStatus(categoryBetaStatus map[string]interface{}) { + a.CategoryBetaStatus = categoryBetaStatus + a.require(accountIntegrationFieldCategoryBetaStatus) +} + func (a *AccountIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountIntegration var value unmarshaler @@ -160,6 +254,17 @@ func (a *AccountIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountIntegration) MarshalJSON() ([]byte, error) { + type embed AccountIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -178,6 +283,26 @@ func (a *AccountIntegration) String() string { // // ### Usage Example // Fetch from the `LIST Applications` endpoint and filter by `ID` to show all applications. +var ( + applicationFieldId = big.NewInt(1 << 0) + applicationFieldRemoteId = big.NewInt(1 << 1) + applicationFieldCreatedAt = big.NewInt(1 << 2) + applicationFieldModifiedAt = big.NewInt(1 << 3) + applicationFieldCandidate = big.NewInt(1 << 4) + applicationFieldJob = big.NewInt(1 << 5) + applicationFieldAppliedAt = big.NewInt(1 << 6) + applicationFieldRejectedAt = big.NewInt(1 << 7) + applicationFieldOffers = big.NewInt(1 << 8) + applicationFieldSource = big.NewInt(1 << 9) + applicationFieldCreditedTo = big.NewInt(1 << 10) + applicationFieldScreeningQuestionAnswers = big.NewInt(1 << 11) + applicationFieldCurrentStage = big.NewInt(1 << 12) + applicationFieldRejectReason = big.NewInt(1 << 13) + applicationFieldRemoteWasDeleted = big.NewInt(1 << 14) + applicationFieldFieldMappings = big.NewInt(1 << 15) + applicationFieldRemoteData = big.NewInt(1 << 16) +) + type Application struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -209,6 +334,9 @@ type Application struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -336,6 +464,132 @@ func (a *Application) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Application) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetId(id *string) { + a.Id = id + a.require(applicationFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(applicationFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(applicationFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(applicationFieldModifiedAt) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetCandidate(candidate *ApplicationCandidate) { + a.Candidate = candidate + a.require(applicationFieldCandidate) +} + +// SetJob sets the Job field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetJob(job *ApplicationJob) { + a.Job = job + a.require(applicationFieldJob) +} + +// SetAppliedAt sets the AppliedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetAppliedAt(appliedAt *time.Time) { + a.AppliedAt = appliedAt + a.require(applicationFieldAppliedAt) +} + +// SetRejectedAt sets the RejectedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetRejectedAt(rejectedAt *time.Time) { + a.RejectedAt = rejectedAt + a.require(applicationFieldRejectedAt) +} + +// SetOffers sets the Offers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetOffers(offers []*ApplicationOffersItem) { + a.Offers = offers + a.require(applicationFieldOffers) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetSource(source *string) { + a.Source = source + a.require(applicationFieldSource) +} + +// SetCreditedTo sets the CreditedTo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetCreditedTo(creditedTo *ApplicationCreditedTo) { + a.CreditedTo = creditedTo + a.require(applicationFieldCreditedTo) +} + +// SetScreeningQuestionAnswers sets the ScreeningQuestionAnswers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetScreeningQuestionAnswers(screeningQuestionAnswers []*ApplicationScreeningQuestionAnswersItem) { + a.ScreeningQuestionAnswers = screeningQuestionAnswers + a.require(applicationFieldScreeningQuestionAnswers) +} + +// SetCurrentStage sets the CurrentStage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetCurrentStage(currentStage *ApplicationCurrentStage) { + a.CurrentStage = currentStage + a.require(applicationFieldCurrentStage) +} + +// SetRejectReason sets the RejectReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetRejectReason(rejectReason *ApplicationRejectReason) { + a.RejectReason = rejectReason + a.require(applicationFieldRejectReason) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetRemoteWasDeleted(remoteWasDeleted *bool) { + a.RemoteWasDeleted = remoteWasDeleted + a.require(applicationFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetFieldMappings(fieldMappings map[string]interface{}) { + a.FieldMappings = fieldMappings + a.require(applicationFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Application) SetRemoteData(remoteData []*RemoteData) { + a.RemoteData = remoteData + a.require(applicationFieldRemoteData) +} + func (a *Application) UnmarshalJSON(data []byte) error { type embed Application var unmarshaler = struct { @@ -379,7 +633,8 @@ func (a *Application) MarshalJSON() ([]byte, error) { AppliedAt: internal.NewOptionalDateTime(a.AppliedAt), RejectedAt: internal.NewOptionalDateTime(a.RejectedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Application) String() string { @@ -838,6 +1093,20 @@ func (a *ApplicationScreeningQuestionAnswersItem) Accept(visitor ApplicationScre // 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. +var ( + attachmentFieldId = big.NewInt(1 << 0) + attachmentFieldRemoteId = big.NewInt(1 << 1) + attachmentFieldCreatedAt = big.NewInt(1 << 2) + attachmentFieldModifiedAt = big.NewInt(1 << 3) + attachmentFieldFileName = big.NewInt(1 << 4) + attachmentFieldFileUrl = big.NewInt(1 << 5) + attachmentFieldCandidate = big.NewInt(1 << 6) + attachmentFieldAttachmentType = big.NewInt(1 << 7) + attachmentFieldRemoteWasDeleted = big.NewInt(1 << 8) + attachmentFieldFieldMappings = big.NewInt(1 << 9) + attachmentFieldRemoteData = big.NewInt(1 << 10) +) + type Attachment struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -863,6 +1132,9 @@ type Attachment struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -948,6 +1220,90 @@ func (a *Attachment) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Attachment) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetId(id *string) { + a.Id = id + a.require(attachmentFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(attachmentFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(attachmentFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(attachmentFieldModifiedAt) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetFileName(fileName *string) { + a.FileName = fileName + a.require(attachmentFieldFileName) +} + +// SetFileUrl sets the FileUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetFileUrl(fileUrl *string) { + a.FileUrl = fileUrl + a.require(attachmentFieldFileUrl) +} + +// SetCandidate sets the Candidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetCandidate(candidate *string) { + a.Candidate = candidate + a.require(attachmentFieldCandidate) +} + +// SetAttachmentType sets the AttachmentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetAttachmentType(attachmentType *AttachmentAttachmentType) { + a.AttachmentType = attachmentType + a.require(attachmentFieldAttachmentType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetRemoteWasDeleted(remoteWasDeleted *bool) { + a.RemoteWasDeleted = remoteWasDeleted + a.require(attachmentFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetFieldMappings(fieldMappings map[string]interface{}) { + a.FieldMappings = fieldMappings + a.require(attachmentFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetRemoteData(remoteData []*RemoteData) { + a.RemoteData = remoteData + a.require(attachmentFieldRemoteData) +} + func (a *Attachment) UnmarshalJSON(data []byte) error { type embed Attachment var unmarshaler = struct { @@ -983,7 +1339,8 @@ func (a *Attachment) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Attachment) String() string { @@ -1103,6 +1460,32 @@ func (a AttachmentTypeEnum) Ptr() *AttachmentTypeEnum { // 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. +var ( + candidateFieldId = big.NewInt(1 << 0) + candidateFieldRemoteId = big.NewInt(1 << 1) + candidateFieldCreatedAt = big.NewInt(1 << 2) + candidateFieldModifiedAt = big.NewInt(1 << 3) + candidateFieldFirstName = big.NewInt(1 << 4) + candidateFieldLastName = big.NewInt(1 << 5) + candidateFieldCompany = big.NewInt(1 << 6) + candidateFieldTitle = big.NewInt(1 << 7) + candidateFieldRemoteCreatedAt = big.NewInt(1 << 8) + candidateFieldRemoteUpdatedAt = big.NewInt(1 << 9) + candidateFieldLastInteractionAt = big.NewInt(1 << 10) + candidateFieldIsPrivate = big.NewInt(1 << 11) + candidateFieldCanEmail = big.NewInt(1 << 12) + candidateFieldLocations = big.NewInt(1 << 13) + candidateFieldPhoneNumbers = big.NewInt(1 << 14) + candidateFieldEmailAddresses = big.NewInt(1 << 15) + candidateFieldUrls = big.NewInt(1 << 16) + candidateFieldTags = big.NewInt(1 << 17) + candidateFieldApplications = big.NewInt(1 << 18) + candidateFieldAttachments = big.NewInt(1 << 19) + candidateFieldRemoteWasDeleted = big.NewInt(1 << 20) + candidateFieldFieldMappings = big.NewInt(1 << 21) + candidateFieldRemoteData = big.NewInt(1 << 22) +) + type Candidate struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -1145,6 +1528,9 @@ type Candidate struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1314,6 +1700,174 @@ func (c *Candidate) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *Candidate) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetId(id *string) { + c.Id = id + c.require(candidateFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(candidateFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(candidateFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(candidateFieldModifiedAt) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetFirstName(firstName *string) { + c.FirstName = firstName + c.require(candidateFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetLastName(lastName *string) { + c.LastName = lastName + c.require(candidateFieldLastName) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetCompany(company *string) { + c.Company = company + c.require(candidateFieldCompany) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetTitle(title *string) { + c.Title = title + c.require(candidateFieldTitle) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + c.RemoteCreatedAt = remoteCreatedAt + c.require(candidateFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + c.RemoteUpdatedAt = remoteUpdatedAt + c.require(candidateFieldRemoteUpdatedAt) +} + +// SetLastInteractionAt sets the LastInteractionAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetLastInteractionAt(lastInteractionAt *time.Time) { + c.LastInteractionAt = lastInteractionAt + c.require(candidateFieldLastInteractionAt) +} + +// SetIsPrivate sets the IsPrivate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetIsPrivate(isPrivate *bool) { + c.IsPrivate = isPrivate + c.require(candidateFieldIsPrivate) +} + +// SetCanEmail sets the CanEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetCanEmail(canEmail *bool) { + c.CanEmail = canEmail + c.require(candidateFieldCanEmail) +} + +// SetLocations sets the Locations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetLocations(locations []*string) { + c.Locations = locations + c.require(candidateFieldLocations) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetPhoneNumbers(phoneNumbers []*PhoneNumber) { + c.PhoneNumbers = phoneNumbers + c.require(candidateFieldPhoneNumbers) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetEmailAddresses(emailAddresses []*EmailAddress) { + c.EmailAddresses = emailAddresses + c.require(candidateFieldEmailAddresses) +} + +// SetUrls sets the Urls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetUrls(urls []*Url) { + c.Urls = urls + c.require(candidateFieldUrls) +} + +// SetTags sets the Tags field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetTags(tags []*string) { + c.Tags = tags + c.require(candidateFieldTags) +} + +// SetApplications sets the Applications field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetApplications(applications []*CandidateApplicationsItem) { + c.Applications = applications + c.require(candidateFieldApplications) +} + +// SetAttachments sets the Attachments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetAttachments(attachments []*CandidateAttachmentsItem) { + c.Attachments = attachments + c.require(candidateFieldAttachments) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(candidateFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(candidateFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Candidate) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(candidateFieldRemoteData) +} + func (c *Candidate) UnmarshalJSON(data []byte) error { type embed Candidate var unmarshaler = struct { @@ -1361,7 +1915,8 @@ func (c *Candidate) MarshalJSON() ([]byte, error) { RemoteUpdatedAt: internal.NewOptionalDateTime(c.RemoteUpdatedAt), LastInteractionAt: internal.NewOptionalDateTime(c.LastInteractionAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *Candidate) String() string { @@ -1594,6 +2149,17 @@ func (c CategoryEnum) Ptr() *CategoryEnum { // // ### Usage Example // Create a `DataPassthrough` to get team hierarchies from your Rippling integration. +var ( + dataPassthroughRequestFieldMethod = big.NewInt(1 << 0) + dataPassthroughRequestFieldPath = big.NewInt(1 << 1) + dataPassthroughRequestFieldBaseUrlOverride = big.NewInt(1 << 2) + dataPassthroughRequestFieldData = big.NewInt(1 << 3) + dataPassthroughRequestFieldMultipartFormData = big.NewInt(1 << 4) + dataPassthroughRequestFieldHeaders = big.NewInt(1 << 5) + dataPassthroughRequestFieldRequestFormat = big.NewInt(1 << 6) + dataPassthroughRequestFieldNormalizeResponse = big.NewInt(1 << 7) +) + type DataPassthroughRequest struct { Method MethodEnum `json:"method" url:"method"` // The path of the request in the third party's platform. @@ -1610,6 +2176,9 @@ type DataPassthroughRequest struct { // 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`. NormalizeResponse *bool `json:"normalize_response,omitempty" url:"normalize_response,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1674,6 +2243,69 @@ func (d *DataPassthroughRequest) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DataPassthroughRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMethod(method MethodEnum) { + d.Method = method + d.require(dataPassthroughRequestFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetPath(path string) { + d.Path = path + d.require(dataPassthroughRequestFieldPath) +} + +// SetBaseUrlOverride sets the BaseUrlOverride field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetBaseUrlOverride(baseUrlOverride *string) { + d.BaseUrlOverride = baseUrlOverride + d.require(dataPassthroughRequestFieldBaseUrlOverride) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetData(data *string) { + d.Data = data + d.require(dataPassthroughRequestFieldData) +} + +// SetMultipartFormData sets the MultipartFormData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMultipartFormData(multipartFormData []*MultipartFormFieldRequest) { + d.MultipartFormData = multipartFormData + d.require(dataPassthroughRequestFieldMultipartFormData) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetHeaders(headers map[string]interface{}) { + d.Headers = headers + d.require(dataPassthroughRequestFieldHeaders) +} + +// SetRequestFormat sets the RequestFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetRequestFormat(requestFormat *RequestFormatEnum) { + d.RequestFormat = requestFormat + d.require(dataPassthroughRequestFieldRequestFormat) +} + +// SetNormalizeResponse sets the NormalizeResponse field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetNormalizeResponse(normalizeResponse *bool) { + d.NormalizeResponse = normalizeResponse + d.require(dataPassthroughRequestFieldNormalizeResponse) +} + func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { type unmarshaler DataPassthroughRequest var value unmarshaler @@ -1690,6 +2322,17 @@ func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { return nil } +func (d *DataPassthroughRequest) MarshalJSON() ([]byte, error) { + type embed DataPassthroughRequest + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DataPassthroughRequest) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -1702,11 +2345,20 @@ func (d *DataPassthroughRequest) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModeLogFieldLogId = big.NewInt(1 << 0) + debugModeLogFieldDashboardView = big.NewInt(1 << 1) + debugModeLogFieldLogSummary = big.NewInt(1 << 2) +) + type DebugModeLog struct { LogId string `json:"log_id" url:"log_id"` DashboardView string `json:"dashboard_view" url:"dashboard_view"` LogSummary *DebugModelLogSummary `json:"log_summary" url:"log_summary"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1736,6 +2388,34 @@ func (d *DebugModeLog) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModeLog) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetLogId sets the LogId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogId(logId string) { + d.LogId = logId + d.require(debugModeLogFieldLogId) +} + +// SetDashboardView sets the DashboardView field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetDashboardView(dashboardView string) { + d.DashboardView = dashboardView + d.require(debugModeLogFieldDashboardView) +} + +// SetLogSummary sets the LogSummary field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogSummary(logSummary *DebugModelLogSummary) { + d.LogSummary = logSummary + d.require(debugModeLogFieldLogSummary) +} + func (d *DebugModeLog) UnmarshalJSON(data []byte) error { type unmarshaler DebugModeLog var value unmarshaler @@ -1752,6 +2432,17 @@ func (d *DebugModeLog) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModeLog) MarshalJSON() ([]byte, error) { + type embed DebugModeLog + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModeLog) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -1764,11 +2455,20 @@ func (d *DebugModeLog) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModelLogSummaryFieldUrl = big.NewInt(1 << 0) + debugModelLogSummaryFieldMethod = big.NewInt(1 << 1) + debugModelLogSummaryFieldStatusCode = big.NewInt(1 << 2) +) + type DebugModelLogSummary struct { Url string `json:"url" url:"url"` Method string `json:"method" url:"method"` StatusCode int `json:"status_code" url:"status_code"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1798,6 +2498,34 @@ func (d *DebugModelLogSummary) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModelLogSummary) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetUrl sets the Url field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetUrl(url string) { + d.Url = url + d.require(debugModelLogSummaryFieldUrl) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetMethod(method string) { + d.Method = method + d.require(debugModelLogSummaryFieldMethod) +} + +// SetStatusCode sets the StatusCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetStatusCode(statusCode int) { + d.StatusCode = statusCode + d.require(debugModelLogSummaryFieldStatusCode) +} + func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { type unmarshaler DebugModelLogSummary var value unmarshaler @@ -1814,6 +2542,17 @@ func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModelLogSummary) MarshalJSON() ([]byte, error) { + type embed DebugModelLogSummary + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModelLogSummary) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -1831,6 +2570,17 @@ func (d *DebugModelLogSummary) String() string { // 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. +var ( + departmentFieldId = big.NewInt(1 << 0) + departmentFieldRemoteId = big.NewInt(1 << 1) + departmentFieldCreatedAt = big.NewInt(1 << 2) + departmentFieldModifiedAt = big.NewInt(1 << 3) + departmentFieldName = big.NewInt(1 << 4) + departmentFieldRemoteWasDeleted = big.NewInt(1 << 5) + departmentFieldFieldMappings = big.NewInt(1 << 6) + departmentFieldRemoteData = big.NewInt(1 << 7) +) + type Department struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -1846,6 +2596,9 @@ type Department struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1910,6 +2663,69 @@ func (d *Department) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *Department) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Department) SetId(id *string) { + d.Id = id + d.require(departmentFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Department) SetRemoteId(remoteId *string) { + d.RemoteId = remoteId + d.require(departmentFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Department) SetCreatedAt(createdAt *time.Time) { + d.CreatedAt = createdAt + d.require(departmentFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Department) SetModifiedAt(modifiedAt *time.Time) { + d.ModifiedAt = modifiedAt + d.require(departmentFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Department) SetName(name *string) { + d.Name = name + d.require(departmentFieldName) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Department) SetRemoteWasDeleted(remoteWasDeleted *bool) { + d.RemoteWasDeleted = remoteWasDeleted + d.require(departmentFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Department) SetFieldMappings(fieldMappings map[string]interface{}) { + d.FieldMappings = fieldMappings + d.require(departmentFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Department) SetRemoteData(remoteData []*RemoteData) { + d.RemoteData = remoteData + d.require(departmentFieldRemoteData) +} + func (d *Department) UnmarshalJSON(data []byte) error { type embed Department var unmarshaler = struct { @@ -1945,7 +2761,8 @@ func (d *Department) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(d.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(d.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) } func (d *Department) String() string { @@ -1965,6 +2782,14 @@ func (d *Department) String() string { // 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. +var ( + emailAddressFieldCreatedAt = big.NewInt(1 << 0) + emailAddressFieldModifiedAt = big.NewInt(1 << 1) + emailAddressFieldValue = big.NewInt(1 << 2) + emailAddressFieldEmailAddressType = big.NewInt(1 << 3) + emailAddressFieldRemoteWasDeleted = big.NewInt(1 << 4) +) + type EmailAddress struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -1981,6 +2806,9 @@ type EmailAddress struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2024,6 +2852,48 @@ func (e *EmailAddress) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EmailAddress) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddress) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(emailAddressFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddress) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(emailAddressFieldModifiedAt) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddress) SetValue(value *string) { + e.Value = value + e.require(emailAddressFieldValue) +} + +// SetEmailAddressType sets the EmailAddressType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddress) SetEmailAddressType(emailAddressType *EmailAddressEmailAddressType) { + e.EmailAddressType = emailAddressType + e.require(emailAddressFieldEmailAddressType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddress) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(emailAddressFieldRemoteWasDeleted) +} + func (e *EmailAddress) UnmarshalJSON(data []byte) error { type embed EmailAddress var unmarshaler = struct { @@ -2059,7 +2929,8 @@ func (e *EmailAddress) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(e.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(e.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *EmailAddress) String() string { @@ -2197,12 +3068,22 @@ func (e EncodingEnum) Ptr() *EncodingEnum { return &e } +var ( + errorValidationProblemFieldSource = big.NewInt(1 << 0) + errorValidationProblemFieldTitle = big.NewInt(1 << 1) + errorValidationProblemFieldDetail = big.NewInt(1 << 2) + errorValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type ErrorValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2239,6 +3120,41 @@ func (e *ErrorValidationProblem) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ErrorValidationProblem) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetSource(source *ValidationProblemSource) { + e.Source = source + e.require(errorValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetTitle(title string) { + e.Title = title + e.require(errorValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetDetail(detail string) { + e.Detail = detail + e.require(errorValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetProblemType(problemType string) { + e.ProblemType = problemType + e.require(errorValidationProblemFieldProblemType) +} + func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler ErrorValidationProblem var value unmarshaler @@ -2255,6 +3171,17 @@ func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (e *ErrorValidationProblem) MarshalJSON() ([]byte, error) { + type embed ErrorValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ErrorValidationProblem) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -2267,10 +3194,18 @@ func (e *ErrorValidationProblem) String() string { return fmt.Sprintf("%#v", e) } +var ( + fieldPermissionDeserializerRequestFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerRequestFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializerRequest struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2293,6 +3228,27 @@ func (f *FieldPermissionDeserializerRequest) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldPermissionDeserializerRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerRequestFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerRequestFieldDisabledFields) +} + func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializerRequest var value unmarshaler @@ -2309,6 +3265,17 @@ func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializerRequest) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -2321,11 +3288,20 @@ func (f *FieldPermissionDeserializerRequest) String() string { return fmt.Sprintf("%#v", f) } +var ( + individualCommonModelScopeDeserializerRequestFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerRequestFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerRequestFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializerRequest struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2355,6 +3331,34 @@ func (i *IndividualCommonModelScopeDeserializerRequest) GetExtraProperties() map return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializerRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerRequestFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializerRequest) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializerRequest) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializerRequest var value unmarshaler @@ -2371,6 +3375,17 @@ func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byt return nil } +func (i *IndividualCommonModelScopeDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializerRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -2388,6 +3403,30 @@ func (i *IndividualCommonModelScopeDeserializerRequest) String() string { // 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. +var ( + jobFieldId = big.NewInt(1 << 0) + jobFieldRemoteId = big.NewInt(1 << 1) + jobFieldCreatedAt = big.NewInt(1 << 2) + jobFieldModifiedAt = big.NewInt(1 << 3) + jobFieldName = big.NewInt(1 << 4) + jobFieldDescription = big.NewInt(1 << 5) + jobFieldCode = big.NewInt(1 << 6) + jobFieldStatus = big.NewInt(1 << 7) + jobFieldType = big.NewInt(1 << 8) + jobFieldJobPostings = big.NewInt(1 << 9) + jobFieldJobPostingUrls = big.NewInt(1 << 10) + jobFieldRemoteCreatedAt = big.NewInt(1 << 11) + jobFieldRemoteUpdatedAt = big.NewInt(1 << 12) + jobFieldConfidential = big.NewInt(1 << 13) + jobFieldDepartments = big.NewInt(1 << 14) + jobFieldOffices = big.NewInt(1 << 15) + jobFieldHiringManagers = big.NewInt(1 << 16) + jobFieldRecruiters = big.NewInt(1 << 17) + jobFieldRemoteWasDeleted = big.NewInt(1 << 18) + jobFieldFieldMappings = big.NewInt(1 << 19) + jobFieldRemoteData = big.NewInt(1 << 20) +) + type Job struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -2438,6 +3477,9 @@ type Job struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2561,36 +3603,190 @@ func (j *Job) GetHiringManagers() []*JobHiringManagersItem { return j.HiringManagers } -func (j *Job) GetRecruiters() []*JobRecruitersItem { - if j == nil { - return nil - } - return j.Recruiters +func (j *Job) GetRecruiters() []*JobRecruitersItem { + if j == nil { + return nil + } + return j.Recruiters +} + +func (j *Job) GetRemoteWasDeleted() *bool { + if j == nil { + return nil + } + return j.RemoteWasDeleted +} + +func (j *Job) GetFieldMappings() map[string]interface{} { + if j == nil { + return nil + } + return j.FieldMappings +} + +func (j *Job) GetRemoteData() []*RemoteData { + if j == nil { + return nil + } + return j.RemoteData +} + +func (j *Job) GetExtraProperties() map[string]interface{} { + return j.extraProperties +} + +func (j *Job) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetId(id *string) { + j.Id = id + j.require(jobFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(jobFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetCreatedAt(createdAt *time.Time) { + j.CreatedAt = createdAt + j.require(jobFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetModifiedAt(modifiedAt *time.Time) { + j.ModifiedAt = modifiedAt + j.require(jobFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetName(name *string) { + j.Name = name + j.require(jobFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetDescription(description *string) { + j.Description = description + j.require(jobFieldDescription) +} + +// SetCode sets the Code field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetCode(code *string) { + j.Code = code + j.require(jobFieldCode) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetStatus(status *JobStatus) { + j.Status = status + j.require(jobFieldStatus) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetType(type_ *JobType) { + j.Type = type_ + j.require(jobFieldType) +} + +// SetJobPostings sets the JobPostings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetJobPostings(jobPostings []*string) { + j.JobPostings = jobPostings + j.require(jobFieldJobPostings) +} + +// SetJobPostingUrls sets the JobPostingUrls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetJobPostingUrls(jobPostingUrls []*Url) { + j.JobPostingUrls = jobPostingUrls + j.require(jobFieldJobPostingUrls) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + j.RemoteCreatedAt = remoteCreatedAt + j.require(jobFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + j.RemoteUpdatedAt = remoteUpdatedAt + j.require(jobFieldRemoteUpdatedAt) +} + +// SetConfidential sets the Confidential field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetConfidential(confidential *bool) { + j.Confidential = confidential + j.require(jobFieldConfidential) +} + +// SetDepartments sets the Departments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetDepartments(departments []*JobDepartmentsItem) { + j.Departments = departments + j.require(jobFieldDepartments) +} + +// SetOffices sets the Offices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetOffices(offices []*JobOfficesItem) { + j.Offices = offices + j.require(jobFieldOffices) +} + +// SetHiringManagers sets the HiringManagers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetHiringManagers(hiringManagers []*JobHiringManagersItem) { + j.HiringManagers = hiringManagers + j.require(jobFieldHiringManagers) } -func (j *Job) GetRemoteWasDeleted() *bool { - if j == nil { - return nil - } - return j.RemoteWasDeleted +// SetRecruiters sets the Recruiters field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetRecruiters(recruiters []*JobRecruitersItem) { + j.Recruiters = recruiters + j.require(jobFieldRecruiters) } -func (j *Job) GetFieldMappings() map[string]interface{} { - if j == nil { - return nil - } - return j.FieldMappings +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetRemoteWasDeleted(remoteWasDeleted *bool) { + j.RemoteWasDeleted = remoteWasDeleted + j.require(jobFieldRemoteWasDeleted) } -func (j *Job) GetRemoteData() []*RemoteData { - if j == nil { - return nil - } - return j.RemoteData +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetFieldMappings(fieldMappings map[string]interface{}) { + j.FieldMappings = fieldMappings + j.require(jobFieldFieldMappings) } -func (j *Job) GetExtraProperties() map[string]interface{} { - return j.extraProperties +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Job) SetRemoteData(remoteData []*RemoteData) { + j.RemoteData = remoteData + j.require(jobFieldRemoteData) } func (j *Job) UnmarshalJSON(data []byte) error { @@ -2636,7 +3832,8 @@ func (j *Job) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(j.RemoteCreatedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(j.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) } func (j *Job) String() string { @@ -2780,6 +3977,19 @@ func (j *JobHiringManagersItem) Accept(visitor JobHiringManagersItemVisitor) err // 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. +var ( + jobInterviewStageFieldId = big.NewInt(1 << 0) + jobInterviewStageFieldRemoteId = big.NewInt(1 << 1) + jobInterviewStageFieldCreatedAt = big.NewInt(1 << 2) + jobInterviewStageFieldModifiedAt = big.NewInt(1 << 3) + jobInterviewStageFieldName = big.NewInt(1 << 4) + jobInterviewStageFieldJob = big.NewInt(1 << 5) + jobInterviewStageFieldStageOrder = big.NewInt(1 << 6) + jobInterviewStageFieldRemoteWasDeleted = big.NewInt(1 << 7) + jobInterviewStageFieldFieldMappings = big.NewInt(1 << 8) + jobInterviewStageFieldRemoteData = big.NewInt(1 << 9) +) + type JobInterviewStage struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -2799,6 +4009,9 @@ type JobInterviewStage struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2877,6 +4090,83 @@ func (j *JobInterviewStage) GetExtraProperties() map[string]interface{} { return j.extraProperties } +func (j *JobInterviewStage) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetId(id *string) { + j.Id = id + j.require(jobInterviewStageFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetRemoteId(remoteId *string) { + j.RemoteId = remoteId + j.require(jobInterviewStageFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetCreatedAt(createdAt *time.Time) { + j.CreatedAt = createdAt + j.require(jobInterviewStageFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetModifiedAt(modifiedAt *time.Time) { + j.ModifiedAt = modifiedAt + j.require(jobInterviewStageFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetName(name *string) { + j.Name = name + j.require(jobInterviewStageFieldName) +} + +// SetJob sets the Job field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetJob(job *JobInterviewStageJob) { + j.Job = job + j.require(jobInterviewStageFieldJob) +} + +// SetStageOrder sets the StageOrder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetStageOrder(stageOrder *int) { + j.StageOrder = stageOrder + j.require(jobInterviewStageFieldStageOrder) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetRemoteWasDeleted(remoteWasDeleted *bool) { + j.RemoteWasDeleted = remoteWasDeleted + j.require(jobInterviewStageFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetFieldMappings(fieldMappings map[string]interface{}) { + j.FieldMappings = fieldMappings + j.require(jobInterviewStageFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *JobInterviewStage) SetRemoteData(remoteData []*RemoteData) { + j.RemoteData = remoteData + j.require(jobInterviewStageFieldRemoteData) +} + func (j *JobInterviewStage) UnmarshalJSON(data []byte) error { type embed JobInterviewStage var unmarshaler = struct { @@ -2912,7 +4202,8 @@ func (j *JobInterviewStage) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(j.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(j.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) } func (j *JobInterviewStage) String() string { @@ -3354,10 +4645,18 @@ func (l LastSyncResultEnum) Ptr() *LastSyncResultEnum { return &l } +var ( + linkedAccountStatusFieldLinkedAccountStatus = big.NewInt(1 << 0) + linkedAccountStatusFieldCanMakeRequest = big.NewInt(1 << 1) +) + type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status" url:"linked_account_status"` CanMakeRequest bool `json:"can_make_request" url:"can_make_request"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3380,6 +4679,27 @@ func (l *LinkedAccountStatus) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkedAccountStatus) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkedAccountStatus sets the LinkedAccountStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetLinkedAccountStatus(linkedAccountStatus string) { + l.LinkedAccountStatus = linkedAccountStatus + l.require(linkedAccountStatusFieldLinkedAccountStatus) +} + +// SetCanMakeRequest sets the CanMakeRequest field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetCanMakeRequest(canMakeRequest bool) { + l.CanMakeRequest = canMakeRequest + l.require(linkedAccountStatusFieldCanMakeRequest) +} + func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { type unmarshaler LinkedAccountStatus var value unmarshaler @@ -3396,6 +4716,17 @@ func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkedAccountStatus) MarshalJSON() ([]byte, error) { + type embed LinkedAccountStatus + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkedAccountStatus) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { @@ -3408,6 +4739,14 @@ func (l *LinkedAccountStatus) String() string { return fmt.Sprintf("%#v", l) } +var ( + metaResponseFieldRequestSchema = big.NewInt(1 << 0) + metaResponseFieldRemoteFieldClasses = big.NewInt(1 << 1) + metaResponseFieldStatus = big.NewInt(1 << 2) + metaResponseFieldHasConditionalParams = big.NewInt(1 << 3) + metaResponseFieldHasRequiredLinkedAccountParams = big.NewInt(1 << 4) +) + type MetaResponse struct { RequestSchema map[string]interface{} `json:"request_schema" url:"request_schema"` RemoteFieldClasses map[string]interface{} `json:"remote_field_classes,omitempty" url:"remote_field_classes,omitempty"` @@ -3415,6 +4754,9 @@ type MetaResponse struct { HasConditionalParams bool `json:"has_conditional_params" url:"has_conditional_params"` HasRequiredLinkedAccountParams bool `json:"has_required_linked_account_params" url:"has_required_linked_account_params"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3458,6 +4800,48 @@ func (m *MetaResponse) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *MetaResponse) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetRequestSchema sets the RequestSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRequestSchema(requestSchema map[string]interface{}) { + m.RequestSchema = requestSchema + m.require(metaResponseFieldRequestSchema) +} + +// SetRemoteFieldClasses sets the RemoteFieldClasses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRemoteFieldClasses(remoteFieldClasses map[string]interface{}) { + m.RemoteFieldClasses = remoteFieldClasses + m.require(metaResponseFieldRemoteFieldClasses) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetStatus(status *LinkedAccountStatus) { + m.Status = status + m.require(metaResponseFieldStatus) +} + +// SetHasConditionalParams sets the HasConditionalParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasConditionalParams(hasConditionalParams bool) { + m.HasConditionalParams = hasConditionalParams + m.require(metaResponseFieldHasConditionalParams) +} + +// SetHasRequiredLinkedAccountParams sets the HasRequiredLinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasRequiredLinkedAccountParams(hasRequiredLinkedAccountParams bool) { + m.HasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams + m.require(metaResponseFieldHasRequiredLinkedAccountParams) +} + func (m *MetaResponse) UnmarshalJSON(data []byte) error { type unmarshaler MetaResponse var value unmarshaler @@ -3474,6 +4858,17 @@ func (m *MetaResponse) UnmarshalJSON(data []byte) error { return nil } +func (m *MetaResponse) MarshalJSON() ([]byte, error) { + type embed MetaResponse + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MetaResponse) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -3536,12 +4931,22 @@ func (m MethodEnum) Ptr() *MethodEnum { // // ### Usage Example // View what operations are supported for the `Candidate` endpoint. +var ( + modelOperationFieldModelName = big.NewInt(1 << 0) + modelOperationFieldAvailableOperations = big.NewInt(1 << 1) + modelOperationFieldRequiredPostParameters = big.NewInt(1 << 2) + modelOperationFieldSupportedFields = big.NewInt(1 << 3) +) + type ModelOperation struct { ModelName string `json:"model_name" url:"model_name"` AvailableOperations []string `json:"available_operations" url:"available_operations"` RequiredPostParameters []string `json:"required_post_parameters" url:"required_post_parameters"` SupportedFields []string `json:"supported_fields" url:"supported_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3578,6 +4983,41 @@ func (m *ModelOperation) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *ModelOperation) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetModelName(modelName string) { + m.ModelName = modelName + m.require(modelOperationFieldModelName) +} + +// SetAvailableOperations sets the AvailableOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetAvailableOperations(availableOperations []string) { + m.AvailableOperations = availableOperations + m.require(modelOperationFieldAvailableOperations) +} + +// SetRequiredPostParameters sets the RequiredPostParameters field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetRequiredPostParameters(requiredPostParameters []string) { + m.RequiredPostParameters = requiredPostParameters + m.require(modelOperationFieldRequiredPostParameters) +} + +// SetSupportedFields sets the SupportedFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetSupportedFields(supportedFields []string) { + m.SupportedFields = supportedFields + m.require(modelOperationFieldSupportedFields) +} + func (m *ModelOperation) UnmarshalJSON(data []byte) error { type unmarshaler ModelOperation var value unmarshaler @@ -3594,6 +5034,17 @@ func (m *ModelOperation) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelOperation) MarshalJSON() ([]byte, error) { + type embed ModelOperation + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelOperation) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -3606,9 +5057,16 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +var ( + modelPermissionDeserializerRequestFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializerRequest struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3624,6 +5082,20 @@ func (m *ModelPermissionDeserializerRequest) GetExtraProperties() map[string]int return m.extraProperties } +func (m *ModelPermissionDeserializerRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializerRequest) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerRequestFieldIsEnabled) +} + func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializerRequest var value unmarshaler @@ -3640,6 +5112,17 @@ func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializerRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -3658,6 +5141,14 @@ func (m *ModelPermissionDeserializerRequest) String() string { // // ### Usage Example // Create a `MultipartFormField` to define a multipart form entry. +var ( + multipartFormFieldRequestFieldName = big.NewInt(1 << 0) + multipartFormFieldRequestFieldData = big.NewInt(1 << 1) + multipartFormFieldRequestFieldEncoding = big.NewInt(1 << 2) + multipartFormFieldRequestFieldFileName = big.NewInt(1 << 3) + multipartFormFieldRequestFieldContentType = big.NewInt(1 << 4) +) + type MultipartFormFieldRequest struct { // The name of the form field Name string `json:"name" url:"name"` @@ -3674,6 +5165,9 @@ type MultipartFormFieldRequest struct { // The MIME type of the file, if the field is for a file. ContentType *string `json:"content_type,omitempty" url:"content_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3717,6 +5211,48 @@ func (m *MultipartFormFieldRequest) GetExtraProperties() map[string]interface{} return m.extraProperties } +func (m *MultipartFormFieldRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetName(name string) { + m.Name = name + m.require(multipartFormFieldRequestFieldName) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetData(data string) { + m.Data = data + m.require(multipartFormFieldRequestFieldData) +} + +// SetEncoding sets the Encoding field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetEncoding(encoding *MultipartFormFieldRequestEncoding) { + m.Encoding = encoding + m.require(multipartFormFieldRequestFieldEncoding) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetFileName(fileName *string) { + m.FileName = fileName + m.require(multipartFormFieldRequestFieldFileName) +} + +// SetContentType sets the ContentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetContentType(contentType *string) { + m.ContentType = contentType + m.require(multipartFormFieldRequestFieldContentType) +} + func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { type unmarshaler MultipartFormFieldRequest var value unmarshaler @@ -3733,6 +5269,17 @@ func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *MultipartFormFieldRequest) MarshalJSON() ([]byte, error) { + type embed MultipartFormFieldRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MultipartFormFieldRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -3817,6 +5364,23 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq // 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. +var ( + offerFieldId = big.NewInt(1 << 0) + offerFieldRemoteId = big.NewInt(1 << 1) + offerFieldCreatedAt = big.NewInt(1 << 2) + offerFieldModifiedAt = big.NewInt(1 << 3) + offerFieldApplication = big.NewInt(1 << 4) + offerFieldCreator = big.NewInt(1 << 5) + offerFieldRemoteCreatedAt = big.NewInt(1 << 6) + offerFieldClosedAt = big.NewInt(1 << 7) + offerFieldSentAt = big.NewInt(1 << 8) + offerFieldStartDate = big.NewInt(1 << 9) + offerFieldStatus = big.NewInt(1 << 10) + offerFieldRemoteWasDeleted = big.NewInt(1 << 11) + offerFieldFieldMappings = big.NewInt(1 << 12) + offerFieldRemoteData = big.NewInt(1 << 13) +) + type Offer struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -3854,6 +5418,9 @@ type Offer struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3960,6 +5527,111 @@ func (o *Offer) GetExtraProperties() map[string]interface{} { return o.extraProperties } +func (o *Offer) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetId(id *string) { + o.Id = id + o.require(offerFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetRemoteId(remoteId *string) { + o.RemoteId = remoteId + o.require(offerFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetCreatedAt(createdAt *time.Time) { + o.CreatedAt = createdAt + o.require(offerFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetModifiedAt(modifiedAt *time.Time) { + o.ModifiedAt = modifiedAt + o.require(offerFieldModifiedAt) +} + +// SetApplication sets the Application field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetApplication(application *OfferApplication) { + o.Application = application + o.require(offerFieldApplication) +} + +// SetCreator sets the Creator field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetCreator(creator *OfferCreator) { + o.Creator = creator + o.require(offerFieldCreator) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + o.RemoteCreatedAt = remoteCreatedAt + o.require(offerFieldRemoteCreatedAt) +} + +// SetClosedAt sets the ClosedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetClosedAt(closedAt *time.Time) { + o.ClosedAt = closedAt + o.require(offerFieldClosedAt) +} + +// SetSentAt sets the SentAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetSentAt(sentAt *time.Time) { + o.SentAt = sentAt + o.require(offerFieldSentAt) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetStartDate(startDate *time.Time) { + o.StartDate = startDate + o.require(offerFieldStartDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetStatus(status *OfferStatus) { + o.Status = status + o.require(offerFieldStatus) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetRemoteWasDeleted(remoteWasDeleted *bool) { + o.RemoteWasDeleted = remoteWasDeleted + o.require(offerFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetFieldMappings(fieldMappings map[string]interface{}) { + o.FieldMappings = fieldMappings + o.require(offerFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Offer) SetRemoteData(remoteData []*RemoteData) { + o.RemoteData = remoteData + o.require(offerFieldRemoteData) +} + func (o *Offer) UnmarshalJSON(data []byte) error { type embed Offer var unmarshaler = struct { @@ -4011,7 +5683,8 @@ func (o *Offer) MarshalJSON() ([]byte, error) { SentAt: internal.NewOptionalDateTime(o.SentAt), StartDate: internal.NewOptionalDateTime(o.StartDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields) + return json.Marshal(explicitMarshaler) } func (o *Offer) String() string { @@ -4282,6 +5955,18 @@ func (o OfferStatusEnum) Ptr() *OfferStatusEnum { // 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. +var ( + officeFieldId = big.NewInt(1 << 0) + officeFieldRemoteId = big.NewInt(1 << 1) + officeFieldCreatedAt = big.NewInt(1 << 2) + officeFieldModifiedAt = big.NewInt(1 << 3) + officeFieldName = big.NewInt(1 << 4) + officeFieldLocation = big.NewInt(1 << 5) + officeFieldRemoteWasDeleted = big.NewInt(1 << 6) + officeFieldFieldMappings = big.NewInt(1 << 7) + officeFieldRemoteData = big.NewInt(1 << 8) +) + type Office struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -4299,6 +5984,9 @@ type Office struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4370,6 +6058,76 @@ func (o *Office) GetExtraProperties() map[string]interface{} { return o.extraProperties } +func (o *Office) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Office) SetId(id *string) { + o.Id = id + o.require(officeFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Office) SetRemoteId(remoteId *string) { + o.RemoteId = remoteId + o.require(officeFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Office) SetCreatedAt(createdAt *time.Time) { + o.CreatedAt = createdAt + o.require(officeFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Office) SetModifiedAt(modifiedAt *time.Time) { + o.ModifiedAt = modifiedAt + o.require(officeFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Office) SetName(name *string) { + o.Name = name + o.require(officeFieldName) +} + +// SetLocation sets the Location field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Office) SetLocation(location *string) { + o.Location = location + o.require(officeFieldLocation) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Office) SetRemoteWasDeleted(remoteWasDeleted *bool) { + o.RemoteWasDeleted = remoteWasDeleted + o.require(officeFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Office) SetFieldMappings(fieldMappings map[string]interface{}) { + o.FieldMappings = fieldMappings + o.require(officeFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Office) SetRemoteData(remoteData []*RemoteData) { + o.RemoteData = remoteData + o.require(officeFieldRemoteData) +} + func (o *Office) UnmarshalJSON(data []byte) error { type embed Office var unmarshaler = struct { @@ -4405,7 +6163,8 @@ func (o *Office) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(o.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(o.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields) + return json.Marshal(explicitMarshaler) } func (o *Office) String() string { @@ -4425,6 +6184,14 @@ func (o *Office) String() string { // 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. +var ( + phoneNumberFieldCreatedAt = big.NewInt(1 << 0) + phoneNumberFieldModifiedAt = big.NewInt(1 << 1) + phoneNumberFieldValue = big.NewInt(1 << 2) + phoneNumberFieldPhoneNumberType = big.NewInt(1 << 3) + phoneNumberFieldRemoteWasDeleted = big.NewInt(1 << 4) +) + type PhoneNumber struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -4443,6 +6210,9 @@ type PhoneNumber struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4486,6 +6256,48 @@ func (p *PhoneNumber) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PhoneNumber) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumber) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(phoneNumberFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumber) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(phoneNumberFieldModifiedAt) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumber) SetValue(value *string) { + p.Value = value + p.require(phoneNumberFieldValue) +} + +// SetPhoneNumberType sets the PhoneNumberType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumber) SetPhoneNumberType(phoneNumberType *PhoneNumberPhoneNumberType) { + p.PhoneNumberType = phoneNumberType + p.require(phoneNumberFieldPhoneNumberType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumber) SetRemoteWasDeleted(remoteWasDeleted *bool) { + p.RemoteWasDeleted = remoteWasDeleted + p.require(phoneNumberFieldRemoteWasDeleted) +} + func (p *PhoneNumber) UnmarshalJSON(data []byte) error { type embed PhoneNumber var unmarshaler = struct { @@ -4521,7 +6333,8 @@ func (p *PhoneNumber) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(p.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PhoneNumber) String() string { @@ -4646,6 +6459,17 @@ func (p PhoneNumberTypeEnum) Ptr() *PhoneNumberTypeEnum { // 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. +var ( + rejectReasonFieldId = big.NewInt(1 << 0) + rejectReasonFieldRemoteId = big.NewInt(1 << 1) + rejectReasonFieldCreatedAt = big.NewInt(1 << 2) + rejectReasonFieldModifiedAt = big.NewInt(1 << 3) + rejectReasonFieldName = big.NewInt(1 << 4) + rejectReasonFieldRemoteWasDeleted = big.NewInt(1 << 5) + rejectReasonFieldFieldMappings = big.NewInt(1 << 6) + rejectReasonFieldRemoteData = big.NewInt(1 << 7) +) + type RejectReason struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -4661,6 +6485,9 @@ type RejectReason struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4725,6 +6552,69 @@ func (r *RejectReason) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RejectReason) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReason) SetId(id *string) { + r.Id = id + r.require(rejectReasonFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReason) SetRemoteId(remoteId *string) { + r.RemoteId = remoteId + r.require(rejectReasonFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReason) SetCreatedAt(createdAt *time.Time) { + r.CreatedAt = createdAt + r.require(rejectReasonFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReason) SetModifiedAt(modifiedAt *time.Time) { + r.ModifiedAt = modifiedAt + r.require(rejectReasonFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReason) SetName(name *string) { + r.Name = name + r.require(rejectReasonFieldName) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReason) SetRemoteWasDeleted(remoteWasDeleted *bool) { + r.RemoteWasDeleted = remoteWasDeleted + r.require(rejectReasonFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReason) SetFieldMappings(fieldMappings map[string]interface{}) { + r.FieldMappings = fieldMappings + r.require(rejectReasonFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RejectReason) SetRemoteData(remoteData []*RemoteData) { + r.RemoteData = remoteData + r.require(rejectReasonFieldRemoteData) +} + func (r *RejectReason) UnmarshalJSON(data []byte) error { type embed RejectReason var unmarshaler = struct { @@ -4760,7 +6650,8 @@ func (r *RejectReason) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(r.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(r.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) } func (r *RejectReason) String() string { @@ -4781,11 +6672,19 @@ func (r *RejectReason) String() string { // // ### Usage Example // TODO +var ( + remoteDataFieldPath = big.NewInt(1 << 0) + remoteDataFieldData = big.NewInt(1 << 1) +) + type RemoteData struct { // The third-party API path that is being called. Path string `json:"path" url:"path"` Data interface{} `json:"data,omitempty" url:"data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4808,6 +6707,27 @@ func (r *RemoteData) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteData) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetPath(path string) { + r.Path = path + r.require(remoteDataFieldPath) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetData(data interface{}) { + r.Data = data + r.require(remoteDataFieldData) +} + func (r *RemoteData) UnmarshalJSON(data []byte) error { type unmarshaler RemoteData var value unmarshaler @@ -4824,6 +6744,17 @@ func (r *RemoteData) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteData) MarshalJSON() ([]byte, error) { + type embed RemoteData + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteData) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -4842,10 +6773,18 @@ func (r *RemoteData) String() string { // // ### Usage Example // Post a `GenerateRemoteKey` to receive a new `RemoteKey`. +var ( + remoteKeyFieldName = big.NewInt(1 << 0) + remoteKeyFieldKey = big.NewInt(1 << 1) +) + type RemoteKey struct { Name string `json:"name" url:"name"` Key string `json:"key" url:"key"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4868,6 +6807,27 @@ func (r *RemoteKey) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteKey) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetName(name string) { + r.Name = name + r.require(remoteKeyFieldName) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetKey(key string) { + r.Key = key + r.require(remoteKeyFieldKey) +} + func (r *RemoteKey) UnmarshalJSON(data []byte) error { type unmarshaler RemoteKey var value unmarshaler @@ -4884,6 +6844,17 @@ func (r *RemoteKey) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteKey) MarshalJSON() ([]byte, error) { + type embed RemoteKey + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteKey) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -4902,6 +6873,16 @@ func (r *RemoteKey) String() string { // // ### Usage Example // View the `RemoteResponse` returned from your `DataPassthrough`. +var ( + remoteResponseFieldMethod = big.NewInt(1 << 0) + remoteResponseFieldPath = big.NewInt(1 << 1) + remoteResponseFieldStatus = big.NewInt(1 << 2) + remoteResponseFieldResponse = big.NewInt(1 << 3) + remoteResponseFieldResponseHeaders = big.NewInt(1 << 4) + remoteResponseFieldResponseType = big.NewInt(1 << 5) + remoteResponseFieldHeaders = big.NewInt(1 << 6) +) + type RemoteResponse struct { Method string `json:"method" url:"method"` Path string `json:"path" url:"path"` @@ -4911,6 +6892,9 @@ type RemoteResponse struct { ResponseType *RemoteResponseResponseType `json:"response_type,omitempty" url:"response_type,omitempty"` Headers map[string]interface{} `json:"headers,omitempty" url:"headers,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4968,6 +6952,62 @@ func (r *RemoteResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetMethod(method string) { + r.Method = method + r.require(remoteResponseFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetPath(path string) { + r.Path = path + r.require(remoteResponseFieldPath) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetStatus(status int) { + r.Status = status + r.require(remoteResponseFieldStatus) +} + +// SetResponse sets the Response field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponse(response interface{}) { + r.Response = response + r.require(remoteResponseFieldResponse) +} + +// SetResponseHeaders sets the ResponseHeaders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseHeaders(responseHeaders map[string]interface{}) { + r.ResponseHeaders = responseHeaders + r.require(remoteResponseFieldResponseHeaders) +} + +// SetResponseType sets the ResponseType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseType(responseType *RemoteResponseResponseType) { + r.ResponseType = responseType + r.require(remoteResponseFieldResponseType) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetHeaders(headers map[string]interface{}) { + r.Headers = headers + r.require(remoteResponseFieldHeaders) +} + func (r *RemoteResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteResponse var value unmarshaler @@ -4984,6 +7024,17 @@ func (r *RemoteResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteResponse) MarshalJSON() ([]byte, error) { + type embed RemoteResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -5063,6 +7114,22 @@ func (r *RemoteResponseResponseType) Accept(visitor RemoteResponseResponseTypeVi // 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. +var ( + remoteUserFieldId = big.NewInt(1 << 0) + remoteUserFieldRemoteId = big.NewInt(1 << 1) + remoteUserFieldCreatedAt = big.NewInt(1 << 2) + remoteUserFieldModifiedAt = big.NewInt(1 << 3) + remoteUserFieldFirstName = big.NewInt(1 << 4) + remoteUserFieldLastName = big.NewInt(1 << 5) + remoteUserFieldEmail = big.NewInt(1 << 6) + remoteUserFieldDisabled = big.NewInt(1 << 7) + remoteUserFieldRemoteCreatedAt = big.NewInt(1 << 8) + remoteUserFieldAccessRole = big.NewInt(1 << 9) + remoteUserFieldRemoteWasDeleted = big.NewInt(1 << 10) + remoteUserFieldFieldMappings = big.NewInt(1 << 11) + remoteUserFieldRemoteData = big.NewInt(1 << 12) +) + type RemoteUser struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -5094,6 +7161,9 @@ type RemoteUser struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5193,6 +7263,104 @@ func (r *RemoteUser) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteUser) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetId(id *string) { + r.Id = id + r.require(remoteUserFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetRemoteId(remoteId *string) { + r.RemoteId = remoteId + r.require(remoteUserFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetCreatedAt(createdAt *time.Time) { + r.CreatedAt = createdAt + r.require(remoteUserFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetModifiedAt(modifiedAt *time.Time) { + r.ModifiedAt = modifiedAt + r.require(remoteUserFieldModifiedAt) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetFirstName(firstName *string) { + r.FirstName = firstName + r.require(remoteUserFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetLastName(lastName *string) { + r.LastName = lastName + r.require(remoteUserFieldLastName) +} + +// SetEmail sets the Email field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetEmail(email *string) { + r.Email = email + r.require(remoteUserFieldEmail) +} + +// SetDisabled sets the Disabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetDisabled(disabled *bool) { + r.Disabled = disabled + r.require(remoteUserFieldDisabled) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + r.RemoteCreatedAt = remoteCreatedAt + r.require(remoteUserFieldRemoteCreatedAt) +} + +// SetAccessRole sets the AccessRole field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetAccessRole(accessRole *RemoteUserAccessRole) { + r.AccessRole = accessRole + r.require(remoteUserFieldAccessRole) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetRemoteWasDeleted(remoteWasDeleted *bool) { + r.RemoteWasDeleted = remoteWasDeleted + r.require(remoteUserFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetFieldMappings(fieldMappings map[string]interface{}) { + r.FieldMappings = fieldMappings + r.require(remoteUserFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteUser) SetRemoteData(remoteData []*RemoteData) { + r.RemoteData = remoteData + r.require(remoteUserFieldRemoteData) +} + func (r *RemoteUser) UnmarshalJSON(data []byte) error { type embed RemoteUser var unmarshaler = struct { @@ -5232,7 +7400,8 @@ func (r *RemoteUser) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(r.ModifiedAt), RemoteCreatedAt: internal.NewOptionalDateTime(r.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) } func (r *RemoteUser) String() string { @@ -5373,6 +7542,26 @@ func (r ResponseTypeEnum) Ptr() *ResponseTypeEnum { // 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. +var ( + scheduledInterviewFieldId = big.NewInt(1 << 0) + scheduledInterviewFieldRemoteId = big.NewInt(1 << 1) + scheduledInterviewFieldCreatedAt = big.NewInt(1 << 2) + scheduledInterviewFieldModifiedAt = big.NewInt(1 << 3) + scheduledInterviewFieldApplication = big.NewInt(1 << 4) + scheduledInterviewFieldJobInterviewStage = big.NewInt(1 << 5) + scheduledInterviewFieldOrganizer = big.NewInt(1 << 6) + scheduledInterviewFieldInterviewers = big.NewInt(1 << 7) + scheduledInterviewFieldLocation = big.NewInt(1 << 8) + scheduledInterviewFieldStartAt = big.NewInt(1 << 9) + scheduledInterviewFieldEndAt = big.NewInt(1 << 10) + scheduledInterviewFieldRemoteCreatedAt = big.NewInt(1 << 11) + scheduledInterviewFieldRemoteUpdatedAt = big.NewInt(1 << 12) + scheduledInterviewFieldStatus = big.NewInt(1 << 13) + scheduledInterviewFieldRemoteWasDeleted = big.NewInt(1 << 14) + scheduledInterviewFieldFieldMappings = big.NewInt(1 << 15) + scheduledInterviewFieldRemoteData = big.NewInt(1 << 16) +) + type ScheduledInterview struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -5410,6 +7599,9 @@ type ScheduledInterview struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5537,6 +7729,132 @@ func (s *ScheduledInterview) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *ScheduledInterview) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetId(id *string) { + s.Id = id + s.require(scheduledInterviewFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetRemoteId(remoteId *string) { + s.RemoteId = remoteId + s.require(scheduledInterviewFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetCreatedAt(createdAt *time.Time) { + s.CreatedAt = createdAt + s.require(scheduledInterviewFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetModifiedAt(modifiedAt *time.Time) { + s.ModifiedAt = modifiedAt + s.require(scheduledInterviewFieldModifiedAt) +} + +// SetApplication sets the Application field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetApplication(application *ScheduledInterviewApplication) { + s.Application = application + s.require(scheduledInterviewFieldApplication) +} + +// SetJobInterviewStage sets the JobInterviewStage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetJobInterviewStage(jobInterviewStage *ScheduledInterviewJobInterviewStage) { + s.JobInterviewStage = jobInterviewStage + s.require(scheduledInterviewFieldJobInterviewStage) +} + +// SetOrganizer sets the Organizer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetOrganizer(organizer *ScheduledInterviewOrganizer) { + s.Organizer = organizer + s.require(scheduledInterviewFieldOrganizer) +} + +// SetInterviewers sets the Interviewers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetInterviewers(interviewers []*ScheduledInterviewInterviewersItem) { + s.Interviewers = interviewers + s.require(scheduledInterviewFieldInterviewers) +} + +// SetLocation sets the Location field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetLocation(location *string) { + s.Location = location + s.require(scheduledInterviewFieldLocation) +} + +// SetStartAt sets the StartAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetStartAt(startAt *time.Time) { + s.StartAt = startAt + s.require(scheduledInterviewFieldStartAt) +} + +// SetEndAt sets the EndAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetEndAt(endAt *time.Time) { + s.EndAt = endAt + s.require(scheduledInterviewFieldEndAt) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + s.RemoteCreatedAt = remoteCreatedAt + s.require(scheduledInterviewFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + s.RemoteUpdatedAt = remoteUpdatedAt + s.require(scheduledInterviewFieldRemoteUpdatedAt) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetStatus(status *ScheduledInterviewStatus) { + s.Status = status + s.require(scheduledInterviewFieldStatus) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetRemoteWasDeleted(remoteWasDeleted *bool) { + s.RemoteWasDeleted = remoteWasDeleted + s.require(scheduledInterviewFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetFieldMappings(fieldMappings map[string]interface{}) { + s.FieldMappings = fieldMappings + s.require(scheduledInterviewFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScheduledInterview) SetRemoteData(remoteData []*RemoteData) { + s.RemoteData = remoteData + s.require(scheduledInterviewFieldRemoteData) +} + func (s *ScheduledInterview) UnmarshalJSON(data []byte) error { type embed ScheduledInterview var unmarshaler = struct { @@ -5588,7 +7906,8 @@ func (s *ScheduledInterview) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(s.RemoteCreatedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(s.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *ScheduledInterview) String() string { @@ -5955,6 +8274,20 @@ func (s ScheduledInterviewStatusEnum) Ptr() *ScheduledInterviewStatusEnum { // // ### Usage Example // TODO +var ( + screeningQuestionFieldId = big.NewInt(1 << 0) + screeningQuestionFieldRemoteId = big.NewInt(1 << 1) + screeningQuestionFieldCreatedAt = big.NewInt(1 << 2) + screeningQuestionFieldModifiedAt = big.NewInt(1 << 3) + screeningQuestionFieldJob = big.NewInt(1 << 4) + screeningQuestionFieldDescription = big.NewInt(1 << 5) + screeningQuestionFieldTitle = big.NewInt(1 << 6) + screeningQuestionFieldType = big.NewInt(1 << 7) + screeningQuestionFieldRequired = big.NewInt(1 << 8) + screeningQuestionFieldOptions = big.NewInt(1 << 9) + screeningQuestionFieldRemoteWasDeleted = big.NewInt(1 << 10) +) + type ScreeningQuestion struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -5986,6 +8319,9 @@ type ScreeningQuestion struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6071,6 +8407,90 @@ func (s *ScreeningQuestion) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *ScreeningQuestion) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetId(id *string) { + s.Id = id + s.require(screeningQuestionFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetRemoteId(remoteId *string) { + s.RemoteId = remoteId + s.require(screeningQuestionFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetCreatedAt(createdAt *time.Time) { + s.CreatedAt = createdAt + s.require(screeningQuestionFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetModifiedAt(modifiedAt *time.Time) { + s.ModifiedAt = modifiedAt + s.require(screeningQuestionFieldModifiedAt) +} + +// SetJob sets the Job field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetJob(job *ScreeningQuestionJob) { + s.Job = job + s.require(screeningQuestionFieldJob) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetDescription(description *string) { + s.Description = description + s.require(screeningQuestionFieldDescription) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetTitle(title *string) { + s.Title = title + s.require(screeningQuestionFieldTitle) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetType(type_ *ScreeningQuestionType) { + s.Type = type_ + s.require(screeningQuestionFieldType) +} + +// SetRequired sets the Required field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetRequired(required *bool) { + s.Required = required + s.require(screeningQuestionFieldRequired) +} + +// SetOptions sets the Options field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetOptions(options []interface{}) { + s.Options = options + s.require(screeningQuestionFieldOptions) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestion) SetRemoteWasDeleted(remoteWasDeleted *bool) { + s.RemoteWasDeleted = remoteWasDeleted + s.require(screeningQuestionFieldRemoteWasDeleted) +} + func (s *ScreeningQuestion) UnmarshalJSON(data []byte) error { type embed ScreeningQuestion var unmarshaler = struct { @@ -6106,7 +8526,8 @@ func (s *ScreeningQuestion) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(s.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(s.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *ScreeningQuestion) String() string { @@ -6127,6 +8548,16 @@ func (s *ScreeningQuestion) String() string { // // ### Usage Example // TODO +var ( + screeningQuestionAnswerFieldId = big.NewInt(1 << 0) + screeningQuestionAnswerFieldRemoteId = big.NewInt(1 << 1) + screeningQuestionAnswerFieldCreatedAt = big.NewInt(1 << 2) + screeningQuestionAnswerFieldModifiedAt = big.NewInt(1 << 3) + screeningQuestionAnswerFieldQuestion = big.NewInt(1 << 4) + screeningQuestionAnswerFieldAnswer = big.NewInt(1 << 5) + screeningQuestionAnswerFieldRemoteWasDeleted = big.NewInt(1 << 6) +) + type ScreeningQuestionAnswer struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -6142,6 +8573,9 @@ type ScreeningQuestionAnswer struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6199,6 +8633,62 @@ func (s *ScreeningQuestionAnswer) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *ScreeningQuestionAnswer) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswer) SetId(id *string) { + s.Id = id + s.require(screeningQuestionAnswerFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswer) SetRemoteId(remoteId *string) { + s.RemoteId = remoteId + s.require(screeningQuestionAnswerFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswer) SetCreatedAt(createdAt *time.Time) { + s.CreatedAt = createdAt + s.require(screeningQuestionAnswerFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswer) SetModifiedAt(modifiedAt *time.Time) { + s.ModifiedAt = modifiedAt + s.require(screeningQuestionAnswerFieldModifiedAt) +} + +// SetQuestion sets the Question field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswer) SetQuestion(question *ScreeningQuestionAnswerQuestion) { + s.Question = question + s.require(screeningQuestionAnswerFieldQuestion) +} + +// SetAnswer sets the Answer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswer) SetAnswer(answer *string) { + s.Answer = answer + s.require(screeningQuestionAnswerFieldAnswer) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionAnswer) SetRemoteWasDeleted(remoteWasDeleted *bool) { + s.RemoteWasDeleted = remoteWasDeleted + s.require(screeningQuestionAnswerFieldRemoteWasDeleted) +} + func (s *ScreeningQuestionAnswer) UnmarshalJSON(data []byte) error { type embed ScreeningQuestionAnswer var unmarshaler = struct { @@ -6234,7 +8724,8 @@ func (s *ScreeningQuestionAnswer) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(s.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(s.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *ScreeningQuestionAnswer) String() string { @@ -6381,6 +8872,15 @@ func (s *ScreeningQuestionJob) Accept(visitor ScreeningQuestionJobVisitor) error // // ### Usage Example // TODO +var ( + screeningQuestionOptionFieldId = big.NewInt(1 << 0) + screeningQuestionOptionFieldRemoteId = big.NewInt(1 << 1) + screeningQuestionOptionFieldCreatedAt = big.NewInt(1 << 2) + screeningQuestionOptionFieldModifiedAt = big.NewInt(1 << 3) + screeningQuestionOptionFieldLabel = big.NewInt(1 << 4) + screeningQuestionOptionFieldRemoteWasDeleted = big.NewInt(1 << 5) +) + type ScreeningQuestionOption struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -6394,6 +8894,9 @@ type ScreeningQuestionOption struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6444,6 +8947,55 @@ func (s *ScreeningQuestionOption) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *ScreeningQuestionOption) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionOption) SetId(id *string) { + s.Id = id + s.require(screeningQuestionOptionFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionOption) SetRemoteId(remoteId *string) { + s.RemoteId = remoteId + s.require(screeningQuestionOptionFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionOption) SetCreatedAt(createdAt *time.Time) { + s.CreatedAt = createdAt + s.require(screeningQuestionOptionFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionOption) SetModifiedAt(modifiedAt *time.Time) { + s.ModifiedAt = modifiedAt + s.require(screeningQuestionOptionFieldModifiedAt) +} + +// SetLabel sets the Label field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionOption) SetLabel(label *string) { + s.Label = label + s.require(screeningQuestionOptionFieldLabel) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *ScreeningQuestionOption) SetRemoteWasDeleted(remoteWasDeleted *bool) { + s.RemoteWasDeleted = remoteWasDeleted + s.require(screeningQuestionOptionFieldRemoteWasDeleted) +} + func (s *ScreeningQuestionOption) UnmarshalJSON(data []byte) error { type embed ScreeningQuestionOption var unmarshaler = struct { @@ -6479,7 +9031,8 @@ func (s *ScreeningQuestionOption) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(s.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(s.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *ScreeningQuestionOption) String() string { @@ -6684,6 +9237,18 @@ func (s StatusFd5Enum) Ptr() *StatusFd5Enum { // // ### Usage Example // View the `SyncStatus` for an account to see how recently its models were synced. +var ( + syncStatusFieldModelName = big.NewInt(1 << 0) + syncStatusFieldModelId = big.NewInt(1 << 1) + syncStatusFieldLastSyncStart = big.NewInt(1 << 2) + syncStatusFieldNextSyncStart = big.NewInt(1 << 3) + syncStatusFieldLastSyncResult = big.NewInt(1 << 4) + syncStatusFieldLastSyncFinished = big.NewInt(1 << 5) + syncStatusFieldStatus = big.NewInt(1 << 6) + syncStatusFieldIsInitialSync = big.NewInt(1 << 7) + syncStatusFieldSelectiveSyncConfigurationsUsage = big.NewInt(1 << 8) +) + type SyncStatus struct { ModelName string `json:"model_name" url:"model_name"` ModelId string `json:"model_id" url:"model_id"` @@ -6695,6 +9260,9 @@ type SyncStatus struct { IsInitialSync bool `json:"is_initial_sync" url:"is_initial_sync"` SelectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum `json:"selective_sync_configurations_usage,omitempty" url:"selective_sync_configurations_usage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6766,6 +9334,76 @@ func (s *SyncStatus) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *SyncStatus) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelName(modelName string) { + s.ModelName = modelName + s.require(syncStatusFieldModelName) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelId(modelId string) { + s.ModelId = modelId + s.require(syncStatusFieldModelId) +} + +// SetLastSyncStart sets the LastSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncStart(lastSyncStart *time.Time) { + s.LastSyncStart = lastSyncStart + s.require(syncStatusFieldLastSyncStart) +} + +// SetNextSyncStart sets the NextSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetNextSyncStart(nextSyncStart *time.Time) { + s.NextSyncStart = nextSyncStart + s.require(syncStatusFieldNextSyncStart) +} + +// SetLastSyncResult sets the LastSyncResult field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncResult(lastSyncResult *SyncStatusLastSyncResult) { + s.LastSyncResult = lastSyncResult + s.require(syncStatusFieldLastSyncResult) +} + +// SetLastSyncFinished sets the LastSyncFinished field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncFinished(lastSyncFinished *time.Time) { + s.LastSyncFinished = lastSyncFinished + s.require(syncStatusFieldLastSyncFinished) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetStatus(status *SyncStatusStatus) { + s.Status = status + s.require(syncStatusFieldStatus) +} + +// SetIsInitialSync sets the IsInitialSync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetIsInitialSync(isInitialSync bool) { + s.IsInitialSync = isInitialSync + s.require(syncStatusFieldIsInitialSync) +} + +// SetSelectiveSyncConfigurationsUsage sets the SelectiveSyncConfigurationsUsage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetSelectiveSyncConfigurationsUsage(selectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum) { + s.SelectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage + s.require(syncStatusFieldSelectiveSyncConfigurationsUsage) +} + func (s *SyncStatus) UnmarshalJSON(data []byte) error { type embed SyncStatus var unmarshaler = struct { @@ -6805,7 +9443,8 @@ func (s *SyncStatus) MarshalJSON() ([]byte, error) { NextSyncStart: internal.NewOptionalDateTime(s.NextSyncStart), LastSyncFinished: internal.NewOptionalDateTime(s.LastSyncFinished), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *SyncStatus) String() string { @@ -6949,6 +9588,14 @@ func (s *SyncStatusStatus) Accept(visitor SyncStatusStatusVisitor) error { // 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. +var ( + urlFieldCreatedAt = big.NewInt(1 << 0) + urlFieldModifiedAt = big.NewInt(1 << 1) + urlFieldValue = big.NewInt(1 << 2) + urlFieldUrlType = big.NewInt(1 << 3) + urlFieldRemoteWasDeleted = big.NewInt(1 << 4) +) + type Url struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -6969,6 +9616,9 @@ type Url struct { // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7012,6 +9662,48 @@ func (u *Url) GetExtraProperties() map[string]interface{} { return u.extraProperties } +func (u *Url) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *Url) SetCreatedAt(createdAt *time.Time) { + u.CreatedAt = createdAt + u.require(urlFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *Url) SetModifiedAt(modifiedAt *time.Time) { + u.ModifiedAt = modifiedAt + u.require(urlFieldModifiedAt) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *Url) SetValue(value *string) { + u.Value = value + u.require(urlFieldValue) +} + +// SetUrlType sets the UrlType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *Url) SetUrlType(urlType *UrlUrlType) { + u.UrlType = urlType + u.require(urlFieldUrlType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *Url) SetRemoteWasDeleted(remoteWasDeleted *bool) { + u.RemoteWasDeleted = remoteWasDeleted + u.require(urlFieldRemoteWasDeleted) +} + func (u *Url) UnmarshalJSON(data []byte) error { type embed Url var unmarshaler = struct { @@ -7047,7 +9739,8 @@ func (u *Url) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(u.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(u.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) } func (u *Url) String() string { @@ -7177,9 +9870,16 @@ func (u *UrlUrlType) Accept(visitor UrlUrlTypeVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", u) } +var ( + validationProblemSourceFieldPointer = big.NewInt(1 << 0) +) + type ValidationProblemSource struct { Pointer string `json:"pointer" url:"pointer"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7195,6 +9895,20 @@ func (v *ValidationProblemSource) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *ValidationProblemSource) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetPointer sets the Pointer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *ValidationProblemSource) SetPointer(pointer string) { + v.Pointer = pointer + v.require(validationProblemSourceFieldPointer) +} + func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { type unmarshaler ValidationProblemSource var value unmarshaler @@ -7211,6 +9925,17 @@ func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { return nil } +func (v *ValidationProblemSource) MarshalJSON() ([]byte, error) { + type embed ValidationProblemSource + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (v *ValidationProblemSource) String() string { if len(v.rawJSON) > 0 { if value, err := internal.StringifyJSON(v.rawJSON); err == nil { @@ -7223,12 +9948,22 @@ func (v *ValidationProblemSource) String() string { return fmt.Sprintf("%#v", v) } +var ( + warningValidationProblemFieldSource = big.NewInt(1 << 0) + warningValidationProblemFieldTitle = big.NewInt(1 << 1) + warningValidationProblemFieldDetail = big.NewInt(1 << 2) + warningValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type WarningValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7265,6 +10000,41 @@ func (w *WarningValidationProblem) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WarningValidationProblem) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetSource(source *ValidationProblemSource) { + w.Source = source + w.require(warningValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetTitle(title string) { + w.Title = title + w.require(warningValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetDetail(detail string) { + w.Detail = detail + w.require(warningValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetProblemType(problemType string) { + w.ProblemType = problemType + w.require(warningValidationProblemFieldProblemType) +} + func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler WarningValidationProblem var value unmarshaler @@ -7281,6 +10051,17 @@ func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (w *WarningValidationProblem) MarshalJSON() ([]byte, error) { + type embed WarningValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WarningValidationProblem) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/ats/users.go b/ats/users.go index 3d29cad..bc9c765 100644 --- a/ats/users.go +++ b/ats/users.go @@ -6,9 +6,26 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + usersListRequestFieldCreatedAfter = big.NewInt(1 << 0) + usersListRequestFieldCreatedBefore = big.NewInt(1 << 1) + usersListRequestFieldCursor = big.NewInt(1 << 2) + usersListRequestFieldEmail = big.NewInt(1 << 3) + usersListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + usersListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + usersListRequestFieldIncludeShellData = big.NewInt(1 << 6) + usersListRequestFieldModifiedAfter = big.NewInt(1 << 7) + usersListRequestFieldModifiedBefore = big.NewInt(1 << 8) + usersListRequestFieldPageSize = big.NewInt(1 << 9) + usersListRequestFieldRemoteFields = big.NewInt(1 << 10) + usersListRequestFieldRemoteId = big.NewInt(1 << 11) + usersListRequestFieldShowEnumOrigins = big.NewInt(1 << 12) +) + type UsersListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -36,8 +53,116 @@ type UsersListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UsersListRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCreatedAfter(createdAfter *time.Time) { + u.CreatedAfter = createdAfter + u.require(usersListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCreatedBefore(createdBefore *time.Time) { + u.CreatedBefore = createdBefore + u.require(usersListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCursor(cursor *string) { + u.Cursor = cursor + u.require(usersListRequestFieldCursor) +} + +// SetEmail sets the Email field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetEmail(email *string) { + u.Email = email + u.require(usersListRequestFieldEmail) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + u.IncludeDeletedData = includeDeletedData + u.require(usersListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + u.IncludeRemoteData = includeRemoteData + u.require(usersListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeShellData(includeShellData *bool) { + u.IncludeShellData = includeShellData + u.require(usersListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + u.ModifiedAfter = modifiedAfter + u.require(usersListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + u.ModifiedBefore = modifiedBefore + u.require(usersListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetPageSize(pageSize *int) { + u.PageSize = pageSize + u.require(usersListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetRemoteFields(remoteFields *string) { + u.RemoteFields = remoteFields + u.require(usersListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetRemoteId(remoteId *string) { + u.RemoteId = remoteId + u.require(usersListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + u.ShowEnumOrigins = showEnumOrigins + u.require(usersListRequestFieldShowEnumOrigins) +} + +var ( + usersRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + usersRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) + usersRetrieveRequestFieldRemoteFields = big.NewInt(1 << 2) + usersRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 3) +) + type UsersRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -47,13 +172,60 @@ type UsersRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UsersRetrieveRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + u.IncludeRemoteData = includeRemoteData + u.require(usersRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + u.IncludeShellData = includeShellData + u.require(usersRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetRemoteFields(remoteFields *string) { + u.RemoteFields = remoteFields + u.require(usersRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + u.ShowEnumOrigins = showEnumOrigins + u.require(usersRetrieveRequestFieldShowEnumOrigins) } +var ( + paginatedRemoteUserListFieldNext = big.NewInt(1 << 0) + paginatedRemoteUserListFieldPrevious = big.NewInt(1 << 1) + paginatedRemoteUserListFieldResults = big.NewInt(1 << 2) +) + type PaginatedRemoteUserList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*RemoteUser `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -83,6 +255,34 @@ func (p *PaginatedRemoteUserList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedRemoteUserList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteUserList) SetNext(next *string) { + p.Next = next + p.require(paginatedRemoteUserListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteUserList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedRemoteUserListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteUserList) SetResults(results []*RemoteUser) { + p.Results = results + p.require(paginatedRemoteUserListFieldResults) +} + func (p *PaginatedRemoteUserList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedRemoteUserList var value unmarshaler @@ -99,6 +299,17 @@ func (p *PaginatedRemoteUserList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedRemoteUserList) MarshalJSON() ([]byte, error) { + type embed PaginatedRemoteUserList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedRemoteUserList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ats/users/ats_users_test/ats_users_test.go b/ats/users/ats_users_test/ats_users_test.go new file mode 100644 index 0000000..826f4da --- /dev/null +++ b/ats/users/ats_users_test/ats_users_test.go @@ -0,0 +1,153 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_users_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsUsersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.UsersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + Email: merge.String( + "email", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ats.Users.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/users", map[string]string{"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"}, 1) +} + +func TestAtsUsersRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.UsersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ats.Users.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/users/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "access_role", "show_enum_origins": "access_role"}, 1) +} diff --git a/ats/users/client.go b/ats/users/client.go index 0cdba3a..a20b491 100644 --- a/ats/users/client.go +++ b/ats/users/client.go @@ -4,7 +4,6 @@ package users import ( context "context" - fmt "fmt" ats "github.com/merge-api/merge-go-client/v2/ats" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ats.UsersListRequest, opts ...option.RequestOption, -) (*core.Page[*ats.RemoteUser], error) { +) (*core.Page[*string, *ats.RemoteUser], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ats.PaginatedRemoteUserList) *internal.PageResponse[*string, *ats.RemoteUser] { + readPageResponse := func(response *ats.PaginatedRemoteUserList) *core.PageResponse[*string, *ats.RemoteUser] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ats.RemoteUser]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ats.RemoteUser]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ats.UsersRetrieveRequest, opts ...option.RequestOption, ) (*ats.RemoteUser, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ats/v1/users/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ats.RemoteUser - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ats/users/raw_client.go b/ats/users/raw_client.go new file mode 100644 index 0000000..e20c503 --- /dev/null +++ b/ats/users/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package users + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ats.UsersRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.RemoteUser], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ats/v1/users/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ats.RemoteUser + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.RemoteUser]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ats/webhook_receivers.go b/ats/webhook_receivers.go index 11791e6..93eb444 100644 --- a/ats/webhook_receivers.go +++ b/ats/webhook_receivers.go @@ -6,19 +6,66 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + webhookReceiverRequestFieldEvent = big.NewInt(1 << 0) + webhookReceiverRequestFieldIsActive = big.NewInt(1 << 1) + webhookReceiverRequestFieldKey = big.NewInt(1 << 2) ) type WebhookReceiverRequest struct { Event string `json:"event" url:"-"` IsActive bool `json:"is_active" url:"-"` Key *string `json:"key,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (w *WebhookReceiverRequest) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverRequestFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverRequestFieldIsActive) } +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverRequestFieldKey) +} + +var ( + webhookReceiverFieldEvent = big.NewInt(1 << 0) + webhookReceiverFieldIsActive = big.NewInt(1 << 1) + webhookReceiverFieldKey = big.NewInt(1 << 2) +) + type WebhookReceiver struct { Event string `json:"event" url:"event"` IsActive bool `json:"is_active" url:"is_active"` Key *string `json:"key,omitempty" url:"key,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +95,34 @@ func (w *WebhookReceiver) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WebhookReceiver) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverFieldIsActive) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverFieldKey) +} + func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { type unmarshaler WebhookReceiver var value unmarshaler @@ -64,6 +139,17 @@ func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { return nil } +func (w *WebhookReceiver) MarshalJSON() ([]byte, error) { + type embed WebhookReceiver + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WebhookReceiver) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/ats/webhookreceivers/ats_webhook_receivers_test/ats_webhook_receivers_test.go b/ats/webhookreceivers/ats_webhook_receivers_test/ats_webhook_receivers_test.go new file mode 100644 index 0000000..25bc42a --- /dev/null +++ b/ats/webhookreceivers/ats_webhook_receivers_test/ats_webhook_receivers_test.go @@ -0,0 +1,103 @@ +// Code generated by Fern. DO NOT EDIT. + +package ats_webhook_receivers_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + ats "github.com/merge-api/merge-go-client/v2/ats" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestAtsWebhookReceiversListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ats.WebhookReceivers.List( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ats/v1/webhook-receivers", nil, 1) +} + +func TestAtsWebhookReceiversCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ats.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } + _, invocationErr := client.Ats.WebhookReceivers.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ats/v1/webhook-receivers", nil, 1) +} diff --git a/ats/webhookreceivers/client.go b/ats/webhookreceivers/client.go index bb2d663..6398e13 100644 --- a/ats/webhookreceivers/client.go +++ b/ats/webhookreceivers/client.go @@ -8,26 +8,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) List( ctx context.Context, opts ...option.RequestOption, ) ([]*ats.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*ats.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.List( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Creates a `WebhookReceiver` object with the given values. @@ -73,35 +53,13 @@ func (c *Client) Create( request *ats.WebhookReceiverRequest, opts ...option.RequestOption, ) (*ats.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ats/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ats.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ats/webhookreceivers/raw_client.go b/ats/webhookreceivers/raw_client.go new file mode 100644 index 0000000..dcc5e5c --- /dev/null +++ b/ats/webhookreceivers/raw_client.go @@ -0,0 +1,112 @@ +// Code generated by Fern. DO NOT EDIT. + +package webhookreceivers + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/v2/ats" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*ats.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*ats.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*ats.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *ats.WebhookReceiverRequest, + opts ...option.RequestOption, +) (*core.Response[*ats.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ats/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ats.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ats.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/client/client.go b/client/client.go index 970d44f..c807566 100644 --- a/client/client.go +++ b/client/client.go @@ -3,9 +3,8 @@ package client import ( - merge "github.com/merge-api/merge-go-client/v2" accountingclient "github.com/merge-api/merge-go-client/v2/accounting/client" - atsclient "github.com/merge-api/merge-go-client/v2/ats/client" + client "github.com/merge-api/merge-go-client/v2/ats/client" core "github.com/merge-api/merge-go-client/v2/core" crmclient "github.com/merge-api/merge-go-client/v2/crm/client" filestorageclient "github.com/merge-api/merge-go-client/v2/filestorage/client" @@ -13,42 +12,43 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketingclient "github.com/merge-api/merge-go-client/v2/ticketing/client" - http "net/http" ) type Client struct { - baseURL string - caller *internal.Caller - header http.Header - - Ats *atsclient.Client + Ats *client.Client Accounting *accountingclient.Client Crm *crmclient.Client FileStorage *filestorageclient.Client Hris *hrisclient.Client Ticketing *ticketingclient.Client + + options *core.RequestOptions + baseURL string + caller *internal.Caller } func NewClient(opts ...option.RequestOption) *Client { options := core.NewRequestOptions(opts...) - if options.BaseURL == "" { - options.BaseURL = merge.Environments.Production + baseURL := options.BaseURL + if baseURL == "" { + baseURL = "https://api.merge.dev/api" } - + // Update the options with the resolved base URL + options.BaseURL = baseURL return &Client{ - baseURL: options.BaseURL, + Ats: client.NewClient(options), + Accounting: accountingclient.NewClient(options), + Crm: crmclient.NewClient(options), + FileStorage: filestorageclient.NewClient(options), + Hris: hrisclient.NewClient(options), + Ticketing: ticketingclient.NewClient(options), + options: options, + baseURL: baseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), - Ats: atsclient.NewClient(opts...), - Accounting: accountingclient.NewClient(opts...), - Crm: crmclient.NewClient(opts...), - FileStorage: filestorageclient.NewClient(opts...), - Hris: hrisclient.NewClient(opts...), - Ticketing: ticketingclient.NewClient(opts...), } } diff --git a/client/client_test.go b/client/client_test.go index 485e78c..71bf4fe 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -41,6 +41,6 @@ func TestNewClient(t *testing.T) { option.WithHTTPHeader(header), ) assert.Equal(t, merge.Environments.Production, c.baseURL) - assert.Equal(t, "test", c.header.Get("X-API-Tenancy")) + assert.Equal(t, "test", c.options.HTTPHeader.Get("X-API-Tenancy")) }) } diff --git a/core/api_error.go b/core/api_error.go index dc4190c..6168388 100644 --- a/core/api_error.go +++ b/core/api_error.go @@ -1,19 +1,24 @@ package core -import "fmt" +import ( + "fmt" + "net/http" +) // APIError is a lightweight wrapper around the standard error // interface that preserves the status code from the RPC, if any. type APIError struct { err error - StatusCode int `json:"-"` + StatusCode int `json:"-"` + Header http.Header `json:"-"` } // NewAPIError constructs a new API error. -func NewAPIError(statusCode int, err error) *APIError { +func NewAPIError(statusCode int, header http.Header, err error) *APIError { return &APIError{ err: err, + Header: header, StatusCode: statusCode, } } diff --git a/core/http.go b/core/http.go index b553350..92c4356 100644 --- a/core/http.go +++ b/core/http.go @@ -6,3 +6,10 @@ import "net/http" type HTTPClient interface { Do(*http.Request) (*http.Response, error) } + +// Response is an HTTP response from an HTTP client. +type Response[T any] struct { + StatusCode int + Header http.Header + Body T +} diff --git a/core/page.go b/core/page.go index 96badc7..1ab1186 100644 --- a/core/page.go +++ b/core/page.go @@ -11,28 +11,44 @@ import ( // a non-actionable error. var ErrNoPages = errors.New("no pages remain") +// PageRequest represents the information required to identify a single page. +type PageRequest[Cursor comparable] struct { + Cursor Cursor + + // Holds the value of the response type (populated by the *Caller). + Response any +} + +// PageResponse represents the information associated with a single page. +type PageResponse[Cursor comparable, Result any] struct { + Results []Result + Next Cursor + Done bool +} + // Page represents a single page of results. -type Page[T any] struct { +type Page[Cursor comparable, T any] struct { Results []T - NextPageFunc func(context.Context) (*Page[T], error) + RawResponse PageResponse[Cursor, T] + NextPageFunc func(context.Context) (*Page[Cursor, T], error) } // GetNextPage fetches the next page, if any. If no pages remain, // the ErrNoPages error is returned. -func (p *Page[T]) GetNextPage(ctx context.Context) (*Page[T], error) { +func (p *Page[Cursor, T]) GetNextPage(ctx context.Context) (*Page[Cursor, T], error) { return p.NextPageFunc(ctx) } // Iterator returns an iterator that starts at the current page. -func (p *Page[T]) Iterator() *PageIterator[T] { - return &PageIterator[T]{ +func (p *Page[Cursor, T]) Iterator() *PageIterator[Cursor, T] { + return &PageIterator[Cursor, T]{ page: p, } } // PageIterator is an auto-iterator for paginated endpoints. -type PageIterator[T any] struct { - page *Page[T] +type PageIterator[Cursor comparable, T any] struct { + page *Page[Cursor, T] current T index int err error @@ -40,7 +56,7 @@ type PageIterator[T any] struct { // Next returns true if the given iterator has more results, // fetching the next page as needed. -func (p *PageIterator[T]) Next(ctx context.Context) bool { +func (p *PageIterator[Cursor, T]) Next(ctx context.Context) bool { if p.page == nil || len(p.page.Results) == 0 { return false } @@ -57,12 +73,12 @@ func (p *PageIterator[T]) Next(ctx context.Context) bool { } // Current returns the current element. -func (p *PageIterator[T]) Current() T { +func (p *PageIterator[Cursor, T]) Current() T { return p.current } // Err returns a non-nil error if the iterator encountered an error. -func (p *PageIterator[T]) Err() error { +func (p *PageIterator[Cursor, T]) Err() error { if errors.Is(p.err, ErrNoPages) { return nil } diff --git a/core/request_option.go b/core/request_option.go index c8e8562..c603add 100644 --- a/core/request_option.go +++ b/core/request_option.go @@ -61,8 +61,8 @@ func (r *RequestOptions) cloneHeader() http.Header { headers := r.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/merge-api/merge-go-client/v2") - headers.Set("X-Fern-SDK-Version", "v2.0.0") - headers.Set("User-Agent", "github.com/merge-api/merge-go-client/2.0.0") + headers.Set("X-Fern-SDK-Version", "v2.1.0") + headers.Set("User-Agent", "github.com/merge-api/merge-go-client/2.1.0") return headers } diff --git a/crm/account_details.go b/crm/account_details.go index 5df5060..b7d2d3a 100644 --- a/crm/account_details.go +++ b/crm/account_details.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountDetailsFieldId = big.NewInt(1 << 0) + accountDetailsFieldIntegration = big.NewInt(1 << 1) + accountDetailsFieldIntegrationSlug = big.NewInt(1 << 2) + accountDetailsFieldCategory = big.NewInt(1 << 3) + accountDetailsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsFieldStatus = big.NewInt(1 << 7) + accountDetailsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsFieldAccountType = big.NewInt(1 << 10) + accountDetailsFieldCompletedAt = big.NewInt(1 << 11) +) + type AccountDetails struct { Id *string `json:"id,omitempty" url:"id,omitempty"` Integration *string `json:"integration,omitempty" url:"integration,omitempty"` @@ -25,6 +41,9 @@ type AccountDetails struct { // The time at which account completes the linking flow. CompletedAt *time.Time `json:"completed_at,omitempty" url:"completed_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -117,6 +136,97 @@ func (a *AccountDetails) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetails) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetId(id *string) { + a.Id = id + a.require(accountDetailsFieldId) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegration(integration *string) { + a.Integration = integration + a.require(accountDetailsFieldIntegration) +} + +// SetIntegrationSlug sets the IntegrationSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegrationSlug(integrationSlug *string) { + a.IntegrationSlug = integrationSlug + a.require(accountDetailsFieldIntegrationSlug) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCategory(category *AccountDetailsCategory) { + a.Category = category + a.require(accountDetailsFieldCategory) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOrganizationName(endUserOrganizationName *string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserEmailAddress(endUserEmailAddress *string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsFieldEndUserEmailAddress) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetStatus(status *string) { + a.Status = status + a.require(accountDetailsFieldStatus) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetWebhookListenerUrl(webhookListenerUrl *string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsFieldIsDuplicate) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetAccountType(accountType *string) { + a.AccountType = accountType + a.require(accountDetailsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCompletedAt(completedAt *time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsFieldCompletedAt) +} + func (a *AccountDetails) UnmarshalJSON(data []byte) error { type embed AccountDetails var unmarshaler = struct { @@ -148,7 +258,8 @@ func (a *AccountDetails) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewOptionalDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetails) String() string { diff --git a/crm/account_token.go b/crm/account_token.go index a3fbbb9..849565f 100644 --- a/crm/account_token.go +++ b/crm/account_token.go @@ -6,6 +6,13 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + accountTokenFieldAccountToken = big.NewInt(1 << 0) + accountTokenFieldIntegration = big.NewInt(1 << 1) + accountTokenFieldId = big.NewInt(1 << 2) ) type AccountToken struct { @@ -13,6 +20,9 @@ type AccountToken struct { Integration *AccountIntegration `json:"integration" url:"integration"` Id string `json:"id" url:"id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -42,6 +52,34 @@ func (a *AccountToken) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountToken) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetAccountToken(accountToken string) { + a.AccountToken = accountToken + a.require(accountTokenFieldAccountToken) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(accountTokenFieldIntegration) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetId(id string) { + a.Id = id + a.require(accountTokenFieldId) +} + func (a *AccountToken) UnmarshalJSON(data []byte) error { type unmarshaler AccountToken var value unmarshaler @@ -58,6 +96,17 @@ func (a *AccountToken) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountToken) MarshalJSON() ([]byte, error) { + type embed AccountToken + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountToken) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/crm/accountdetails/client.go b/crm/accountdetails/client.go index 7c2f3ff..014d7ae 100644 --- a/crm/accountdetails/client.go +++ b/crm/accountdetails/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.AccountDetails, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/account-details" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.AccountDetails - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/accountdetails/crm_account_details_test/crm_account_details_test.go b/crm/accountdetails/crm_account_details_test/crm_account_details_test.go new file mode 100644 index 0000000..dd79d1c --- /dev/null +++ b/crm/accountdetails/crm_account_details_test/crm_account_details_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_account_details_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmAccountDetailsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.AccountDetails.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/account-details", nil, 1) +} diff --git a/crm/accountdetails/raw_client.go b/crm/accountdetails/raw_client.go new file mode 100644 index 0000000..5e678a7 --- /dev/null +++ b/crm/accountdetails/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package accountdetails + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.AccountDetails], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/account-details" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.AccountDetails + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.AccountDetails]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/accounts.go b/crm/accounts.go index 8e3c285..d6f344c 100644 --- a/crm/accounts.go +++ b/crm/accounts.go @@ -6,17 +6,72 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + crmAccountEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + crmAccountEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + crmAccountEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type CrmAccountEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *AccountRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CrmAccountEndpointRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAccountEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + c.IsDebugMode = isDebugMode + c.require(crmAccountEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAccountEndpointRequest) SetRunAsync(runAsync *bool) { + c.RunAsync = runAsync + c.require(crmAccountEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAccountEndpointRequest) SetModel(model *AccountRequest) { + c.Model = model + c.require(crmAccountEndpointRequestFieldModel) } +var ( + accountsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + accountsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + accountsListRequestFieldCursor = big.NewInt(1 << 2) + accountsListRequestFieldExpand = big.NewInt(1 << 3) + accountsListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + accountsListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + accountsListRequestFieldIncludeRemoteFields = big.NewInt(1 << 6) + accountsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + accountsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + accountsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + accountsListRequestFieldName = big.NewInt(1 << 10) + accountsListRequestFieldOwnerId = big.NewInt(1 << 11) + accountsListRequestFieldPageSize = big.NewInt(1 << 12) + accountsListRequestFieldRemoteId = big.NewInt(1 << 13) +) + type AccountsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -46,16 +101,172 @@ type AccountsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AccountsListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCreatedAfter(createdAfter *time.Time) { + a.CreatedAfter = createdAfter + a.require(accountsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCreatedBefore(createdBefore *time.Time) { + a.CreatedBefore = createdBefore + a.require(accountsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(accountsListRequestFieldCursor) } +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(accountsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(accountsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(accountsListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + a.IncludeRemoteFields = includeRemoteFields + a.require(accountsListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(accountsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + a.ModifiedAfter = modifiedAfter + a.require(accountsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + a.ModifiedBefore = modifiedBefore + a.require(accountsListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetName(name *string) { + a.Name = name + a.require(accountsListRequestFieldName) +} + +// SetOwnerId sets the OwnerId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetOwnerId(ownerId *string) { + a.OwnerId = ownerId + a.require(accountsListRequestFieldOwnerId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(accountsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(accountsListRequestFieldRemoteId) +} + +var ( + patchedCrmAccountEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedCrmAccountEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedCrmAccountEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PatchedCrmAccountEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PatchedAccountRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedCrmAccountEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCrmAccountEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedCrmAccountEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCrmAccountEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedCrmAccountEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCrmAccountEndpointRequest) SetModel(model *PatchedAccountRequest) { + p.Model = model + p.require(patchedCrmAccountEndpointRequestFieldModel) +} + +var ( + accountsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + accountsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + accountsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + accountsRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + accountsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + accountsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + accountsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + accountsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type AccountsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -73,8 +284,81 @@ type AccountsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AccountsRemoteFieldClassesListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(accountsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(accountsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(accountsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + a.IncludeRemoteFields = includeRemoteFields + a.require(accountsRemoteFieldClassesListRequestFieldIncludeRemoteFields) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(accountsRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + a.IsCommonModelField = isCommonModelField + a.require(accountsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + a.IsCustom = isCustom + a.require(accountsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(accountsRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + accountsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + accountsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + accountsRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + accountsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) +) + type AccountsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -84,6 +368,44 @@ type AccountsRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AccountsRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(accountsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(accountsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + a.IncludeRemoteFields = includeRemoteFields + a.require(accountsRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(accountsRetrieveRequestFieldIncludeShellData) } // # The Account Object @@ -91,6 +413,20 @@ type AccountsRetrieveRequest struct { // The `Account` object is used to represent a company in a CRM system. // ### Usage Example // TODO +var ( + accountRequestFieldOwner = big.NewInt(1 << 0) + accountRequestFieldName = big.NewInt(1 << 1) + accountRequestFieldDescription = big.NewInt(1 << 2) + accountRequestFieldIndustry = big.NewInt(1 << 3) + accountRequestFieldWebsite = big.NewInt(1 << 4) + accountRequestFieldNumberOfEmployees = big.NewInt(1 << 5) + accountRequestFieldAddresses = big.NewInt(1 << 6) + accountRequestFieldLastActivityAt = big.NewInt(1 << 7) + accountRequestFieldIntegrationParams = big.NewInt(1 << 8) + accountRequestFieldLinkedAccountParams = big.NewInt(1 << 9) + accountRequestFieldRemoteFields = big.NewInt(1 << 10) +) + type AccountRequest struct { // The account's owner. Owner *AccountRequestOwner `json:"owner,omitempty" url:"owner,omitempty"` @@ -111,6 +447,9 @@ type AccountRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -196,6 +535,90 @@ func (a *AccountRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetOwner(owner *AccountRequestOwner) { + a.Owner = owner + a.require(accountRequestFieldOwner) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetName(name *string) { + a.Name = name + a.require(accountRequestFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetDescription(description *string) { + a.Description = description + a.require(accountRequestFieldDescription) +} + +// SetIndustry sets the Industry field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetIndustry(industry *string) { + a.Industry = industry + a.require(accountRequestFieldIndustry) +} + +// SetWebsite sets the Website field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetWebsite(website *string) { + a.Website = website + a.require(accountRequestFieldWebsite) +} + +// SetNumberOfEmployees sets the NumberOfEmployees field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetNumberOfEmployees(numberOfEmployees *int) { + a.NumberOfEmployees = numberOfEmployees + a.require(accountRequestFieldNumberOfEmployees) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetAddresses(addresses []*AddressRequest) { + a.Addresses = addresses + a.require(accountRequestFieldAddresses) +} + +// SetLastActivityAt sets the LastActivityAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetLastActivityAt(lastActivityAt *time.Time) { + a.LastActivityAt = lastActivityAt + a.require(accountRequestFieldLastActivityAt) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(accountRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(accountRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + a.RemoteFields = remoteFields + a.require(accountRequestFieldRemoteFields) +} + func (a *AccountRequest) UnmarshalJSON(data []byte) error { type embed AccountRequest var unmarshaler = struct { @@ -227,7 +650,8 @@ func (a *AccountRequest) MarshalJSON() ([]byte, error) { embed: embed(*a), LastActivityAt: internal.NewOptionalDateTime(a.LastActivityAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountRequest) String() string { @@ -305,12 +729,22 @@ func (a *AccountRequestOwner) Accept(visitor AccountRequestOwnerVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + crmAccountResponseFieldModel = big.NewInt(1 << 0) + crmAccountResponseFieldWarnings = big.NewInt(1 << 1) + crmAccountResponseFieldErrors = big.NewInt(1 << 2) + crmAccountResponseFieldLogs = big.NewInt(1 << 3) +) + type CrmAccountResponse struct { Model *Account `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -347,6 +781,41 @@ func (c *CrmAccountResponse) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CrmAccountResponse) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAccountResponse) SetModel(model *Account) { + c.Model = model + c.require(crmAccountResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAccountResponse) SetWarnings(warnings []*WarningValidationProblem) { + c.Warnings = warnings + c.require(crmAccountResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAccountResponse) SetErrors(errors []*ErrorValidationProblem) { + c.Errors = errors + c.require(crmAccountResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAccountResponse) SetLogs(logs []*DebugModeLog) { + c.Logs = logs + c.require(crmAccountResponseFieldLogs) +} + func (c *CrmAccountResponse) UnmarshalJSON(data []byte) error { type unmarshaler CrmAccountResponse var value unmarshaler @@ -363,6 +832,17 @@ func (c *CrmAccountResponse) UnmarshalJSON(data []byte) error { return nil } +func (c *CrmAccountResponse) MarshalJSON() ([]byte, error) { + type embed CrmAccountResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CrmAccountResponse) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -375,11 +855,20 @@ func (c *CrmAccountResponse) String() string { return fmt.Sprintf("%#v", c) } +var ( + paginatedAccountListFieldNext = big.NewInt(1 << 0) + paginatedAccountListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Account `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -409,6 +898,34 @@ func (p *PaginatedAccountList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedAccountList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountList) SetResults(results []*Account) { + p.Results = results + p.require(paginatedAccountListFieldResults) +} + func (p *PaginatedAccountList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountList var value unmarshaler @@ -425,6 +942,17 @@ func (p *PaginatedAccountList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAccountList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -442,6 +970,20 @@ func (p *PaginatedAccountList) String() string { // The `Account` object is used to represent a company in a CRM system. // ### Usage Example // TODO +var ( + patchedAccountRequestFieldOwner = big.NewInt(1 << 0) + patchedAccountRequestFieldName = big.NewInt(1 << 1) + patchedAccountRequestFieldDescription = big.NewInt(1 << 2) + patchedAccountRequestFieldIndustry = big.NewInt(1 << 3) + patchedAccountRequestFieldWebsite = big.NewInt(1 << 4) + patchedAccountRequestFieldNumberOfEmployees = big.NewInt(1 << 5) + patchedAccountRequestFieldAddresses = big.NewInt(1 << 6) + patchedAccountRequestFieldLastActivityAt = big.NewInt(1 << 7) + patchedAccountRequestFieldIntegrationParams = big.NewInt(1 << 8) + patchedAccountRequestFieldLinkedAccountParams = big.NewInt(1 << 9) + patchedAccountRequestFieldRemoteFields = big.NewInt(1 << 10) +) + type PatchedAccountRequest struct { // The account's owner. Owner *string `json:"owner,omitempty" url:"owner,omitempty"` @@ -462,6 +1004,9 @@ type PatchedAccountRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -547,6 +1092,90 @@ func (p *PatchedAccountRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PatchedAccountRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetOwner(owner *string) { + p.Owner = owner + p.require(patchedAccountRequestFieldOwner) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetName(name *string) { + p.Name = name + p.require(patchedAccountRequestFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetDescription(description *string) { + p.Description = description + p.require(patchedAccountRequestFieldDescription) +} + +// SetIndustry sets the Industry field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetIndustry(industry *string) { + p.Industry = industry + p.require(patchedAccountRequestFieldIndustry) +} + +// SetWebsite sets the Website field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetWebsite(website *string) { + p.Website = website + p.require(patchedAccountRequestFieldWebsite) +} + +// SetNumberOfEmployees sets the NumberOfEmployees field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetNumberOfEmployees(numberOfEmployees *int) { + p.NumberOfEmployees = numberOfEmployees + p.require(patchedAccountRequestFieldNumberOfEmployees) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetAddresses(addresses []*AddressRequest) { + p.Addresses = addresses + p.require(patchedAccountRequestFieldAddresses) +} + +// SetLastActivityAt sets the LastActivityAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetLastActivityAt(lastActivityAt *time.Time) { + p.LastActivityAt = lastActivityAt + p.require(patchedAccountRequestFieldLastActivityAt) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(patchedAccountRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(patchedAccountRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedAccountRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(patchedAccountRequestFieldRemoteFields) +} + func (p *PatchedAccountRequest) UnmarshalJSON(data []byte) error { type embed PatchedAccountRequest var unmarshaler = struct { @@ -578,7 +1207,8 @@ func (p *PatchedAccountRequest) MarshalJSON() ([]byte, error) { embed: embed(*p), LastActivityAt: internal.NewOptionalDateTime(p.LastActivityAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PatchedAccountRequest) String() string { diff --git a/crm/accounts/client.go b/crm/accounts/client.go index 7486c47..9317371 100644 --- a/crm/accounts/client.go +++ b/crm/accounts/client.go @@ -4,7 +4,6 @@ package accounts import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.AccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Account], error) { +) (*core.Page[*string, *crm.Account], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedAccountList) *internal.PageResponse[*string, *crm.Account] { + readPageResponse := func(response *crm.PaginatedAccountList) *core.PageResponse[*string, *crm.Account] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Account]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Account]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *crm.CrmAccountEndpointRequest, opts ...option.RequestOption, ) (*crm.CrmAccountResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/accounts" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.CrmAccountResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Account` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *crm.AccountsRetrieveRequest, opts ...option.RequestOption, ) (*crm.Account, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/accounts/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Account - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates an `Account` object with the given `id`. @@ -192,47 +134,16 @@ func (c *Client) PartialUpdate( request *crm.PatchedCrmAccountEndpointRequest, opts ...option.RequestOption, ) (*crm.CrmAccountResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/accounts/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.CrmAccountResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `CRMAccount` PATCHs. @@ -241,38 +152,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/accounts/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `CRMAccount` POSTs. @@ -280,35 +168,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/accounts/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -316,7 +183,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.AccountsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -329,13 +196,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -352,11 +218,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/accounts/crm_accounts_test/crm_accounts_test.go b/crm/accounts/crm_accounts_test/crm_accounts_test.go new file mode 100644 index 0000000..a8ffbad --- /dev/null +++ b/crm/accounts/crm_accounts_test/crm_accounts_test.go @@ -0,0 +1,301 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.AccountsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + OwnerId: merge.String( + "owner_id", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.Accounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/accounts", map[string]string{"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"}, 1) +} + +func TestCrmAccountsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CrmAccountEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.AccountRequest{}, + } + _, invocationErr := client.Crm.Accounts.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/accounts", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmAccountsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.AccountsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Accounts.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/accounts/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmAccountsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.PatchedCrmAccountEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedAccountRequest{}, + } + _, invocationErr := client.Crm.Accounts.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/crm/v1/accounts/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmAccountsMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Accounts.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/accounts/meta/patch/id", nil, 1) +} + +func TestCrmAccountsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Accounts.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/accounts/meta/post", nil, 1) +} + +func TestCrmAccountsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.AccountsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.Accounts.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/accounts/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/accounts/raw_client.go b/crm/accounts/raw_client.go new file mode 100644 index 0000000..f2c731e --- /dev/null +++ b/crm/accounts/raw_client.go @@ -0,0 +1,266 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounts + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.CrmAccountEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.CrmAccountResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/accounts" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.CrmAccountResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CrmAccountResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.AccountsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.Account], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/accounts/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Account + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Account]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *crm.PatchedCrmAccountEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.CrmAccountResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/accounts/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.CrmAccountResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CrmAccountResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/accounts/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/accounts/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/accounttoken/client.go b/crm/accounttoken/client.go index 52c0826..0e4965a 100644 --- a/crm/accounttoken/client.go +++ b/crm/accounttoken/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,36 +38,13 @@ func (c *Client) Retrieve( publicToken string, opts ...option.RequestOption, ) (*crm.AccountToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/account-token/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, publicToken, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.AccountToken - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/accounttoken/crm_account_token_test/crm_account_token_test.go b/crm/accounttoken/crm_account_token_test/crm_account_token_test.go new file mode 100644 index 0000000..dd81d56 --- /dev/null +++ b/crm/accounttoken/crm_account_token_test/crm_account_token_test.go @@ -0,0 +1,80 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_account_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmAccountTokenRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/account-token/public_token", nil, 1) +} diff --git a/crm/accounttoken/raw_client.go b/crm/accounttoken/raw_client.go new file mode 100644 index 0000000..b09bb53 --- /dev/null +++ b/crm/accounttoken/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounttoken + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + publicToken string, + opts ...option.RequestOption, +) (*core.Response[*crm.AccountToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/account-token/%v", + publicToken, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.AccountToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.AccountToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/association_types.go b/crm/association_types.go index 8194181..3bf1bb5 100644 --- a/crm/association_types.go +++ b/crm/association_types.go @@ -6,17 +6,69 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + crmAssociationTypeEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + crmAssociationTypeEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + crmAssociationTypeEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type CrmAssociationTypeEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *AssociationTypeRequestRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CrmAssociationTypeEndpointRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAssociationTypeEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + c.IsDebugMode = isDebugMode + c.require(crmAssociationTypeEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAssociationTypeEndpointRequest) SetRunAsync(runAsync *bool) { + c.RunAsync = runAsync + c.require(crmAssociationTypeEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAssociationTypeEndpointRequest) SetModel(model *AssociationTypeRequestRequest) { + c.Model = model + c.require(crmAssociationTypeEndpointRequestFieldModel) +} + +var ( + customObjectClassesAssociationTypesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + customObjectClassesAssociationTypesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + customObjectClassesAssociationTypesListRequestFieldCursor = big.NewInt(1 << 2) + customObjectClassesAssociationTypesListRequestFieldExpand = big.NewInt(1 << 3) + customObjectClassesAssociationTypesListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + customObjectClassesAssociationTypesListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + customObjectClassesAssociationTypesListRequestFieldIncludeShellData = big.NewInt(1 << 6) + customObjectClassesAssociationTypesListRequestFieldModifiedAfter = big.NewInt(1 << 7) + customObjectClassesAssociationTypesListRequestFieldModifiedBefore = big.NewInt(1 << 8) + customObjectClassesAssociationTypesListRequestFieldPageSize = big.NewInt(1 << 9) + customObjectClassesAssociationTypesListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type CustomObjectClassesAssociationTypesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -40,8 +92,101 @@ type CustomObjectClassesAssociationTypesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CustomObjectClassesAssociationTypesListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(customObjectClassesAssociationTypesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(customObjectClassesAssociationTypesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(customObjectClassesAssociationTypesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(customObjectClassesAssociationTypesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(customObjectClassesAssociationTypesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(customObjectClassesAssociationTypesListRequestFieldIncludeRemoteData) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(customObjectClassesAssociationTypesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(customObjectClassesAssociationTypesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(customObjectClassesAssociationTypesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(customObjectClassesAssociationTypesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(customObjectClassesAssociationTypesListRequestFieldRemoteId) +} + +var ( + customObjectClassesAssociationTypesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + customObjectClassesAssociationTypesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + customObjectClassesAssociationTypesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type CustomObjectClassesAssociationTypesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -49,8 +194,48 @@ type CustomObjectClassesAssociationTypesRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (c *CustomObjectClassesAssociationTypesRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesRetrieveRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(customObjectClassesAssociationTypesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(customObjectClassesAssociationTypesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesAssociationTypesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(customObjectClassesAssociationTypesRetrieveRequestFieldIncludeShellData) +} + +var ( + associationTypeRequestRequestFieldSourceObjectClass = big.NewInt(1 << 0) + associationTypeRequestRequestFieldTargetObjectClasses = big.NewInt(1 << 1) + associationTypeRequestRequestFieldRemoteKeyName = big.NewInt(1 << 2) + associationTypeRequestRequestFieldDisplayName = big.NewInt(1 << 3) + associationTypeRequestRequestFieldCardinality = big.NewInt(1 << 4) + associationTypeRequestRequestFieldIsRequired = big.NewInt(1 << 5) +) + type AssociationTypeRequestRequest struct { SourceObjectClass *ObjectClassDescriptionRequest `json:"source_object_class" url:"source_object_class"` TargetObjectClasses []*ObjectClassDescriptionRequest `json:"target_object_classes" url:"target_object_classes"` @@ -59,6 +244,9 @@ type AssociationTypeRequestRequest struct { Cardinality *CardinalityEnum `json:"cardinality,omitempty" url:"cardinality,omitempty"` IsRequired *bool `json:"is_required,omitempty" url:"is_required,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -109,6 +297,55 @@ func (a *AssociationTypeRequestRequest) GetExtraProperties() map[string]interfac return a.extraProperties } +func (a *AssociationTypeRequestRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetSourceObjectClass sets the SourceObjectClass field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationTypeRequestRequest) SetSourceObjectClass(sourceObjectClass *ObjectClassDescriptionRequest) { + a.SourceObjectClass = sourceObjectClass + a.require(associationTypeRequestRequestFieldSourceObjectClass) +} + +// SetTargetObjectClasses sets the TargetObjectClasses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationTypeRequestRequest) SetTargetObjectClasses(targetObjectClasses []*ObjectClassDescriptionRequest) { + a.TargetObjectClasses = targetObjectClasses + a.require(associationTypeRequestRequestFieldTargetObjectClasses) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationTypeRequestRequest) SetRemoteKeyName(remoteKeyName string) { + a.RemoteKeyName = remoteKeyName + a.require(associationTypeRequestRequestFieldRemoteKeyName) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationTypeRequestRequest) SetDisplayName(displayName *string) { + a.DisplayName = displayName + a.require(associationTypeRequestRequestFieldDisplayName) +} + +// SetCardinality sets the Cardinality field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationTypeRequestRequest) SetCardinality(cardinality *CardinalityEnum) { + a.Cardinality = cardinality + a.require(associationTypeRequestRequestFieldCardinality) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationTypeRequestRequest) SetIsRequired(isRequired *bool) { + a.IsRequired = isRequired + a.require(associationTypeRequestRequestFieldIsRequired) +} + func (a *AssociationTypeRequestRequest) UnmarshalJSON(data []byte) error { type unmarshaler AssociationTypeRequestRequest var value unmarshaler @@ -125,6 +362,17 @@ func (a *AssociationTypeRequestRequest) UnmarshalJSON(data []byte) error { return nil } +func (a *AssociationTypeRequestRequest) MarshalJSON() ([]byte, error) { + type embed AssociationTypeRequestRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AssociationTypeRequestRequest) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -137,12 +385,22 @@ func (a *AssociationTypeRequestRequest) String() string { return fmt.Sprintf("%#v", a) } +var ( + crmAssociationTypeResponseFieldModel = big.NewInt(1 << 0) + crmAssociationTypeResponseFieldWarnings = big.NewInt(1 << 1) + crmAssociationTypeResponseFieldErrors = big.NewInt(1 << 2) + crmAssociationTypeResponseFieldLogs = big.NewInt(1 << 3) +) + type CrmAssociationTypeResponse struct { Model *AssociationType `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -179,6 +437,41 @@ func (c *CrmAssociationTypeResponse) GetExtraProperties() map[string]interface{} return c.extraProperties } +func (c *CrmAssociationTypeResponse) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAssociationTypeResponse) SetModel(model *AssociationType) { + c.Model = model + c.require(crmAssociationTypeResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAssociationTypeResponse) SetWarnings(warnings []*WarningValidationProblem) { + c.Warnings = warnings + c.require(crmAssociationTypeResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAssociationTypeResponse) SetErrors(errors []*ErrorValidationProblem) { + c.Errors = errors + c.require(crmAssociationTypeResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmAssociationTypeResponse) SetLogs(logs []*DebugModeLog) { + c.Logs = logs + c.require(crmAssociationTypeResponseFieldLogs) +} + func (c *CrmAssociationTypeResponse) UnmarshalJSON(data []byte) error { type unmarshaler CrmAssociationTypeResponse var value unmarshaler @@ -195,6 +488,17 @@ func (c *CrmAssociationTypeResponse) UnmarshalJSON(data []byte) error { return nil } +func (c *CrmAssociationTypeResponse) MarshalJSON() ([]byte, error) { + type embed CrmAssociationTypeResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CrmAssociationTypeResponse) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -207,10 +511,18 @@ func (c *CrmAssociationTypeResponse) String() string { return fmt.Sprintf("%#v", c) } +var ( + objectClassDescriptionRequestFieldId = big.NewInt(1 << 0) + objectClassDescriptionRequestFieldOriginType = big.NewInt(1 << 1) +) + type ObjectClassDescriptionRequest struct { Id string `json:"id" url:"id"` OriginType OriginTypeEnum `json:"origin_type" url:"origin_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -233,6 +545,27 @@ func (o *ObjectClassDescriptionRequest) GetExtraProperties() map[string]interfac return o.extraProperties } +func (o *ObjectClassDescriptionRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *ObjectClassDescriptionRequest) SetId(id string) { + o.Id = id + o.require(objectClassDescriptionRequestFieldId) +} + +// SetOriginType sets the OriginType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *ObjectClassDescriptionRequest) SetOriginType(originType OriginTypeEnum) { + o.OriginType = originType + o.require(objectClassDescriptionRequestFieldOriginType) +} + func (o *ObjectClassDescriptionRequest) UnmarshalJSON(data []byte) error { type unmarshaler ObjectClassDescriptionRequest var value unmarshaler @@ -249,6 +582,17 @@ func (o *ObjectClassDescriptionRequest) UnmarshalJSON(data []byte) error { return nil } +func (o *ObjectClassDescriptionRequest) MarshalJSON() ([]byte, error) { + type embed ObjectClassDescriptionRequest + var marshaler = struct { + embed + }{ + embed: embed(*o), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (o *ObjectClassDescriptionRequest) String() string { if len(o.rawJSON) > 0 { if value, err := internal.StringifyJSON(o.rawJSON); err == nil { @@ -289,11 +633,20 @@ func (o OriginTypeEnum) Ptr() *OriginTypeEnum { return &o } +var ( + paginatedAssociationTypeListFieldNext = big.NewInt(1 << 0) + paginatedAssociationTypeListFieldPrevious = big.NewInt(1 << 1) + paginatedAssociationTypeListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAssociationTypeList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AssociationType `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -323,6 +676,34 @@ func (p *PaginatedAssociationTypeList) GetExtraProperties() map[string]interface return p.extraProperties } +func (p *PaginatedAssociationTypeList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAssociationTypeList) SetNext(next *string) { + p.Next = next + p.require(paginatedAssociationTypeListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAssociationTypeList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAssociationTypeListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAssociationTypeList) SetResults(results []*AssociationType) { + p.Results = results + p.require(paginatedAssociationTypeListFieldResults) +} + func (p *PaginatedAssociationTypeList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAssociationTypeList var value unmarshaler @@ -339,6 +720,17 @@ func (p *PaginatedAssociationTypeList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAssociationTypeList) MarshalJSON() ([]byte, error) { + type embed PaginatedAssociationTypeList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAssociationTypeList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/associations.go b/crm/associations.go index 0a68a0c..7c20774 100644 --- a/crm/associations.go +++ b/crm/associations.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + customObjectClassesCustomObjectsAssociationsListRequestFieldAssociationTypeId = big.NewInt(1 << 0) + customObjectClassesCustomObjectsAssociationsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + customObjectClassesCustomObjectsAssociationsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + customObjectClassesCustomObjectsAssociationsListRequestFieldCursor = big.NewInt(1 << 3) + customObjectClassesCustomObjectsAssociationsListRequestFieldExpand = big.NewInt(1 << 4) + customObjectClassesCustomObjectsAssociationsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + customObjectClassesCustomObjectsAssociationsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + customObjectClassesCustomObjectsAssociationsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + customObjectClassesCustomObjectsAssociationsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + customObjectClassesCustomObjectsAssociationsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + customObjectClassesCustomObjectsAssociationsListRequestFieldPageSize = big.NewInt(1 << 10) + customObjectClassesCustomObjectsAssociationsListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type CustomObjectClassesCustomObjectsAssociationsListRequest struct { // If provided, will only return opportunities with this association_type. AssociationTypeId *string `json:"-" url:"association_type_id,omitempty"` @@ -34,13 +50,136 @@ type CustomObjectClassesCustomObjectsAssociationsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetAssociationTypeId sets the AssociationTypeId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetAssociationTypeId(associationTypeId *string) { + c.AssociationTypeId = associationTypeId + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldAssociationTypeId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldCreatedAfter) } +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(customObjectClassesCustomObjectsAssociationsListRequestFieldRemoteId) +} + +var ( + customObjectClassesCustomObjectsAssociationsUpdateRequestFieldIsDebugMode = big.NewInt(1 << 0) + customObjectClassesCustomObjectsAssociationsUpdateRequestFieldRunAsync = big.NewInt(1 << 1) +) + type CustomObjectClassesCustomObjectsAssociationsUpdateRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CustomObjectClassesCustomObjectsAssociationsUpdateRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsUpdateRequest) SetIsDebugMode(isDebugMode *bool) { + c.IsDebugMode = isDebugMode + c.require(customObjectClassesCustomObjectsAssociationsUpdateRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsAssociationsUpdateRequest) SetRunAsync(runAsync *bool) { + c.RunAsync = runAsync + c.require(customObjectClassesCustomObjectsAssociationsUpdateRequestFieldRunAsync) } // # The Association Object @@ -48,6 +187,14 @@ type CustomObjectClassesCustomObjectsAssociationsUpdateRequest struct { // The `Association` record refers to an instance of an Association Type. // ### Usage Example // TODO +var ( + associationFieldCreatedAt = big.NewInt(1 << 0) + associationFieldModifiedAt = big.NewInt(1 << 1) + associationFieldSourceObject = big.NewInt(1 << 2) + associationFieldTargetObject = big.NewInt(1 << 3) + associationFieldAssociationType = big.NewInt(1 << 4) +) + type Association struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -58,6 +205,9 @@ type Association struct { // The association type the association belongs to. AssociationType *AssociationAssociationType `json:"association_type,omitempty" url:"association_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -101,6 +251,48 @@ func (a *Association) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Association) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Association) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(associationFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Association) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(associationFieldModifiedAt) +} + +// SetSourceObject sets the SourceObject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Association) SetSourceObject(sourceObject *string) { + a.SourceObject = sourceObject + a.require(associationFieldSourceObject) +} + +// SetTargetObject sets the TargetObject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Association) SetTargetObject(targetObject *string) { + a.TargetObject = targetObject + a.require(associationFieldTargetObject) +} + +// SetAssociationType sets the AssociationType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Association) SetAssociationType(associationType *AssociationAssociationType) { + a.AssociationType = associationType + a.require(associationFieldAssociationType) +} + func (a *Association) UnmarshalJSON(data []byte) error { type embed Association var unmarshaler = struct { @@ -136,7 +328,8 @@ func (a *Association) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Association) String() string { @@ -214,11 +407,20 @@ func (a *AssociationAssociationType) Accept(visitor AssociationAssociationTypeVi return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + paginatedAssociationListFieldNext = big.NewInt(1 << 0) + paginatedAssociationListFieldPrevious = big.NewInt(1 << 1) + paginatedAssociationListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAssociationList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Association `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -248,6 +450,34 @@ func (p *PaginatedAssociationList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedAssociationList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAssociationList) SetNext(next *string) { + p.Next = next + p.require(paginatedAssociationListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAssociationList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAssociationListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAssociationList) SetResults(results []*Association) { + p.Results = results + p.require(paginatedAssociationListFieldResults) +} + func (p *PaginatedAssociationList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAssociationList var value unmarshaler @@ -264,6 +494,17 @@ func (p *PaginatedAssociationList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAssociationList) MarshalJSON() ([]byte, error) { + type embed PaginatedAssociationList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAssociationList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/associations/client.go b/crm/associations/client.go index 95404d3..6dc74e3 100644 --- a/crm/associations/client.go +++ b/crm/associations/client.go @@ -4,7 +4,6 @@ package associations import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -39,7 +40,7 @@ func (c *Client) CustomObjectClassesCustomObjectsAssociationsList( objectId string, request *crm.CustomObjectClassesCustomObjectsAssociationsListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Association], error) { +) (*core.Page[*string, *crm.Association], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -56,13 +57,12 @@ func (c *Client) CustomObjectClassesCustomObjectsAssociationsList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -79,11 +79,11 @@ func (c *Client) CustomObjectClassesCustomObjectsAssociationsList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedAssociationList) *internal.PageResponse[*string, *crm.Association] { + readPageResponse := func(response *crm.PaginatedAssociationList) *core.PageResponse[*string, *crm.Association] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Association]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Association]{ Next: next, Results: results, Done: next == zeroValue, @@ -100,55 +100,26 @@ func (c *Client) CustomObjectClassesCustomObjectsAssociationsList( // Creates an Association between `source_object_id` and `target_object_id` of type `association_type_id`. func (c *Client) CustomObjectClassesCustomObjectsAssociationsUpdate( ctx context.Context, - associationTypeId string, sourceClassId string, sourceObjectId string, targetClassId string, targetObjectId string, + associationTypeId string, request *crm.CustomObjectClassesCustomObjectsAssociationsUpdateRequest, opts ...option.RequestOption, ) (*crm.Association, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/custom-object-classes/%v/custom-objects/%v/associations/%v/%v/%v", + response, err := c.WithRawResponse.CustomObjectClassesCustomObjectsAssociationsUpdate( + ctx, sourceClassId, sourceObjectId, targetClassId, targetObjectId, associationTypeId, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Association - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPut, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/crm/associations/crm_associations_test/crm_associations_test.go b/crm/associations/crm_associations_test/crm_associations_test.go new file mode 100644 index 0000000..8f0ca9b --- /dev/null +++ b/crm/associations/crm_associations_test/crm_associations_test.go @@ -0,0 +1,159 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_associations_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmAssociationsCustomObjectClassesCustomObjectsAssociationsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CustomObjectClassesCustomObjectsAssociationsListRequest{ + AssociationTypeId: merge.String( + "association_type_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsList( + context.TODO(), + "custom_object_class_id", + "object_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes/custom_object_class_id/custom-objects/object_id/associations", map[string]string{"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"}, 1) +} + +func TestCrmAssociationsCustomObjectClassesCustomObjectsAssociationsUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CustomObjectClassesCustomObjectsAssociationsUpdateRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsUpdate( + context.TODO(), + "source_class_id", + "source_object_id", + "target_class_id", + "target_object_id", + "association_type_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PUT", "/crm/v1/custom-object-classes/source_class_id/custom-objects/source_object_id/associations/target_class_id/target_object_id/association_type_id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} diff --git a/crm/associations/raw_client.go b/crm/associations/raw_client.go new file mode 100644 index 0000000..9c4bcfa --- /dev/null +++ b/crm/associations/raw_client.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package associations + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) CustomObjectClassesCustomObjectsAssociationsUpdate( + ctx context.Context, + sourceClassId string, + sourceObjectId string, + targetClassId string, + targetObjectId string, + associationTypeId string, + request *crm.CustomObjectClassesCustomObjectsAssociationsUpdateRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.Association], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/custom-object-classes/%v/custom-objects/%v/associations/%v/%v/%v", + sourceClassId, + sourceObjectId, + targetClassId, + targetObjectId, + associationTypeId, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Association + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPut, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Association]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/associationtypes/client.go b/crm/associationtypes/client.go index dfc0d44..ad49f57 100644 --- a/crm/associationtypes/client.go +++ b/crm/associationtypes/client.go @@ -4,7 +4,6 @@ package associationtypes import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -38,7 +39,7 @@ func (c *Client) CustomObjectClassesAssociationTypesList( customObjectClassId string, request *crm.CustomObjectClassesAssociationTypesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.AssociationType], error) { +) (*core.Page[*string, *crm.AssociationType], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -54,13 +55,12 @@ func (c *Client) CustomObjectClassesAssociationTypesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -77,11 +77,11 @@ func (c *Client) CustomObjectClassesAssociationTypesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedAssociationTypeList) *internal.PageResponse[*string, *crm.AssociationType] { + readPageResponse := func(response *crm.PaginatedAssociationTypeList) *core.PageResponse[*string, *crm.AssociationType] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.AssociationType]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.AssociationType]{ Next: next, Results: results, Done: next == zeroValue, @@ -102,47 +102,16 @@ func (c *Client) CustomObjectClassesAssociationTypesCreate( request *crm.CrmAssociationTypeEndpointRequest, opts ...option.RequestOption, ) (*crm.CrmAssociationTypeResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/custom-object-classes/%v/association-types", + response, err := c.WithRawResponse.CustomObjectClassesAssociationTypesCreate( + ctx, customObjectClassId, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.CrmAssociationTypeResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `AssociationType` object with the given `id`. @@ -153,46 +122,17 @@ func (c *Client) CustomObjectClassesAssociationTypesRetrieve( request *crm.CustomObjectClassesAssociationTypesRetrieveRequest, opts ...option.RequestOption, ) (*crm.AssociationType, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/custom-object-classes/%v/association-types/%v", + response, err := c.WithRawResponse.CustomObjectClassesAssociationTypesRetrieve( + ctx, customObjectClassId, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.AssociationType - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `CRMAssociationType` POSTs. @@ -201,36 +141,13 @@ func (c *Client) CustomObjectClassesAssociationTypesMetaPostRetrieve( customObjectClassId string, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/custom-object-classes/%v/association-types/meta/post", + response, err := c.WithRawResponse.CustomObjectClassesAssociationTypesMetaPostRetrieve( + ctx, customObjectClassId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/associationtypes/crm_association_types_test/crm_association_types_test.go b/crm/associationtypes/crm_association_types_test/crm_association_types_test.go new file mode 100644 index 0000000..c613af2 --- /dev/null +++ b/crm/associationtypes/crm_association_types_test/crm_association_types_test.go @@ -0,0 +1,212 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_association_types_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmAssociationTypesCustomObjectClassesAssociationTypesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CustomObjectClassesAssociationTypesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesList( + context.TODO(), + "custom_object_class_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes/custom_object_class_id/association-types", map[string]string{"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"}, 1) +} + +func TestCrmAssociationTypesCustomObjectClassesAssociationTypesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CrmAssociationTypeEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.AssociationTypeRequestRequest{ + SourceObjectClass: &crm.ObjectClassDescriptionRequest{ + Id: "id", + OriginType: crm.OriginTypeEnumCustomObject, + }, + TargetObjectClasses: []*crm.ObjectClassDescriptionRequest{ + &crm.ObjectClassDescriptionRequest{ + Id: "id", + OriginType: crm.OriginTypeEnumCustomObject, + }, + }, + RemoteKeyName: "remote_key_name", + }, + } + _, invocationErr := client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesCreate( + context.TODO(), + "custom_object_class_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/custom-object-classes/custom_object_class_id/association-types", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmAssociationTypesCustomObjectClassesAssociationTypesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CustomObjectClassesAssociationTypesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesRetrieve( + context.TODO(), + "custom_object_class_id", + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes/custom_object_class_id/association-types/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmAssociationTypesCustomObjectClassesAssociationTypesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesMetaPostRetrieve( + context.TODO(), + "custom_object_class_id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes/custom_object_class_id/association-types/meta/post", nil, 1) +} diff --git a/crm/associationtypes/raw_client.go b/crm/associationtypes/raw_client.go new file mode 100644 index 0000000..56d2399 --- /dev/null +++ b/crm/associationtypes/raw_client.go @@ -0,0 +1,180 @@ +// Code generated by Fern. DO NOT EDIT. + +package associationtypes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) CustomObjectClassesAssociationTypesCreate( + ctx context.Context, + customObjectClassId string, + request *crm.CrmAssociationTypeEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.CrmAssociationTypeResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/custom-object-classes/%v/association-types", + customObjectClassId, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.CrmAssociationTypeResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CrmAssociationTypeResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) CustomObjectClassesAssociationTypesRetrieve( + ctx context.Context, + customObjectClassId string, + id string, + request *crm.CustomObjectClassesAssociationTypesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.AssociationType], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/custom-object-classes/%v/association-types/%v", + customObjectClassId, + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.AssociationType + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.AssociationType]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) CustomObjectClassesAssociationTypesMetaPostRetrieve( + ctx context.Context, + customObjectClassId string, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/custom-object-classes/%v/association-types/meta/post", + customObjectClassId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/async_passthrough.go b/crm/async_passthrough.go index 54f6de3..1ca6302 100644 --- a/crm/async_passthrough.go +++ b/crm/async_passthrough.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) type AsyncPassthroughRetrieveResponse struct { @@ -70,9 +71,16 @@ func (a *AsyncPassthroughRetrieveResponse) Accept(visitor AsyncPassthroughRetrie return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + asyncPassthroughRecieptFieldAsyncPassthroughReceiptId = big.NewInt(1 << 0) +) + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id" url:"async_passthrough_receipt_id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -88,6 +96,20 @@ func (a *AsyncPassthroughReciept) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AsyncPassthroughReciept) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAsyncPassthroughReceiptId sets the AsyncPassthroughReceiptId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPassthroughReciept) SetAsyncPassthroughReceiptId(asyncPassthroughReceiptId string) { + a.AsyncPassthroughReceiptId = asyncPassthroughReceiptId + a.require(asyncPassthroughRecieptFieldAsyncPassthroughReceiptId) +} + func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { type unmarshaler AsyncPassthroughReciept var value unmarshaler @@ -104,6 +126,17 @@ func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { return nil } +func (a *AsyncPassthroughReciept) MarshalJSON() ([]byte, error) { + type embed AsyncPassthroughReciept + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AsyncPassthroughReciept) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/crm/asyncpassthrough/client.go b/crm/asyncpassthrough/client.go index 3476edc..84aee8b 100644 --- a/crm/asyncpassthrough/client.go +++ b/crm/asyncpassthrough/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,37 +38,15 @@ func (c *Client) Create( request *crm.DataPassthroughRequest, opts ...option.RequestOption, ) (*crm.AsyncPassthroughReciept, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/async-passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.AsyncPassthroughReciept - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Retrieves data from earlier async-passthrough POST request @@ -76,36 +55,13 @@ func (c *Client) Retrieve( asyncPassthroughReceiptId string, opts ...option.RequestOption, ) (*crm.AsyncPassthroughRetrieveResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/async-passthrough/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, asyncPassthroughReceiptId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.AsyncPassthroughRetrieveResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/asyncpassthrough/crm_async_passthrough_test/crm_async_passthrough_test.go b/crm/asyncpassthrough/crm_async_passthrough_test/crm_async_passthrough_test.go new file mode 100644 index 0000000..1e18644 --- /dev/null +++ b/crm/asyncpassthrough/crm_async_passthrough_test/crm_async_passthrough_test.go @@ -0,0 +1,104 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_async_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmAsyncPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.DataPassthroughRequest{ + Method: crm.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Crm.AsyncPassthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/async-passthrough", nil, 1) +} + +func TestCrmAsyncPassthroughRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/async-passthrough/async_passthrough_receipt_id", nil, 1) +} diff --git a/crm/asyncpassthrough/raw_client.go b/crm/asyncpassthrough/raw_client.go new file mode 100644 index 0000000..c46e804 --- /dev/null +++ b/crm/asyncpassthrough/raw_client.go @@ -0,0 +1,115 @@ +// Code generated by Fern. DO NOT EDIT. + +package asyncpassthrough + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.AsyncPassthroughReciept], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/async-passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.AsyncPassthroughReciept + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.AsyncPassthroughReciept]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + asyncPassthroughReceiptId string, + opts ...option.RequestOption, +) (*core.Response[*crm.AsyncPassthroughRetrieveResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/async-passthrough/%v", + asyncPassthroughReceiptId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.AsyncPassthroughRetrieveResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.AsyncPassthroughRetrieveResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/audit_trail.go b/crm/audit_trail.go index f5fa787..085d4b7 100644 --- a/crm/audit_trail.go +++ b/crm/audit_trail.go @@ -6,9 +6,19 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + auditTrailListRequestFieldCursor = big.NewInt(1 << 0) + auditTrailListRequestFieldEndDate = big.NewInt(1 << 1) + auditTrailListRequestFieldEventType = big.NewInt(1 << 2) + auditTrailListRequestFieldPageSize = big.NewInt(1 << 3) + auditTrailListRequestFieldStartDate = big.NewInt(1 << 4) + auditTrailListRequestFieldUserEmail = big.NewInt(1 << 5) +) + type AuditTrailListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -22,8 +32,71 @@ type AuditTrailListRequest struct { StartDate *string `json:"-" url:"start_date,omitempty"` // 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. UserEmail *string `json:"-" url:"user_email,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AuditTrailListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(auditTrailListRequestFieldCursor) } +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEndDate(endDate *string) { + a.EndDate = endDate + a.require(auditTrailListRequestFieldEndDate) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEventType(eventType *string) { + a.EventType = eventType + a.require(auditTrailListRequestFieldEventType) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(auditTrailListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetStartDate(startDate *string) { + a.StartDate = startDate + a.require(auditTrailListRequestFieldStartDate) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditTrailListRequestFieldUserEmail) +} + +var ( + auditLogEventFieldId = big.NewInt(1 << 0) + auditLogEventFieldUserName = big.NewInt(1 << 1) + auditLogEventFieldUserEmail = big.NewInt(1 << 2) + auditLogEventFieldRole = big.NewInt(1 << 3) + auditLogEventFieldIpAddress = big.NewInt(1 << 4) + auditLogEventFieldEventType = big.NewInt(1 << 5) + auditLogEventFieldEventDescription = big.NewInt(1 << 6) + auditLogEventFieldCreatedAt = big.NewInt(1 << 7) +) + type AuditLogEvent struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The User's full name at the time of this Event occurring. @@ -89,6 +162,9 @@ type AuditLogEvent struct { EventDescription string `json:"event_description" url:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -153,6 +229,69 @@ func (a *AuditLogEvent) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AuditLogEvent) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetId(id *string) { + a.Id = id + a.require(auditLogEventFieldId) +} + +// SetUserName sets the UserName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserName(userName *string) { + a.UserName = userName + a.require(auditLogEventFieldUserName) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditLogEventFieldUserEmail) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetRole(role *AuditLogEventRole) { + a.Role = role + a.require(auditLogEventFieldRole) +} + +// SetIpAddress sets the IpAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetIpAddress(ipAddress string) { + a.IpAddress = ipAddress + a.require(auditLogEventFieldIpAddress) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventType(eventType *AuditLogEventEventType) { + a.EventType = eventType + a.require(auditLogEventFieldEventType) +} + +// SetEventDescription sets the EventDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventDescription(eventDescription string) { + a.EventDescription = eventDescription + a.require(auditLogEventFieldEventDescription) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(auditLogEventFieldCreatedAt) +} + func (a *AuditLogEvent) UnmarshalJSON(data []byte) error { type embed AuditLogEvent var unmarshaler = struct { @@ -184,7 +323,8 @@ func (a *AuditLogEvent) MarshalJSON() ([]byte, error) { embed: embed(*a), CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AuditLogEvent) String() string { @@ -564,11 +704,20 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +var ( + paginatedAuditLogEventListFieldNext = big.NewInt(1 << 0) + paginatedAuditLogEventListFieldPrevious = big.NewInt(1 << 1) + paginatedAuditLogEventListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAuditLogEventList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AuditLogEvent `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -598,6 +747,34 @@ func (p *PaginatedAuditLogEventList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedAuditLogEventList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetNext(next *string) { + p.Next = next + p.require(paginatedAuditLogEventListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAuditLogEventListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetResults(results []*AuditLogEvent) { + p.Results = results + p.require(paginatedAuditLogEventListFieldResults) +} + func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAuditLogEventList var value unmarshaler @@ -614,6 +791,17 @@ func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAuditLogEventList) MarshalJSON() ([]byte, error) { + type embed PaginatedAuditLogEventList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAuditLogEventList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/audittrail/client.go b/crm/audittrail/client.go index c0b90d6..1351da7 100644 --- a/crm/audittrail/client.go +++ b/crm/audittrail/client.go @@ -4,7 +4,6 @@ package audittrail import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.AuditTrailListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.AuditLogEvent], error) { +) (*core.Page[*string, *crm.AuditLogEvent], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedAuditLogEventList) *internal.PageResponse[*string, *crm.AuditLogEvent] { + readPageResponse := func(response *crm.PaginatedAuditLogEventList) *core.PageResponse[*string, *crm.AuditLogEvent] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.AuditLogEvent]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.AuditLogEvent]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/audittrail/crm_audit_trail_test/crm_audit_trail_test.go b/crm/audittrail/crm_audit_trail_test/crm_audit_trail_test.go new file mode 100644 index 0000000..1b6a60d --- /dev/null +++ b/crm/audittrail/crm_audit_trail_test/crm_audit_trail_test.go @@ -0,0 +1,102 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_audit_trail_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmAuditTrailListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } + _, invocationErr := client.Crm.AuditTrail.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/audit-trail", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "end_date": "end_date", "event_type": "event_type", "page_size": "1", "start_date": "start_date", "user_email": "user_email"}, 1) +} diff --git a/crm/audittrail/raw_client.go b/crm/audittrail/raw_client.go new file mode 100644 index 0000000..cce0cac --- /dev/null +++ b/crm/audittrail/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package audittrail + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/crm/available_actions.go b/crm/available_actions.go index 4f150ac..0d5d495 100644 --- a/crm/available_actions.go +++ b/crm/available_actions.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) // # The AvailableActions Object @@ -14,11 +15,20 @@ import ( // // ### Usage Example // Fetch all the actions available for the `Zenefits` integration. +var ( + availableActionsFieldIntegration = big.NewInt(1 << 0) + availableActionsFieldPassthroughAvailable = big.NewInt(1 << 1) + availableActionsFieldAvailableModelOperations = big.NewInt(1 << 2) +) + type AvailableActions struct { Integration *AccountIntegration `json:"integration" url:"integration"` PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +58,34 @@ func (a *AvailableActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AvailableActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(availableActionsFieldIntegration) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(availableActionsFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(availableActionsFieldAvailableModelOperations) +} + func (a *AvailableActions) UnmarshalJSON(data []byte) error { type unmarshaler AvailableActions var value unmarshaler @@ -64,6 +102,17 @@ func (a *AvailableActions) UnmarshalJSON(data []byte) error { return nil } +func (a *AvailableActions) MarshalJSON() ([]byte, error) { + type embed AvailableActions + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AvailableActions) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/crm/availableactions/client.go b/crm/availableactions/client.go index cd6b9b1..5778b49 100644 --- a/crm/availableactions/client.go +++ b/crm/availableactions/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.AvailableActions, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/available-actions" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.AvailableActions - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/availableactions/crm_available_actions_test/crm_available_actions_test.go b/crm/availableactions/crm_available_actions_test/crm_available_actions_test.go new file mode 100644 index 0000000..894b1b0 --- /dev/null +++ b/crm/availableactions/crm_available_actions_test/crm_available_actions_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_available_actions_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmAvailableActionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.AvailableActions.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/available-actions", nil, 1) +} diff --git a/crm/availableactions/raw_client.go b/crm/availableactions/raw_client.go new file mode 100644 index 0000000..a15c3be --- /dev/null +++ b/crm/availableactions/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package availableactions + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.AvailableActions], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/available-actions" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.AvailableActions + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.AvailableActions]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/client/client.go b/crm/client/client.go index a1e7f0a..73074f4 100644 --- a/crm/client/client.go +++ b/crm/client/client.go @@ -36,15 +36,9 @@ import ( users "github.com/merge-api/merge-go-client/v2/crm/users" webhookreceivers "github.com/merge-api/merge-go-client/v2/crm/webhookreceivers" internal "github.com/merge-api/merge-go-client/v2/internal" - option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { - baseURL string - caller *internal.Caller - header http.Header - AccountDetails *accountdetails.Client AccountToken *accounttoken.Client Accounts *accounts.Client @@ -76,49 +70,52 @@ type Client struct { Tasks *tasks.Client Users *users.Client WebhookReceivers *webhookreceivers.Client + + options *core.RequestOptions + baseURL string + caller *internal.Caller } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + AccountDetails: accountdetails.NewClient(options), + AccountToken: accounttoken.NewClient(options), + Accounts: accounts.NewClient(options), + AsyncPassthrough: asyncpassthrough.NewClient(options), + AuditTrail: audittrail.NewClient(options), + AvailableActions: availableactions.NewClient(options), + Contacts: contacts.NewClient(options), + CustomObjectClasses: customobjectclasses.NewClient(options), + AssociationTypes: associationtypes.NewClient(options), + CustomObjects: customobjects.NewClient(options), + Associations: associations.NewClient(options), + Scopes: scopes.NewClient(options), + DeleteAccount: deleteaccount.NewClient(options), + EngagementTypes: engagementtypes.NewClient(options), + Engagements: engagements.NewClient(options), + FieldMapping: fieldmapping.NewClient(options), + GenerateKey: generatekey.NewClient(options), + Issues: issues.NewClient(options), + Leads: leads.NewClient(options), + LinkToken: linktoken.NewClient(options), + LinkedAccounts: linkedaccounts.NewClient(options), + Notes: notes.NewClient(options), + Opportunities: opportunities.NewClient(options), + Passthrough: passthrough.NewClient(options), + RegenerateKey: regeneratekey.NewClient(options), + Stages: stages.NewClient(options), + SyncStatus: syncstatus.NewClient(options), + ForceResync: forceresync.NewClient(options), + Tasks: tasks.NewClient(options), + Users: users.NewClient(options), + WebhookReceivers: webhookreceivers.NewClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), - AccountDetails: accountdetails.NewClient(opts...), - AccountToken: accounttoken.NewClient(opts...), - Accounts: accounts.NewClient(opts...), - AsyncPassthrough: asyncpassthrough.NewClient(opts...), - AuditTrail: audittrail.NewClient(opts...), - AvailableActions: availableactions.NewClient(opts...), - Contacts: contacts.NewClient(opts...), - CustomObjectClasses: customobjectclasses.NewClient(opts...), - AssociationTypes: associationtypes.NewClient(opts...), - CustomObjects: customobjects.NewClient(opts...), - Associations: associations.NewClient(opts...), - Scopes: scopes.NewClient(opts...), - DeleteAccount: deleteaccount.NewClient(opts...), - EngagementTypes: engagementtypes.NewClient(opts...), - Engagements: engagements.NewClient(opts...), - FieldMapping: fieldmapping.NewClient(opts...), - GenerateKey: generatekey.NewClient(opts...), - Issues: issues.NewClient(opts...), - Leads: leads.NewClient(opts...), - LinkToken: linktoken.NewClient(opts...), - LinkedAccounts: linkedaccounts.NewClient(opts...), - Notes: notes.NewClient(opts...), - Opportunities: opportunities.NewClient(opts...), - Passthrough: passthrough.NewClient(opts...), - RegenerateKey: regeneratekey.NewClient(opts...), - Stages: stages.NewClient(opts...), - SyncStatus: syncstatus.NewClient(opts...), - ForceResync: forceresync.NewClient(opts...), - Tasks: tasks.NewClient(opts...), - Users: users.NewClient(opts...), - WebhookReceivers: webhookreceivers.NewClient(opts...), } } diff --git a/crm/contacts.go b/crm/contacts.go index 9ca00a4..53c12b1 100644 --- a/crm/contacts.go +++ b/crm/contacts.go @@ -6,17 +6,73 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + crmContactEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + crmContactEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + crmContactEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type CrmContactEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *ContactRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CrmContactEndpointRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmContactEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + c.IsDebugMode = isDebugMode + c.require(crmContactEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmContactEndpointRequest) SetRunAsync(runAsync *bool) { + c.RunAsync = runAsync + c.require(crmContactEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmContactEndpointRequest) SetModel(model *ContactRequest) { + c.Model = model + c.require(crmContactEndpointRequestFieldModel) } +var ( + contactsListRequestFieldAccountId = big.NewInt(1 << 0) + contactsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + contactsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + contactsListRequestFieldCursor = big.NewInt(1 << 3) + contactsListRequestFieldEmailAddresses = big.NewInt(1 << 4) + contactsListRequestFieldExpand = big.NewInt(1 << 5) + contactsListRequestFieldIncludeDeletedData = big.NewInt(1 << 6) + contactsListRequestFieldIncludeRemoteData = big.NewInt(1 << 7) + contactsListRequestFieldIncludeRemoteFields = big.NewInt(1 << 8) + contactsListRequestFieldIncludeShellData = big.NewInt(1 << 9) + contactsListRequestFieldModifiedAfter = big.NewInt(1 << 10) + contactsListRequestFieldModifiedBefore = big.NewInt(1 << 11) + contactsListRequestFieldPageSize = big.NewInt(1 << 12) + contactsListRequestFieldPhoneNumbers = big.NewInt(1 << 13) + contactsListRequestFieldRemoteId = big.NewInt(1 << 14) +) + type ContactsListRequest struct { // If provided, will only return contacts with this account. AccountId *string `json:"-" url:"account_id,omitempty"` @@ -48,16 +104,179 @@ type ContactsListRequest struct { PhoneNumbers *string `json:"-" url:"phone_numbers,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ContactsListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetAccountId sets the AccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetAccountId(accountId *string) { + c.AccountId = accountId + c.require(contactsListRequestFieldAccountId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(contactsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(contactsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(contactsListRequestFieldCursor) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetEmailAddresses(emailAddresses *string) { + c.EmailAddresses = emailAddresses + c.require(contactsListRequestFieldEmailAddresses) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetExpand(expand []*ContactsListRequestExpandItem) { + c.Expand = expand + c.require(contactsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(contactsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(contactsListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + c.IncludeRemoteFields = includeRemoteFields + c.require(contactsListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(contactsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(contactsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(contactsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(contactsListRequestFieldPageSize) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetPhoneNumbers(phoneNumbers *string) { + c.PhoneNumbers = phoneNumbers + c.require(contactsListRequestFieldPhoneNumbers) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(contactsListRequestFieldRemoteId) } +var ( + patchedCrmContactEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedCrmContactEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedCrmContactEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PatchedCrmContactEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PatchedContactRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedCrmContactEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCrmContactEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedCrmContactEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCrmContactEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedCrmContactEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedCrmContactEndpointRequest) SetModel(model *PatchedContactRequest) { + p.Model = model + p.require(patchedCrmContactEndpointRequestFieldModel) } +var ( + contactsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + contactsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + contactsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + contactsRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + contactsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + contactsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + contactsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + contactsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type ContactsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -75,8 +294,81 @@ type ContactsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ContactsRemoteFieldClassesListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(contactsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(contactsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(contactsRemoteFieldClassesListRequestFieldIncludeRemoteData) } +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + c.IncludeRemoteFields = includeRemoteFields + c.require(contactsRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(contactsRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + c.IsCommonModelField = isCommonModelField + c.require(contactsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + c.IsCustom = isCustom + c.require(contactsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(contactsRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + contactsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + contactsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + contactsRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + contactsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) +) + type ContactsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*ContactsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -86,6 +378,44 @@ type ContactsRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ContactsRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetExpand(expand []*ContactsRetrieveRequestExpandItem) { + c.Expand = expand + c.require(contactsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(contactsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + c.IncludeRemoteFields = includeRemoteFields + c.require(contactsRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(contactsRetrieveRequestFieldIncludeShellData) } type ContactsListRequestExpandItem string @@ -137,6 +467,20 @@ func (c ContactsRetrieveRequestExpandItem) Ptr() *ContactsRetrieveRequestExpandI // The `Contact` object is used to represent an existing point of contact at a company in a CRM system. // ### Usage Example // TODO +var ( + contactRequestFieldFirstName = big.NewInt(1 << 0) + contactRequestFieldLastName = big.NewInt(1 << 1) + contactRequestFieldAccount = big.NewInt(1 << 2) + contactRequestFieldOwner = big.NewInt(1 << 3) + contactRequestFieldAddresses = big.NewInt(1 << 4) + contactRequestFieldEmailAddresses = big.NewInt(1 << 5) + contactRequestFieldPhoneNumbers = big.NewInt(1 << 6) + contactRequestFieldLastActivityAt = big.NewInt(1 << 7) + contactRequestFieldIntegrationParams = big.NewInt(1 << 8) + contactRequestFieldLinkedAccountParams = big.NewInt(1 << 9) + contactRequestFieldRemoteFields = big.NewInt(1 << 10) +) + type ContactRequest struct { // The contact's first name. FirstName *string `json:"first_name,omitempty" url:"first_name,omitempty"` @@ -155,6 +499,9 @@ type ContactRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -240,6 +587,90 @@ func (c *ContactRequest) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *ContactRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetFirstName(firstName *string) { + c.FirstName = firstName + c.require(contactRequestFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetLastName(lastName *string) { + c.LastName = lastName + c.require(contactRequestFieldLastName) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetAccount(account *ContactRequestAccount) { + c.Account = account + c.require(contactRequestFieldAccount) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetOwner(owner *ContactRequestOwner) { + c.Owner = owner + c.require(contactRequestFieldOwner) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetAddresses(addresses []*AddressRequest) { + c.Addresses = addresses + c.require(contactRequestFieldAddresses) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetEmailAddresses(emailAddresses []*EmailAddressRequest) { + c.EmailAddresses = emailAddresses + c.require(contactRequestFieldEmailAddresses) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetPhoneNumbers(phoneNumbers []*PhoneNumberRequest) { + c.PhoneNumbers = phoneNumbers + c.require(contactRequestFieldPhoneNumbers) +} + +// SetLastActivityAt sets the LastActivityAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetLastActivityAt(lastActivityAt *time.Time) { + c.LastActivityAt = lastActivityAt + c.require(contactRequestFieldLastActivityAt) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + c.IntegrationParams = integrationParams + c.require(contactRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + c.LinkedAccountParams = linkedAccountParams + c.require(contactRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + c.RemoteFields = remoteFields + c.require(contactRequestFieldRemoteFields) +} + func (c *ContactRequest) UnmarshalJSON(data []byte) error { type embed ContactRequest var unmarshaler = struct { @@ -271,7 +702,8 @@ func (c *ContactRequest) MarshalJSON() ([]byte, error) { embed: embed(*c), LastActivityAt: internal.NewOptionalDateTime(c.LastActivityAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *ContactRequest) String() string { @@ -412,12 +844,22 @@ func (c *ContactRequestOwner) Accept(visitor ContactRequestOwnerVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", c) } +var ( + crmContactResponseFieldModel = big.NewInt(1 << 0) + crmContactResponseFieldWarnings = big.NewInt(1 << 1) + crmContactResponseFieldErrors = big.NewInt(1 << 2) + crmContactResponseFieldLogs = big.NewInt(1 << 3) +) + type CrmContactResponse struct { Model *Contact `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -454,6 +896,41 @@ func (c *CrmContactResponse) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CrmContactResponse) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmContactResponse) SetModel(model *Contact) { + c.Model = model + c.require(crmContactResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmContactResponse) SetWarnings(warnings []*WarningValidationProblem) { + c.Warnings = warnings + c.require(crmContactResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmContactResponse) SetErrors(errors []*ErrorValidationProblem) { + c.Errors = errors + c.require(crmContactResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmContactResponse) SetLogs(logs []*DebugModeLog) { + c.Logs = logs + c.require(crmContactResponseFieldLogs) +} + func (c *CrmContactResponse) UnmarshalJSON(data []byte) error { type unmarshaler CrmContactResponse var value unmarshaler @@ -470,6 +947,17 @@ func (c *CrmContactResponse) UnmarshalJSON(data []byte) error { return nil } +func (c *CrmContactResponse) MarshalJSON() ([]byte, error) { + type embed CrmContactResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CrmContactResponse) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -482,11 +970,20 @@ func (c *CrmContactResponse) String() string { return fmt.Sprintf("%#v", c) } +var ( + paginatedContactListFieldNext = big.NewInt(1 << 0) + paginatedContactListFieldPrevious = big.NewInt(1 << 1) + paginatedContactListFieldResults = big.NewInt(1 << 2) +) + type PaginatedContactList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Contact `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -516,6 +1013,34 @@ func (p *PaginatedContactList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedContactList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedContactList) SetNext(next *string) { + p.Next = next + p.require(paginatedContactListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedContactList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedContactListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedContactList) SetResults(results []*Contact) { + p.Results = results + p.require(paginatedContactListFieldResults) +} + func (p *PaginatedContactList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedContactList var value unmarshaler @@ -532,6 +1057,17 @@ func (p *PaginatedContactList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedContactList) MarshalJSON() ([]byte, error) { + type embed PaginatedContactList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedContactList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -549,6 +1085,20 @@ func (p *PaginatedContactList) String() string { // The `Contact` object is used to represent an existing point of contact at a company in a CRM system. // ### Usage Example // TODO +var ( + patchedContactRequestFieldFirstName = big.NewInt(1 << 0) + patchedContactRequestFieldLastName = big.NewInt(1 << 1) + patchedContactRequestFieldAccount = big.NewInt(1 << 2) + patchedContactRequestFieldOwner = big.NewInt(1 << 3) + patchedContactRequestFieldAddresses = big.NewInt(1 << 4) + patchedContactRequestFieldEmailAddresses = big.NewInt(1 << 5) + patchedContactRequestFieldPhoneNumbers = big.NewInt(1 << 6) + patchedContactRequestFieldLastActivityAt = big.NewInt(1 << 7) + patchedContactRequestFieldIntegrationParams = big.NewInt(1 << 8) + patchedContactRequestFieldLinkedAccountParams = big.NewInt(1 << 9) + patchedContactRequestFieldRemoteFields = big.NewInt(1 << 10) +) + type PatchedContactRequest struct { // The contact's first name. FirstName *string `json:"first_name,omitempty" url:"first_name,omitempty"` @@ -567,6 +1117,9 @@ type PatchedContactRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -652,6 +1205,90 @@ func (p *PatchedContactRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PatchedContactRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetFirstName(firstName *string) { + p.FirstName = firstName + p.require(patchedContactRequestFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetLastName(lastName *string) { + p.LastName = lastName + p.require(patchedContactRequestFieldLastName) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetAccount(account *string) { + p.Account = account + p.require(patchedContactRequestFieldAccount) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetOwner(owner *PatchedContactRequestOwner) { + p.Owner = owner + p.require(patchedContactRequestFieldOwner) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetAddresses(addresses []*AddressRequest) { + p.Addresses = addresses + p.require(patchedContactRequestFieldAddresses) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetEmailAddresses(emailAddresses []*EmailAddressRequest) { + p.EmailAddresses = emailAddresses + p.require(patchedContactRequestFieldEmailAddresses) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetPhoneNumbers(phoneNumbers []*PhoneNumberRequest) { + p.PhoneNumbers = phoneNumbers + p.require(patchedContactRequestFieldPhoneNumbers) +} + +// SetLastActivityAt sets the LastActivityAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetLastActivityAt(lastActivityAt *time.Time) { + p.LastActivityAt = lastActivityAt + p.require(patchedContactRequestFieldLastActivityAt) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(patchedContactRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(patchedContactRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedContactRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(patchedContactRequestFieldRemoteFields) +} + func (p *PatchedContactRequest) UnmarshalJSON(data []byte) error { type embed PatchedContactRequest var unmarshaler = struct { @@ -683,7 +1320,8 @@ func (p *PatchedContactRequest) MarshalJSON() ([]byte, error) { embed: embed(*p), LastActivityAt: internal.NewOptionalDateTime(p.LastActivityAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PatchedContactRequest) String() string { diff --git a/crm/contacts/client.go b/crm/contacts/client.go index 3a45064..1c6fd53 100644 --- a/crm/contacts/client.go +++ b/crm/contacts/client.go @@ -4,7 +4,6 @@ package contacts import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.ContactsListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Contact], error) { +) (*core.Page[*string, *crm.Contact], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedContactList) *internal.PageResponse[*string, *crm.Contact] { + readPageResponse := func(response *crm.PaginatedContactList) *core.PageResponse[*string, *crm.Contact] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Contact]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Contact]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *crm.CrmContactEndpointRequest, opts ...option.RequestOption, ) (*crm.CrmContactResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/contacts" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.CrmContactResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Contact` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *crm.ContactsRetrieveRequest, opts ...option.RequestOption, ) (*crm.Contact, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/contacts/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Contact - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates a `Contact` object with the given `id`. @@ -192,47 +134,16 @@ func (c *Client) PartialUpdate( request *crm.PatchedCrmContactEndpointRequest, opts ...option.RequestOption, ) (*crm.CrmContactResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/contacts/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.CrmContactResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -242,35 +153,13 @@ func (c *Client) IgnoreCreate( request *crm.IgnoreCommonModelRequest, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/contacts/ignore/%v", + _, err := c.WithRawResponse.IgnoreCreate( + ctx, modelId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - }, - ); err != nil { + if err != nil { return err } return nil @@ -282,38 +171,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/contacts/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `CRMContact` POSTs. @@ -321,35 +187,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/contacts/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -357,7 +202,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.ContactsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -370,13 +215,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -393,11 +237,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/contacts/crm_contacts_test/crm_contacts_test.go b/crm/contacts/crm_contacts_test/crm_contacts_test.go new file mode 100644 index 0000000..0476efa --- /dev/null +++ b/crm/contacts/crm_contacts_test/crm_contacts_test.go @@ -0,0 +1,329 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_contacts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmContactsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.ContactsListRequest{ + AccountId: merge.String( + "account_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddresses: merge.String( + "email_addresses", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PhoneNumbers: merge.String( + "phone_numbers", + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.Contacts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/contacts", map[string]string{"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"}, 1) +} + +func TestCrmContactsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CrmContactEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.ContactRequest{}, + } + _, invocationErr := client.Crm.Contacts.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/contacts", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmContactsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.ContactsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Contacts.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/contacts/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmContactsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.PatchedCrmContactEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedContactRequest{}, + } + _, invocationErr := client.Crm.Contacts.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/crm/v1/contacts/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmContactsIgnoreCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.IgnoreCommonModelRequest{ + Reason: &crm.IgnoreCommonModelRequestReason{ + ReasonEnum: crm.ReasonEnumGeneralCustomerRequest, + }, + } + invocationErr := client.Crm.Contacts.IgnoreCreate( + context.TODO(), + "model_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/contacts/ignore/model_id", nil, 1) +} + +func TestCrmContactsMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Contacts.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/contacts/meta/patch/id", nil, 1) +} + +func TestCrmContactsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Contacts.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/contacts/meta/post", nil, 1) +} + +func TestCrmContactsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.ContactsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.Contacts.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/contacts/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/contacts/raw_client.go b/crm/contacts/raw_client.go new file mode 100644 index 0000000..0b78e88 --- /dev/null +++ b/crm/contacts/raw_client.go @@ -0,0 +1,309 @@ +// Code generated by Fern. DO NOT EDIT. + +package contacts + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.CrmContactEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.CrmContactResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/contacts" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.CrmContactResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CrmContactResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.ContactsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.Contact], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/contacts/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Contact + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Contact]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *crm.PatchedCrmContactEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.CrmContactResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/contacts/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.CrmContactResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CrmContactResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) IgnoreCreate( + ctx context.Context, + modelId string, + request *crm.IgnoreCommonModelRequest, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/contacts/ignore/%v", + modelId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/contacts/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/contacts/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/custom_object_classes.go b/crm/custom_object_classes.go index 226587c..20c198a 100644 --- a/crm/custom_object_classes.go +++ b/crm/custom_object_classes.go @@ -6,9 +6,24 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + customObjectClassesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + customObjectClassesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + customObjectClassesListRequestFieldCursor = big.NewInt(1 << 2) + customObjectClassesListRequestFieldExpand = big.NewInt(1 << 3) + customObjectClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + customObjectClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + customObjectClassesListRequestFieldIncludeShellData = big.NewInt(1 << 6) + customObjectClassesListRequestFieldModifiedAfter = big.NewInt(1 << 7) + customObjectClassesListRequestFieldModifiedBefore = big.NewInt(1 << 8) + customObjectClassesListRequestFieldPageSize = big.NewInt(1 << 9) + customObjectClassesListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type CustomObjectClassesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -32,8 +47,101 @@ type CustomObjectClassesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CustomObjectClassesListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(customObjectClassesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(customObjectClassesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(customObjectClassesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(customObjectClassesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(customObjectClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(customObjectClassesListRequestFieldIncludeRemoteData) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(customObjectClassesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(customObjectClassesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(customObjectClassesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(customObjectClassesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(customObjectClassesListRequestFieldRemoteId) +} + +var ( + customObjectClassesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + customObjectClassesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + customObjectClassesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type CustomObjectClassesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -41,6 +149,37 @@ type CustomObjectClassesRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CustomObjectClassesRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesRetrieveRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(customObjectClassesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(customObjectClassesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(customObjectClassesRetrieveRequestFieldIncludeShellData) } // # The Custom Object Class Object @@ -48,6 +187,18 @@ type CustomObjectClassesRetrieveRequest struct { // The `Custom Object Class` object is used to represent a Custom Object Schema in the remote system. // ### Usage Example // TODO +var ( + customObjectClassFieldId = big.NewInt(1 << 0) + customObjectClassFieldRemoteId = big.NewInt(1 << 1) + customObjectClassFieldCreatedAt = big.NewInt(1 << 2) + customObjectClassFieldModifiedAt = big.NewInt(1 << 3) + customObjectClassFieldName = big.NewInt(1 << 4) + customObjectClassFieldDescription = big.NewInt(1 << 5) + customObjectClassFieldLabels = big.NewInt(1 << 6) + customObjectClassFieldFields = big.NewInt(1 << 7) + customObjectClassFieldAssociationTypes = big.NewInt(1 << 8) +) + type CustomObjectClass struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -64,6 +215,9 @@ type CustomObjectClass struct { // The types of associations with other models that the custom object class can have. AssociationTypes []map[string]interface{} `json:"association_types,omitempty" url:"association_types,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -135,6 +289,76 @@ func (c *CustomObjectClass) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CustomObjectClass) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClass) SetId(id *string) { + c.Id = id + c.require(customObjectClassFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClass) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(customObjectClassFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClass) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(customObjectClassFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClass) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(customObjectClassFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClass) SetName(name *string) { + c.Name = name + c.require(customObjectClassFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClass) SetDescription(description *string) { + c.Description = description + c.require(customObjectClassFieldDescription) +} + +// SetLabels sets the Labels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClass) SetLabels(labels map[string]*string) { + c.Labels = labels + c.require(customObjectClassFieldLabels) +} + +// SetFields sets the Fields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClass) SetFields(fields []*RemoteFieldClassForCustomObjectClass) { + c.Fields = fields + c.require(customObjectClassFieldFields) +} + +// SetAssociationTypes sets the AssociationTypes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClass) SetAssociationTypes(associationTypes []map[string]interface{}) { + c.AssociationTypes = associationTypes + c.require(customObjectClassFieldAssociationTypes) +} + func (c *CustomObjectClass) UnmarshalJSON(data []byte) error { type embed CustomObjectClass var unmarshaler = struct { @@ -170,7 +394,8 @@ func (c *CustomObjectClass) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(c.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CustomObjectClass) String() string { @@ -185,11 +410,20 @@ func (c *CustomObjectClass) String() string { return fmt.Sprintf("%#v", c) } +var ( + paginatedCustomObjectClassListFieldNext = big.NewInt(1 << 0) + paginatedCustomObjectClassListFieldPrevious = big.NewInt(1 << 1) + paginatedCustomObjectClassListFieldResults = big.NewInt(1 << 2) +) + type PaginatedCustomObjectClassList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*CustomObjectClass `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -219,6 +453,34 @@ func (p *PaginatedCustomObjectClassList) GetExtraProperties() map[string]interfa return p.extraProperties } +func (p *PaginatedCustomObjectClassList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCustomObjectClassList) SetNext(next *string) { + p.Next = next + p.require(paginatedCustomObjectClassListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCustomObjectClassList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedCustomObjectClassListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCustomObjectClassList) SetResults(results []*CustomObjectClass) { + p.Results = results + p.require(paginatedCustomObjectClassListFieldResults) +} + func (p *PaginatedCustomObjectClassList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedCustomObjectClassList var value unmarshaler @@ -235,6 +497,17 @@ func (p *PaginatedCustomObjectClassList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedCustomObjectClassList) MarshalJSON() ([]byte, error) { + type embed PaginatedCustomObjectClassList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedCustomObjectClassList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -247,6 +520,19 @@ func (p *PaginatedCustomObjectClassList) String() string { return fmt.Sprintf("%#v", p) } +var ( + remoteFieldClassForCustomObjectClassFieldCreatedAt = big.NewInt(1 << 0) + remoteFieldClassForCustomObjectClassFieldModifiedAt = big.NewInt(1 << 1) + remoteFieldClassForCustomObjectClassFieldDisplayName = big.NewInt(1 << 2) + remoteFieldClassForCustomObjectClassFieldRemoteKeyName = big.NewInt(1 << 3) + remoteFieldClassForCustomObjectClassFieldDescription = big.NewInt(1 << 4) + remoteFieldClassForCustomObjectClassFieldIsRequired = big.NewInt(1 << 5) + remoteFieldClassForCustomObjectClassFieldFieldType = big.NewInt(1 << 6) + remoteFieldClassForCustomObjectClassFieldFieldFormat = big.NewInt(1 << 7) + remoteFieldClassForCustomObjectClassFieldFieldChoices = big.NewInt(1 << 8) + remoteFieldClassForCustomObjectClassFieldItemSchema = big.NewInt(1 << 9) +) + type RemoteFieldClassForCustomObjectClass struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -261,6 +547,9 @@ type RemoteFieldClassForCustomObjectClass struct { FieldChoices []*RemoteFieldClassForCustomObjectClassFieldChoicesItem `json:"field_choices,omitempty" url:"field_choices,omitempty"` ItemSchema *RemoteFieldClassForCustomObjectClassItemSchema `json:"item_schema,omitempty" url:"item_schema,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -339,6 +628,83 @@ func (r *RemoteFieldClassForCustomObjectClass) GetExtraProperties() map[string]i return r.extraProperties } +func (r *RemoteFieldClassForCustomObjectClass) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetCreatedAt(createdAt *time.Time) { + r.CreatedAt = createdAt + r.require(remoteFieldClassForCustomObjectClassFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetModifiedAt(modifiedAt *time.Time) { + r.ModifiedAt = modifiedAt + r.require(remoteFieldClassForCustomObjectClassFieldModifiedAt) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetDisplayName(displayName *string) { + r.DisplayName = displayName + r.require(remoteFieldClassForCustomObjectClassFieldDisplayName) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetRemoteKeyName(remoteKeyName *string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldClassForCustomObjectClassFieldRemoteKeyName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetDescription(description *string) { + r.Description = description + r.require(remoteFieldClassForCustomObjectClassFieldDescription) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetIsRequired(isRequired *bool) { + r.IsRequired = isRequired + r.require(remoteFieldClassForCustomObjectClassFieldIsRequired) +} + +// SetFieldType sets the FieldType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetFieldType(fieldType *RemoteFieldClassForCustomObjectClassFieldType) { + r.FieldType = fieldType + r.require(remoteFieldClassForCustomObjectClassFieldFieldType) +} + +// SetFieldFormat sets the FieldFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetFieldFormat(fieldFormat *RemoteFieldClassForCustomObjectClassFieldFormat) { + r.FieldFormat = fieldFormat + r.require(remoteFieldClassForCustomObjectClassFieldFieldFormat) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetFieldChoices(fieldChoices []*RemoteFieldClassForCustomObjectClassFieldChoicesItem) { + r.FieldChoices = fieldChoices + r.require(remoteFieldClassForCustomObjectClassFieldFieldChoices) +} + +// SetItemSchema sets the ItemSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClass) SetItemSchema(itemSchema *RemoteFieldClassForCustomObjectClassItemSchema) { + r.ItemSchema = itemSchema + r.require(remoteFieldClassForCustomObjectClassFieldItemSchema) +} + func (r *RemoteFieldClassForCustomObjectClass) UnmarshalJSON(data []byte) error { type embed RemoteFieldClassForCustomObjectClass var unmarshaler = struct { @@ -374,7 +740,8 @@ func (r *RemoteFieldClassForCustomObjectClass) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(r.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(r.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) } func (r *RemoteFieldClassForCustomObjectClass) String() string { @@ -389,10 +756,18 @@ func (r *RemoteFieldClassForCustomObjectClass) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldClassForCustomObjectClassFieldChoicesItemFieldValue = big.NewInt(1 << 0) + remoteFieldClassForCustomObjectClassFieldChoicesItemFieldDisplayName = big.NewInt(1 << 1) +) + type RemoteFieldClassForCustomObjectClassFieldChoicesItem struct { Value interface{} `json:"value,omitempty" url:"value,omitempty"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -415,6 +790,27 @@ func (r *RemoteFieldClassForCustomObjectClassFieldChoicesItem) GetExtraPropertie return r.extraProperties } +func (r *RemoteFieldClassForCustomObjectClassFieldChoicesItem) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClassFieldChoicesItem) SetValue(value interface{}) { + r.Value = value + r.require(remoteFieldClassForCustomObjectClassFieldChoicesItemFieldValue) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClassFieldChoicesItem) SetDisplayName(displayName *string) { + r.DisplayName = displayName + r.require(remoteFieldClassForCustomObjectClassFieldChoicesItemFieldDisplayName) +} + func (r *RemoteFieldClassForCustomObjectClassFieldChoicesItem) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldClassForCustomObjectClassFieldChoicesItem var value unmarshaler @@ -431,6 +827,17 @@ func (r *RemoteFieldClassForCustomObjectClassFieldChoicesItem) UnmarshalJSON(dat return nil } +func (r *RemoteFieldClassForCustomObjectClassFieldChoicesItem) MarshalJSON() ([]byte, error) { + type embed RemoteFieldClassForCustomObjectClassFieldChoicesItem + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldClassForCustomObjectClassFieldChoicesItem) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -567,11 +974,20 @@ func (r *RemoteFieldClassForCustomObjectClassFieldType) Accept(visitor RemoteFie return fmt.Errorf("type %T does not include a non-empty union type", r) } +var ( + remoteFieldClassForCustomObjectClassItemSchemaFieldItemType = big.NewInt(1 << 0) + remoteFieldClassForCustomObjectClassItemSchemaFieldItemFormat = big.NewInt(1 << 1) + remoteFieldClassForCustomObjectClassItemSchemaFieldItemChoices = big.NewInt(1 << 2) +) + type RemoteFieldClassForCustomObjectClassItemSchema struct { ItemType *string `json:"item_type,omitempty" url:"item_type,omitempty"` ItemFormat *string `json:"item_format,omitempty" url:"item_format,omitempty"` ItemChoices []*string `json:"item_choices,omitempty" url:"item_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -601,6 +1017,34 @@ func (r *RemoteFieldClassForCustomObjectClassItemSchema) GetExtraProperties() ma return r.extraProperties } +func (r *RemoteFieldClassForCustomObjectClassItemSchema) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetItemType sets the ItemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClassItemSchema) SetItemType(itemType *string) { + r.ItemType = itemType + r.require(remoteFieldClassForCustomObjectClassItemSchemaFieldItemType) +} + +// SetItemFormat sets the ItemFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClassItemSchema) SetItemFormat(itemFormat *string) { + r.ItemFormat = itemFormat + r.require(remoteFieldClassForCustomObjectClassItemSchemaFieldItemFormat) +} + +// SetItemChoices sets the ItemChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassForCustomObjectClassItemSchema) SetItemChoices(itemChoices []*string) { + r.ItemChoices = itemChoices + r.require(remoteFieldClassForCustomObjectClassItemSchemaFieldItemChoices) +} + func (r *RemoteFieldClassForCustomObjectClassItemSchema) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldClassForCustomObjectClassItemSchema var value unmarshaler @@ -617,6 +1061,17 @@ func (r *RemoteFieldClassForCustomObjectClassItemSchema) UnmarshalJSON(data []by return nil } +func (r *RemoteFieldClassForCustomObjectClassItemSchema) MarshalJSON() ([]byte, error) { + type embed RemoteFieldClassForCustomObjectClassItemSchema + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldClassForCustomObjectClassItemSchema) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { diff --git a/crm/custom_objects.go b/crm/custom_objects.go index 98e063f..3895fb7 100644 --- a/crm/custom_objects.go +++ b/crm/custom_objects.go @@ -6,17 +6,69 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + crmCustomObjectEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + crmCustomObjectEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + crmCustomObjectEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type CrmCustomObjectEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *CustomObjectRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CrmCustomObjectEndpointRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmCustomObjectEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + c.IsDebugMode = isDebugMode + c.require(crmCustomObjectEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmCustomObjectEndpointRequest) SetRunAsync(runAsync *bool) { + c.RunAsync = runAsync + c.require(crmCustomObjectEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmCustomObjectEndpointRequest) SetModel(model *CustomObjectRequest) { + c.Model = model + c.require(crmCustomObjectEndpointRequestFieldModel) +} + +var ( + customObjectClassesCustomObjectsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + customObjectClassesCustomObjectsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + customObjectClassesCustomObjectsListRequestFieldCursor = big.NewInt(1 << 2) + customObjectClassesCustomObjectsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + customObjectClassesCustomObjectsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + customObjectClassesCustomObjectsListRequestFieldIncludeRemoteFields = big.NewInt(1 << 5) + customObjectClassesCustomObjectsListRequestFieldIncludeShellData = big.NewInt(1 << 6) + customObjectClassesCustomObjectsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + customObjectClassesCustomObjectsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + customObjectClassesCustomObjectsListRequestFieldPageSize = big.NewInt(1 << 9) + customObjectClassesCustomObjectsListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type CustomObjectClassesCustomObjectsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -40,8 +92,106 @@ type CustomObjectClassesCustomObjectsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CustomObjectClassesCustomObjectsListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(customObjectClassesCustomObjectsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(customObjectClassesCustomObjectsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(customObjectClassesCustomObjectsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(customObjectClassesCustomObjectsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(customObjectClassesCustomObjectsListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + c.IncludeRemoteFields = includeRemoteFields + c.require(customObjectClassesCustomObjectsListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(customObjectClassesCustomObjectsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(customObjectClassesCustomObjectsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(customObjectClassesCustomObjectsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(customObjectClassesCustomObjectsListRequestFieldPageSize) } +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(customObjectClassesCustomObjectsListRequestFieldRemoteId) +} + +var ( + customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -59,8 +209,80 @@ type CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + c.IncludeRemoteFields = includeRemoteFields + c.require(customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + c.IsCommonModelField = isCommonModelField + c.require(customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + c.IsCustom = isCustom + c.require(customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(customObjectClassesCustomObjectsRemoteFieldClassesListRequestFieldPageSize) } +var ( + customObjectClassesCustomObjectsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + customObjectClassesCustomObjectsRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 1) + customObjectClassesCustomObjectsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type CustomObjectClassesCustomObjectsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -68,14 +290,55 @@ type CustomObjectClassesCustomObjectsRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (c *CustomObjectClassesCustomObjectsRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(customObjectClassesCustomObjectsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + c.IncludeRemoteFields = includeRemoteFields + c.require(customObjectClassesCustomObjectsRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectClassesCustomObjectsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(customObjectClassesCustomObjectsRetrieveRequestFieldIncludeShellData) +} + +var ( + crmCustomObjectResponseFieldModel = big.NewInt(1 << 0) + crmCustomObjectResponseFieldWarnings = big.NewInt(1 << 1) + crmCustomObjectResponseFieldErrors = big.NewInt(1 << 2) + crmCustomObjectResponseFieldLogs = big.NewInt(1 << 3) +) + type CrmCustomObjectResponse struct { Model *CustomObject `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -112,6 +375,41 @@ func (c *CrmCustomObjectResponse) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CrmCustomObjectResponse) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmCustomObjectResponse) SetModel(model *CustomObject) { + c.Model = model + c.require(crmCustomObjectResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmCustomObjectResponse) SetWarnings(warnings []*WarningValidationProblem) { + c.Warnings = warnings + c.require(crmCustomObjectResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmCustomObjectResponse) SetErrors(errors []*ErrorValidationProblem) { + c.Errors = errors + c.require(crmCustomObjectResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CrmCustomObjectResponse) SetLogs(logs []*DebugModeLog) { + c.Logs = logs + c.require(crmCustomObjectResponseFieldLogs) +} + func (c *CrmCustomObjectResponse) UnmarshalJSON(data []byte) error { type unmarshaler CrmCustomObjectResponse var value unmarshaler @@ -128,6 +426,17 @@ func (c *CrmCustomObjectResponse) UnmarshalJSON(data []byte) error { return nil } +func (c *CrmCustomObjectResponse) MarshalJSON() ([]byte, error) { + type embed CrmCustomObjectResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CrmCustomObjectResponse) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -145,6 +454,16 @@ func (c *CrmCustomObjectResponse) String() string { // The `Custom Object` record refers to an instance of a Custom Object Class. // ### Usage Example // TODO +var ( + customObjectFieldId = big.NewInt(1 << 0) + customObjectFieldRemoteId = big.NewInt(1 << 1) + customObjectFieldCreatedAt = big.NewInt(1 << 2) + customObjectFieldModifiedAt = big.NewInt(1 << 3) + customObjectFieldObjectClass = big.NewInt(1 << 4) + customObjectFieldFields = big.NewInt(1 << 5) + customObjectFieldRemoteFields = big.NewInt(1 << 6) +) + type CustomObject struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -159,6 +478,9 @@ type CustomObject struct { Fields map[string]interface{} `json:"fields,omitempty" url:"fields,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -216,6 +538,62 @@ func (c *CustomObject) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CustomObject) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObject) SetId(id *string) { + c.Id = id + c.require(customObjectFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObject) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(customObjectFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObject) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(customObjectFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObject) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(customObjectFieldModifiedAt) +} + +// SetObjectClass sets the ObjectClass field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObject) SetObjectClass(objectClass *string) { + c.ObjectClass = objectClass + c.require(customObjectFieldObjectClass) +} + +// SetFields sets the Fields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObject) SetFields(fields map[string]interface{}) { + c.Fields = fields + c.require(customObjectFieldFields) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObject) SetRemoteFields(remoteFields []*RemoteField) { + c.RemoteFields = remoteFields + c.require(customObjectFieldRemoteFields) +} + func (c *CustomObject) UnmarshalJSON(data []byte) error { type embed CustomObject var unmarshaler = struct { @@ -251,7 +629,8 @@ func (c *CustomObject) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(c.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *CustomObject) String() string { @@ -266,11 +645,20 @@ func (c *CustomObject) String() string { return fmt.Sprintf("%#v", c) } +var ( + customObjectRequestFieldFields = big.NewInt(1 << 0) + customObjectRequestFieldIntegrationParams = big.NewInt(1 << 1) + customObjectRequestFieldLinkedAccountParams = big.NewInt(1 << 2) +) + type CustomObjectRequest struct { Fields map[string]interface{} `json:"fields" url:"fields"` IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -300,6 +688,34 @@ func (c *CustomObjectRequest) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CustomObjectRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetFields sets the Fields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectRequest) SetFields(fields map[string]interface{}) { + c.Fields = fields + c.require(customObjectRequestFieldFields) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + c.IntegrationParams = integrationParams + c.require(customObjectRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CustomObjectRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + c.LinkedAccountParams = linkedAccountParams + c.require(customObjectRequestFieldLinkedAccountParams) +} + func (c *CustomObjectRequest) UnmarshalJSON(data []byte) error { type unmarshaler CustomObjectRequest var value unmarshaler @@ -316,6 +732,17 @@ func (c *CustomObjectRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *CustomObjectRequest) MarshalJSON() ([]byte, error) { + type embed CustomObjectRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CustomObjectRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -328,11 +755,20 @@ func (c *CustomObjectRequest) String() string { return fmt.Sprintf("%#v", c) } +var ( + paginatedCustomObjectListFieldNext = big.NewInt(1 << 0) + paginatedCustomObjectListFieldPrevious = big.NewInt(1 << 1) + paginatedCustomObjectListFieldResults = big.NewInt(1 << 2) +) + type PaginatedCustomObjectList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*CustomObject `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -362,6 +798,34 @@ func (p *PaginatedCustomObjectList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedCustomObjectList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCustomObjectList) SetNext(next *string) { + p.Next = next + p.require(paginatedCustomObjectListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCustomObjectList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedCustomObjectListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCustomObjectList) SetResults(results []*CustomObject) { + p.Results = results + p.require(paginatedCustomObjectListFieldResults) +} + func (p *PaginatedCustomObjectList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedCustomObjectList var value unmarshaler @@ -378,6 +842,17 @@ func (p *PaginatedCustomObjectList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedCustomObjectList) MarshalJSON() ([]byte, error) { + type embed PaginatedCustomObjectList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedCustomObjectList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/customobjectclasses/client.go b/crm/customobjectclasses/client.go index f30ac4f..354a3e1 100644 --- a/crm/customobjectclasses/client.go +++ b/crm/customobjectclasses/client.go @@ -4,7 +4,6 @@ package customobjectclasses import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.CustomObjectClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.CustomObjectClass], error) { +) (*core.Page[*string, *crm.CustomObjectClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedCustomObjectClassList) *internal.PageResponse[*string, *crm.CustomObjectClass] { + readPageResponse := func(response *crm.PaginatedCustomObjectClassList) *core.PageResponse[*string, *crm.CustomObjectClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.CustomObjectClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.CustomObjectClass]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *crm.CustomObjectClassesRetrieveRequest, opts ...option.RequestOption, ) (*crm.CustomObjectClass, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/custom-object-classes/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.CustomObjectClass - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/crm/customobjectclasses/crm_custom_object_classes_test/crm_custom_object_classes_test.go b/crm/customobjectclasses/crm_custom_object_classes_test/crm_custom_object_classes_test.go new file mode 100644 index 0000000..294189a --- /dev/null +++ b/crm/customobjectclasses/crm_custom_object_classes_test/crm_custom_object_classes_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_custom_object_classes_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmCustomObjectClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CustomObjectClassesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.CustomObjectClasses.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes", map[string]string{"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"}, 1) +} + +func TestCrmCustomObjectClassesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CustomObjectClassesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.CustomObjectClasses.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/crm/customobjectclasses/raw_client.go b/crm/customobjectclasses/raw_client.go new file mode 100644 index 0000000..643926b --- /dev/null +++ b/crm/customobjectclasses/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package customobjectclasses + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.CustomObjectClassesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.CustomObjectClass], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/custom-object-classes/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.CustomObjectClass + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CustomObjectClass]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/customobjects/client.go b/crm/customobjects/client.go index 46d3eef..2c84ae6 100644 --- a/crm/customobjects/client.go +++ b/crm/customobjects/client.go @@ -4,7 +4,6 @@ package customobjects import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -38,7 +39,7 @@ func (c *Client) CustomObjectClassesCustomObjectsList( customObjectClassId string, request *crm.CustomObjectClassesCustomObjectsListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.CustomObject], error) { +) (*core.Page[*string, *crm.CustomObject], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -54,13 +55,12 @@ func (c *Client) CustomObjectClassesCustomObjectsList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -77,11 +77,11 @@ func (c *Client) CustomObjectClassesCustomObjectsList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedCustomObjectList) *internal.PageResponse[*string, *crm.CustomObject] { + readPageResponse := func(response *crm.PaginatedCustomObjectList) *core.PageResponse[*string, *crm.CustomObject] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.CustomObject]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.CustomObject]{ Next: next, Results: results, Done: next == zeroValue, @@ -102,47 +102,16 @@ func (c *Client) CustomObjectClassesCustomObjectsCreate( request *crm.CrmCustomObjectEndpointRequest, opts ...option.RequestOption, ) (*crm.CrmCustomObjectResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/custom-object-classes/%v/custom-objects", + response, err := c.WithRawResponse.CustomObjectClassesCustomObjectsCreate( + ctx, customObjectClassId, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.CrmCustomObjectResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `CustomObject` object with the given `id`. @@ -153,46 +122,17 @@ func (c *Client) CustomObjectClassesCustomObjectsRetrieve( request *crm.CustomObjectClassesCustomObjectsRetrieveRequest, opts ...option.RequestOption, ) (*crm.CustomObject, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/custom-object-classes/%v/custom-objects/%v", + response, err := c.WithRawResponse.CustomObjectClassesCustomObjectsRetrieve( + ctx, customObjectClassId, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.CustomObject - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `CRMCustomObject` POSTs. @@ -201,38 +141,15 @@ func (c *Client) CustomObjectClassesCustomObjectsMetaPostRetrieve( customObjectClassId string, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/custom-object-classes/%v/custom-objects/meta/post", + response, err := c.WithRawResponse.CustomObjectClassesCustomObjectsMetaPostRetrieve( + ctx, customObjectClassId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -240,7 +157,7 @@ func (c *Client) CustomObjectClassesCustomObjectsRemoteFieldClassesList( ctx context.Context, request *crm.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -253,13 +170,12 @@ func (c *Client) CustomObjectClassesCustomObjectsRemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -276,11 +192,11 @@ func (c *Client) CustomObjectClassesCustomObjectsRemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/customobjects/crm_custom_objects_test/crm_custom_objects_test.go b/crm/customobjects/crm_custom_objects_test/crm_custom_objects_test.go new file mode 100644 index 0000000..3473a3d --- /dev/null +++ b/crm/customobjects/crm_custom_objects_test/crm_custom_objects_test.go @@ -0,0 +1,255 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_custom_objects_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmCustomObjectsCustomObjectClassesCustomObjectsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CustomObjectClassesCustomObjectsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.CustomObjects.CustomObjectClassesCustomObjectsList( + context.TODO(), + "custom_object_class_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes/custom_object_class_id/custom-objects", map[string]string{"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"}, 1) +} + +func TestCrmCustomObjectsCustomObjectClassesCustomObjectsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CrmCustomObjectEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.CustomObjectRequest{ + Fields: map[string]any{ + "test_field": "hello", + }, + }, + } + _, invocationErr := client.Crm.CustomObjects.CustomObjectClassesCustomObjectsCreate( + context.TODO(), + "custom_object_class_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/custom-object-classes/custom_object_class_id/custom-objects", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmCustomObjectsCustomObjectClassesCustomObjectsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CustomObjectClassesCustomObjectsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRetrieve( + context.TODO(), + "custom_object_class_id", + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes/custom_object_class_id/custom-objects/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmCustomObjectsCustomObjectClassesCustomObjectsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.CustomObjects.CustomObjectClassesCustomObjectsMetaPostRetrieve( + context.TODO(), + "custom_object_class_id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes/custom_object_class_id/custom-objects/meta/post", nil, 1) +} + +func TestCrmCustomObjectsCustomObjectClassesCustomObjectsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/custom-object-classes/custom-objects/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/customobjects/raw_client.go b/crm/customobjects/raw_client.go new file mode 100644 index 0000000..a4b27a9 --- /dev/null +++ b/crm/customobjects/raw_client.go @@ -0,0 +1,180 @@ +// Code generated by Fern. DO NOT EDIT. + +package customobjects + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) CustomObjectClassesCustomObjectsCreate( + ctx context.Context, + customObjectClassId string, + request *crm.CrmCustomObjectEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.CrmCustomObjectResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/custom-object-classes/%v/custom-objects", + customObjectClassId, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.CrmCustomObjectResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CrmCustomObjectResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) CustomObjectClassesCustomObjectsRetrieve( + ctx context.Context, + customObjectClassId string, + id string, + request *crm.CustomObjectClassesCustomObjectsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.CustomObject], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/custom-object-classes/%v/custom-objects/%v", + customObjectClassId, + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.CustomObject + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CustomObject]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) CustomObjectClassesCustomObjectsMetaPostRetrieve( + ctx context.Context, + customObjectClassId string, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/custom-object-classes/%v/custom-objects/meta/post", + customObjectClassId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/deleteaccount/client.go b/crm/deleteaccount/client.go index 2471264..9f2d80e 100644 --- a/crm/deleteaccount/client.go +++ b/crm/deleteaccount/client.go @@ -7,26 +7,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -35,30 +36,11 @@ func (c *Client) Delete( ctx context.Context, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/delete-account" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - if err := c.caller.Call( + _, err := c.WithRawResponse.Delete( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - }, - ); err != nil { + opts..., + ) + if err != nil { return err } return nil diff --git a/crm/deleteaccount/crm_delete_account_test/crm_delete_account_test.go b/crm/deleteaccount/crm_delete_account_test/crm_delete_account_test.go new file mode 100644 index 0000000..0ad1a7e --- /dev/null +++ b/crm/deleteaccount/crm_delete_account_test/crm_delete_account_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_delete_account_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmDeleteAccountDeleteWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + invocationErr := client.Crm.DeleteAccount.Delete( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/delete-account", nil, 1) +} diff --git a/crm/deleteaccount/raw_client.go b/crm/deleteaccount/raw_client.go new file mode 100644 index 0000000..e815391 --- /dev/null +++ b/crm/deleteaccount/raw_client.go @@ -0,0 +1,67 @@ +// Code generated by Fern. DO NOT EDIT. + +package deleteaccount + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Delete( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/delete-account" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} diff --git a/crm/engagement_types.go b/crm/engagement_types.go index 6ab7e14..da6c532 100644 --- a/crm/engagement_types.go +++ b/crm/engagement_types.go @@ -6,9 +6,24 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + engagementTypesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + engagementTypesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + engagementTypesListRequestFieldCursor = big.NewInt(1 << 2) + engagementTypesListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + engagementTypesListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + engagementTypesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 5) + engagementTypesListRequestFieldIncludeShellData = big.NewInt(1 << 6) + engagementTypesListRequestFieldModifiedAfter = big.NewInt(1 << 7) + engagementTypesListRequestFieldModifiedBefore = big.NewInt(1 << 8) + engagementTypesListRequestFieldPageSize = big.NewInt(1 << 9) + engagementTypesListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type EngagementTypesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -32,8 +47,106 @@ type EngagementTypesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EngagementTypesListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetCreatedAfter(createdAfter *time.Time) { + e.CreatedAfter = createdAfter + e.require(engagementTypesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetCreatedBefore(createdBefore *time.Time) { + e.CreatedBefore = createdBefore + e.require(engagementTypesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(engagementTypesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(engagementTypesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(engagementTypesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + e.IncludeRemoteFields = includeRemoteFields + e.require(engagementTypesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(engagementTypesListRequestFieldIncludeShellData) } +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + e.ModifiedAfter = modifiedAfter + e.require(engagementTypesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + e.ModifiedBefore = modifiedBefore + e.require(engagementTypesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(engagementTypesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesListRequest) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(engagementTypesListRequestFieldRemoteId) +} + +var ( + engagementTypesRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + engagementTypesRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + engagementTypesRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + engagementTypesRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + engagementTypesRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + engagementTypesRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + engagementTypesRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + engagementTypesRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type EngagementTypesRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -51,8 +164,80 @@ type EngagementTypesRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (e *EngagementTypesRemoteFieldClassesListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRemoteFieldClassesListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(engagementTypesRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(engagementTypesRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(engagementTypesRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + e.IncludeRemoteFields = includeRemoteFields + e.require(engagementTypesRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(engagementTypesRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + e.IsCommonModelField = isCommonModelField + e.require(engagementTypesRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + e.IsCustom = isCustom + e.require(engagementTypesRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(engagementTypesRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + engagementTypesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + engagementTypesRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 1) + engagementTypesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type EngagementTypesRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -60,13 +245,53 @@ type EngagementTypesRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EngagementTypesRetrieveRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(engagementTypesRetrieveRequestFieldIncludeRemoteData) } +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + e.IncludeRemoteFields = includeRemoteFields + e.require(engagementTypesRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementTypesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(engagementTypesRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedEngagementTypeListFieldNext = big.NewInt(1 << 0) + paginatedEngagementTypeListFieldPrevious = big.NewInt(1 << 1) + paginatedEngagementTypeListFieldResults = big.NewInt(1 << 2) +) + type PaginatedEngagementTypeList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*EngagementType `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -96,6 +321,34 @@ func (p *PaginatedEngagementTypeList) GetExtraProperties() map[string]interface{ return p.extraProperties } +func (p *PaginatedEngagementTypeList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEngagementTypeList) SetNext(next *string) { + p.Next = next + p.require(paginatedEngagementTypeListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEngagementTypeList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedEngagementTypeListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEngagementTypeList) SetResults(results []*EngagementType) { + p.Results = results + p.require(paginatedEngagementTypeListFieldResults) +} + func (p *PaginatedEngagementTypeList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedEngagementTypeList var value unmarshaler @@ -112,6 +365,17 @@ func (p *PaginatedEngagementTypeList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedEngagementTypeList) MarshalJSON() ([]byte, error) { + type embed PaginatedEngagementTypeList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedEngagementTypeList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/engagements.go b/crm/engagements.go index 8908cc8..6988495 100644 --- a/crm/engagements.go +++ b/crm/engagements.go @@ -6,17 +6,72 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + engagementEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + engagementEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + engagementEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type EngagementEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *EngagementRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EngagementEndpointRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + e.IsDebugMode = isDebugMode + e.require(engagementEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementEndpointRequest) SetRunAsync(runAsync *bool) { + e.RunAsync = runAsync + e.require(engagementEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementEndpointRequest) SetModel(model *EngagementRequest) { + e.Model = model + e.require(engagementEndpointRequestFieldModel) +} + +var ( + engagementsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + engagementsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + engagementsListRequestFieldCursor = big.NewInt(1 << 2) + engagementsListRequestFieldExpand = big.NewInt(1 << 3) + engagementsListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + engagementsListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + engagementsListRequestFieldIncludeRemoteFields = big.NewInt(1 << 6) + engagementsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + engagementsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + engagementsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + engagementsListRequestFieldPageSize = big.NewInt(1 << 10) + engagementsListRequestFieldRemoteId = big.NewInt(1 << 11) + engagementsListRequestFieldStartedAfter = big.NewInt(1 << 12) + engagementsListRequestFieldStartedBefore = big.NewInt(1 << 13) +) + type EngagementsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -46,16 +101,172 @@ type EngagementsListRequest struct { StartedAfter *time.Time `json:"-" url:"started_after,omitempty"` // If provided, will only return engagements started before this datetime. StartedBefore *time.Time `json:"-" url:"started_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EngagementsListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetCreatedAfter(createdAfter *time.Time) { + e.CreatedAfter = createdAfter + e.require(engagementsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetCreatedBefore(createdBefore *time.Time) { + e.CreatedBefore = createdBefore + e.require(engagementsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(engagementsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetExpand(expand []*EngagementsListRequestExpandItem) { + e.Expand = expand + e.require(engagementsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(engagementsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(engagementsListRequestFieldIncludeRemoteData) } +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + e.IncludeRemoteFields = includeRemoteFields + e.require(engagementsListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(engagementsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + e.ModifiedAfter = modifiedAfter + e.require(engagementsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + e.ModifiedBefore = modifiedBefore + e.require(engagementsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(engagementsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(engagementsListRequestFieldRemoteId) +} + +// SetStartedAfter sets the StartedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetStartedAfter(startedAfter *time.Time) { + e.StartedAfter = startedAfter + e.require(engagementsListRequestFieldStartedAfter) +} + +// SetStartedBefore sets the StartedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsListRequest) SetStartedBefore(startedBefore *time.Time) { + e.StartedBefore = startedBefore + e.require(engagementsListRequestFieldStartedBefore) +} + +var ( + patchedEngagementEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedEngagementEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedEngagementEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PatchedEngagementEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PatchedEngagementRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedEngagementEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) } +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedEngagementEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedEngagementEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementEndpointRequest) SetModel(model *PatchedEngagementRequest) { + p.Model = model + p.require(patchedEngagementEndpointRequestFieldModel) +} + +var ( + engagementsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + engagementsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + engagementsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + engagementsRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + engagementsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + engagementsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + engagementsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + engagementsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type EngagementsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -73,8 +284,81 @@ type EngagementsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EngagementsRemoteFieldClassesListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(engagementsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(engagementsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(engagementsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + e.IncludeRemoteFields = includeRemoteFields + e.require(engagementsRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(engagementsRemoteFieldClassesListRequestFieldIncludeShellData) } +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + e.IsCommonModelField = isCommonModelField + e.require(engagementsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + e.IsCustom = isCustom + e.require(engagementsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(engagementsRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + engagementsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + engagementsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + engagementsRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + engagementsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) +) + type EngagementsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*EngagementsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -84,6 +368,44 @@ type EngagementsRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EngagementsRetrieveRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRetrieveRequest) SetExpand(expand []*EngagementsRetrieveRequestExpandItem) { + e.Expand = expand + e.require(engagementsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(engagementsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + e.IncludeRemoteFields = includeRemoteFields + e.require(engagementsRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(engagementsRetrieveRequestFieldIncludeShellData) } type EngagementsListRequestExpandItem string @@ -171,6 +493,26 @@ func (d DirectionEnum) Ptr() *DirectionEnum { // The `Engagement` object is used to represent an interaction noted in a CRM system. // ### Usage Example // TODO +var ( + engagementFieldId = big.NewInt(1 << 0) + engagementFieldRemoteId = big.NewInt(1 << 1) + engagementFieldCreatedAt = big.NewInt(1 << 2) + engagementFieldModifiedAt = big.NewInt(1 << 3) + engagementFieldOwner = big.NewInt(1 << 4) + engagementFieldContent = big.NewInt(1 << 5) + engagementFieldSubject = big.NewInt(1 << 6) + engagementFieldDirection = big.NewInt(1 << 7) + engagementFieldEngagementType = big.NewInt(1 << 8) + engagementFieldStartTime = big.NewInt(1 << 9) + engagementFieldEndTime = big.NewInt(1 << 10) + engagementFieldAccount = big.NewInt(1 << 11) + engagementFieldContacts = big.NewInt(1 << 12) + engagementFieldRemoteWasDeleted = big.NewInt(1 << 13) + engagementFieldFieldMappings = big.NewInt(1 << 14) + engagementFieldRemoteData = big.NewInt(1 << 15) + engagementFieldRemoteFields = big.NewInt(1 << 16) +) + type Engagement struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -205,6 +547,9 @@ type Engagement struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -332,6 +677,132 @@ func (e *Engagement) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *Engagement) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetId(id *string) { + e.Id = id + e.require(engagementFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(engagementFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(engagementFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(engagementFieldModifiedAt) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetOwner(owner *EngagementOwner) { + e.Owner = owner + e.require(engagementFieldOwner) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetContent(content *string) { + e.Content = content + e.require(engagementFieldContent) +} + +// SetSubject sets the Subject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetSubject(subject *string) { + e.Subject = subject + e.require(engagementFieldSubject) +} + +// SetDirection sets the Direction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetDirection(direction *EngagementDirection) { + e.Direction = direction + e.require(engagementFieldDirection) +} + +// SetEngagementType sets the EngagementType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetEngagementType(engagementType *EngagementEngagementType) { + e.EngagementType = engagementType + e.require(engagementFieldEngagementType) +} + +// SetStartTime sets the StartTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetStartTime(startTime *time.Time) { + e.StartTime = startTime + e.require(engagementFieldStartTime) +} + +// SetEndTime sets the EndTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetEndTime(endTime *time.Time) { + e.EndTime = endTime + e.require(engagementFieldEndTime) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetAccount(account *EngagementAccount) { + e.Account = account + e.require(engagementFieldAccount) +} + +// SetContacts sets the Contacts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetContacts(contacts []*EngagementContactsItem) { + e.Contacts = contacts + e.require(engagementFieldContacts) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(engagementFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetFieldMappings(fieldMappings map[string]interface{}) { + e.FieldMappings = fieldMappings + e.require(engagementFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetRemoteData(remoteData []*RemoteData) { + e.RemoteData = remoteData + e.require(engagementFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Engagement) SetRemoteFields(remoteFields []*RemoteField) { + e.RemoteFields = remoteFields + e.require(engagementFieldRemoteFields) +} + func (e *Engagement) UnmarshalJSON(data []byte) error { type embed Engagement var unmarshaler = struct { @@ -375,7 +846,8 @@ func (e *Engagement) MarshalJSON() ([]byte, error) { StartTime: internal.NewOptionalDateTime(e.StartTime), EndTime: internal.NewOptionalDateTime(e.EndTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *Engagement) String() string { @@ -712,6 +1184,21 @@ func (e *EngagementOwner) Accept(visitor EngagementOwnerVisitor) error { // The `Engagement` object is used to represent an interaction noted in a CRM system. // ### Usage Example // TODO +var ( + engagementRequestFieldOwner = big.NewInt(1 << 0) + engagementRequestFieldContent = big.NewInt(1 << 1) + engagementRequestFieldSubject = big.NewInt(1 << 2) + engagementRequestFieldDirection = big.NewInt(1 << 3) + engagementRequestFieldEngagementType = big.NewInt(1 << 4) + engagementRequestFieldStartTime = big.NewInt(1 << 5) + engagementRequestFieldEndTime = big.NewInt(1 << 6) + engagementRequestFieldAccount = big.NewInt(1 << 7) + engagementRequestFieldContacts = big.NewInt(1 << 8) + engagementRequestFieldIntegrationParams = big.NewInt(1 << 9) + engagementRequestFieldLinkedAccountParams = big.NewInt(1 << 10) + engagementRequestFieldRemoteFields = big.NewInt(1 << 11) +) + type EngagementRequest struct { // The engagement's owner. Owner *EngagementRequestOwner `json:"owner,omitempty" url:"owner,omitempty"` @@ -737,6 +1224,9 @@ type EngagementRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -829,6 +1319,97 @@ func (e *EngagementRequest) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EngagementRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetOwner(owner *EngagementRequestOwner) { + e.Owner = owner + e.require(engagementRequestFieldOwner) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetContent(content *string) { + e.Content = content + e.require(engagementRequestFieldContent) +} + +// SetSubject sets the Subject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetSubject(subject *string) { + e.Subject = subject + e.require(engagementRequestFieldSubject) +} + +// SetDirection sets the Direction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetDirection(direction *EngagementRequestDirection) { + e.Direction = direction + e.require(engagementRequestFieldDirection) +} + +// SetEngagementType sets the EngagementType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetEngagementType(engagementType *EngagementRequestEngagementType) { + e.EngagementType = engagementType + e.require(engagementRequestFieldEngagementType) +} + +// SetStartTime sets the StartTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetStartTime(startTime *time.Time) { + e.StartTime = startTime + e.require(engagementRequestFieldStartTime) +} + +// SetEndTime sets the EndTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetEndTime(endTime *time.Time) { + e.EndTime = endTime + e.require(engagementRequestFieldEndTime) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetAccount(account *EngagementRequestAccount) { + e.Account = account + e.require(engagementRequestFieldAccount) +} + +// SetContacts sets the Contacts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetContacts(contacts []*EngagementRequestContactsItem) { + e.Contacts = contacts + e.require(engagementRequestFieldContacts) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + e.IntegrationParams = integrationParams + e.require(engagementRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + e.LinkedAccountParams = linkedAccountParams + e.require(engagementRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + e.RemoteFields = remoteFields + e.require(engagementRequestFieldRemoteFields) +} + func (e *EngagementRequest) UnmarshalJSON(data []byte) error { type embed EngagementRequest var unmarshaler = struct { @@ -864,7 +1445,8 @@ func (e *EngagementRequest) MarshalJSON() ([]byte, error) { StartTime: internal.NewOptionalDateTime(e.StartTime), EndTime: internal.NewOptionalDateTime(e.EndTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *EngagementRequest) String() string { @@ -1196,12 +1778,22 @@ func (e *EngagementRequestOwner) Accept(visitor EngagementRequestOwnerVisitor) e return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + engagementResponseFieldModel = big.NewInt(1 << 0) + engagementResponseFieldWarnings = big.NewInt(1 << 1) + engagementResponseFieldErrors = big.NewInt(1 << 2) + engagementResponseFieldLogs = big.NewInt(1 << 3) +) + type EngagementResponse struct { Model *Engagement `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1238,6 +1830,41 @@ func (e *EngagementResponse) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EngagementResponse) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementResponse) SetModel(model *Engagement) { + e.Model = model + e.require(engagementResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementResponse) SetWarnings(warnings []*WarningValidationProblem) { + e.Warnings = warnings + e.require(engagementResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementResponse) SetErrors(errors []*ErrorValidationProblem) { + e.Errors = errors + e.require(engagementResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementResponse) SetLogs(logs []*DebugModeLog) { + e.Logs = logs + e.require(engagementResponseFieldLogs) +} + func (e *EngagementResponse) UnmarshalJSON(data []byte) error { type unmarshaler EngagementResponse var value unmarshaler @@ -1254,6 +1881,17 @@ func (e *EngagementResponse) UnmarshalJSON(data []byte) error { return nil } +func (e *EngagementResponse) MarshalJSON() ([]byte, error) { + type embed EngagementResponse + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *EngagementResponse) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -1266,11 +1904,20 @@ func (e *EngagementResponse) String() string { return fmt.Sprintf("%#v", e) } +var ( + paginatedEngagementListFieldNext = big.NewInt(1 << 0) + paginatedEngagementListFieldPrevious = big.NewInt(1 << 1) + paginatedEngagementListFieldResults = big.NewInt(1 << 2) +) + type PaginatedEngagementList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Engagement `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1300,6 +1947,34 @@ func (p *PaginatedEngagementList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedEngagementList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEngagementList) SetNext(next *string) { + p.Next = next + p.require(paginatedEngagementListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEngagementList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedEngagementListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEngagementList) SetResults(results []*Engagement) { + p.Results = results + p.require(paginatedEngagementListFieldResults) +} + func (p *PaginatedEngagementList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedEngagementList var value unmarshaler @@ -1316,6 +1991,17 @@ func (p *PaginatedEngagementList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedEngagementList) MarshalJSON() ([]byte, error) { + type embed PaginatedEngagementList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedEngagementList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -1333,6 +2019,21 @@ func (p *PaginatedEngagementList) String() string { // The `Engagement` object is used to represent an interaction noted in a CRM system. // ### Usage Example // TODO +var ( + patchedEngagementRequestFieldOwner = big.NewInt(1 << 0) + patchedEngagementRequestFieldContent = big.NewInt(1 << 1) + patchedEngagementRequestFieldSubject = big.NewInt(1 << 2) + patchedEngagementRequestFieldDirection = big.NewInt(1 << 3) + patchedEngagementRequestFieldEngagementType = big.NewInt(1 << 4) + patchedEngagementRequestFieldStartTime = big.NewInt(1 << 5) + patchedEngagementRequestFieldEndTime = big.NewInt(1 << 6) + patchedEngagementRequestFieldAccount = big.NewInt(1 << 7) + patchedEngagementRequestFieldContacts = big.NewInt(1 << 8) + patchedEngagementRequestFieldIntegrationParams = big.NewInt(1 << 9) + patchedEngagementRequestFieldLinkedAccountParams = big.NewInt(1 << 10) + patchedEngagementRequestFieldRemoteFields = big.NewInt(1 << 11) +) + type PatchedEngagementRequest struct { // The engagement's owner. Owner *string `json:"owner,omitempty" url:"owner,omitempty"` @@ -1358,6 +2059,9 @@ type PatchedEngagementRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1450,6 +2154,97 @@ func (p *PatchedEngagementRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PatchedEngagementRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetOwner(owner *string) { + p.Owner = owner + p.require(patchedEngagementRequestFieldOwner) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetContent(content *string) { + p.Content = content + p.require(patchedEngagementRequestFieldContent) +} + +// SetSubject sets the Subject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetSubject(subject *string) { + p.Subject = subject + p.require(patchedEngagementRequestFieldSubject) +} + +// SetDirection sets the Direction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetDirection(direction *PatchedEngagementRequestDirection) { + p.Direction = direction + p.require(patchedEngagementRequestFieldDirection) +} + +// SetEngagementType sets the EngagementType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetEngagementType(engagementType *string) { + p.EngagementType = engagementType + p.require(patchedEngagementRequestFieldEngagementType) +} + +// SetStartTime sets the StartTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetStartTime(startTime *time.Time) { + p.StartTime = startTime + p.require(patchedEngagementRequestFieldStartTime) +} + +// SetEndTime sets the EndTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetEndTime(endTime *time.Time) { + p.EndTime = endTime + p.require(patchedEngagementRequestFieldEndTime) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetAccount(account *string) { + p.Account = account + p.require(patchedEngagementRequestFieldAccount) +} + +// SetContacts sets the Contacts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetContacts(contacts []*string) { + p.Contacts = contacts + p.require(patchedEngagementRequestFieldContacts) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(patchedEngagementRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(patchedEngagementRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEngagementRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(patchedEngagementRequestFieldRemoteFields) +} + func (p *PatchedEngagementRequest) UnmarshalJSON(data []byte) error { type embed PatchedEngagementRequest var unmarshaler = struct { @@ -1485,7 +2280,8 @@ func (p *PatchedEngagementRequest) MarshalJSON() ([]byte, error) { StartTime: internal.NewOptionalDateTime(p.StartTime), EndTime: internal.NewOptionalDateTime(p.EndTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PatchedEngagementRequest) String() string { diff --git a/crm/engagements/client.go b/crm/engagements/client.go index 56a8fa8..29779e4 100644 --- a/crm/engagements/client.go +++ b/crm/engagements/client.go @@ -4,7 +4,6 @@ package engagements import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.EngagementsListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Engagement], error) { +) (*core.Page[*string, *crm.Engagement], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedEngagementList) *internal.PageResponse[*string, *crm.Engagement] { + readPageResponse := func(response *crm.PaginatedEngagementList) *core.PageResponse[*string, *crm.Engagement] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Engagement]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Engagement]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *crm.EngagementEndpointRequest, opts ...option.RequestOption, ) (*crm.EngagementResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/engagements" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.EngagementResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Engagement` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *crm.EngagementsRetrieveRequest, opts ...option.RequestOption, ) (*crm.Engagement, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/engagements/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Engagement - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates an `Engagement` object with the given `id`. @@ -192,47 +134,16 @@ func (c *Client) PartialUpdate( request *crm.PatchedEngagementEndpointRequest, opts ...option.RequestOption, ) (*crm.EngagementResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/engagements/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.EngagementResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Engagement` PATCHs. @@ -241,38 +152,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/engagements/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `Engagement` POSTs. @@ -280,35 +168,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/engagements/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -316,7 +183,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.EngagementsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -329,13 +196,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -352,11 +218,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/engagements/crm_engagements_test/crm_engagements_test.go b/crm/engagements/crm_engagements_test/crm_engagements_test.go new file mode 100644 index 0000000..2b0e8ad --- /dev/null +++ b/crm/engagements/crm_engagements_test/crm_engagements_test.go @@ -0,0 +1,305 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_engagements_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmEngagementsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.EngagementsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Crm.Engagements.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/engagements", map[string]string{"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"}, 1) +} + +func TestCrmEngagementsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.EngagementEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.EngagementRequest{}, + } + _, invocationErr := client.Crm.Engagements.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/engagements", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmEngagementsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.EngagementsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Engagements.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/engagements/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmEngagementsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.PatchedEngagementEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedEngagementRequest{}, + } + _, invocationErr := client.Crm.Engagements.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/crm/v1/engagements/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmEngagementsMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Engagements.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/engagements/meta/patch/id", nil, 1) +} + +func TestCrmEngagementsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Engagements.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/engagements/meta/post", nil, 1) +} + +func TestCrmEngagementsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.EngagementsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.Engagements.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/engagements/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/engagements/raw_client.go b/crm/engagements/raw_client.go new file mode 100644 index 0000000..9358fa1 --- /dev/null +++ b/crm/engagements/raw_client.go @@ -0,0 +1,266 @@ +// Code generated by Fern. DO NOT EDIT. + +package engagements + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.EngagementEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.EngagementResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/engagements" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.EngagementResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.EngagementResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.EngagementsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.Engagement], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/engagements/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Engagement + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Engagement]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *crm.PatchedEngagementEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.EngagementResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/engagements/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.EngagementResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.EngagementResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/engagements/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/engagements/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/engagementtypes/client.go b/crm/engagementtypes/client.go index 645d6f7..282e9d7 100644 --- a/crm/engagementtypes/client.go +++ b/crm/engagementtypes/client.go @@ -4,7 +4,6 @@ package engagementtypes import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.EngagementTypesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.EngagementType], error) { +) (*core.Page[*string, *crm.EngagementType], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedEngagementTypeList) *internal.PageResponse[*string, *crm.EngagementType] { + readPageResponse := func(response *crm.PaginatedEngagementTypeList) *core.PageResponse[*string, *crm.EngagementType] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.EngagementType]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.EngagementType]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,45 +98,16 @@ func (c *Client) Retrieve( request *crm.EngagementTypesRetrieveRequest, opts ...option.RequestOption, ) (*crm.EngagementType, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/engagement-types/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.EngagementType - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -144,7 +115,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.EngagementTypesRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -157,13 +128,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -180,11 +150,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/engagementtypes/crm_engagement_types_test/crm_engagement_types_test.go b/crm/engagementtypes/crm_engagement_types_test/crm_engagement_types_test.go new file mode 100644 index 0000000..fa0730b --- /dev/null +++ b/crm/engagementtypes/crm_engagement_types_test/crm_engagement_types_test.go @@ -0,0 +1,201 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_engagement_types_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmEngagementTypesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.EngagementTypesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.EngagementTypes.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/engagement-types", map[string]string{"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"}, 1) +} + +func TestCrmEngagementTypesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.EngagementTypesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.EngagementTypes.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/engagement-types/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmEngagementTypesRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.EngagementTypesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.EngagementTypes.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/engagement-types/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/engagementtypes/raw_client.go b/crm/engagementtypes/raw_client.go new file mode 100644 index 0000000..e8296d9 --- /dev/null +++ b/crm/engagementtypes/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package engagementtypes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.EngagementTypesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.EngagementType], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/engagement-types/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.EngagementType + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.EngagementType]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/field_mapping.go b/crm/field_mapping.go index 9d41422..37a9354 100644 --- a/crm/field_mapping.go +++ b/crm/field_mapping.go @@ -6,6 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + createFieldMappingRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) + createFieldMappingRequestFieldTargetFieldName = big.NewInt(1 << 1) + createFieldMappingRequestFieldTargetFieldDescription = big.NewInt(1 << 2) + createFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 3) + createFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 4) + createFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 5) + createFieldMappingRequestFieldCommonModelName = big.NewInt(1 << 6) ) type CreateFieldMappingRequest struct { @@ -23,8 +34,73 @@ type CreateFieldMappingRequest struct { RemoteUrlPath string `json:"remote_url_path" url:"-"` // The name of the Common Model that the remote field corresponds to in a given category. CommonModelName string `json:"common_model_name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreateFieldMappingRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + c.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + c.require(createFieldMappingRequestFieldExcludeRemoteFieldMetadata) +} + +// SetTargetFieldName sets the TargetFieldName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldName(targetFieldName string) { + c.TargetFieldName = targetFieldName + c.require(createFieldMappingRequestFieldTargetFieldName) +} + +// SetTargetFieldDescription sets the TargetFieldDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldDescription(targetFieldDescription string) { + c.TargetFieldDescription = targetFieldDescription + c.require(createFieldMappingRequestFieldTargetFieldDescription) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + c.RemoteFieldTraversalPath = remoteFieldTraversalPath + c.require(createFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteMethod(remoteMethod string) { + c.RemoteMethod = remoteMethod + c.require(createFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath string) { + c.RemoteUrlPath = remoteUrlPath + c.require(createFieldMappingRequestFieldRemoteUrlPath) } +// SetCommonModelName sets the CommonModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetCommonModelName(commonModelName string) { + c.CommonModelName = commonModelName + c.require(createFieldMappingRequestFieldCommonModelName) +} + +var ( + patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 0) + patchedEditFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 1) + patchedEditFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 2) +) + type PatchedEditFieldMappingRequest struct { // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty" url:"-"` @@ -32,20 +108,110 @@ type PatchedEditFieldMappingRequest struct { RemoteMethod *string `json:"remote_method,omitempty" url:"-"` // The path of the remote endpoint where the remote field is coming from. RemoteUrlPath *string `json:"remote_url_path,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedEditFieldMappingRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + p.RemoteFieldTraversalPath = remoteFieldTraversalPath + p.require(patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteMethod(remoteMethod *string) { + p.RemoteMethod = remoteMethod + p.require(patchedEditFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath *string) { + p.RemoteUrlPath = remoteUrlPath + p.require(patchedEditFieldMappingRequestFieldRemoteUrlPath) } +var ( + fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) +) + type FieldMappingsRetrieveRequest struct { // 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. ExcludeRemoteFieldMetadata *bool `json:"-" url:"exclude_remote_field_metadata,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (f *FieldMappingsRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingsRetrieveRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + f.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + f.require(fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata) +} + +var ( + remoteFieldsRetrieveRequestFieldCommonModels = big.NewInt(1 << 0) + remoteFieldsRetrieveRequestFieldIncludeExampleValues = big.NewInt(1 << 1) +) + type RemoteFieldsRetrieveRequest struct { // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. CommonModels *string `json:"-" url:"common_models,omitempty"` // 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. IncludeExampleValues *string `json:"-" url:"include_example_values,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteFieldsRetrieveRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetCommonModels(commonModels *string) { + r.CommonModels = commonModels + r.require(remoteFieldsRetrieveRequestFieldCommonModels) +} + +// SetIncludeExampleValues sets the IncludeExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetIncludeExampleValues(includeExampleValues *string) { + r.IncludeExampleValues = includeExampleValues + r.require(remoteFieldsRetrieveRequestFieldIncludeExampleValues) } +var ( + advancedMetadataFieldId = big.NewInt(1 << 0) + advancedMetadataFieldDisplayName = big.NewInt(1 << 1) + advancedMetadataFieldDescription = big.NewInt(1 << 2) + advancedMetadataFieldIsRequired = big.NewInt(1 << 3) + advancedMetadataFieldIsCustom = big.NewInt(1 << 4) + advancedMetadataFieldFieldChoices = big.NewInt(1 << 5) +) + type AdvancedMetadata struct { Id string `json:"id" url:"id"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` @@ -54,6 +220,9 @@ type AdvancedMetadata struct { IsCustom *bool `json:"is_custom,omitempty" url:"is_custom,omitempty"` FieldChoices []interface{} `json:"field_choices,omitempty" url:"field_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -104,6 +273,55 @@ func (a *AdvancedMetadata) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AdvancedMetadata) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetId(id string) { + a.Id = id + a.require(advancedMetadataFieldId) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDisplayName(displayName *string) { + a.DisplayName = displayName + a.require(advancedMetadataFieldDisplayName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDescription(description *string) { + a.Description = description + a.require(advancedMetadataFieldDescription) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsRequired(isRequired *bool) { + a.IsRequired = isRequired + a.require(advancedMetadataFieldIsRequired) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsCustom(isCustom *bool) { + a.IsCustom = isCustom + a.require(advancedMetadataFieldIsCustom) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetFieldChoices(fieldChoices []interface{}) { + a.FieldChoices = fieldChoices + a.require(advancedMetadataFieldFieldChoices) +} + func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { type unmarshaler AdvancedMetadata var value unmarshaler @@ -120,6 +338,17 @@ func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { return nil } +func (a *AdvancedMetadata) MarshalJSON() ([]byte, error) { + type embed AdvancedMetadata + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AdvancedMetadata) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -132,11 +361,20 @@ func (a *AdvancedMetadata) String() string { return fmt.Sprintf("%#v", a) } +var ( + externalTargetFieldApiFieldName = big.NewInt(1 << 0) + externalTargetFieldApiFieldDescription = big.NewInt(1 << 1) + externalTargetFieldApiFieldIsMapped = big.NewInt(1 << 2) +) + type ExternalTargetFieldApi struct { Name *string `json:"name,omitempty" url:"name,omitempty"` Description *string `json:"description,omitempty" url:"description,omitempty"` IsMapped *string `json:"is_mapped,omitempty" url:"is_mapped,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -166,6 +404,34 @@ func (e *ExternalTargetFieldApi) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExternalTargetFieldApi) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetName(name *string) { + e.Name = name + e.require(externalTargetFieldApiFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetDescription(description *string) { + e.Description = description + e.require(externalTargetFieldApiFieldDescription) +} + +// SetIsMapped sets the IsMapped field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetIsMapped(isMapped *string) { + e.IsMapped = isMapped + e.require(externalTargetFieldApiFieldIsMapped) +} + func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApi var value unmarshaler @@ -182,6 +448,17 @@ func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApi) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApi) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -194,6 +471,18 @@ func (e *ExternalTargetFieldApi) String() string { return fmt.Sprintf("%#v", e) } +var ( + externalTargetFieldApiResponseFieldAccount = big.NewInt(1 << 0) + externalTargetFieldApiResponseFieldContact = big.NewInt(1 << 1) + externalTargetFieldApiResponseFieldLead = big.NewInt(1 << 2) + externalTargetFieldApiResponseFieldNote = big.NewInt(1 << 3) + externalTargetFieldApiResponseFieldOpportunity = big.NewInt(1 << 4) + externalTargetFieldApiResponseFieldStage = big.NewInt(1 << 5) + externalTargetFieldApiResponseFieldUser = big.NewInt(1 << 6) + externalTargetFieldApiResponseFieldTask = big.NewInt(1 << 7) + externalTargetFieldApiResponseFieldEngagement = big.NewInt(1 << 8) +) + type ExternalTargetFieldApiResponse struct { Account []*ExternalTargetFieldApi `json:"Account,omitempty" url:"Account,omitempty"` Contact []*ExternalTargetFieldApi `json:"Contact,omitempty" url:"Contact,omitempty"` @@ -205,6 +494,9 @@ type ExternalTargetFieldApiResponse struct { Task []*ExternalTargetFieldApi `json:"Task,omitempty" url:"Task,omitempty"` Engagement []*ExternalTargetFieldApi `json:"Engagement,omitempty" url:"Engagement,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -276,6 +568,76 @@ func (e *ExternalTargetFieldApiResponse) GetExtraProperties() map[string]interfa return e.extraProperties } +func (e *ExternalTargetFieldApiResponse) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetAccount(account []*ExternalTargetFieldApi) { + e.Account = account + e.require(externalTargetFieldApiResponseFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetContact(contact []*ExternalTargetFieldApi) { + e.Contact = contact + e.require(externalTargetFieldApiResponseFieldContact) +} + +// SetLead sets the Lead field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetLead(lead []*ExternalTargetFieldApi) { + e.Lead = lead + e.require(externalTargetFieldApiResponseFieldLead) +} + +// SetNote sets the Note field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetNote(note []*ExternalTargetFieldApi) { + e.Note = note + e.require(externalTargetFieldApiResponseFieldNote) +} + +// SetOpportunity sets the Opportunity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetOpportunity(opportunity []*ExternalTargetFieldApi) { + e.Opportunity = opportunity + e.require(externalTargetFieldApiResponseFieldOpportunity) +} + +// SetStage sets the Stage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetStage(stage []*ExternalTargetFieldApi) { + e.Stage = stage + e.require(externalTargetFieldApiResponseFieldStage) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetUser(user []*ExternalTargetFieldApi) { + e.User = user + e.require(externalTargetFieldApiResponseFieldUser) +} + +// SetTask sets the Task field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTask(task []*ExternalTargetFieldApi) { + e.Task = task + e.require(externalTargetFieldApiResponseFieldTask) +} + +// SetEngagement sets the Engagement field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetEngagement(engagement []*ExternalTargetFieldApi) { + e.Engagement = engagement + e.require(externalTargetFieldApiResponseFieldEngagement) +} + func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApiResponse var value unmarshaler @@ -292,6 +654,17 @@ func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApiResponse) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -304,12 +677,22 @@ func (e *ExternalTargetFieldApiResponse) String() string { return fmt.Sprintf("%#v", e) } +var ( + fieldMappingApiInstanceFieldId = big.NewInt(1 << 0) + fieldMappingApiInstanceFieldIsIntegrationWide = big.NewInt(1 << 1) + fieldMappingApiInstanceFieldTargetField = big.NewInt(1 << 2) + fieldMappingApiInstanceFieldRemoteField = big.NewInt(1 << 3) +) + type FieldMappingApiInstance struct { Id *string `json:"id,omitempty" url:"id,omitempty"` IsIntegrationWide *bool `json:"is_integration_wide,omitempty" url:"is_integration_wide,omitempty"` TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty" url:"target_field,omitempty"` RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty" url:"remote_field,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -346,6 +729,41 @@ func (f *FieldMappingApiInstance) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *FieldMappingApiInstance) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetId(id *string) { + f.Id = id + f.require(fieldMappingApiInstanceFieldId) +} + +// SetIsIntegrationWide sets the IsIntegrationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetIsIntegrationWide(isIntegrationWide *bool) { + f.IsIntegrationWide = isIntegrationWide + f.require(fieldMappingApiInstanceFieldIsIntegrationWide) +} + +// SetTargetField sets the TargetField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetTargetField(targetField *FieldMappingApiInstanceTargetField) { + f.TargetField = targetField + f.require(fieldMappingApiInstanceFieldTargetField) +} + +// SetRemoteField sets the RemoteField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetRemoteField(remoteField *FieldMappingApiInstanceRemoteField) { + f.RemoteField = remoteField + f.require(fieldMappingApiInstanceFieldRemoteField) +} + func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstance var value unmarshaler @@ -362,6 +780,17 @@ func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstance) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstance + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstance) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -374,11 +803,20 @@ func (f *FieldMappingApiInstance) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldFieldSchema = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteField struct { RemoteKeyName *string `json:"remote_key_name,omitempty" url:"remote_key_name,omitempty"` Schema map[string]interface{} `json:"schema,omitempty" url:"schema,omitempty"` RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info" url:"remote_endpoint_info"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -408,6 +846,34 @@ func (f *FieldMappingApiInstanceRemoteField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteKeyName(remoteKeyName *string) { + f.RemoteKeyName = remoteKeyName + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetSchema(schema map[string]interface{}) { + f.Schema = schema + f.require(fieldMappingApiInstanceRemoteFieldFieldSchema) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteEndpointInfo(remoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) { + f.RemoteEndpointInfo = remoteEndpointInfo + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo) +} + func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteField var value unmarshaler @@ -424,6 +890,17 @@ func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceRemoteField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -436,11 +913,20 @@ func (f *FieldMappingApiInstanceRemoteField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { Method *string `json:"method,omitempty" url:"method,omitempty"` UrlPath *string `json:"url_path,omitempty" url:"url_path,omitempty"` FieldTraversalPath []string `json:"field_traversal_path,omitempty" url:"field_traversal_path,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -470,6 +956,34 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) GetExtraPropertie return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetMethod(method *string) { + f.Method = method + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetUrlPath(urlPath *string) { + f.UrlPath = urlPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []string) { + f.FieldTraversalPath = fieldTraversalPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo var value unmarshaler @@ -486,6 +1000,17 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(dat return nil } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -498,6 +1023,18 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceResponseFieldAccount = big.NewInt(1 << 0) + fieldMappingApiInstanceResponseFieldContact = big.NewInt(1 << 1) + fieldMappingApiInstanceResponseFieldLead = big.NewInt(1 << 2) + fieldMappingApiInstanceResponseFieldNote = big.NewInt(1 << 3) + fieldMappingApiInstanceResponseFieldOpportunity = big.NewInt(1 << 4) + fieldMappingApiInstanceResponseFieldStage = big.NewInt(1 << 5) + fieldMappingApiInstanceResponseFieldUser = big.NewInt(1 << 6) + fieldMappingApiInstanceResponseFieldTask = big.NewInt(1 << 7) + fieldMappingApiInstanceResponseFieldEngagement = big.NewInt(1 << 8) +) + type FieldMappingApiInstanceResponse struct { Account []*FieldMappingApiInstance `json:"Account,omitempty" url:"Account,omitempty"` Contact []*FieldMappingApiInstance `json:"Contact,omitempty" url:"Contact,omitempty"` @@ -509,6 +1046,9 @@ type FieldMappingApiInstanceResponse struct { Task []*FieldMappingApiInstance `json:"Task,omitempty" url:"Task,omitempty"` Engagement []*FieldMappingApiInstance `json:"Engagement,omitempty" url:"Engagement,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -580,6 +1120,76 @@ func (f *FieldMappingApiInstanceResponse) GetExtraProperties() map[string]interf return f.extraProperties } +func (f *FieldMappingApiInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetAccount(account []*FieldMappingApiInstance) { + f.Account = account + f.require(fieldMappingApiInstanceResponseFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetContact(contact []*FieldMappingApiInstance) { + f.Contact = contact + f.require(fieldMappingApiInstanceResponseFieldContact) +} + +// SetLead sets the Lead field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetLead(lead []*FieldMappingApiInstance) { + f.Lead = lead + f.require(fieldMappingApiInstanceResponseFieldLead) +} + +// SetNote sets the Note field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetNote(note []*FieldMappingApiInstance) { + f.Note = note + f.require(fieldMappingApiInstanceResponseFieldNote) +} + +// SetOpportunity sets the Opportunity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetOpportunity(opportunity []*FieldMappingApiInstance) { + f.Opportunity = opportunity + f.require(fieldMappingApiInstanceResponseFieldOpportunity) +} + +// SetStage sets the Stage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetStage(stage []*FieldMappingApiInstance) { + f.Stage = stage + f.require(fieldMappingApiInstanceResponseFieldStage) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetUser(user []*FieldMappingApiInstance) { + f.User = user + f.require(fieldMappingApiInstanceResponseFieldUser) +} + +// SetTask sets the Task field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTask(task []*FieldMappingApiInstance) { + f.Task = task + f.require(fieldMappingApiInstanceResponseFieldTask) +} + +// SetEngagement sets the Engagement field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetEngagement(engagement []*FieldMappingApiInstance) { + f.Engagement = engagement + f.require(fieldMappingApiInstanceResponseFieldEngagement) +} + func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceResponse var value unmarshaler @@ -596,6 +1206,17 @@ func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -608,11 +1229,20 @@ func (f *FieldMappingApiInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceTargetFieldFieldName = big.NewInt(1 << 0) + fieldMappingApiInstanceTargetFieldFieldDescription = big.NewInt(1 << 1) + fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceTargetField struct { Name string `json:"name" url:"name"` Description string `json:"description" url:"description"` IsOrganizationWide bool `json:"is_organization_wide" url:"is_organization_wide"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -642,6 +1272,34 @@ func (f *FieldMappingApiInstanceTargetField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceTargetField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetName(name string) { + f.Name = name + f.require(fieldMappingApiInstanceTargetFieldFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetDescription(description string) { + f.Description = description + f.require(fieldMappingApiInstanceTargetFieldFieldDescription) +} + +// SetIsOrganizationWide sets the IsOrganizationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetIsOrganizationWide(isOrganizationWide bool) { + f.IsOrganizationWide = isOrganizationWide + f.require(fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide) +} + func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceTargetField var value unmarshaler @@ -658,6 +1316,17 @@ func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceTargetField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceTargetField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceTargetField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -670,12 +1339,22 @@ func (f *FieldMappingApiInstanceTargetField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingInstanceResponseFieldModel = big.NewInt(1 << 0) + fieldMappingInstanceResponseFieldWarnings = big.NewInt(1 << 1) + fieldMappingInstanceResponseFieldErrors = big.NewInt(1 << 2) + fieldMappingInstanceResponseFieldLogs = big.NewInt(1 << 3) +) + type FieldMappingInstanceResponse struct { Model *FieldMappingApiInstance `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -712,6 +1391,41 @@ func (f *FieldMappingInstanceResponse) GetExtraProperties() map[string]interface return f.extraProperties } +func (f *FieldMappingInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetModel(model *FieldMappingApiInstance) { + f.Model = model + f.require(fieldMappingInstanceResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetWarnings(warnings []*WarningValidationProblem) { + f.Warnings = warnings + f.require(fieldMappingInstanceResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetErrors(errors []*ErrorValidationProblem) { + f.Errors = errors + f.require(fieldMappingInstanceResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetLogs(logs []*DebugModeLog) { + f.Logs = logs + f.require(fieldMappingInstanceResponseFieldLogs) +} + func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingInstanceResponse var value unmarshaler @@ -728,6 +1442,17 @@ func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -740,11 +1465,20 @@ func (f *FieldMappingInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + remoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + remoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + remoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type RemoteEndpointInfo struct { Method string `json:"method" url:"method"` UrlPath string `json:"url_path" url:"url_path"` FieldTraversalPath []interface{} `json:"field_traversal_path" url:"field_traversal_path"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -774,6 +1508,34 @@ func (r *RemoteEndpointInfo) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteEndpointInfo) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetMethod(method string) { + r.Method = method + r.require(remoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetUrlPath(urlPath string) { + r.UrlPath = urlPath + r.require(remoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []interface{}) { + r.FieldTraversalPath = fieldTraversalPath + r.require(remoteEndpointInfoFieldFieldTraversalPath) +} + func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler RemoteEndpointInfo var value unmarshaler @@ -790,6 +1552,17 @@ func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed RemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteEndpointInfo) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -802,6 +1575,15 @@ func (r *RemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldApiFieldSchema = big.NewInt(1 << 0) + remoteFieldApiFieldRemoteKeyName = big.NewInt(1 << 1) + remoteFieldApiFieldRemoteEndpointInfo = big.NewInt(1 << 2) + remoteFieldApiFieldExampleValues = big.NewInt(1 << 3) + remoteFieldApiFieldAdvancedMetadata = big.NewInt(1 << 4) + remoteFieldApiFieldCoverage = big.NewInt(1 << 5) +) + type RemoteFieldApi struct { Schema map[string]interface{} `json:"schema" url:"schema"` RemoteKeyName string `json:"remote_key_name" url:"remote_key_name"` @@ -810,6 +1592,9 @@ type RemoteFieldApi struct { AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty" url:"advanced_metadata,omitempty"` Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty" url:"coverage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -860,6 +1645,55 @@ func (r *RemoteFieldApi) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApi) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetSchema(schema map[string]interface{}) { + r.Schema = schema + r.require(remoteFieldApiFieldSchema) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteKeyName(remoteKeyName string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldApiFieldRemoteKeyName) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteEndpointInfo(remoteEndpointInfo *RemoteEndpointInfo) { + r.RemoteEndpointInfo = remoteEndpointInfo + r.require(remoteFieldApiFieldRemoteEndpointInfo) +} + +// SetExampleValues sets the ExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetExampleValues(exampleValues []interface{}) { + r.ExampleValues = exampleValues + r.require(remoteFieldApiFieldExampleValues) +} + +// SetAdvancedMetadata sets the AdvancedMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetAdvancedMetadata(advancedMetadata *AdvancedMetadata) { + r.AdvancedMetadata = advancedMetadata + r.require(remoteFieldApiFieldAdvancedMetadata) +} + +// SetCoverage sets the Coverage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetCoverage(coverage *RemoteFieldApiCoverage) { + r.Coverage = coverage + r.require(remoteFieldApiFieldCoverage) +} + func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApi var value unmarshaler @@ -876,6 +1710,17 @@ func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApi) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApi) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -950,6 +1795,18 @@ func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) e return fmt.Errorf("type %T does not include a non-empty union type", r) } +var ( + remoteFieldApiResponseFieldAccount = big.NewInt(1 << 0) + remoteFieldApiResponseFieldContact = big.NewInt(1 << 1) + remoteFieldApiResponseFieldLead = big.NewInt(1 << 2) + remoteFieldApiResponseFieldNote = big.NewInt(1 << 3) + remoteFieldApiResponseFieldOpportunity = big.NewInt(1 << 4) + remoteFieldApiResponseFieldStage = big.NewInt(1 << 5) + remoteFieldApiResponseFieldUser = big.NewInt(1 << 6) + remoteFieldApiResponseFieldTask = big.NewInt(1 << 7) + remoteFieldApiResponseFieldEngagement = big.NewInt(1 << 8) +) + type RemoteFieldApiResponse struct { Account []*RemoteFieldApi `json:"Account,omitempty" url:"Account,omitempty"` Contact []*RemoteFieldApi `json:"Contact,omitempty" url:"Contact,omitempty"` @@ -961,6 +1818,9 @@ type RemoteFieldApiResponse struct { Task []*RemoteFieldApi `json:"Task,omitempty" url:"Task,omitempty"` Engagement []*RemoteFieldApi `json:"Engagement,omitempty" url:"Engagement,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1032,6 +1892,76 @@ func (r *RemoteFieldApiResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApiResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetAccount(account []*RemoteFieldApi) { + r.Account = account + r.require(remoteFieldApiResponseFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetContact(contact []*RemoteFieldApi) { + r.Contact = contact + r.require(remoteFieldApiResponseFieldContact) +} + +// SetLead sets the Lead field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetLead(lead []*RemoteFieldApi) { + r.Lead = lead + r.require(remoteFieldApiResponseFieldLead) +} + +// SetNote sets the Note field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetNote(note []*RemoteFieldApi) { + r.Note = note + r.require(remoteFieldApiResponseFieldNote) +} + +// SetOpportunity sets the Opportunity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetOpportunity(opportunity []*RemoteFieldApi) { + r.Opportunity = opportunity + r.require(remoteFieldApiResponseFieldOpportunity) +} + +// SetStage sets the Stage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetStage(stage []*RemoteFieldApi) { + r.Stage = stage + r.require(remoteFieldApiResponseFieldStage) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetUser(user []*RemoteFieldApi) { + r.User = user + r.require(remoteFieldApiResponseFieldUser) +} + +// SetTask sets the Task field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTask(task []*RemoteFieldApi) { + r.Task = task + r.require(remoteFieldApiResponseFieldTask) +} + +// SetEngagement sets the Engagement field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetEngagement(engagement []*RemoteFieldApi) { + r.Engagement = engagement + r.require(remoteFieldApiResponseFieldEngagement) +} + func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApiResponse var value unmarshaler @@ -1048,6 +1978,17 @@ func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApiResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { diff --git a/crm/fieldmapping/client.go b/crm/fieldmapping/client.go index 31f8508..f2bf0b0 100644 --- a/crm/fieldmapping/client.go +++ b/crm/fieldmapping/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,42 +38,15 @@ func (c *Client) FieldMappingsRetrieve( request *crm.FieldMappingsRetrieveRequest, opts ...option.RequestOption, ) (*crm.FieldMappingApiInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.FieldMappingApiInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -81,44 +55,15 @@ func (c *Client) FieldMappingsCreate( request *crm.CreateFieldMappingRequest, opts ...option.RequestOption, ) (*crm.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsCreate( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -127,38 +72,15 @@ func (c *Client) FieldMappingsDestroy( fieldMappingId string, opts ...option.RequestOption, ) (*crm.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsDestroy( + ctx, fieldMappingId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodDelete, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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. @@ -168,40 +90,16 @@ func (c *Client) FieldMappingsPartialUpdate( request *crm.PatchedEditFieldMappingRequest, opts ...option.RequestOption, ) (*crm.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsPartialUpdate( + ctx, fieldMappingId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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/). @@ -210,42 +108,15 @@ func (c *Client) RemoteFieldsRetrieve( request *crm.RemoteFieldsRetrieveRequest, opts ...option.RequestOption, ) (*crm.RemoteFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.RemoteFieldsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/remote-fields" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.RemoteFieldApiResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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/). @@ -253,33 +124,12 @@ func (c *Client) TargetFieldsRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.ExternalTargetFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/target-fields" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.ExternalTargetFieldApiResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.TargetFieldsRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/fieldmapping/crm_field_mapping_test/crm_field_mapping_test.go b/crm/fieldmapping/crm_field_mapping_test/crm_field_mapping_test.go new file mode 100644 index 0000000..d90d049 --- /dev/null +++ b/crm/fieldmapping/crm_field_mapping_test/crm_field_mapping_test.go @@ -0,0 +1,210 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_field_mapping_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmFieldMappingFieldMappingsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestCrmFieldMappingFieldMappingsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } + _, invocationErr := client.Crm.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestCrmFieldMappingFieldMappingsDestroyWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + response, invocationErr := client.Crm.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) + + // DELETE operations may return nil response body, which is acceptable + if invocationErr != nil && response == nil { + // This is expected for DELETE operations that return 204 No Content + require.Contains(t, invocationErr.Error(), "but the server responded with nothing", "Expected empty response error") + } else { + require.NoError(t, invocationErr, "Client method call should succeed") + } + VerifyRequestCount(t, "DELETE", "/crm/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestCrmFieldMappingFieldMappingsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.PatchedEditFieldMappingRequest{} + _, invocationErr := client.Crm.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/crm/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestCrmFieldMappingRemoteFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } + _, invocationErr := client.Crm.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/remote-fields", map[string]string{"common_models": "common_models", "include_example_values": "include_example_values"}, 1) +} + +func TestCrmFieldMappingTargetFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/target-fields", nil, 1) +} diff --git a/crm/fieldmapping/raw_client.go b/crm/fieldmapping/raw_client.go new file mode 100644 index 0000000..72ac54e --- /dev/null +++ b/crm/fieldmapping/raw_client.go @@ -0,0 +1,302 @@ +// Code generated by Fern. DO NOT EDIT. + +package fieldmapping + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) FieldMappingsRetrieve( + ctx context.Context, + request *crm.FieldMappingsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.FieldMappingApiInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.FieldMappingApiInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.FieldMappingApiInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsCreate( + ctx context.Context, + request *crm.CreateFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsDestroy( + ctx context.Context, + fieldMappingId string, + opts ...option.RequestOption, +) (*core.Response[*crm.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsPartialUpdate( + ctx context.Context, + fieldMappingId string, + request *crm.PatchedEditFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) RemoteFieldsRetrieve( + ctx context.Context, + request *crm.RemoteFieldsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.RemoteFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/remote-fields" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.RemoteFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.RemoteFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) TargetFieldsRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.ExternalTargetFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/target-fields" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.ExternalTargetFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.ExternalTargetFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/forceresync/client.go b/crm/forceresync/client.go index 7f2e16e..ae9fc0b 100644 --- a/crm/forceresync/client.go +++ b/crm/forceresync/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) SyncStatusResyncCreate( ctx context.Context, opts ...option.RequestOption, ) ([]*crm.SyncStatus, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/sync-status/resync" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*crm.SyncStatus - if err := c.caller.Call( + response, err := c.WithRawResponse.SyncStatusResyncCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/forceresync/crm_force_resync_test/crm_force_resync_test.go b/crm/forceresync/crm_force_resync_test/crm_force_resync_test.go new file mode 100644 index 0000000..b1f74c5 --- /dev/null +++ b/crm/forceresync/crm_force_resync_test/crm_force_resync_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_force_resync_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmForceResyncSyncStatusResyncCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/sync-status/resync", nil, 1) +} diff --git a/crm/forceresync/raw_client.go b/crm/forceresync/raw_client.go new file mode 100644 index 0000000..ecc3e24 --- /dev/null +++ b/crm/forceresync/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package forceresync + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) SyncStatusResyncCreate( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*crm.SyncStatus], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/sync-status/resync" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*crm.SyncStatus + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*crm.SyncStatus]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/generate_key.go b/crm/generate_key.go index 8a955e7..b0a0453 100644 --- a/crm/generate_key.go +++ b/crm/generate_key.go @@ -2,7 +2,32 @@ package crm +import ( + big "math/big" +) + +var ( + generateRemoteKeyRequestFieldName = big.NewInt(1 << 0) +) + type GenerateRemoteKeyRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GenerateRemoteKeyRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GenerateRemoteKeyRequest) SetName(name string) { + g.Name = name + g.require(generateRemoteKeyRequestFieldName) } diff --git a/crm/generatekey/client.go b/crm/generatekey/client.go index a80bdee..f02237d 100644 --- a/crm/generatekey/client.go +++ b/crm/generatekey/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *crm.GenerateRemoteKeyRequest, opts ...option.RequestOption, ) (*crm.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/generate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/generatekey/crm_generate_key_test/crm_generate_key_test.go b/crm/generatekey/crm_generate_key_test/crm_generate_key_test.go new file mode 100644 index 0000000..db64843 --- /dev/null +++ b/crm/generatekey/crm_generate_key_test/crm_generate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_generate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmGenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Crm.GenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/generate-key", nil, 1) +} diff --git a/crm/generatekey/raw_client.go b/crm/generatekey/raw_client.go new file mode 100644 index 0000000..087a285 --- /dev/null +++ b/crm/generatekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package generatekey + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.GenerateRemoteKeyRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/generate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/issues.go b/crm/issues.go index 37d58b8..7e8201e 100644 --- a/crm/issues.go +++ b/crm/issues.go @@ -6,9 +6,27 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + issuesListRequestFieldAccountToken = big.NewInt(1 << 0) + issuesListRequestFieldCursor = big.NewInt(1 << 1) + issuesListRequestFieldEndDate = big.NewInt(1 << 2) + issuesListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + issuesListRequestFieldFirstIncidentTimeAfter = big.NewInt(1 << 4) + issuesListRequestFieldFirstIncidentTimeBefore = big.NewInt(1 << 5) + issuesListRequestFieldIncludeMuted = big.NewInt(1 << 6) + issuesListRequestFieldIntegrationName = big.NewInt(1 << 7) + issuesListRequestFieldLastIncidentTimeAfter = big.NewInt(1 << 8) + issuesListRequestFieldLastIncidentTimeBefore = big.NewInt(1 << 9) + issuesListRequestFieldLinkedAccountId = big.NewInt(1 << 10) + issuesListRequestFieldPageSize = big.NewInt(1 << 11) + issuesListRequestFieldStartDate = big.NewInt(1 << 12) + issuesListRequestFieldStatus = big.NewInt(1 << 13) +) + type IssuesListRequest struct { AccountToken *string `json:"-" url:"account_token,omitempty"` // The pagination cursor value. @@ -38,6 +56,114 @@ type IssuesListRequest struct { // * `ONGOING` - ONGOING // * `RESOLVED` - RESOLVED Status *IssuesListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *IssuesListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetAccountToken(accountToken *string) { + i.AccountToken = accountToken + i.require(issuesListRequestFieldAccountToken) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(issuesListRequestFieldCursor) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndDate(endDate *string) { + i.EndDate = endDate + i.require(issuesListRequestFieldEndDate) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + i.EndUserOrganizationName = endUserOrganizationName + i.require(issuesListRequestFieldEndUserOrganizationName) +} + +// SetFirstIncidentTimeAfter sets the FirstIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeAfter(firstIncidentTimeAfter *time.Time) { + i.FirstIncidentTimeAfter = firstIncidentTimeAfter + i.require(issuesListRequestFieldFirstIncidentTimeAfter) +} + +// SetFirstIncidentTimeBefore sets the FirstIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeBefore(firstIncidentTimeBefore *time.Time) { + i.FirstIncidentTimeBefore = firstIncidentTimeBefore + i.require(issuesListRequestFieldFirstIncidentTimeBefore) +} + +// SetIncludeMuted sets the IncludeMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIncludeMuted(includeMuted *string) { + i.IncludeMuted = includeMuted + i.require(issuesListRequestFieldIncludeMuted) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIntegrationName(integrationName *string) { + i.IntegrationName = integrationName + i.require(issuesListRequestFieldIntegrationName) +} + +// SetLastIncidentTimeAfter sets the LastIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeAfter(lastIncidentTimeAfter *time.Time) { + i.LastIncidentTimeAfter = lastIncidentTimeAfter + i.require(issuesListRequestFieldLastIncidentTimeAfter) +} + +// SetLastIncidentTimeBefore sets the LastIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeBefore(lastIncidentTimeBefore *time.Time) { + i.LastIncidentTimeBefore = lastIncidentTimeBefore + i.require(issuesListRequestFieldLastIncidentTimeBefore) +} + +// SetLinkedAccountId sets the LinkedAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLinkedAccountId(linkedAccountId *string) { + i.LinkedAccountId = linkedAccountId + i.require(issuesListRequestFieldLinkedAccountId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(issuesListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStartDate(startDate *string) { + i.StartDate = startDate + i.require(issuesListRequestFieldStartDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStatus(status *IssuesListRequestStatus) { + i.Status = status + i.require(issuesListRequestFieldStatus) } type IssuesListRequestStatus string @@ -62,6 +188,17 @@ func (i IssuesListRequestStatus) Ptr() *IssuesListRequestStatus { return &i } +var ( + issueFieldId = big.NewInt(1 << 0) + issueFieldStatus = big.NewInt(1 << 1) + issueFieldErrorDescription = big.NewInt(1 << 2) + issueFieldEndUser = big.NewInt(1 << 3) + issueFieldFirstIncidentTime = big.NewInt(1 << 4) + issueFieldLastIncidentTime = big.NewInt(1 << 5) + issueFieldIsMuted = big.NewInt(1 << 6) + issueFieldErrorDetails = big.NewInt(1 << 7) +) + type Issue struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -76,6 +213,9 @@ type Issue struct { IsMuted *bool `json:"is_muted,omitempty" url:"is_muted,omitempty"` ErrorDetails []string `json:"error_details,omitempty" url:"error_details,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +280,69 @@ func (i *Issue) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *Issue) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetId(id *string) { + i.Id = id + i.require(issueFieldId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetStatus(status *IssueStatus) { + i.Status = status + i.require(issueFieldStatus) +} + +// SetErrorDescription sets the ErrorDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDescription(errorDescription string) { + i.ErrorDescription = errorDescription + i.require(issueFieldErrorDescription) +} + +// SetEndUser sets the EndUser field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetEndUser(endUser map[string]interface{}) { + i.EndUser = endUser + i.require(issueFieldEndUser) +} + +// SetFirstIncidentTime sets the FirstIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetFirstIncidentTime(firstIncidentTime *time.Time) { + i.FirstIncidentTime = firstIncidentTime + i.require(issueFieldFirstIncidentTime) +} + +// SetLastIncidentTime sets the LastIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetLastIncidentTime(lastIncidentTime *time.Time) { + i.LastIncidentTime = lastIncidentTime + i.require(issueFieldLastIncidentTime) +} + +// SetIsMuted sets the IsMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetIsMuted(isMuted *bool) { + i.IsMuted = isMuted + i.require(issueFieldIsMuted) +} + +// SetErrorDetails sets the ErrorDetails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDetails(errorDetails []string) { + i.ErrorDetails = errorDetails + i.require(issueFieldErrorDetails) +} + func (i *Issue) UnmarshalJSON(data []byte) error { type embed Issue var unmarshaler = struct { @@ -175,7 +378,8 @@ func (i *Issue) MarshalJSON() ([]byte, error) { FirstIncidentTime: internal.NewOptionalDateTime(i.FirstIncidentTime), LastIncidentTime: internal.NewOptionalDateTime(i.LastIncidentTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *Issue) String() string { @@ -280,11 +484,20 @@ func (i IssueStatusEnum) Ptr() *IssueStatusEnum { return &i } +var ( + paginatedIssueListFieldNext = big.NewInt(1 << 0) + paginatedIssueListFieldPrevious = big.NewInt(1 << 1) + paginatedIssueListFieldResults = big.NewInt(1 << 2) +) + type PaginatedIssueList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Issue `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -314,6 +527,34 @@ func (p *PaginatedIssueList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedIssueList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetNext(next *string) { + p.Next = next + p.require(paginatedIssueListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedIssueListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetResults(results []*Issue) { + p.Results = results + p.require(paginatedIssueListFieldResults) +} + func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedIssueList var value unmarshaler @@ -330,6 +571,17 @@ func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedIssueList) MarshalJSON() ([]byte, error) { + type embed PaginatedIssueList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedIssueList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/issues/client.go b/crm/issues/client.go index 355c841..bceabbd 100644 --- a/crm/issues/client.go +++ b/crm/issues/client.go @@ -4,7 +4,6 @@ package issues import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.IssuesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Issue], error) { +) (*core.Page[*string, *crm.Issue], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedIssueList) *internal.PageResponse[*string, *crm.Issue] { + readPageResponse := func(response *crm.PaginatedIssueList) *core.PageResponse[*string, *crm.Issue] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Issue]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Issue]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,36 +97,13 @@ func (c *Client) Retrieve( id string, opts ...option.RequestOption, ) (*crm.Issue, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/issues/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Issue - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/issues/crm_issues_test/crm_issues_test.go b/crm/issues/crm_issues_test/crm_issues_test.go new file mode 100644 index 0000000..1f2c007 --- /dev/null +++ b/crm/issues/crm_issues_test/crm_issues_test.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_issues_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmIssuesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: crm.IssuesListRequestStatusOngoing.Ptr(), + } + _, invocationErr := client.Crm.Issues.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/issues", map[string]string{"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"}, 1) +} + +func TestCrmIssuesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Issues.Retrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/issues/id", nil, 1) +} diff --git a/crm/issues/raw_client.go b/crm/issues/raw_client.go new file mode 100644 index 0000000..7217311 --- /dev/null +++ b/crm/issues/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package issues + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*crm.Issue], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/issues/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Issue + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Issue]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/leads.go b/crm/leads.go index b5f69af..8aaa093 100644 --- a/crm/leads.go +++ b/crm/leads.go @@ -6,17 +6,75 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + leadEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + leadEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + leadEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type LeadEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *LeadRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LeadEndpointRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + l.IsDebugMode = isDebugMode + l.require(leadEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadEndpointRequest) SetRunAsync(runAsync *bool) { + l.RunAsync = runAsync + l.require(leadEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadEndpointRequest) SetModel(model *LeadRequest) { + l.Model = model + l.require(leadEndpointRequestFieldModel) +} + +var ( + leadsListRequestFieldConvertedAccountId = big.NewInt(1 << 0) + leadsListRequestFieldConvertedContactId = big.NewInt(1 << 1) + leadsListRequestFieldCreatedAfter = big.NewInt(1 << 2) + leadsListRequestFieldCreatedBefore = big.NewInt(1 << 3) + leadsListRequestFieldCursor = big.NewInt(1 << 4) + leadsListRequestFieldEmailAddresses = big.NewInt(1 << 5) + leadsListRequestFieldExpand = big.NewInt(1 << 6) + leadsListRequestFieldIncludeDeletedData = big.NewInt(1 << 7) + leadsListRequestFieldIncludeRemoteData = big.NewInt(1 << 8) + leadsListRequestFieldIncludeRemoteFields = big.NewInt(1 << 9) + leadsListRequestFieldIncludeShellData = big.NewInt(1 << 10) + leadsListRequestFieldModifiedAfter = big.NewInt(1 << 11) + leadsListRequestFieldModifiedBefore = big.NewInt(1 << 12) + leadsListRequestFieldOwnerId = big.NewInt(1 << 13) + leadsListRequestFieldPageSize = big.NewInt(1 << 14) + leadsListRequestFieldPhoneNumbers = big.NewInt(1 << 15) + leadsListRequestFieldRemoteId = big.NewInt(1 << 16) +) + type LeadsListRequest struct { // If provided, will only return leads with this account. ConvertedAccountId *string `json:"-" url:"converted_account_id,omitempty"` @@ -52,8 +110,148 @@ type LeadsListRequest struct { PhoneNumbers *string `json:"-" url:"phone_numbers,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LeadsListRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetConvertedAccountId sets the ConvertedAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetConvertedAccountId(convertedAccountId *string) { + l.ConvertedAccountId = convertedAccountId + l.require(leadsListRequestFieldConvertedAccountId) +} + +// SetConvertedContactId sets the ConvertedContactId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetConvertedContactId(convertedContactId *string) { + l.ConvertedContactId = convertedContactId + l.require(leadsListRequestFieldConvertedContactId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetCreatedAfter(createdAfter *time.Time) { + l.CreatedAfter = createdAfter + l.require(leadsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetCreatedBefore(createdBefore *time.Time) { + l.CreatedBefore = createdBefore + l.require(leadsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetCursor(cursor *string) { + l.Cursor = cursor + l.require(leadsListRequestFieldCursor) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetEmailAddresses(emailAddresses *string) { + l.EmailAddresses = emailAddresses + l.require(leadsListRequestFieldEmailAddresses) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetExpand(expand []*LeadsListRequestExpandItem) { + l.Expand = expand + l.require(leadsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + l.IncludeDeletedData = includeDeletedData + l.require(leadsListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + l.IncludeRemoteData = includeRemoteData + l.require(leadsListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + l.IncludeRemoteFields = includeRemoteFields + l.require(leadsListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetIncludeShellData(includeShellData *bool) { + l.IncludeShellData = includeShellData + l.require(leadsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + l.ModifiedAfter = modifiedAfter + l.require(leadsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + l.ModifiedBefore = modifiedBefore + l.require(leadsListRequestFieldModifiedBefore) +} + +// SetOwnerId sets the OwnerId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetOwnerId(ownerId *string) { + l.OwnerId = ownerId + l.require(leadsListRequestFieldOwnerId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetPageSize(pageSize *int) { + l.PageSize = pageSize + l.require(leadsListRequestFieldPageSize) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetPhoneNumbers(phoneNumbers *string) { + l.PhoneNumbers = phoneNumbers + l.require(leadsListRequestFieldPhoneNumbers) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsListRequest) SetRemoteId(remoteId *string) { + l.RemoteId = remoteId + l.require(leadsListRequestFieldRemoteId) +} + +var ( + leadsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + leadsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + leadsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + leadsRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + leadsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + leadsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + leadsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + leadsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type LeadsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -71,8 +269,81 @@ type LeadsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LeadsRemoteFieldClassesListRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + l.Cursor = cursor + l.require(leadsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + l.IncludeDeletedData = includeDeletedData + l.require(leadsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + l.IncludeRemoteData = includeRemoteData + l.require(leadsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + l.IncludeRemoteFields = includeRemoteFields + l.require(leadsRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + l.IncludeShellData = includeShellData + l.require(leadsRemoteFieldClassesListRequestFieldIncludeShellData) } +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + l.IsCommonModelField = isCommonModelField + l.require(leadsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + l.IsCustom = isCustom + l.require(leadsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + l.PageSize = pageSize + l.require(leadsRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + leadsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + leadsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + leadsRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + leadsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) +) + type LeadsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*LeadsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -82,6 +353,44 @@ type LeadsRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LeadsRetrieveRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRetrieveRequest) SetExpand(expand []*LeadsRetrieveRequestExpandItem) { + l.Expand = expand + l.require(leadsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + l.IncludeRemoteData = includeRemoteData + l.require(leadsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + l.IncludeRemoteFields = includeRemoteFields + l.require(leadsRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + l.IncludeShellData = includeShellData + l.require(leadsRetrieveRequestFieldIncludeShellData) } type LeadsListRequestExpandItem string @@ -139,6 +448,31 @@ func (l LeadsRetrieveRequestExpandItem) Ptr() *LeadsRetrieveRequestExpandItem { // The `Lead` object is used to represent an individual who is a potential customer. // ### Usage Example // TODO +var ( + leadFieldId = big.NewInt(1 << 0) + leadFieldRemoteId = big.NewInt(1 << 1) + leadFieldCreatedAt = big.NewInt(1 << 2) + leadFieldModifiedAt = big.NewInt(1 << 3) + leadFieldOwner = big.NewInt(1 << 4) + leadFieldLeadSource = big.NewInt(1 << 5) + leadFieldTitle = big.NewInt(1 << 6) + leadFieldCompany = big.NewInt(1 << 7) + leadFieldFirstName = big.NewInt(1 << 8) + leadFieldLastName = big.NewInt(1 << 9) + leadFieldAddresses = big.NewInt(1 << 10) + leadFieldEmailAddresses = big.NewInt(1 << 11) + leadFieldPhoneNumbers = big.NewInt(1 << 12) + leadFieldRemoteUpdatedAt = big.NewInt(1 << 13) + leadFieldRemoteCreatedAt = big.NewInt(1 << 14) + leadFieldConvertedDate = big.NewInt(1 << 15) + leadFieldConvertedContact = big.NewInt(1 << 16) + leadFieldConvertedAccount = big.NewInt(1 << 17) + leadFieldRemoteWasDeleted = big.NewInt(1 << 18) + leadFieldFieldMappings = big.NewInt(1 << 19) + leadFieldRemoteData = big.NewInt(1 << 20) + leadFieldRemoteFields = big.NewInt(1 << 21) +) + type Lead struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -178,6 +512,9 @@ type Lead struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -340,6 +677,167 @@ func (l *Lead) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *Lead) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetId(id *string) { + l.Id = id + l.require(leadFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetRemoteId(remoteId *string) { + l.RemoteId = remoteId + l.require(leadFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetCreatedAt(createdAt *time.Time) { + l.CreatedAt = createdAt + l.require(leadFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetModifiedAt(modifiedAt *time.Time) { + l.ModifiedAt = modifiedAt + l.require(leadFieldModifiedAt) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetOwner(owner *LeadOwner) { + l.Owner = owner + l.require(leadFieldOwner) +} + +// SetLeadSource sets the LeadSource field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetLeadSource(leadSource *string) { + l.LeadSource = leadSource + l.require(leadFieldLeadSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetTitle(title *string) { + l.Title = title + l.require(leadFieldTitle) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetCompany(company *string) { + l.Company = company + l.require(leadFieldCompany) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetFirstName(firstName *string) { + l.FirstName = firstName + l.require(leadFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetLastName(lastName *string) { + l.LastName = lastName + l.require(leadFieldLastName) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetAddresses(addresses []*Address) { + l.Addresses = addresses + l.require(leadFieldAddresses) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetEmailAddresses(emailAddresses []*EmailAddress) { + l.EmailAddresses = emailAddresses + l.require(leadFieldEmailAddresses) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetPhoneNumbers(phoneNumbers []*PhoneNumber) { + l.PhoneNumbers = phoneNumbers + l.require(leadFieldPhoneNumbers) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + l.RemoteUpdatedAt = remoteUpdatedAt + l.require(leadFieldRemoteUpdatedAt) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + l.RemoteCreatedAt = remoteCreatedAt + l.require(leadFieldRemoteCreatedAt) +} + +// SetConvertedDate sets the ConvertedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetConvertedDate(convertedDate *time.Time) { + l.ConvertedDate = convertedDate + l.require(leadFieldConvertedDate) +} + +// SetConvertedContact sets the ConvertedContact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetConvertedContact(convertedContact *LeadConvertedContact) { + l.ConvertedContact = convertedContact + l.require(leadFieldConvertedContact) +} + +// SetConvertedAccount sets the ConvertedAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetConvertedAccount(convertedAccount *LeadConvertedAccount) { + l.ConvertedAccount = convertedAccount + l.require(leadFieldConvertedAccount) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetRemoteWasDeleted(remoteWasDeleted *bool) { + l.RemoteWasDeleted = remoteWasDeleted + l.require(leadFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetFieldMappings(fieldMappings map[string]interface{}) { + l.FieldMappings = fieldMappings + l.require(leadFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetRemoteData(remoteData []*RemoteData) { + l.RemoteData = remoteData + l.require(leadFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Lead) SetRemoteFields(remoteFields []*RemoteField) { + l.RemoteFields = remoteFields + l.require(leadFieldRemoteFields) +} + func (l *Lead) UnmarshalJSON(data []byte) error { type embed Lead var unmarshaler = struct { @@ -387,7 +885,8 @@ func (l *Lead) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(l.RemoteCreatedAt), ConvertedDate: internal.NewOptionalDateTime(l.ConvertedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) } func (l *Lead) String() string { @@ -596,6 +1095,24 @@ func (l *LeadOwner) Accept(visitor LeadOwnerVisitor) error { // The `Lead` object is used to represent an individual who is a potential customer. // ### Usage Example // TODO +var ( + leadRequestFieldOwner = big.NewInt(1 << 0) + leadRequestFieldLeadSource = big.NewInt(1 << 1) + leadRequestFieldTitle = big.NewInt(1 << 2) + leadRequestFieldCompany = big.NewInt(1 << 3) + leadRequestFieldFirstName = big.NewInt(1 << 4) + leadRequestFieldLastName = big.NewInt(1 << 5) + leadRequestFieldAddresses = big.NewInt(1 << 6) + leadRequestFieldEmailAddresses = big.NewInt(1 << 7) + leadRequestFieldPhoneNumbers = big.NewInt(1 << 8) + leadRequestFieldConvertedDate = big.NewInt(1 << 9) + leadRequestFieldConvertedContact = big.NewInt(1 << 10) + leadRequestFieldConvertedAccount = big.NewInt(1 << 11) + leadRequestFieldIntegrationParams = big.NewInt(1 << 12) + leadRequestFieldLinkedAccountParams = big.NewInt(1 << 13) + leadRequestFieldRemoteFields = big.NewInt(1 << 14) +) + type LeadRequest struct { // The lead's owner. Owner *LeadRequestOwner `json:"owner,omitempty" url:"owner,omitempty"` @@ -622,6 +1139,9 @@ type LeadRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -735,6 +1255,118 @@ func (l *LeadRequest) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LeadRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetOwner(owner *LeadRequestOwner) { + l.Owner = owner + l.require(leadRequestFieldOwner) +} + +// SetLeadSource sets the LeadSource field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetLeadSource(leadSource *string) { + l.LeadSource = leadSource + l.require(leadRequestFieldLeadSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetTitle(title *string) { + l.Title = title + l.require(leadRequestFieldTitle) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetCompany(company *string) { + l.Company = company + l.require(leadRequestFieldCompany) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetFirstName(firstName *string) { + l.FirstName = firstName + l.require(leadRequestFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetLastName(lastName *string) { + l.LastName = lastName + l.require(leadRequestFieldLastName) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetAddresses(addresses []*AddressRequest) { + l.Addresses = addresses + l.require(leadRequestFieldAddresses) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetEmailAddresses(emailAddresses []*EmailAddressRequest) { + l.EmailAddresses = emailAddresses + l.require(leadRequestFieldEmailAddresses) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetPhoneNumbers(phoneNumbers []*PhoneNumberRequest) { + l.PhoneNumbers = phoneNumbers + l.require(leadRequestFieldPhoneNumbers) +} + +// SetConvertedDate sets the ConvertedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetConvertedDate(convertedDate *time.Time) { + l.ConvertedDate = convertedDate + l.require(leadRequestFieldConvertedDate) +} + +// SetConvertedContact sets the ConvertedContact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetConvertedContact(convertedContact *LeadRequestConvertedContact) { + l.ConvertedContact = convertedContact + l.require(leadRequestFieldConvertedContact) +} + +// SetConvertedAccount sets the ConvertedAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetConvertedAccount(convertedAccount *LeadRequestConvertedAccount) { + l.ConvertedAccount = convertedAccount + l.require(leadRequestFieldConvertedAccount) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + l.IntegrationParams = integrationParams + l.require(leadRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + l.LinkedAccountParams = linkedAccountParams + l.require(leadRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + l.RemoteFields = remoteFields + l.require(leadRequestFieldRemoteFields) +} + func (l *LeadRequest) UnmarshalJSON(data []byte) error { type embed LeadRequest var unmarshaler = struct { @@ -766,7 +1398,8 @@ func (l *LeadRequest) MarshalJSON() ([]byte, error) { embed: embed(*l), ConvertedDate: internal.NewOptionalDateTime(l.ConvertedDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) } func (l *LeadRequest) String() string { @@ -970,12 +1603,22 @@ func (l *LeadRequestOwner) Accept(visitor LeadRequestOwnerVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", l) } +var ( + leadResponseFieldModel = big.NewInt(1 << 0) + leadResponseFieldWarnings = big.NewInt(1 << 1) + leadResponseFieldErrors = big.NewInt(1 << 2) + leadResponseFieldLogs = big.NewInt(1 << 3) +) + type LeadResponse struct { Model *Lead `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1012,6 +1655,41 @@ func (l *LeadResponse) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LeadResponse) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadResponse) SetModel(model *Lead) { + l.Model = model + l.require(leadResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadResponse) SetWarnings(warnings []*WarningValidationProblem) { + l.Warnings = warnings + l.require(leadResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadResponse) SetErrors(errors []*ErrorValidationProblem) { + l.Errors = errors + l.require(leadResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LeadResponse) SetLogs(logs []*DebugModeLog) { + l.Logs = logs + l.require(leadResponseFieldLogs) +} + func (l *LeadResponse) UnmarshalJSON(data []byte) error { type unmarshaler LeadResponse var value unmarshaler @@ -1028,6 +1706,17 @@ func (l *LeadResponse) UnmarshalJSON(data []byte) error { return nil } +func (l *LeadResponse) MarshalJSON() ([]byte, error) { + type embed LeadResponse + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LeadResponse) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { @@ -1040,11 +1729,20 @@ func (l *LeadResponse) String() string { return fmt.Sprintf("%#v", l) } +var ( + paginatedLeadListFieldNext = big.NewInt(1 << 0) + paginatedLeadListFieldPrevious = big.NewInt(1 << 1) + paginatedLeadListFieldResults = big.NewInt(1 << 2) +) + type PaginatedLeadList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Lead `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1074,6 +1772,34 @@ func (p *PaginatedLeadList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedLeadList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedLeadList) SetNext(next *string) { + p.Next = next + p.require(paginatedLeadListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedLeadList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedLeadListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedLeadList) SetResults(results []*Lead) { + p.Results = results + p.require(paginatedLeadListFieldResults) +} + func (p *PaginatedLeadList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedLeadList var value unmarshaler @@ -1090,6 +1816,17 @@ func (p *PaginatedLeadList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedLeadList) MarshalJSON() ([]byte, error) { + type embed PaginatedLeadList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedLeadList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/leads/client.go b/crm/leads/client.go index 1cb779d..102574f 100644 --- a/crm/leads/client.go +++ b/crm/leads/client.go @@ -4,7 +4,6 @@ package leads import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.LeadsListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Lead], error) { +) (*core.Page[*string, *crm.Lead], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedLeadList) *internal.PageResponse[*string, *crm.Lead] { + readPageResponse := func(response *crm.PaginatedLeadList) *core.PageResponse[*string, *crm.Lead] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Lead]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Lead]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *crm.LeadEndpointRequest, opts ...option.RequestOption, ) (*crm.LeadResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/leads" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.LeadResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Lead` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *crm.LeadsRetrieveRequest, opts ...option.RequestOption, ) (*crm.Lead, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/leads/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Lead - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Lead` POSTs. @@ -190,35 +132,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/leads/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -226,7 +147,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.LeadsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -239,13 +160,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -262,11 +182,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/leads/crm_leads_test/crm_leads_test.go b/crm/leads/crm_leads_test/crm_leads_test.go new file mode 100644 index 0000000..ec78f93 --- /dev/null +++ b/crm/leads/crm_leads_test/crm_leads_test.go @@ -0,0 +1,262 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_leads_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmLeadsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.LeadsListRequest{ + ConvertedAccountId: merge.String( + "converted_account_id", + ), + ConvertedContactId: merge.String( + "converted_contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddresses: merge.String( + "email_addresses", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OwnerId: merge.String( + "owner_id", + ), + PageSize: merge.Int( + 1, + ), + PhoneNumbers: merge.String( + "phone_numbers", + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.Leads.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/leads", map[string]string{"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"}, 1) +} + +func TestCrmLeadsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.LeadEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.LeadRequest{}, + } + _, invocationErr := client.Crm.Leads.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/leads", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmLeadsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.LeadsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Leads.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/leads/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmLeadsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Leads.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/leads/meta/post", nil, 1) +} + +func TestCrmLeadsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.LeadsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.Leads.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/leads/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/leads/raw_client.go b/crm/leads/raw_client.go new file mode 100644 index 0000000..bda7d3e --- /dev/null +++ b/crm/leads/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package leads + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.LeadEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.LeadResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/leads" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.LeadResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.LeadResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.LeadsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.Lead], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/leads/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Lead + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Lead]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/leads/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/link_token.go b/crm/link_token.go index ddfd699..4ae0793 100644 --- a/crm/link_token.go +++ b/crm/link_token.go @@ -6,6 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + endUserDetailsRequestFieldEndUserEmailAddress = big.NewInt(1 << 0) + endUserDetailsRequestFieldEndUserOrganizationName = big.NewInt(1 << 1) + endUserDetailsRequestFieldEndUserOriginId = big.NewInt(1 << 2) + endUserDetailsRequestFieldCategories = big.NewInt(1 << 3) + endUserDetailsRequestFieldIntegration = big.NewInt(1 << 4) + endUserDetailsRequestFieldLinkExpiryMins = big.NewInt(1 << 5) + endUserDetailsRequestFieldShouldCreateMagicLinkUrl = big.NewInt(1 << 6) + endUserDetailsRequestFieldHideAdminMagicLink = big.NewInt(1 << 7) + endUserDetailsRequestFieldCommonModels = big.NewInt(1 << 8) + endUserDetailsRequestFieldCategoryCommonModelScopes = big.NewInt(1 << 9) + endUserDetailsRequestFieldLanguage = big.NewInt(1 << 10) + endUserDetailsRequestFieldAreSyncsDisabled = big.NewInt(1 << 11) + endUserDetailsRequestFieldIntegrationSpecificConfig = big.NewInt(1 << 12) ) type EndUserDetailsRequest struct { @@ -38,6 +55,107 @@ type EndUserDetailsRequest struct { AreSyncsDisabled *bool `json:"are_syncs_disabled,omitempty" url:"-"` // A JSON object containing integration-specific configuration options. IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EndUserDetailsRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserEmailAddress(endUserEmailAddress string) { + e.EndUserEmailAddress = endUserEmailAddress + e.require(endUserDetailsRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOrganizationName(endUserOrganizationName string) { + e.EndUserOrganizationName = endUserOrganizationName + e.require(endUserDetailsRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOriginId(endUserOriginId string) { + e.EndUserOriginId = endUserOriginId + e.require(endUserDetailsRequestFieldEndUserOriginId) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategories(categories []CategoriesEnum) { + e.Categories = categories + e.require(endUserDetailsRequestFieldCategories) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegration(integration *string) { + e.Integration = integration + e.require(endUserDetailsRequestFieldIntegration) +} + +// SetLinkExpiryMins sets the LinkExpiryMins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLinkExpiryMins(linkExpiryMins *int) { + e.LinkExpiryMins = linkExpiryMins + e.require(endUserDetailsRequestFieldLinkExpiryMins) +} + +// SetShouldCreateMagicLinkUrl sets the ShouldCreateMagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetShouldCreateMagicLinkUrl(shouldCreateMagicLinkUrl *bool) { + e.ShouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl + e.require(endUserDetailsRequestFieldShouldCreateMagicLinkUrl) +} + +// SetHideAdminMagicLink sets the HideAdminMagicLink field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetHideAdminMagicLink(hideAdminMagicLink *bool) { + e.HideAdminMagicLink = hideAdminMagicLink + e.require(endUserDetailsRequestFieldHideAdminMagicLink) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCommonModels(commonModels []*CommonModelScopesBodyRequest) { + e.CommonModels = commonModels + e.require(endUserDetailsRequestFieldCommonModels) +} + +// SetCategoryCommonModelScopes sets the CategoryCommonModelScopes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategoryCommonModelScopes(categoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest) { + e.CategoryCommonModelScopes = categoryCommonModelScopes + e.require(endUserDetailsRequestFieldCategoryCommonModelScopes) +} + +// SetLanguage sets the Language field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLanguage(language *EndUserDetailsRequestLanguage) { + e.Language = language + e.require(endUserDetailsRequestFieldLanguage) +} + +// SetAreSyncsDisabled sets the AreSyncsDisabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetAreSyncsDisabled(areSyncsDisabled *bool) { + e.AreSyncsDisabled = areSyncsDisabled + e.require(endUserDetailsRequestFieldAreSyncsDisabled) +} + +// SetIntegrationSpecificConfig sets the IntegrationSpecificConfig field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegrationSpecificConfig(integrationSpecificConfig map[string]interface{}) { + e.IntegrationSpecificConfig = integrationSpecificConfig + e.require(endUserDetailsRequestFieldIntegrationSpecificConfig) } // The following subset of IETF language tags can be used to configure localization. @@ -106,11 +224,20 @@ func (e *EndUserDetailsRequestLanguage) Accept(visitor EndUserDetailsRequestLang return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + commonModelScopesBodyRequestFieldModelId = big.NewInt(1 << 0) + commonModelScopesBodyRequestFieldEnabledActions = big.NewInt(1 << 1) + commonModelScopesBodyRequestFieldDisabledFields = big.NewInt(1 << 2) +) + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id" url:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions" url:"enabled_actions"` DisabledFields []string `json:"disabled_fields" url:"disabled_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +267,34 @@ func (c *CommonModelScopesBodyRequest) GetExtraProperties() map[string]interface return c.extraProperties } +func (c *CommonModelScopesBodyRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetModelId(modelId string) { + c.ModelId = modelId + c.require(commonModelScopesBodyRequestFieldModelId) +} + +// SetEnabledActions sets the EnabledActions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetEnabledActions(enabledActions []EnabledActionsEnum) { + c.EnabledActions = enabledActions + c.require(commonModelScopesBodyRequestFieldEnabledActions) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetDisabledFields(disabledFields []string) { + c.DisabledFields = disabledFields + c.require(commonModelScopesBodyRequestFieldDisabledFields) +} + func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopesBodyRequest var value unmarshaler @@ -156,6 +311,17 @@ func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopesBodyRequest) MarshalJSON() ([]byte, error) { + type embed CommonModelScopesBodyRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopesBodyRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -216,11 +382,20 @@ func (l LanguageEnum) Ptr() *LanguageEnum { return &l } +var ( + linkTokenFieldLinkToken = big.NewInt(1 << 0) + linkTokenFieldIntegrationName = big.NewInt(1 << 1) + linkTokenFieldMagicLinkUrl = big.NewInt(1 << 2) +) + type LinkToken struct { LinkToken string `json:"link_token" url:"link_token"` IntegrationName *string `json:"integration_name,omitempty" url:"integration_name,omitempty"` MagicLinkUrl *string `json:"magic_link_url,omitempty" url:"magic_link_url,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -250,6 +425,34 @@ func (l *LinkToken) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkToken) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkToken sets the LinkToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetLinkToken(linkToken string) { + l.LinkToken = linkToken + l.require(linkTokenFieldLinkToken) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkTokenFieldIntegrationName) +} + +// SetMagicLinkUrl sets the MagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetMagicLinkUrl(magicLinkUrl *string) { + l.MagicLinkUrl = magicLinkUrl + l.require(linkTokenFieldMagicLinkUrl) +} + func (l *LinkToken) UnmarshalJSON(data []byte) error { type unmarshaler LinkToken var value unmarshaler @@ -266,6 +469,17 @@ func (l *LinkToken) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkToken) MarshalJSON() ([]byte, error) { + type embed LinkToken + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkToken) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { diff --git a/crm/linked_accounts.go b/crm/linked_accounts.go index 02a2ac7..34c2205 100644 --- a/crm/linked_accounts.go +++ b/crm/linked_accounts.go @@ -6,9 +6,26 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + linkedAccountsListRequestFieldCategory = big.NewInt(1 << 0) + linkedAccountsListRequestFieldCursor = big.NewInt(1 << 1) + linkedAccountsListRequestFieldEndUserEmailAddress = big.NewInt(1 << 2) + linkedAccountsListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + linkedAccountsListRequestFieldEndUserOriginId = big.NewInt(1 << 4) + linkedAccountsListRequestFieldEndUserOriginIds = big.NewInt(1 << 5) + linkedAccountsListRequestFieldId = big.NewInt(1 << 6) + linkedAccountsListRequestFieldIds = big.NewInt(1 << 7) + linkedAccountsListRequestFieldIncludeDuplicates = big.NewInt(1 << 8) + linkedAccountsListRequestFieldIntegrationName = big.NewInt(1 << 9) + linkedAccountsListRequestFieldIsTestAccount = big.NewInt(1 << 10) + linkedAccountsListRequestFieldPageSize = big.NewInt(1 << 11) + linkedAccountsListRequestFieldStatus = big.NewInt(1 << 12) +) + type LinkedAccountsListRequest struct { // Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` // @@ -43,6 +60,107 @@ type LinkedAccountsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` Status *string `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountsListRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCategory(category *LinkedAccountsListRequestCategory) { + l.Category = category + l.require(linkedAccountsListRequestFieldCategory) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCursor(cursor *string) { + l.Cursor = cursor + l.require(linkedAccountsListRequestFieldCursor) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserEmailAddress(endUserEmailAddress *string) { + l.EndUserEmailAddress = endUserEmailAddress + l.require(linkedAccountsListRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + l.EndUserOrganizationName = endUserOrganizationName + l.require(linkedAccountsListRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginId(endUserOriginId *string) { + l.EndUserOriginId = endUserOriginId + l.require(linkedAccountsListRequestFieldEndUserOriginId) +} + +// SetEndUserOriginIds sets the EndUserOriginIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginIds(endUserOriginIds *string) { + l.EndUserOriginIds = endUserOriginIds + l.require(linkedAccountsListRequestFieldEndUserOriginIds) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetId(id *string) { + l.Id = id + l.require(linkedAccountsListRequestFieldId) +} + +// SetIds sets the Ids field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIds(ids *string) { + l.Ids = ids + l.require(linkedAccountsListRequestFieldIds) +} + +// SetIncludeDuplicates sets the IncludeDuplicates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIncludeDuplicates(includeDuplicates *bool) { + l.IncludeDuplicates = includeDuplicates + l.require(linkedAccountsListRequestFieldIncludeDuplicates) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkedAccountsListRequestFieldIntegrationName) +} + +// SetIsTestAccount sets the IsTestAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIsTestAccount(isTestAccount *string) { + l.IsTestAccount = isTestAccount + l.require(linkedAccountsListRequestFieldIsTestAccount) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetPageSize(pageSize *int) { + l.PageSize = pageSize + l.require(linkedAccountsListRequestFieldPageSize) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetStatus(status *string) { + l.Status = status + l.require(linkedAccountsListRequestFieldStatus) } type LinkedAccountsListRequestCategory string @@ -88,6 +206,22 @@ func (l LinkedAccountsListRequestCategory) Ptr() *LinkedAccountsListRequestCateg // // ### Usage Example // View a list of your organization's `LinkedAccount` objects. +var ( + accountDetailsAndActionsFieldId = big.NewInt(1 << 0) + accountDetailsAndActionsFieldCategory = big.NewInt(1 << 1) + accountDetailsAndActionsFieldStatus = big.NewInt(1 << 2) + accountDetailsAndActionsFieldStatusDetail = big.NewInt(1 << 3) + accountDetailsAndActionsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsAndActionsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsAndActionsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsAndActionsFieldSubdomain = big.NewInt(1 << 7) + accountDetailsAndActionsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsAndActionsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsAndActionsFieldIntegration = big.NewInt(1 << 10) + accountDetailsAndActionsFieldAccountType = big.NewInt(1 << 11) + accountDetailsAndActionsFieldCompletedAt = big.NewInt(1 << 12) +) + type AccountDetailsAndActions struct { Id string `json:"id" url:"id"` Category *AccountDetailsAndActionsCategory `json:"category,omitempty" url:"category,omitempty"` @@ -105,6 +239,9 @@ type AccountDetailsAndActions struct { AccountType string `json:"account_type" url:"account_type"` CompletedAt time.Time `json:"completed_at" url:"completed_at"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -204,6 +341,104 @@ func (a *AccountDetailsAndActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetailsAndActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetId(id string) { + a.Id = id + a.require(accountDetailsAndActionsFieldId) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCategory(category *AccountDetailsAndActionsCategory) { + a.Category = category + a.require(accountDetailsAndActionsFieldCategory) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatus(status *AccountDetailsAndActionsStatus) { + a.Status = status + a.require(accountDetailsAndActionsFieldStatus) +} + +// SetStatusDetail sets the StatusDetail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatusDetail(statusDetail *string) { + a.StatusDetail = statusDetail + a.require(accountDetailsAndActionsFieldStatusDetail) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsAndActionsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOrganizationName(endUserOrganizationName string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsAndActionsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserEmailAddress(endUserEmailAddress string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsAndActionsFieldEndUserEmailAddress) +} + +// SetSubdomain sets the Subdomain field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetSubdomain(subdomain *string) { + a.Subdomain = subdomain + a.require(accountDetailsAndActionsFieldSubdomain) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetWebhookListenerUrl(webhookListenerUrl string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsAndActionsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsAndActionsFieldIsDuplicate) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIntegration(integration *AccountDetailsAndActionsIntegration) { + a.Integration = integration + a.require(accountDetailsAndActionsFieldIntegration) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetAccountType(accountType string) { + a.AccountType = accountType + a.require(accountDetailsAndActionsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCompletedAt(completedAt time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsAndActionsFieldCompletedAt) +} + func (a *AccountDetailsAndActions) UnmarshalJSON(data []byte) error { type embed AccountDetailsAndActions var unmarshaler = struct { @@ -235,7 +470,8 @@ func (a *AccountDetailsAndActions) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetailsAndActions) String() string { @@ -312,6 +548,17 @@ func (a *AccountDetailsAndActionsCategory) Accept(visitor AccountDetailsAndActio return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + accountDetailsAndActionsIntegrationFieldName = big.NewInt(1 << 0) + accountDetailsAndActionsIntegrationFieldCategories = big.NewInt(1 << 1) + accountDetailsAndActionsIntegrationFieldImage = big.NewInt(1 << 2) + accountDetailsAndActionsIntegrationFieldSquareImage = big.NewInt(1 << 3) + accountDetailsAndActionsIntegrationFieldColor = big.NewInt(1 << 4) + accountDetailsAndActionsIntegrationFieldSlug = big.NewInt(1 << 5) + accountDetailsAndActionsIntegrationFieldPassthroughAvailable = big.NewInt(1 << 6) + accountDetailsAndActionsIntegrationFieldAvailableModelOperations = big.NewInt(1 << 7) +) + type AccountDetailsAndActionsIntegration struct { Name string `json:"name" url:"name"` Categories []CategoriesEnum `json:"categories" url:"categories"` @@ -322,6 +569,9 @@ type AccountDetailsAndActionsIntegration struct { PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -386,6 +636,69 @@ func (a *AccountDetailsAndActionsIntegration) GetExtraProperties() map[string]in return a.extraProperties } +func (a *AccountDetailsAndActionsIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetName(name string) { + a.Name = name + a.require(accountDetailsAndActionsIntegrationFieldName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountDetailsAndActionsIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetImage(image *string) { + a.Image = image + a.require(accountDetailsAndActionsIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountDetailsAndActionsIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetColor(color string) { + a.Color = color + a.require(accountDetailsAndActionsIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSlug(slug string) { + a.Slug = slug + a.require(accountDetailsAndActionsIntegrationFieldSlug) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(accountDetailsAndActionsIntegrationFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(accountDetailsAndActionsIntegrationFieldAvailableModelOperations) +} + func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountDetailsAndActionsIntegration var value unmarshaler @@ -402,6 +715,17 @@ func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountDetailsAndActionsIntegration) MarshalJSON() ([]byte, error) { + type embed AccountDetailsAndActionsIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountDetailsAndActionsIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -508,11 +832,20 @@ func (a AccountDetailsAndActionsStatusEnum) Ptr() *AccountDetailsAndActionsStatu return &a } +var ( + paginatedAccountDetailsAndActionsListFieldNext = big.NewInt(1 << 0) + paginatedAccountDetailsAndActionsListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountDetailsAndActionsListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AccountDetailsAndActions `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -542,6 +875,34 @@ func (p *PaginatedAccountDetailsAndActionsList) GetExtraProperties() map[string] return p.extraProperties } +func (p *PaginatedAccountDetailsAndActionsList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountDetailsAndActionsListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountDetailsAndActionsListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetResults(results []*AccountDetailsAndActions) { + p.Results = results + p.require(paginatedAccountDetailsAndActionsListFieldResults) +} + func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountDetailsAndActionsList var value unmarshaler @@ -558,6 +919,17 @@ func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error return nil } +func (p *PaginatedAccountDetailsAndActionsList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountDetailsAndActionsList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountDetailsAndActionsList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/linkedaccounts/client.go b/crm/linkedaccounts/client.go index f76504c..c7666d1 100644 --- a/crm/linkedaccounts/client.go +++ b/crm/linkedaccounts/client.go @@ -4,7 +4,6 @@ package linkedaccounts import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.LinkedAccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.AccountDetailsAndActions], error) { +) (*core.Page[*string, *crm.AccountDetailsAndActions], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedAccountDetailsAndActionsList) *internal.PageResponse[*string, *crm.AccountDetailsAndActions] { + readPageResponse := func(response *crm.PaginatedAccountDetailsAndActionsList) *core.PageResponse[*string, *crm.AccountDetailsAndActions] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.AccountDetailsAndActions]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.AccountDetailsAndActions]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/linkedaccounts/crm_linked_accounts_test/crm_linked_accounts_test.go b/crm/linkedaccounts/crm_linked_accounts_test/crm_linked_accounts_test.go new file mode 100644 index 0000000..d8aac2c --- /dev/null +++ b/crm/linkedaccounts/crm_linked_accounts_test/crm_linked_accounts_test.go @@ -0,0 +1,121 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_linked_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmLinkedAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.LinkedAccountsListRequest{ + Category: crm.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } + _, invocationErr := client.Crm.LinkedAccounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/linked-accounts", map[string]string{"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"}, 1) +} diff --git a/crm/linkedaccounts/raw_client.go b/crm/linkedaccounts/raw_client.go new file mode 100644 index 0000000..cb54205 --- /dev/null +++ b/crm/linkedaccounts/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package linkedaccounts + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/crm/linktoken/client.go b/crm/linktoken/client.go index 1694856..a17b44e 100644 --- a/crm/linktoken/client.go +++ b/crm/linktoken/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *crm.EndUserDetailsRequest, opts ...option.RequestOption, ) (*crm.LinkToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/link-token" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.LinkToken - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/linktoken/crm_link_token_test/crm_link_token_test.go b/crm/linktoken/crm_link_token_test/crm_link_token_test.go new file mode 100644 index 0000000..f105b40 --- /dev/null +++ b/crm/linktoken/crm_link_token_test/crm_link_token_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_link_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmLinkTokenCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []crm.CategoriesEnum{ + crm.CategoriesEnumHris, + crm.CategoriesEnumAts, + }, + } + _, invocationErr := client.Crm.LinkToken.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/link-token", nil, 1) +} diff --git a/crm/linktoken/raw_client.go b/crm/linktoken/raw_client.go new file mode 100644 index 0000000..6b958fb --- /dev/null +++ b/crm/linktoken/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package linktoken + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.EndUserDetailsRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.LinkToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/link-token" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.LinkToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.LinkToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/notes.go b/crm/notes.go index 45dd507..c4b4148 100644 --- a/crm/notes.go +++ b/crm/notes.go @@ -6,17 +6,74 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + noteEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + noteEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + noteEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type NoteEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *NoteRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (n *NoteEndpointRequest) require(field *big.Int) { + if n.explicitFields == nil { + n.explicitFields = big.NewInt(0) + } + n.explicitFields.Or(n.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + n.IsDebugMode = isDebugMode + n.require(noteEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteEndpointRequest) SetRunAsync(runAsync *bool) { + n.RunAsync = runAsync + n.require(noteEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteEndpointRequest) SetModel(model *NoteRequest) { + n.Model = model + n.require(noteEndpointRequestFieldModel) } +var ( + notesListRequestFieldAccountId = big.NewInt(1 << 0) + notesListRequestFieldContactId = big.NewInt(1 << 1) + notesListRequestFieldCreatedAfter = big.NewInt(1 << 2) + notesListRequestFieldCreatedBefore = big.NewInt(1 << 3) + notesListRequestFieldCursor = big.NewInt(1 << 4) + notesListRequestFieldExpand = big.NewInt(1 << 5) + notesListRequestFieldIncludeDeletedData = big.NewInt(1 << 6) + notesListRequestFieldIncludeRemoteData = big.NewInt(1 << 7) + notesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 8) + notesListRequestFieldIncludeShellData = big.NewInt(1 << 9) + notesListRequestFieldModifiedAfter = big.NewInt(1 << 10) + notesListRequestFieldModifiedBefore = big.NewInt(1 << 11) + notesListRequestFieldOpportunityId = big.NewInt(1 << 12) + notesListRequestFieldOwnerId = big.NewInt(1 << 13) + notesListRequestFieldPageSize = big.NewInt(1 << 14) + notesListRequestFieldRemoteId = big.NewInt(1 << 15) +) + type NotesListRequest struct { // If provided, will only return notes with this account. AccountId *string `json:"-" url:"account_id,omitempty"` @@ -50,8 +107,141 @@ type NotesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (n *NotesListRequest) require(field *big.Int) { + if n.explicitFields == nil { + n.explicitFields = big.NewInt(0) + } + n.explicitFields.Or(n.explicitFields, field) +} + +// SetAccountId sets the AccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetAccountId(accountId *string) { + n.AccountId = accountId + n.require(notesListRequestFieldAccountId) +} + +// SetContactId sets the ContactId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetContactId(contactId *string) { + n.ContactId = contactId + n.require(notesListRequestFieldContactId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetCreatedAfter(createdAfter *time.Time) { + n.CreatedAfter = createdAfter + n.require(notesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetCreatedBefore(createdBefore *time.Time) { + n.CreatedBefore = createdBefore + n.require(notesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetCursor(cursor *string) { + n.Cursor = cursor + n.require(notesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetExpand(expand []*NotesListRequestExpandItem) { + n.Expand = expand + n.require(notesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + n.IncludeDeletedData = includeDeletedData + n.require(notesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + n.IncludeRemoteData = includeRemoteData + n.require(notesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + n.IncludeRemoteFields = includeRemoteFields + n.require(notesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetIncludeShellData(includeShellData *bool) { + n.IncludeShellData = includeShellData + n.require(notesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + n.ModifiedAfter = modifiedAfter + n.require(notesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + n.ModifiedBefore = modifiedBefore + n.require(notesListRequestFieldModifiedBefore) +} + +// SetOpportunityId sets the OpportunityId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetOpportunityId(opportunityId *string) { + n.OpportunityId = opportunityId + n.require(notesListRequestFieldOpportunityId) +} + +// SetOwnerId sets the OwnerId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetOwnerId(ownerId *string) { + n.OwnerId = ownerId + n.require(notesListRequestFieldOwnerId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetPageSize(pageSize *int) { + n.PageSize = pageSize + n.require(notesListRequestFieldPageSize) } +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesListRequest) SetRemoteId(remoteId *string) { + n.RemoteId = remoteId + n.require(notesListRequestFieldRemoteId) +} + +var ( + notesRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + notesRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + notesRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + notesRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + notesRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + notesRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + notesRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + notesRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type NotesRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -69,8 +259,81 @@ type NotesRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (n *NotesRemoteFieldClassesListRequest) require(field *big.Int) { + if n.explicitFields == nil { + n.explicitFields = big.NewInt(0) + } + n.explicitFields.Or(n.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRemoteFieldClassesListRequest) SetCursor(cursor *string) { + n.Cursor = cursor + n.require(notesRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + n.IncludeDeletedData = includeDeletedData + n.require(notesRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + n.IncludeRemoteData = includeRemoteData + n.require(notesRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + n.IncludeRemoteFields = includeRemoteFields + n.require(notesRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + n.IncludeShellData = includeShellData + n.require(notesRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + n.IsCommonModelField = isCommonModelField + n.require(notesRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + n.IsCustom = isCustom + n.require(notesRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + n.PageSize = pageSize + n.require(notesRemoteFieldClassesListRequestFieldPageSize) } +var ( + notesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + notesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + notesRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + notesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) +) + type NotesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*NotesRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -80,6 +343,44 @@ type NotesRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (n *NotesRetrieveRequest) require(field *big.Int) { + if n.explicitFields == nil { + n.explicitFields = big.NewInt(0) + } + n.explicitFields.Or(n.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRetrieveRequest) SetExpand(expand []*NotesRetrieveRequestExpandItem) { + n.Expand = expand + n.require(notesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + n.IncludeRemoteData = includeRemoteData + n.require(notesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + n.IncludeRemoteFields = includeRemoteFields + n.require(notesRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NotesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + n.IncludeShellData = includeShellData + n.require(notesRetrieveRequestFieldIncludeShellData) } type NotesListRequestExpandItem string @@ -143,6 +444,24 @@ func (n NotesRetrieveRequestExpandItem) Ptr() *NotesRetrieveRequestExpandItem { // The `Note` object is used to represent a note on another object. // ### Usage Example // TODO +var ( + noteFieldId = big.NewInt(1 << 0) + noteFieldRemoteId = big.NewInt(1 << 1) + noteFieldCreatedAt = big.NewInt(1 << 2) + noteFieldModifiedAt = big.NewInt(1 << 3) + noteFieldOwner = big.NewInt(1 << 4) + noteFieldContent = big.NewInt(1 << 5) + noteFieldContact = big.NewInt(1 << 6) + noteFieldAccount = big.NewInt(1 << 7) + noteFieldOpportunity = big.NewInt(1 << 8) + noteFieldRemoteUpdatedAt = big.NewInt(1 << 9) + noteFieldRemoteCreatedAt = big.NewInt(1 << 10) + noteFieldRemoteWasDeleted = big.NewInt(1 << 11) + noteFieldFieldMappings = big.NewInt(1 << 12) + noteFieldRemoteData = big.NewInt(1 << 13) + noteFieldRemoteFields = big.NewInt(1 << 14) +) + type Note struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -171,6 +490,9 @@ type Note struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -284,6 +606,118 @@ func (n *Note) GetExtraProperties() map[string]interface{} { return n.extraProperties } +func (n *Note) require(field *big.Int) { + if n.explicitFields == nil { + n.explicitFields = big.NewInt(0) + } + n.explicitFields.Or(n.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetId(id *string) { + n.Id = id + n.require(noteFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetRemoteId(remoteId *string) { + n.RemoteId = remoteId + n.require(noteFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetCreatedAt(createdAt *time.Time) { + n.CreatedAt = createdAt + n.require(noteFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetModifiedAt(modifiedAt *time.Time) { + n.ModifiedAt = modifiedAt + n.require(noteFieldModifiedAt) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetOwner(owner *NoteOwner) { + n.Owner = owner + n.require(noteFieldOwner) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetContent(content *string) { + n.Content = content + n.require(noteFieldContent) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetContact(contact *NoteContact) { + n.Contact = contact + n.require(noteFieldContact) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetAccount(account *NoteAccount) { + n.Account = account + n.require(noteFieldAccount) +} + +// SetOpportunity sets the Opportunity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetOpportunity(opportunity *NoteOpportunity) { + n.Opportunity = opportunity + n.require(noteFieldOpportunity) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + n.RemoteUpdatedAt = remoteUpdatedAt + n.require(noteFieldRemoteUpdatedAt) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + n.RemoteCreatedAt = remoteCreatedAt + n.require(noteFieldRemoteCreatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetRemoteWasDeleted(remoteWasDeleted *bool) { + n.RemoteWasDeleted = remoteWasDeleted + n.require(noteFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetFieldMappings(fieldMappings map[string]interface{}) { + n.FieldMappings = fieldMappings + n.require(noteFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetRemoteData(remoteData []*RemoteData) { + n.RemoteData = remoteData + n.require(noteFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *Note) SetRemoteFields(remoteFields []*RemoteField) { + n.RemoteFields = remoteFields + n.require(noteFieldRemoteFields) +} + func (n *Note) UnmarshalJSON(data []byte) error { type embed Note var unmarshaler = struct { @@ -327,7 +761,8 @@ func (n *Note) MarshalJSON() ([]byte, error) { RemoteUpdatedAt: internal.NewOptionalDateTime(n.RemoteUpdatedAt), RemoteCreatedAt: internal.NewOptionalDateTime(n.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, n.explicitFields) + return json.Marshal(explicitMarshaler) } func (n *Note) String() string { @@ -599,6 +1034,17 @@ func (n *NoteOwner) Accept(visitor NoteOwnerVisitor) error { // The `Note` object is used to represent a note on another object. // ### Usage Example // TODO +var ( + noteRequestFieldOwner = big.NewInt(1 << 0) + noteRequestFieldContent = big.NewInt(1 << 1) + noteRequestFieldContact = big.NewInt(1 << 2) + noteRequestFieldAccount = big.NewInt(1 << 3) + noteRequestFieldOpportunity = big.NewInt(1 << 4) + noteRequestFieldIntegrationParams = big.NewInt(1 << 5) + noteRequestFieldLinkedAccountParams = big.NewInt(1 << 6) + noteRequestFieldRemoteFields = big.NewInt(1 << 7) +) + type NoteRequest struct { // The note's owner. Owner *NoteRequestOwner `json:"owner,omitempty" url:"owner,omitempty"` @@ -614,6 +1060,9 @@ type NoteRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -678,6 +1127,69 @@ func (n *NoteRequest) GetExtraProperties() map[string]interface{} { return n.extraProperties } +func (n *NoteRequest) require(field *big.Int) { + if n.explicitFields == nil { + n.explicitFields = big.NewInt(0) + } + n.explicitFields.Or(n.explicitFields, field) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteRequest) SetOwner(owner *NoteRequestOwner) { + n.Owner = owner + n.require(noteRequestFieldOwner) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteRequest) SetContent(content *string) { + n.Content = content + n.require(noteRequestFieldContent) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteRequest) SetContact(contact *NoteRequestContact) { + n.Contact = contact + n.require(noteRequestFieldContact) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteRequest) SetAccount(account *NoteRequestAccount) { + n.Account = account + n.require(noteRequestFieldAccount) +} + +// SetOpportunity sets the Opportunity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteRequest) SetOpportunity(opportunity *NoteRequestOpportunity) { + n.Opportunity = opportunity + n.require(noteRequestFieldOpportunity) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + n.IntegrationParams = integrationParams + n.require(noteRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + n.LinkedAccountParams = linkedAccountParams + n.require(noteRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + n.RemoteFields = remoteFields + n.require(noteRequestFieldRemoteFields) +} + func (n *NoteRequest) UnmarshalJSON(data []byte) error { type unmarshaler NoteRequest var value unmarshaler @@ -694,6 +1206,17 @@ func (n *NoteRequest) UnmarshalJSON(data []byte) error { return nil } +func (n *NoteRequest) MarshalJSON() ([]byte, error) { + type embed NoteRequest + var marshaler = struct { + embed + }{ + embed: embed(*n), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, n.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (n *NoteRequest) String() string { if len(n.rawJSON) > 0 { if value, err := internal.StringifyJSON(n.rawJSON); err == nil { @@ -958,12 +1481,22 @@ func (n *NoteRequestOwner) Accept(visitor NoteRequestOwnerVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", n) } +var ( + noteResponseFieldModel = big.NewInt(1 << 0) + noteResponseFieldWarnings = big.NewInt(1 << 1) + noteResponseFieldErrors = big.NewInt(1 << 2) + noteResponseFieldLogs = big.NewInt(1 << 3) +) + type NoteResponse struct { Model *Note `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1000,6 +1533,41 @@ func (n *NoteResponse) GetExtraProperties() map[string]interface{} { return n.extraProperties } +func (n *NoteResponse) require(field *big.Int) { + if n.explicitFields == nil { + n.explicitFields = big.NewInt(0) + } + n.explicitFields.Or(n.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteResponse) SetModel(model *Note) { + n.Model = model + n.require(noteResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteResponse) SetWarnings(warnings []*WarningValidationProblem) { + n.Warnings = warnings + n.require(noteResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteResponse) SetErrors(errors []*ErrorValidationProblem) { + n.Errors = errors + n.require(noteResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (n *NoteResponse) SetLogs(logs []*DebugModeLog) { + n.Logs = logs + n.require(noteResponseFieldLogs) +} + func (n *NoteResponse) UnmarshalJSON(data []byte) error { type unmarshaler NoteResponse var value unmarshaler @@ -1016,6 +1584,17 @@ func (n *NoteResponse) UnmarshalJSON(data []byte) error { return nil } +func (n *NoteResponse) MarshalJSON() ([]byte, error) { + type embed NoteResponse + var marshaler = struct { + embed + }{ + embed: embed(*n), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, n.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (n *NoteResponse) String() string { if len(n.rawJSON) > 0 { if value, err := internal.StringifyJSON(n.rawJSON); err == nil { @@ -1028,11 +1607,20 @@ func (n *NoteResponse) String() string { return fmt.Sprintf("%#v", n) } +var ( + paginatedNoteListFieldNext = big.NewInt(1 << 0) + paginatedNoteListFieldPrevious = big.NewInt(1 << 1) + paginatedNoteListFieldResults = big.NewInt(1 << 2) +) + type PaginatedNoteList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Note `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1062,6 +1650,34 @@ func (p *PaginatedNoteList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedNoteList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedNoteList) SetNext(next *string) { + p.Next = next + p.require(paginatedNoteListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedNoteList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedNoteListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedNoteList) SetResults(results []*Note) { + p.Results = results + p.require(paginatedNoteListFieldResults) +} + func (p *PaginatedNoteList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedNoteList var value unmarshaler @@ -1078,6 +1694,17 @@ func (p *PaginatedNoteList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedNoteList) MarshalJSON() ([]byte, error) { + type embed PaginatedNoteList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedNoteList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/notes/client.go b/crm/notes/client.go index 841ac9b..f85fcbf 100644 --- a/crm/notes/client.go +++ b/crm/notes/client.go @@ -4,7 +4,6 @@ package notes import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.NotesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Note], error) { +) (*core.Page[*string, *crm.Note], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedNoteList) *internal.PageResponse[*string, *crm.Note] { + readPageResponse := func(response *crm.PaginatedNoteList) *core.PageResponse[*string, *crm.Note] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Note]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Note]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *crm.NoteEndpointRequest, opts ...option.RequestOption, ) (*crm.NoteResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/notes" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.NoteResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Note` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *crm.NotesRetrieveRequest, opts ...option.RequestOption, ) (*crm.Note, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/notes/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Note - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Note` POSTs. @@ -190,35 +132,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/notes/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -226,7 +147,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.NotesRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -239,13 +160,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -262,11 +182,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/notes/crm_notes_test/crm_notes_test.go b/crm/notes/crm_notes_test/crm_notes_test.go new file mode 100644 index 0000000..11479d7 --- /dev/null +++ b/crm/notes/crm_notes_test/crm_notes_test.go @@ -0,0 +1,259 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_notes_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmNotesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.NotesListRequest{ + AccountId: merge.String( + "account_id", + ), + ContactId: merge.String( + "contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OpportunityId: merge.String( + "opportunity_id", + ), + OwnerId: merge.String( + "owner_id", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.Notes.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/notes", map[string]string{"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"}, 1) +} + +func TestCrmNotesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.NoteEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.NoteRequest{}, + } + _, invocationErr := client.Crm.Notes.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/notes", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmNotesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.NotesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Notes.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/notes/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmNotesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Notes.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/notes/meta/post", nil, 1) +} + +func TestCrmNotesRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.NotesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.Notes.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/notes/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/notes/raw_client.go b/crm/notes/raw_client.go new file mode 100644 index 0000000..1c048f1 --- /dev/null +++ b/crm/notes/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package notes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.NoteEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.NoteResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/notes" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.NoteResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.NoteResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.NotesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.Note], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/notes/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Note + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Note]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/notes/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/opportunities.go b/crm/opportunities.go index 3761a83..baeea42 100644 --- a/crm/opportunities.go +++ b/crm/opportunities.go @@ -6,16 +6,76 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + opportunityEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + opportunityEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + opportunityEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type OpportunityEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *OpportunityRequest `json:"model,omitempty" url:"-"` -} + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (o *OpportunityEndpointRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + o.IsDebugMode = isDebugMode + o.require(opportunityEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityEndpointRequest) SetRunAsync(runAsync *bool) { + o.RunAsync = runAsync + o.require(opportunityEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityEndpointRequest) SetModel(model *OpportunityRequest) { + o.Model = model + o.require(opportunityEndpointRequestFieldModel) +} + +var ( + opportunitiesListRequestFieldAccountId = big.NewInt(1 << 0) + opportunitiesListRequestFieldCreatedAfter = big.NewInt(1 << 1) + opportunitiesListRequestFieldCreatedBefore = big.NewInt(1 << 2) + opportunitiesListRequestFieldCursor = big.NewInt(1 << 3) + opportunitiesListRequestFieldExpand = big.NewInt(1 << 4) + opportunitiesListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + opportunitiesListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + opportunitiesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 7) + opportunitiesListRequestFieldIncludeShellData = big.NewInt(1 << 8) + opportunitiesListRequestFieldModifiedAfter = big.NewInt(1 << 9) + opportunitiesListRequestFieldModifiedBefore = big.NewInt(1 << 10) + opportunitiesListRequestFieldOwnerId = big.NewInt(1 << 11) + opportunitiesListRequestFieldPageSize = big.NewInt(1 << 12) + opportunitiesListRequestFieldRemoteCreatedAfter = big.NewInt(1 << 13) + opportunitiesListRequestFieldRemoteFields = big.NewInt(1 << 14) + opportunitiesListRequestFieldRemoteId = big.NewInt(1 << 15) + opportunitiesListRequestFieldShowEnumOrigins = big.NewInt(1 << 16) + opportunitiesListRequestFieldStageId = big.NewInt(1 << 17) + opportunitiesListRequestFieldStatus = big.NewInt(1 << 18) +) type OpportunitiesListRequest struct { // If provided, will only return opportunities with this account. @@ -60,16 +120,207 @@ type OpportunitiesListRequest struct { // * `WON` - WON // * `LOST` - LOST Status *OpportunitiesListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (o *OpportunitiesListRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetAccountId sets the AccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetAccountId(accountId *string) { + o.AccountId = accountId + o.require(opportunitiesListRequestFieldAccountId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetCreatedAfter(createdAfter *time.Time) { + o.CreatedAfter = createdAfter + o.require(opportunitiesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetCreatedBefore(createdBefore *time.Time) { + o.CreatedBefore = createdBefore + o.require(opportunitiesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetCursor(cursor *string) { + o.Cursor = cursor + o.require(opportunitiesListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetExpand(expand []*OpportunitiesListRequestExpandItem) { + o.Expand = expand + o.require(opportunitiesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + o.IncludeDeletedData = includeDeletedData + o.require(opportunitiesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + o.IncludeRemoteData = includeRemoteData + o.require(opportunitiesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + o.IncludeRemoteFields = includeRemoteFields + o.require(opportunitiesListRequestFieldIncludeRemoteFields) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetIncludeShellData(includeShellData *bool) { + o.IncludeShellData = includeShellData + o.require(opportunitiesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + o.ModifiedAfter = modifiedAfter + o.require(opportunitiesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + o.ModifiedBefore = modifiedBefore + o.require(opportunitiesListRequestFieldModifiedBefore) +} + +// SetOwnerId sets the OwnerId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetOwnerId(ownerId *string) { + o.OwnerId = ownerId + o.require(opportunitiesListRequestFieldOwnerId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetPageSize(pageSize *int) { + o.PageSize = pageSize + o.require(opportunitiesListRequestFieldPageSize) +} + +// SetRemoteCreatedAfter sets the RemoteCreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetRemoteCreatedAfter(remoteCreatedAfter *time.Time) { + o.RemoteCreatedAfter = remoteCreatedAfter + o.require(opportunitiesListRequestFieldRemoteCreatedAfter) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetRemoteFields(remoteFields *string) { + o.RemoteFields = remoteFields + o.require(opportunitiesListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetRemoteId(remoteId *string) { + o.RemoteId = remoteId + o.require(opportunitiesListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + o.ShowEnumOrigins = showEnumOrigins + o.require(opportunitiesListRequestFieldShowEnumOrigins) +} + +// SetStageId sets the StageId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetStageId(stageId *string) { + o.StageId = stageId + o.require(opportunitiesListRequestFieldStageId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesListRequest) SetStatus(status *OpportunitiesListRequestStatus) { + o.Status = status + o.require(opportunitiesListRequestFieldStatus) +} + +var ( + patchedOpportunityEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedOpportunityEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedOpportunityEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PatchedOpportunityEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PatchedOpportunityRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (p *PatchedOpportunityEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedOpportunityEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedOpportunityEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityEndpointRequest) SetModel(model *PatchedOpportunityRequest) { + p.Model = model + p.require(patchedOpportunityEndpointRequestFieldModel) +} + +var ( + opportunitiesRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + opportunitiesRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + opportunitiesRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + opportunitiesRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + opportunitiesRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + opportunitiesRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + opportunitiesRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + opportunitiesRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type OpportunitiesRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -87,8 +338,83 @@ type OpportunitiesRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (o *OpportunitiesRemoteFieldClassesListRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRemoteFieldClassesListRequest) SetCursor(cursor *string) { + o.Cursor = cursor + o.require(opportunitiesRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + o.IncludeDeletedData = includeDeletedData + o.require(opportunitiesRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + o.IncludeRemoteData = includeRemoteData + o.require(opportunitiesRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + o.IncludeRemoteFields = includeRemoteFields + o.require(opportunitiesRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + o.IncludeShellData = includeShellData + o.require(opportunitiesRemoteFieldClassesListRequestFieldIncludeShellData) } +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + o.IsCommonModelField = isCommonModelField + o.require(opportunitiesRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + o.IsCustom = isCustom + o.require(opportunitiesRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + o.PageSize = pageSize + o.require(opportunitiesRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + opportunitiesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + opportunitiesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + opportunitiesRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + opportunitiesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) + opportunitiesRetrieveRequestFieldRemoteFields = big.NewInt(1 << 4) + opportunitiesRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 5) +) + type OpportunitiesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*OpportunitiesRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -102,6 +428,58 @@ type OpportunitiesRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (o *OpportunitiesRetrieveRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRetrieveRequest) SetExpand(expand []*OpportunitiesRetrieveRequestExpandItem) { + o.Expand = expand + o.require(opportunitiesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + o.IncludeRemoteData = includeRemoteData + o.require(opportunitiesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + o.IncludeRemoteFields = includeRemoteFields + o.require(opportunitiesRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + o.IncludeShellData = includeShellData + o.require(opportunitiesRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRetrieveRequest) SetRemoteFields(remoteFields *string) { + o.RemoteFields = remoteFields + o.require(opportunitiesRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunitiesRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + o.ShowEnumOrigins = showEnumOrigins + o.require(opportunitiesRetrieveRequestFieldShowEnumOrigins) } type OpportunitiesListRequestExpandItem string @@ -184,6 +562,21 @@ func (o OpportunitiesRetrieveRequestExpandItem) Ptr() *OpportunitiesRetrieveRequ // The `Opportunity` object is used to represent a deal opportunity in a CRM system. // ### Usage Example // TODO +var ( + opportunityRequestFieldName = big.NewInt(1 << 0) + opportunityRequestFieldDescription = big.NewInt(1 << 1) + opportunityRequestFieldAmount = big.NewInt(1 << 2) + opportunityRequestFieldOwner = big.NewInt(1 << 3) + opportunityRequestFieldAccount = big.NewInt(1 << 4) + opportunityRequestFieldStage = big.NewInt(1 << 5) + opportunityRequestFieldStatus = big.NewInt(1 << 6) + opportunityRequestFieldLastActivityAt = big.NewInt(1 << 7) + opportunityRequestFieldCloseDate = big.NewInt(1 << 8) + opportunityRequestFieldIntegrationParams = big.NewInt(1 << 9) + opportunityRequestFieldLinkedAccountParams = big.NewInt(1 << 10) + opportunityRequestFieldRemoteFields = big.NewInt(1 << 11) +) + type OpportunityRequest struct { // The opportunity's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -211,6 +604,9 @@ type OpportunityRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -303,6 +699,97 @@ func (o *OpportunityRequest) GetExtraProperties() map[string]interface{} { return o.extraProperties } +func (o *OpportunityRequest) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetName(name *string) { + o.Name = name + o.require(opportunityRequestFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetDescription(description *string) { + o.Description = description + o.require(opportunityRequestFieldDescription) +} + +// SetAmount sets the Amount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetAmount(amount *int) { + o.Amount = amount + o.require(opportunityRequestFieldAmount) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetOwner(owner *OpportunityRequestOwner) { + o.Owner = owner + o.require(opportunityRequestFieldOwner) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetAccount(account *OpportunityRequestAccount) { + o.Account = account + o.require(opportunityRequestFieldAccount) +} + +// SetStage sets the Stage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetStage(stage *OpportunityRequestStage) { + o.Stage = stage + o.require(opportunityRequestFieldStage) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetStatus(status *OpportunityRequestStatus) { + o.Status = status + o.require(opportunityRequestFieldStatus) +} + +// SetLastActivityAt sets the LastActivityAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetLastActivityAt(lastActivityAt *time.Time) { + o.LastActivityAt = lastActivityAt + o.require(opportunityRequestFieldLastActivityAt) +} + +// SetCloseDate sets the CloseDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetCloseDate(closeDate *time.Time) { + o.CloseDate = closeDate + o.require(opportunityRequestFieldCloseDate) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + o.IntegrationParams = integrationParams + o.require(opportunityRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + o.LinkedAccountParams = linkedAccountParams + o.require(opportunityRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + o.RemoteFields = remoteFields + o.require(opportunityRequestFieldRemoteFields) +} + func (o *OpportunityRequest) UnmarshalJSON(data []byte) error { type embed OpportunityRequest var unmarshaler = struct { @@ -338,7 +825,8 @@ func (o *OpportunityRequest) MarshalJSON() ([]byte, error) { LastActivityAt: internal.NewOptionalDateTime(o.LastActivityAt), CloseDate: internal.NewOptionalDateTime(o.CloseDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields) + return json.Marshal(explicitMarshaler) } func (o *OpportunityRequest) String() string { @@ -609,12 +1097,22 @@ func (o *OpportunityRequestStatus) Accept(visitor OpportunityRequestStatusVisito return fmt.Errorf("type %T does not include a non-empty union type", o) } +var ( + opportunityResponseFieldModel = big.NewInt(1 << 0) + opportunityResponseFieldWarnings = big.NewInt(1 << 1) + opportunityResponseFieldErrors = big.NewInt(1 << 2) + opportunityResponseFieldLogs = big.NewInt(1 << 3) +) + type OpportunityResponse struct { Model *Opportunity `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -651,6 +1149,41 @@ func (o *OpportunityResponse) GetExtraProperties() map[string]interface{} { return o.extraProperties } +func (o *OpportunityResponse) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityResponse) SetModel(model *Opportunity) { + o.Model = model + o.require(opportunityResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityResponse) SetWarnings(warnings []*WarningValidationProblem) { + o.Warnings = warnings + o.require(opportunityResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityResponse) SetErrors(errors []*ErrorValidationProblem) { + o.Errors = errors + o.require(opportunityResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OpportunityResponse) SetLogs(logs []*DebugModeLog) { + o.Logs = logs + o.require(opportunityResponseFieldLogs) +} + func (o *OpportunityResponse) UnmarshalJSON(data []byte) error { type unmarshaler OpportunityResponse var value unmarshaler @@ -667,6 +1200,17 @@ func (o *OpportunityResponse) UnmarshalJSON(data []byte) error { return nil } +func (o *OpportunityResponse) MarshalJSON() ([]byte, error) { + type embed OpportunityResponse + var marshaler = struct { + embed + }{ + embed: embed(*o), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (o *OpportunityResponse) String() string { if len(o.rawJSON) > 0 { if value, err := internal.StringifyJSON(o.rawJSON); err == nil { @@ -679,11 +1223,20 @@ func (o *OpportunityResponse) String() string { return fmt.Sprintf("%#v", o) } +var ( + paginatedOpportunityListFieldNext = big.NewInt(1 << 0) + paginatedOpportunityListFieldPrevious = big.NewInt(1 << 1) + paginatedOpportunityListFieldResults = big.NewInt(1 << 2) +) + type PaginatedOpportunityList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Opportunity `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -713,6 +1266,34 @@ func (p *PaginatedOpportunityList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedOpportunityList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedOpportunityList) SetNext(next *string) { + p.Next = next + p.require(paginatedOpportunityListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedOpportunityList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedOpportunityListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedOpportunityList) SetResults(results []*Opportunity) { + p.Results = results + p.require(paginatedOpportunityListFieldResults) +} + func (p *PaginatedOpportunityList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedOpportunityList var value unmarshaler @@ -729,6 +1310,17 @@ func (p *PaginatedOpportunityList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedOpportunityList) MarshalJSON() ([]byte, error) { + type embed PaginatedOpportunityList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedOpportunityList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -746,6 +1338,21 @@ func (p *PaginatedOpportunityList) String() string { // The `Opportunity` object is used to represent a deal opportunity in a CRM system. // ### Usage Example // TODO +var ( + patchedOpportunityRequestFieldName = big.NewInt(1 << 0) + patchedOpportunityRequestFieldDescription = big.NewInt(1 << 1) + patchedOpportunityRequestFieldAmount = big.NewInt(1 << 2) + patchedOpportunityRequestFieldOwner = big.NewInt(1 << 3) + patchedOpportunityRequestFieldAccount = big.NewInt(1 << 4) + patchedOpportunityRequestFieldStage = big.NewInt(1 << 5) + patchedOpportunityRequestFieldStatus = big.NewInt(1 << 6) + patchedOpportunityRequestFieldLastActivityAt = big.NewInt(1 << 7) + patchedOpportunityRequestFieldCloseDate = big.NewInt(1 << 8) + patchedOpportunityRequestFieldIntegrationParams = big.NewInt(1 << 9) + patchedOpportunityRequestFieldLinkedAccountParams = big.NewInt(1 << 10) + patchedOpportunityRequestFieldRemoteFields = big.NewInt(1 << 11) +) + type PatchedOpportunityRequest struct { // The opportunity's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -773,6 +1380,9 @@ type PatchedOpportunityRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -865,6 +1475,97 @@ func (p *PatchedOpportunityRequest) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PatchedOpportunityRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetName(name *string) { + p.Name = name + p.require(patchedOpportunityRequestFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetDescription(description *string) { + p.Description = description + p.require(patchedOpportunityRequestFieldDescription) +} + +// SetAmount sets the Amount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetAmount(amount *int) { + p.Amount = amount + p.require(patchedOpportunityRequestFieldAmount) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetOwner(owner *string) { + p.Owner = owner + p.require(patchedOpportunityRequestFieldOwner) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetAccount(account *string) { + p.Account = account + p.require(patchedOpportunityRequestFieldAccount) +} + +// SetStage sets the Stage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetStage(stage *string) { + p.Stage = stage + p.require(patchedOpportunityRequestFieldStage) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetStatus(status *PatchedOpportunityRequestStatus) { + p.Status = status + p.require(patchedOpportunityRequestFieldStatus) +} + +// SetLastActivityAt sets the LastActivityAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetLastActivityAt(lastActivityAt *time.Time) { + p.LastActivityAt = lastActivityAt + p.require(patchedOpportunityRequestFieldLastActivityAt) +} + +// SetCloseDate sets the CloseDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetCloseDate(closeDate *time.Time) { + p.CloseDate = closeDate + p.require(patchedOpportunityRequestFieldCloseDate) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(patchedOpportunityRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(patchedOpportunityRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedOpportunityRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(patchedOpportunityRequestFieldRemoteFields) +} + func (p *PatchedOpportunityRequest) UnmarshalJSON(data []byte) error { type embed PatchedOpportunityRequest var unmarshaler = struct { @@ -900,7 +1601,8 @@ func (p *PatchedOpportunityRequest) MarshalJSON() ([]byte, error) { LastActivityAt: internal.NewOptionalDateTime(p.LastActivityAt), CloseDate: internal.NewOptionalDateTime(p.CloseDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PatchedOpportunityRequest) String() string { diff --git a/crm/opportunities/client.go b/crm/opportunities/client.go index d6a6528..c39f845 100644 --- a/crm/opportunities/client.go +++ b/crm/opportunities/client.go @@ -4,7 +4,6 @@ package opportunities import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.OpportunitiesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Opportunity], error) { +) (*core.Page[*string, *crm.Opportunity], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedOpportunityList) *internal.PageResponse[*string, *crm.Opportunity] { + readPageResponse := func(response *crm.PaginatedOpportunityList) *core.PageResponse[*string, *crm.Opportunity] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Opportunity]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Opportunity]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *crm.OpportunityEndpointRequest, opts ...option.RequestOption, ) (*crm.OpportunityResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/opportunities" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.OpportunityResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Opportunity` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *crm.OpportunitiesRetrieveRequest, opts ...option.RequestOption, ) (*crm.Opportunity, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/opportunities/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Opportunity - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates an `Opportunity` object with the given `id`. @@ -192,47 +134,16 @@ func (c *Client) PartialUpdate( request *crm.PatchedOpportunityEndpointRequest, opts ...option.RequestOption, ) (*crm.OpportunityResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/opportunities/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.OpportunityResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Opportunity` PATCHs. @@ -241,38 +152,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/opportunities/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `Opportunity` POSTs. @@ -280,35 +168,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/opportunities/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -316,7 +183,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.OpportunitiesRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -329,13 +196,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -352,11 +218,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/opportunities/crm_opportunities_test/crm_opportunities_test.go b/crm/opportunities/crm_opportunities_test/crm_opportunities_test.go new file mode 100644 index 0000000..59e8b58 --- /dev/null +++ b/crm/opportunities/crm_opportunities_test/crm_opportunities_test.go @@ -0,0 +1,310 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_opportunities_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmOpportunitiesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.OpportunitiesListRequest{ + AccountId: merge.String( + "account_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OwnerId: merge.String( + "owner_id", + ), + PageSize: merge.Int( + 1, + ), + RemoteCreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteId: merge.String( + "remote_id", + ), + StageId: merge.String( + "stage_id", + ), + Status: crm.OpportunitiesListRequestStatusLost.Ptr(), + } + _, invocationErr := client.Crm.Opportunities.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/opportunities", map[string]string{"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"}, 1) +} + +func TestCrmOpportunitiesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.OpportunityEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.OpportunityRequest{}, + } + _, invocationErr := client.Crm.Opportunities.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/opportunities", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmOpportunitiesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.OpportunitiesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Opportunities.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/opportunities/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true", "remote_fields": "status", "show_enum_origins": "status"}, 1) +} + +func TestCrmOpportunitiesPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.PatchedOpportunityEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedOpportunityRequest{}, + } + _, invocationErr := client.Crm.Opportunities.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/crm/v1/opportunities/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmOpportunitiesMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Opportunities.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/opportunities/meta/patch/id", nil, 1) +} + +func TestCrmOpportunitiesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Opportunities.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/opportunities/meta/post", nil, 1) +} + +func TestCrmOpportunitiesRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.OpportunitiesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.Opportunities.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/opportunities/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/opportunities/raw_client.go b/crm/opportunities/raw_client.go new file mode 100644 index 0000000..b13e3b5 --- /dev/null +++ b/crm/opportunities/raw_client.go @@ -0,0 +1,266 @@ +// Code generated by Fern. DO NOT EDIT. + +package opportunities + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.OpportunityEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.OpportunityResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/opportunities" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.OpportunityResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.OpportunityResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.OpportunitiesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.Opportunity], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/opportunities/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Opportunity + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Opportunity]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *crm.PatchedOpportunityEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.OpportunityResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/opportunities/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.OpportunityResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.OpportunityResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/opportunities/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/opportunities/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/passthrough/client.go b/crm/passthrough/client.go index 9d79435..4b0dc39 100644 --- a/crm/passthrough/client.go +++ b/crm/passthrough/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *crm.DataPassthroughRequest, opts ...option.RequestOption, ) (*crm.RemoteResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.RemoteResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/passthrough/crm_passthrough_test/crm_passthrough_test.go b/crm/passthrough/crm_passthrough_test/crm_passthrough_test.go new file mode 100644 index 0000000..f400ee0 --- /dev/null +++ b/crm/passthrough/crm_passthrough_test/crm_passthrough_test.go @@ -0,0 +1,85 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.DataPassthroughRequest{ + Method: crm.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Crm.Passthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/passthrough", nil, 1) +} diff --git a/crm/passthrough/raw_client.go b/crm/passthrough/raw_client.go new file mode 100644 index 0000000..7c44883 --- /dev/null +++ b/crm/passthrough/raw_client.go @@ -0,0 +1,72 @@ +// Code generated by Fern. DO NOT EDIT. + +package passthrough + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.RemoteResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.RemoteResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.RemoteResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/regenerate_key.go b/crm/regenerate_key.go index 369099f..1ebd9fa 100644 --- a/crm/regenerate_key.go +++ b/crm/regenerate_key.go @@ -2,7 +2,32 @@ package crm +import ( + big "math/big" +) + +var ( + remoteKeyForRegenerationRequestFieldName = big.NewInt(1 << 0) +) + type RemoteKeyForRegenerationRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteKeyForRegenerationRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKeyForRegenerationRequest) SetName(name string) { + r.Name = name + r.require(remoteKeyForRegenerationRequestFieldName) } diff --git a/crm/regeneratekey/client.go b/crm/regeneratekey/client.go index 1fd6d35..8e91612 100644 --- a/crm/regeneratekey/client.go +++ b/crm/regeneratekey/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *crm.RemoteKeyForRegenerationRequest, opts ...option.RequestOption, ) (*crm.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/regenerate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/regeneratekey/crm_regenerate_key_test/crm_regenerate_key_test.go b/crm/regeneratekey/crm_regenerate_key_test/crm_regenerate_key_test.go new file mode 100644 index 0000000..d55a57b --- /dev/null +++ b/crm/regeneratekey/crm_regenerate_key_test/crm_regenerate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_regenerate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmRegenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Crm.RegenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/regenerate-key", nil, 1) +} diff --git a/crm/regeneratekey/raw_client.go b/crm/regeneratekey/raw_client.go new file mode 100644 index 0000000..a6bd58d --- /dev/null +++ b/crm/regeneratekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package regeneratekey + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.RemoteKeyForRegenerationRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/regenerate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/scopes.go b/crm/scopes.go index a417bb4..e748377 100644 --- a/crm/scopes.go +++ b/crm/scopes.go @@ -6,17 +6,46 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels = big.NewInt(1 << 0) ) type LinkedAccountCommonModelScopeDeserializerRequest struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountCommonModelScopeDeserializerRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountCommonModelScopeDeserializerRequest) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializerRequest) { + l.CommonModels = commonModels + l.require(linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels) } +var ( + commonModelScopeApiFieldCommonModels = big.NewInt(1 << 0) +) + type CommonModelScopeApi struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models" url:"common_models"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -32,6 +61,20 @@ func (c *CommonModelScopeApi) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CommonModelScopeApi) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopeApi) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializer) { + c.CommonModels = commonModels + c.require(commonModelScopeApiFieldCommonModels) +} + func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopeApi var value unmarshaler @@ -48,6 +91,17 @@ func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopeApi) MarshalJSON() ([]byte, error) { + type embed CommonModelScopeApi + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopeApi) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -60,10 +114,18 @@ func (c *CommonModelScopeApi) String() string { return fmt.Sprintf("%#v", c) } +var ( + fieldPermissionDeserializerFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializer struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -86,6 +148,27 @@ func (f *FieldPermissionDeserializer) GetExtraProperties() map[string]interface{ return f.extraProperties } +func (f *FieldPermissionDeserializer) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerFieldDisabledFields) +} + func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializer var value unmarshaler @@ -102,6 +185,17 @@ func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializer) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -114,11 +208,20 @@ func (f *FieldPermissionDeserializer) String() string { return fmt.Sprintf("%#v", f) } +var ( + individualCommonModelScopeDeserializerFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializer struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -148,6 +251,34 @@ func (i *IndividualCommonModelScopeDeserializer) GetExtraProperties() map[string return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializer) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializer) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializer) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializer var value unmarshaler @@ -164,6 +295,17 @@ func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) erro return nil } +func (i *IndividualCommonModelScopeDeserializer) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializer) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -176,9 +318,16 @@ func (i *IndividualCommonModelScopeDeserializer) String() string { return fmt.Sprintf("%#v", i) } +var ( + modelPermissionDeserializerFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializer struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -194,6 +343,20 @@ func (m *ModelPermissionDeserializer) GetExtraProperties() map[string]interface{ return m.extraProperties } +func (m *ModelPermissionDeserializer) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializer) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerFieldIsEnabled) +} + func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializer var value unmarshaler @@ -210,6 +373,17 @@ func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializer) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { diff --git a/crm/scopes/client.go b/crm/scopes/client.go index ae249a1..c8c72ba 100644 --- a/crm/scopes/client.go +++ b/crm/scopes/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) DefaultScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/default-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.DefaultScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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). @@ -72,35 +52,14 @@ func (c *Client) LinkedAccountScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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) @@ -109,35 +68,13 @@ func (c *Client) LinkedAccountScopesCreate( request *crm.LinkedAccountCommonModelScopeDeserializerRequest, opts ...option.RequestOption, ) (*crm.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/scopes/crm_scopes_test/crm_scopes_test.go b/crm/scopes/crm_scopes_test/crm_scopes_test.go new file mode 100644 index 0000000..16b177c --- /dev/null +++ b/crm/scopes/crm_scopes_test/crm_scopes_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_scopes_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmScopesDefaultScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/default-scopes", nil, 1) +} + +func TestCrmScopesLinkedAccountScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/linked-account-scopes", nil, 1) +} + +func TestCrmScopesLinkedAccountScopesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*crm.IndividualCommonModelScopeDeserializerRequest{ + &crm.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*crm.ModelPermissionDeserializerRequest{ + "READ": &crm.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &crm.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &crm.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &crm.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*crm.ModelPermissionDeserializerRequest{ + "WRITE": &crm.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } + _, invocationErr := client.Crm.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/linked-account-scopes", nil, 1) +} diff --git a/crm/scopes/raw_client.go b/crm/scopes/raw_client.go new file mode 100644 index 0000000..a211444 --- /dev/null +++ b/crm/scopes/raw_client.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package scopes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) DefaultScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/default-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesCreate( + ctx context.Context, + request *crm.LinkedAccountCommonModelScopeDeserializerRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/stages.go b/crm/stages.go index 0117d8d..b174e98 100644 --- a/crm/stages.go +++ b/crm/stages.go @@ -6,9 +6,24 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + stagesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + stagesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + stagesListRequestFieldCursor = big.NewInt(1 << 2) + stagesListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + stagesListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + stagesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 5) + stagesListRequestFieldIncludeShellData = big.NewInt(1 << 6) + stagesListRequestFieldModifiedAfter = big.NewInt(1 << 7) + stagesListRequestFieldModifiedBefore = big.NewInt(1 << 8) + stagesListRequestFieldPageSize = big.NewInt(1 << 9) + stagesListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type StagesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -32,8 +47,106 @@ type StagesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (s *StagesListRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetCreatedAfter(createdAfter *time.Time) { + s.CreatedAfter = createdAfter + s.require(stagesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetCreatedBefore(createdBefore *time.Time) { + s.CreatedBefore = createdBefore + s.require(stagesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetCursor(cursor *string) { + s.Cursor = cursor + s.require(stagesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + s.IncludeDeletedData = includeDeletedData + s.require(stagesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + s.IncludeRemoteData = includeRemoteData + s.require(stagesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + s.IncludeRemoteFields = includeRemoteFields + s.require(stagesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetIncludeShellData(includeShellData *bool) { + s.IncludeShellData = includeShellData + s.require(stagesListRequestFieldIncludeShellData) } +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + s.ModifiedAfter = modifiedAfter + s.require(stagesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + s.ModifiedBefore = modifiedBefore + s.require(stagesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetPageSize(pageSize *int) { + s.PageSize = pageSize + s.require(stagesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesListRequest) SetRemoteId(remoteId *string) { + s.RemoteId = remoteId + s.require(stagesListRequestFieldRemoteId) +} + +var ( + stagesRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + stagesRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + stagesRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + stagesRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + stagesRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + stagesRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + stagesRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + stagesRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type StagesRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -51,8 +164,80 @@ type StagesRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (s *StagesRemoteFieldClassesListRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRemoteFieldClassesListRequest) SetCursor(cursor *string) { + s.Cursor = cursor + s.require(stagesRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + s.IncludeDeletedData = includeDeletedData + s.require(stagesRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + s.IncludeRemoteData = includeRemoteData + s.require(stagesRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + s.IncludeRemoteFields = includeRemoteFields + s.require(stagesRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + s.IncludeShellData = includeShellData + s.require(stagesRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + s.IsCommonModelField = isCommonModelField + s.require(stagesRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + s.IsCustom = isCustom + s.require(stagesRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + s.PageSize = pageSize + s.require(stagesRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + stagesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + stagesRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 1) + stagesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type StagesRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -60,13 +245,53 @@ type StagesRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (s *StagesRetrieveRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + s.IncludeRemoteData = includeRemoteData + s.require(stagesRetrieveRequestFieldIncludeRemoteData) } +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + s.IncludeRemoteFields = includeRemoteFields + s.require(stagesRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *StagesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + s.IncludeShellData = includeShellData + s.require(stagesRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedStageListFieldNext = big.NewInt(1 << 0) + paginatedStageListFieldPrevious = big.NewInt(1 << 1) + paginatedStageListFieldResults = big.NewInt(1 << 2) +) + type PaginatedStageList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Stage `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -96,6 +321,34 @@ func (p *PaginatedStageList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedStageList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedStageList) SetNext(next *string) { + p.Next = next + p.require(paginatedStageListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedStageList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedStageListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedStageList) SetResults(results []*Stage) { + p.Results = results + p.require(paginatedStageListFieldResults) +} + func (p *PaginatedStageList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedStageList var value unmarshaler @@ -112,6 +365,17 @@ func (p *PaginatedStageList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedStageList) MarshalJSON() ([]byte, error) { + type embed PaginatedStageList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedStageList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/stages/client.go b/crm/stages/client.go index 8fad6a0..db352c5 100644 --- a/crm/stages/client.go +++ b/crm/stages/client.go @@ -4,7 +4,6 @@ package stages import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.StagesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Stage], error) { +) (*core.Page[*string, *crm.Stage], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedStageList) *internal.PageResponse[*string, *crm.Stage] { + readPageResponse := func(response *crm.PaginatedStageList) *core.PageResponse[*string, *crm.Stage] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Stage]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Stage]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,45 +98,16 @@ func (c *Client) Retrieve( request *crm.StagesRetrieveRequest, opts ...option.RequestOption, ) (*crm.Stage, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/stages/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Stage - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -144,7 +115,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.StagesRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -157,13 +128,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -180,11 +150,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/stages/crm_stages_test/crm_stages_test.go b/crm/stages/crm_stages_test/crm_stages_test.go new file mode 100644 index 0000000..47d8f9e --- /dev/null +++ b/crm/stages/crm_stages_test/crm_stages_test.go @@ -0,0 +1,201 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_stages_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmStagesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.StagesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.Stages.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/stages", map[string]string{"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"}, 1) +} + +func TestCrmStagesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.StagesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Stages.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/stages/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmStagesRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.StagesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.Stages.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/stages/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/stages/raw_client.go b/crm/stages/raw_client.go new file mode 100644 index 0000000..9862421 --- /dev/null +++ b/crm/stages/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package stages + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.StagesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.Stage], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/stages/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Stage + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Stage]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/sync_status.go b/crm/sync_status.go index 5dbf82e..401deac 100644 --- a/crm/sync_status.go +++ b/crm/sync_status.go @@ -6,6 +6,12 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + syncStatusListRequestFieldCursor = big.NewInt(1 << 0) + syncStatusListRequestFieldPageSize = big.NewInt(1 << 1) ) type SyncStatusListRequest struct { @@ -13,13 +19,46 @@ type SyncStatusListRequest struct { Cursor *string `json:"-" url:"cursor,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (s *SyncStatusListRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetCursor(cursor *string) { + s.Cursor = cursor + s.require(syncStatusListRequestFieldCursor) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetPageSize(pageSize *int) { + s.PageSize = pageSize + s.require(syncStatusListRequestFieldPageSize) +} + +var ( + paginatedSyncStatusListFieldNext = big.NewInt(1 << 0) + paginatedSyncStatusListFieldPrevious = big.NewInt(1 << 1) + paginatedSyncStatusListFieldResults = big.NewInt(1 << 2) +) + type PaginatedSyncStatusList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*SyncStatus `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -49,6 +88,34 @@ func (p *PaginatedSyncStatusList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedSyncStatusList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetNext(next *string) { + p.Next = next + p.require(paginatedSyncStatusListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedSyncStatusListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetResults(results []*SyncStatus) { + p.Results = results + p.require(paginatedSyncStatusListFieldResults) +} + func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedSyncStatusList var value unmarshaler @@ -65,6 +132,17 @@ func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedSyncStatusList) MarshalJSON() ([]byte, error) { + type embed PaginatedSyncStatusList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedSyncStatusList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/syncstatus/client.go b/crm/syncstatus/client.go index 0142f15..728c430 100644 --- a/crm/syncstatus/client.go +++ b/crm/syncstatus/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,40 +38,13 @@ func (c *Client) List( request *crm.SyncStatusListRequest, opts ...option.RequestOption, ) (*crm.PaginatedSyncStatusList, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.List( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/sync-status" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.PaginatedSyncStatusList - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/crm/syncstatus/crm_sync_status_test/crm_sync_status_test.go b/crm/syncstatus/crm_sync_status_test/crm_sync_status_test.go new file mode 100644 index 0000000..74bf8e8 --- /dev/null +++ b/crm/syncstatus/crm_sync_status_test/crm_sync_status_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_sync_status_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmSyncStatusListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.SyncStatus.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/sync-status", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "page_size": "1"}, 1) +} diff --git a/crm/syncstatus/raw_client.go b/crm/syncstatus/raw_client.go new file mode 100644 index 0000000..5b20402 --- /dev/null +++ b/crm/syncstatus/raw_client.go @@ -0,0 +1,78 @@ +// Code generated by Fern. DO NOT EDIT. + +package syncstatus + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + request *crm.SyncStatusListRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.PaginatedSyncStatusList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/sync-status" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.PaginatedSyncStatusList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.PaginatedSyncStatusList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/tasks.go b/crm/tasks.go index ee0408a..8778099 100644 --- a/crm/tasks.go +++ b/crm/tasks.go @@ -6,17 +6,70 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + taskEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + taskEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + taskEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type TaskEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *TaskRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TaskEndpointRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + t.IsDebugMode = isDebugMode + t.require(taskEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskEndpointRequest) SetRunAsync(runAsync *bool) { + t.RunAsync = runAsync + t.require(taskEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskEndpointRequest) SetModel(model *TaskRequest) { + t.Model = model + t.require(taskEndpointRequestFieldModel) +} + +var ( + tasksListRequestFieldCreatedAfter = big.NewInt(1 << 0) + tasksListRequestFieldCreatedBefore = big.NewInt(1 << 1) + tasksListRequestFieldCursor = big.NewInt(1 << 2) + tasksListRequestFieldExpand = big.NewInt(1 << 3) + tasksListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + tasksListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + tasksListRequestFieldIncludeRemoteFields = big.NewInt(1 << 6) + tasksListRequestFieldIncludeShellData = big.NewInt(1 << 7) + tasksListRequestFieldModifiedAfter = big.NewInt(1 << 8) + tasksListRequestFieldModifiedBefore = big.NewInt(1 << 9) + tasksListRequestFieldPageSize = big.NewInt(1 << 10) + tasksListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type TasksListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -42,16 +95,158 @@ type TasksListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TasksListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(tasksListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(tasksListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(tasksListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetExpand(expand []*TasksListRequestExpandItem) { + t.Expand = expand + t.require(tasksListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(tasksListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(tasksListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + t.IncludeRemoteFields = includeRemoteFields + t.require(tasksListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(tasksListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(tasksListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(tasksListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(tasksListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(tasksListRequestFieldRemoteId) +} + +var ( + patchedTaskEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedTaskEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedTaskEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PatchedTaskEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PatchedTaskRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedTaskEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedTaskEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedTaskEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskEndpointRequest) SetModel(model *PatchedTaskRequest) { + p.Model = model + p.require(patchedTaskEndpointRequestFieldModel) +} + +var ( + tasksRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + tasksRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + tasksRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + tasksRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + tasksRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + tasksRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + tasksRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + tasksRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type TasksRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -69,8 +264,81 @@ type TasksRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TasksRemoteFieldClassesListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRemoteFieldClassesListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(tasksRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(tasksRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(tasksRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + t.IncludeRemoteFields = includeRemoteFields + t.require(tasksRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(tasksRemoteFieldClassesListRequestFieldIncludeShellData) } +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + t.IsCommonModelField = isCommonModelField + t.require(tasksRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + t.IsCustom = isCustom + t.require(tasksRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(tasksRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + tasksRetrieveRequestFieldExpand = big.NewInt(1 << 0) + tasksRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + tasksRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + tasksRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) +) + type TasksRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*TasksRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -80,6 +348,44 @@ type TasksRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TasksRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRetrieveRequest) SetExpand(expand []*TasksRetrieveRequestExpandItem) { + t.Expand = expand + t.require(tasksRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(tasksRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + t.IncludeRemoteFields = includeRemoteFields + t.require(tasksRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TasksRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(tasksRetrieveRequestFieldIncludeShellData) } type TasksListRequestExpandItem string @@ -132,11 +438,20 @@ func (t TasksRetrieveRequestExpandItem) Ptr() *TasksRetrieveRequestExpandItem { return &t } +var ( + paginatedTaskListFieldNext = big.NewInt(1 << 0) + paginatedTaskListFieldPrevious = big.NewInt(1 << 1) + paginatedTaskListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTaskList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Task `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -166,6 +481,34 @@ func (p *PaginatedTaskList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedTaskList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTaskList) SetNext(next *string) { + p.Next = next + p.require(paginatedTaskListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTaskList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTaskListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTaskList) SetResults(results []*Task) { + p.Results = results + p.require(paginatedTaskListFieldResults) +} + func (p *PaginatedTaskList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTaskList var value unmarshaler @@ -182,6 +525,17 @@ func (p *PaginatedTaskList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTaskList) MarshalJSON() ([]byte, error) { + type embed PaginatedTaskList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTaskList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -199,6 +553,20 @@ func (p *PaginatedTaskList) String() string { // The `Task` object is used to represent a task, such as a to-do item. // ### Usage Example // TODO +var ( + patchedTaskRequestFieldSubject = big.NewInt(1 << 0) + patchedTaskRequestFieldContent = big.NewInt(1 << 1) + patchedTaskRequestFieldOwner = big.NewInt(1 << 2) + patchedTaskRequestFieldAccount = big.NewInt(1 << 3) + patchedTaskRequestFieldOpportunity = big.NewInt(1 << 4) + patchedTaskRequestFieldCompletedDate = big.NewInt(1 << 5) + patchedTaskRequestFieldDueDate = big.NewInt(1 << 6) + patchedTaskRequestFieldStatus = big.NewInt(1 << 7) + patchedTaskRequestFieldIntegrationParams = big.NewInt(1 << 8) + patchedTaskRequestFieldLinkedAccountParams = big.NewInt(1 << 9) + patchedTaskRequestFieldRemoteFields = big.NewInt(1 << 10) +) + type PatchedTaskRequest struct { // The task's subject. Subject *string `json:"subject,omitempty" url:"subject,omitempty"` @@ -223,6 +591,9 @@ type PatchedTaskRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -308,6 +679,90 @@ func (p *PatchedTaskRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PatchedTaskRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetSubject sets the Subject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetSubject(subject *string) { + p.Subject = subject + p.require(patchedTaskRequestFieldSubject) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetContent(content *string) { + p.Content = content + p.require(patchedTaskRequestFieldContent) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetOwner(owner *string) { + p.Owner = owner + p.require(patchedTaskRequestFieldOwner) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetAccount(account *string) { + p.Account = account + p.require(patchedTaskRequestFieldAccount) +} + +// SetOpportunity sets the Opportunity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetOpportunity(opportunity *string) { + p.Opportunity = opportunity + p.require(patchedTaskRequestFieldOpportunity) +} + +// SetCompletedDate sets the CompletedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetCompletedDate(completedDate *time.Time) { + p.CompletedDate = completedDate + p.require(patchedTaskRequestFieldCompletedDate) +} + +// SetDueDate sets the DueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetDueDate(dueDate *time.Time) { + p.DueDate = dueDate + p.require(patchedTaskRequestFieldDueDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetStatus(status *PatchedTaskRequestStatus) { + p.Status = status + p.require(patchedTaskRequestFieldStatus) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(patchedTaskRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(patchedTaskRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTaskRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(patchedTaskRequestFieldRemoteFields) +} + func (p *PatchedTaskRequest) UnmarshalJSON(data []byte) error { type embed PatchedTaskRequest var unmarshaler = struct { @@ -343,7 +798,8 @@ func (p *PatchedTaskRequest) MarshalJSON() ([]byte, error) { CompletedDate: internal.NewOptionalDateTime(p.CompletedDate), DueDate: internal.NewOptionalDateTime(p.DueDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PatchedTaskRequest) String() string { @@ -429,6 +885,25 @@ func (p *PatchedTaskRequestStatus) Accept(visitor PatchedTaskRequestStatusVisito // The `Task` object is used to represent a task, such as a to-do item. // ### Usage Example // TODO +var ( + taskFieldId = big.NewInt(1 << 0) + taskFieldRemoteId = big.NewInt(1 << 1) + taskFieldCreatedAt = big.NewInt(1 << 2) + taskFieldModifiedAt = big.NewInt(1 << 3) + taskFieldSubject = big.NewInt(1 << 4) + taskFieldContent = big.NewInt(1 << 5) + taskFieldOwner = big.NewInt(1 << 6) + taskFieldAccount = big.NewInt(1 << 7) + taskFieldOpportunity = big.NewInt(1 << 8) + taskFieldCompletedDate = big.NewInt(1 << 9) + taskFieldDueDate = big.NewInt(1 << 10) + taskFieldStatus = big.NewInt(1 << 11) + taskFieldRemoteWasDeleted = big.NewInt(1 << 12) + taskFieldFieldMappings = big.NewInt(1 << 13) + taskFieldRemoteData = big.NewInt(1 << 14) + taskFieldRemoteFields = big.NewInt(1 << 15) +) + type Task struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -462,6 +937,9 @@ type Task struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -582,6 +1060,125 @@ func (t *Task) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *Task) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetId(id *string) { + t.Id = id + t.require(taskFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(taskFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(taskFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(taskFieldModifiedAt) +} + +// SetSubject sets the Subject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetSubject(subject *string) { + t.Subject = subject + t.require(taskFieldSubject) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetContent(content *string) { + t.Content = content + t.require(taskFieldContent) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetOwner(owner *TaskOwner) { + t.Owner = owner + t.require(taskFieldOwner) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetAccount(account *TaskAccount) { + t.Account = account + t.require(taskFieldAccount) +} + +// SetOpportunity sets the Opportunity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetOpportunity(opportunity *TaskOpportunity) { + t.Opportunity = opportunity + t.require(taskFieldOpportunity) +} + +// SetCompletedDate sets the CompletedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetCompletedDate(completedDate *time.Time) { + t.CompletedDate = completedDate + t.require(taskFieldCompletedDate) +} + +// SetDueDate sets the DueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetDueDate(dueDate *time.Time) { + t.DueDate = dueDate + t.require(taskFieldDueDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetStatus(status *TaskStatus) { + t.Status = status + t.require(taskFieldStatus) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(taskFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(taskFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(taskFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Task) SetRemoteFields(remoteFields []*RemoteField) { + t.RemoteFields = remoteFields + t.require(taskFieldRemoteFields) +} + func (t *Task) UnmarshalJSON(data []byte) error { type embed Task var unmarshaler = struct { @@ -625,7 +1222,8 @@ func (t *Task) MarshalJSON() ([]byte, error) { CompletedDate: internal.NewOptionalDateTime(t.CompletedDate), DueDate: internal.NewOptionalDateTime(t.DueDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *Task) String() string { @@ -834,6 +1432,20 @@ func (t *TaskOwner) Accept(visitor TaskOwnerVisitor) error { // The `Task` object is used to represent a task, such as a to-do item. // ### Usage Example // TODO +var ( + taskRequestFieldSubject = big.NewInt(1 << 0) + taskRequestFieldContent = big.NewInt(1 << 1) + taskRequestFieldOwner = big.NewInt(1 << 2) + taskRequestFieldAccount = big.NewInt(1 << 3) + taskRequestFieldOpportunity = big.NewInt(1 << 4) + taskRequestFieldCompletedDate = big.NewInt(1 << 5) + taskRequestFieldDueDate = big.NewInt(1 << 6) + taskRequestFieldStatus = big.NewInt(1 << 7) + taskRequestFieldIntegrationParams = big.NewInt(1 << 8) + taskRequestFieldLinkedAccountParams = big.NewInt(1 << 9) + taskRequestFieldRemoteFields = big.NewInt(1 << 10) +) + type TaskRequest struct { // The task's subject. Subject *string `json:"subject,omitempty" url:"subject,omitempty"` @@ -858,6 +1470,9 @@ type TaskRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -943,6 +1558,90 @@ func (t *TaskRequest) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TaskRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetSubject sets the Subject field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetSubject(subject *string) { + t.Subject = subject + t.require(taskRequestFieldSubject) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetContent(content *string) { + t.Content = content + t.require(taskRequestFieldContent) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetOwner(owner *TaskRequestOwner) { + t.Owner = owner + t.require(taskRequestFieldOwner) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetAccount(account *TaskRequestAccount) { + t.Account = account + t.require(taskRequestFieldAccount) +} + +// SetOpportunity sets the Opportunity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetOpportunity(opportunity *TaskRequestOpportunity) { + t.Opportunity = opportunity + t.require(taskRequestFieldOpportunity) +} + +// SetCompletedDate sets the CompletedDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetCompletedDate(completedDate *time.Time) { + t.CompletedDate = completedDate + t.require(taskRequestFieldCompletedDate) +} + +// SetDueDate sets the DueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetDueDate(dueDate *time.Time) { + t.DueDate = dueDate + t.require(taskRequestFieldDueDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetStatus(status *TaskRequestStatus) { + t.Status = status + t.require(taskRequestFieldStatus) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + t.IntegrationParams = integrationParams + t.require(taskRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + t.LinkedAccountParams = linkedAccountParams + t.require(taskRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + t.RemoteFields = remoteFields + t.require(taskRequestFieldRemoteFields) +} + func (t *TaskRequest) UnmarshalJSON(data []byte) error { type embed TaskRequest var unmarshaler = struct { @@ -978,7 +1677,8 @@ func (t *TaskRequest) MarshalJSON() ([]byte, error) { CompletedDate: internal.NewOptionalDateTime(t.CompletedDate), DueDate: internal.NewOptionalDateTime(t.DueDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TaskRequest) String() string { @@ -1248,12 +1948,22 @@ func (t *TaskRequestStatus) Accept(visitor TaskRequestStatusVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", t) } +var ( + taskResponseFieldModel = big.NewInt(1 << 0) + taskResponseFieldWarnings = big.NewInt(1 << 1) + taskResponseFieldErrors = big.NewInt(1 << 2) + taskResponseFieldLogs = big.NewInt(1 << 3) +) + type TaskResponse struct { Model *Task `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1290,6 +2000,41 @@ func (t *TaskResponse) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TaskResponse) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskResponse) SetModel(model *Task) { + t.Model = model + t.require(taskResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskResponse) SetWarnings(warnings []*WarningValidationProblem) { + t.Warnings = warnings + t.require(taskResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskResponse) SetErrors(errors []*ErrorValidationProblem) { + t.Errors = errors + t.require(taskResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TaskResponse) SetLogs(logs []*DebugModeLog) { + t.Logs = logs + t.require(taskResponseFieldLogs) +} + func (t *TaskResponse) UnmarshalJSON(data []byte) error { type unmarshaler TaskResponse var value unmarshaler @@ -1306,6 +2051,17 @@ func (t *TaskResponse) UnmarshalJSON(data []byte) error { return nil } +func (t *TaskResponse) MarshalJSON() ([]byte, error) { + type embed TaskResponse + var marshaler = struct { + embed + }{ + embed: embed(*t), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (t *TaskResponse) String() string { if len(t.rawJSON) > 0 { if value, err := internal.StringifyJSON(t.rawJSON); err == nil { diff --git a/crm/tasks/client.go b/crm/tasks/client.go index 41ebaf4..fb7c043 100644 --- a/crm/tasks/client.go +++ b/crm/tasks/client.go @@ -4,7 +4,6 @@ package tasks import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.TasksListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.Task], error) { +) (*core.Page[*string, *crm.Task], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedTaskList) *internal.PageResponse[*string, *crm.Task] { + readPageResponse := func(response *crm.PaginatedTaskList) *core.PageResponse[*string, *crm.Task] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.Task]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.Task]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *crm.TaskEndpointRequest, opts ...option.RequestOption, ) (*crm.TaskResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/crm/v1/tasks" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.TaskResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Task` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *crm.TasksRetrieveRequest, opts ...option.RequestOption, ) (*crm.Task, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/tasks/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.Task - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates a `Task` object with the given `id`. @@ -192,47 +134,16 @@ func (c *Client) PartialUpdate( request *crm.PatchedTaskEndpointRequest, opts ...option.RequestOption, ) (*crm.TaskResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/tasks/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.TaskResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Task` PATCHs. @@ -241,38 +152,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/tasks/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `Task` POSTs. @@ -280,35 +168,14 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*crm.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/tasks/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -316,7 +183,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.TasksRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -329,13 +196,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -352,11 +218,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/tasks/crm_tasks_test/crm_tasks_test.go b/crm/tasks/crm_tasks_test/crm_tasks_test.go new file mode 100644 index 0000000..801a380 --- /dev/null +++ b/crm/tasks/crm_tasks_test/crm_tasks_test.go @@ -0,0 +1,295 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_tasks_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmTasksListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.TasksListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.Tasks.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/tasks", map[string]string{"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"}, 1) +} + +func TestCrmTasksCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.TaskEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.TaskRequest{}, + } + _, invocationErr := client.Crm.Tasks.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/tasks", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmTasksRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.TasksRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Tasks.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/tasks/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmTasksPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.PatchedTaskEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedTaskRequest{}, + } + _, invocationErr := client.Crm.Tasks.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/crm/v1/tasks/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestCrmTasksMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Tasks.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/tasks/meta/patch/id", nil, 1) +} + +func TestCrmTasksMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.Tasks.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/tasks/meta/post", nil, 1) +} + +func TestCrmTasksRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.TasksRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.Tasks.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/tasks/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/tasks/raw_client.go b/crm/tasks/raw_client.go new file mode 100644 index 0000000..90516bd --- /dev/null +++ b/crm/tasks/raw_client.go @@ -0,0 +1,266 @@ +// Code generated by Fern. DO NOT EDIT. + +package tasks + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.TaskEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.TaskResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/tasks" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.TaskResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.TaskResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.TasksRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.Task], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/tasks/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.Task + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.Task]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *crm.PatchedTaskEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.TaskResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/tasks/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.TaskResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.TaskResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/tasks/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*crm.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/tasks/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/crm/types.go b/crm/types.go index f4d9a30..e8cd19b 100644 --- a/crm/types.go +++ b/crm/types.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) @@ -14,6 +15,28 @@ import ( // The `Account` object is used to represent a company in a CRM system. // ### Usage Example // TODO +var ( + accountFieldId = big.NewInt(1 << 0) + accountFieldRemoteId = big.NewInt(1 << 1) + accountFieldCreatedAt = big.NewInt(1 << 2) + accountFieldModifiedAt = big.NewInt(1 << 3) + accountFieldOwner = big.NewInt(1 << 4) + accountFieldName = big.NewInt(1 << 5) + accountFieldDescription = big.NewInt(1 << 6) + accountFieldIndustry = big.NewInt(1 << 7) + accountFieldWebsite = big.NewInt(1 << 8) + accountFieldNumberOfEmployees = big.NewInt(1 << 9) + accountFieldAddresses = big.NewInt(1 << 10) + accountFieldPhoneNumbers = big.NewInt(1 << 11) + accountFieldLastActivityAt = big.NewInt(1 << 12) + accountFieldRemoteUpdatedAt = big.NewInt(1 << 13) + accountFieldRemoteCreatedAt = big.NewInt(1 << 14) + accountFieldRemoteWasDeleted = big.NewInt(1 << 15) + accountFieldFieldMappings = big.NewInt(1 << 16) + accountFieldRemoteData = big.NewInt(1 << 17) + accountFieldRemoteFields = big.NewInt(1 << 18) +) + type Account struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -48,6 +71,9 @@ type Account struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -189,6 +215,146 @@ func (a *Account) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Account) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetId(id *string) { + a.Id = id + a.require(accountFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(accountFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(accountFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(accountFieldModifiedAt) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetOwner(owner *AccountOwner) { + a.Owner = owner + a.require(accountFieldOwner) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetName(name *string) { + a.Name = name + a.require(accountFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetDescription(description *string) { + a.Description = description + a.require(accountFieldDescription) +} + +// SetIndustry sets the Industry field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetIndustry(industry *string) { + a.Industry = industry + a.require(accountFieldIndustry) +} + +// SetWebsite sets the Website field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetWebsite(website *string) { + a.Website = website + a.require(accountFieldWebsite) +} + +// SetNumberOfEmployees sets the NumberOfEmployees field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetNumberOfEmployees(numberOfEmployees *int) { + a.NumberOfEmployees = numberOfEmployees + a.require(accountFieldNumberOfEmployees) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetAddresses(addresses []*Address) { + a.Addresses = addresses + a.require(accountFieldAddresses) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetPhoneNumbers(phoneNumbers []*PhoneNumber) { + a.PhoneNumbers = phoneNumbers + a.require(accountFieldPhoneNumbers) +} + +// SetLastActivityAt sets the LastActivityAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetLastActivityAt(lastActivityAt *time.Time) { + a.LastActivityAt = lastActivityAt + a.require(accountFieldLastActivityAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + a.RemoteUpdatedAt = remoteUpdatedAt + a.require(accountFieldRemoteUpdatedAt) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + a.RemoteCreatedAt = remoteCreatedAt + a.require(accountFieldRemoteCreatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteWasDeleted(remoteWasDeleted *bool) { + a.RemoteWasDeleted = remoteWasDeleted + a.require(accountFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetFieldMappings(fieldMappings map[string]interface{}) { + a.FieldMappings = fieldMappings + a.require(accountFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteData(remoteData []*RemoteData) { + a.RemoteData = remoteData + a.require(accountFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteFields(remoteFields []*RemoteField) { + a.RemoteFields = remoteFields + a.require(accountFieldRemoteFields) +} + func (a *Account) UnmarshalJSON(data []byte) error { type embed Account var unmarshaler = struct { @@ -236,7 +402,8 @@ func (a *Account) MarshalJSON() ([]byte, error) { RemoteUpdatedAt: internal.NewOptionalDateTime(a.RemoteUpdatedAt), RemoteCreatedAt: internal.NewOptionalDateTime(a.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Account) String() string { @@ -251,6 +418,19 @@ func (a *Account) String() string { return fmt.Sprintf("%#v", a) } +var ( + accountIntegrationFieldName = big.NewInt(1 << 0) + accountIntegrationFieldAbbreviatedName = big.NewInt(1 << 1) + accountIntegrationFieldCategories = big.NewInt(1 << 2) + accountIntegrationFieldImage = big.NewInt(1 << 3) + accountIntegrationFieldSquareImage = big.NewInt(1 << 4) + accountIntegrationFieldColor = big.NewInt(1 << 5) + accountIntegrationFieldSlug = big.NewInt(1 << 6) + accountIntegrationFieldApiEndpointsToDocumentationUrls = big.NewInt(1 << 7) + accountIntegrationFieldWebhookSetupGuideUrl = big.NewInt(1 << 8) + accountIntegrationFieldCategoryBetaStatus = big.NewInt(1 << 9) +) + type AccountIntegration struct { // Company name. Name string `json:"name" url:"name"` @@ -272,6 +452,9 @@ type AccountIntegration struct { // Category or categories this integration is in beta status for. CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty" url:"category_beta_status,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -350,6 +533,83 @@ func (a *AccountIntegration) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetName(name string) { + a.Name = name + a.require(accountIntegrationFieldName) +} + +// SetAbbreviatedName sets the AbbreviatedName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetAbbreviatedName(abbreviatedName *string) { + a.AbbreviatedName = abbreviatedName + a.require(accountIntegrationFieldAbbreviatedName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetImage(image *string) { + a.Image = image + a.require(accountIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetColor(color *string) { + a.Color = color + a.require(accountIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSlug(slug *string) { + a.Slug = slug + a.require(accountIntegrationFieldSlug) +} + +// SetApiEndpointsToDocumentationUrls sets the ApiEndpointsToDocumentationUrls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetApiEndpointsToDocumentationUrls(apiEndpointsToDocumentationUrls map[string]interface{}) { + a.ApiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls + a.require(accountIntegrationFieldApiEndpointsToDocumentationUrls) +} + +// SetWebhookSetupGuideUrl sets the WebhookSetupGuideUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetWebhookSetupGuideUrl(webhookSetupGuideUrl *string) { + a.WebhookSetupGuideUrl = webhookSetupGuideUrl + a.require(accountIntegrationFieldWebhookSetupGuideUrl) +} + +// SetCategoryBetaStatus sets the CategoryBetaStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategoryBetaStatus(categoryBetaStatus map[string]interface{}) { + a.CategoryBetaStatus = categoryBetaStatus + a.require(accountIntegrationFieldCategoryBetaStatus) +} + func (a *AccountIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountIntegration var value unmarshaler @@ -366,6 +626,17 @@ func (a *AccountIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountIntegration) MarshalJSON() ([]byte, error) { + type embed AccountIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -474,6 +745,18 @@ func (a ActivityTypeEnum) Ptr() *ActivityTypeEnum { // The `Address` object is used to represent an entity's address. // ### Usage Example // TODO +var ( + addressFieldCreatedAt = big.NewInt(1 << 0) + addressFieldModifiedAt = big.NewInt(1 << 1) + addressFieldStreet1 = big.NewInt(1 << 2) + addressFieldStreet2 = big.NewInt(1 << 3) + addressFieldCity = big.NewInt(1 << 4) + addressFieldState = big.NewInt(1 << 5) + addressFieldPostalCode = big.NewInt(1 << 6) + addressFieldCountry = big.NewInt(1 << 7) + addressFieldAddressType = big.NewInt(1 << 8) +) + type Address struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -747,6 +1030,9 @@ type Address struct { // * `SHIPPING` - SHIPPING AddressType *AddressAddressType `json:"address_type,omitempty" url:"address_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -818,6 +1104,76 @@ func (a *Address) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Address) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(addressFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(addressFieldModifiedAt) +} + +// SetStreet1 sets the Street1 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetStreet1(street1 *string) { + a.Street1 = street1 + a.require(addressFieldStreet1) +} + +// SetStreet2 sets the Street2 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetStreet2(street2 *string) { + a.Street2 = street2 + a.require(addressFieldStreet2) +} + +// SetCity sets the City field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetCity(city *string) { + a.City = city + a.require(addressFieldCity) +} + +// SetState sets the State field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetState(state *string) { + a.State = state + a.require(addressFieldState) +} + +// SetPostalCode sets the PostalCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetPostalCode(postalCode *string) { + a.PostalCode = postalCode + a.require(addressFieldPostalCode) +} + +// SetCountry sets the Country field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetCountry(country *AddressCountry) { + a.Country = country + a.require(addressFieldCountry) +} + +// SetAddressType sets the AddressType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetAddressType(addressType *AddressAddressType) { + a.AddressType = addressType + a.require(addressFieldAddressType) +} + func (a *Address) UnmarshalJSON(data []byte) error { type embed Address var unmarshaler = struct { @@ -853,7 +1209,8 @@ func (a *Address) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Address) String() string { @@ -1252,6 +1609,18 @@ func (a *AddressCountry) Accept(visitor AddressCountryVisitor) error { // The `Address` object is used to represent an entity's address. // ### Usage Example // TODO +var ( + addressRequestFieldStreet1 = big.NewInt(1 << 0) + addressRequestFieldStreet2 = big.NewInt(1 << 1) + addressRequestFieldCity = big.NewInt(1 << 2) + addressRequestFieldState = big.NewInt(1 << 3) + addressRequestFieldPostalCode = big.NewInt(1 << 4) + addressRequestFieldCountry = big.NewInt(1 << 5) + addressRequestFieldAddressType = big.NewInt(1 << 6) + addressRequestFieldIntegrationParams = big.NewInt(1 << 7) + addressRequestFieldLinkedAccountParams = big.NewInt(1 << 8) +) + type AddressRequest struct { // Line 1 of the address's street. Street1 *string `json:"street_1,omitempty" url:"street_1,omitempty"` @@ -1523,6 +1892,9 @@ type AddressRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1594,6 +1966,76 @@ func (a *AddressRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AddressRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetStreet1 sets the Street1 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetStreet1(street1 *string) { + a.Street1 = street1 + a.require(addressRequestFieldStreet1) +} + +// SetStreet2 sets the Street2 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetStreet2(street2 *string) { + a.Street2 = street2 + a.require(addressRequestFieldStreet2) +} + +// SetCity sets the City field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetCity(city *string) { + a.City = city + a.require(addressRequestFieldCity) +} + +// SetState sets the State field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetState(state *string) { + a.State = state + a.require(addressRequestFieldState) +} + +// SetPostalCode sets the PostalCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetPostalCode(postalCode *string) { + a.PostalCode = postalCode + a.require(addressRequestFieldPostalCode) +} + +// SetCountry sets the Country field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetCountry(country *AddressRequestCountry) { + a.Country = country + a.require(addressRequestFieldCountry) +} + +// SetAddressType sets the AddressType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetAddressType(addressType *AddressRequestAddressType) { + a.AddressType = addressType + a.require(addressRequestFieldAddressType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(addressRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AddressRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(addressRequestFieldLinkedAccountParams) +} + func (a *AddressRequest) UnmarshalJSON(data []byte) error { type unmarshaler AddressRequest var value unmarshaler @@ -1610,6 +2052,17 @@ func (a *AddressRequest) UnmarshalJSON(data []byte) error { return nil } +func (a *AddressRequest) MarshalJSON() ([]byte, error) { + type embed AddressRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AddressRequest) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -2025,6 +2478,13 @@ func (a AddressTypeEnum) Ptr() *AddressTypeEnum { return &a } +var ( + associationSubTypeFieldId = big.NewInt(1 << 0) + associationSubTypeFieldCreatedAt = big.NewInt(1 << 1) + associationSubTypeFieldModifiedAt = big.NewInt(1 << 2) + associationSubTypeFieldOriginType = big.NewInt(1 << 3) +) + type AssociationSubType struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The datetime that this object was created by Merge. @@ -2033,6 +2493,9 @@ type AssociationSubType struct { ModifiedAt *time.Time `json:"modified_at,omitempty" url:"modified_at,omitempty"` OriginType *string `json:"origin_type,omitempty" url:"origin_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2069,6 +2532,41 @@ func (a *AssociationSubType) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AssociationSubType) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationSubType) SetId(id *string) { + a.Id = id + a.require(associationSubTypeFieldId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationSubType) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(associationSubTypeFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationSubType) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(associationSubTypeFieldModifiedAt) +} + +// SetOriginType sets the OriginType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationSubType) SetOriginType(originType *string) { + a.OriginType = originType + a.require(associationSubTypeFieldOriginType) +} + func (a *AssociationSubType) UnmarshalJSON(data []byte) error { type embed AssociationSubType var unmarshaler = struct { @@ -2104,7 +2602,8 @@ func (a *AssociationSubType) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AssociationSubType) String() string { @@ -2124,6 +2623,19 @@ func (a *AssociationSubType) String() string { // The `Association Type` object represents the relationship between two objects. // ### Usage Example // TODO +var ( + associationTypeFieldId = big.NewInt(1 << 0) + associationTypeFieldRemoteId = big.NewInt(1 << 1) + associationTypeFieldCreatedAt = big.NewInt(1 << 2) + associationTypeFieldModifiedAt = big.NewInt(1 << 3) + associationTypeFieldSourceObjectClass = big.NewInt(1 << 4) + associationTypeFieldTargetObjectClasses = big.NewInt(1 << 5) + associationTypeFieldRemoteKeyName = big.NewInt(1 << 6) + associationTypeFieldDisplayName = big.NewInt(1 << 7) + associationTypeFieldCardinality = big.NewInt(1 << 8) + associationTypeFieldIsRequired = big.NewInt(1 << 9) +) + type AssociationType struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -2140,6 +2652,9 @@ type AssociationType struct { Cardinality *AssociationTypeCardinality `json:"cardinality,omitempty" url:"cardinality,omitempty"` IsRequired *bool `json:"is_required,omitempty" url:"is_required,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2218,6 +2733,83 @@ func (a *AssociationType) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AssociationType) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetId(id *string) { + a.Id = id + a.require(associationTypeFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(associationTypeFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(associationTypeFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(associationTypeFieldModifiedAt) +} + +// SetSourceObjectClass sets the SourceObjectClass field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetSourceObjectClass(sourceObjectClass map[string]interface{}) { + a.SourceObjectClass = sourceObjectClass + a.require(associationTypeFieldSourceObjectClass) +} + +// SetTargetObjectClasses sets the TargetObjectClasses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetTargetObjectClasses(targetObjectClasses []*AssociationSubType) { + a.TargetObjectClasses = targetObjectClasses + a.require(associationTypeFieldTargetObjectClasses) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetRemoteKeyName(remoteKeyName *string) { + a.RemoteKeyName = remoteKeyName + a.require(associationTypeFieldRemoteKeyName) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetDisplayName(displayName *string) { + a.DisplayName = displayName + a.require(associationTypeFieldDisplayName) +} + +// SetCardinality sets the Cardinality field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetCardinality(cardinality *AssociationTypeCardinality) { + a.Cardinality = cardinality + a.require(associationTypeFieldCardinality) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AssociationType) SetIsRequired(isRequired *bool) { + a.IsRequired = isRequired + a.require(associationTypeFieldIsRequired) +} + func (a *AssociationType) UnmarshalJSON(data []byte) error { type embed AssociationType var unmarshaler = struct { @@ -2253,7 +2845,8 @@ func (a *AssociationType) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AssociationType) String() string { @@ -2455,6 +3048,26 @@ func (c CategoryEnum) Ptr() *CategoryEnum { // The `Contact` object is used to represent an existing point of contact at a company in a CRM system. // ### Usage Example // TODO +var ( + contactFieldId = big.NewInt(1 << 0) + contactFieldRemoteId = big.NewInt(1 << 1) + contactFieldCreatedAt = big.NewInt(1 << 2) + contactFieldModifiedAt = big.NewInt(1 << 3) + contactFieldFirstName = big.NewInt(1 << 4) + contactFieldLastName = big.NewInt(1 << 5) + contactFieldAccount = big.NewInt(1 << 6) + contactFieldOwner = big.NewInt(1 << 7) + contactFieldAddresses = big.NewInt(1 << 8) + contactFieldEmailAddresses = big.NewInt(1 << 9) + contactFieldPhoneNumbers = big.NewInt(1 << 10) + contactFieldLastActivityAt = big.NewInt(1 << 11) + contactFieldRemoteCreatedAt = big.NewInt(1 << 12) + contactFieldRemoteWasDeleted = big.NewInt(1 << 13) + contactFieldFieldMappings = big.NewInt(1 << 14) + contactFieldRemoteData = big.NewInt(1 << 15) + contactFieldRemoteFields = big.NewInt(1 << 16) +) + type Contact struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -2484,6 +3097,9 @@ type Contact struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2611,6 +3227,132 @@ func (c *Contact) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *Contact) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetId(id *string) { + c.Id = id + c.require(contactFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(contactFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(contactFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(contactFieldModifiedAt) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetFirstName(firstName *string) { + c.FirstName = firstName + c.require(contactFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetLastName(lastName *string) { + c.LastName = lastName + c.require(contactFieldLastName) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetAccount(account *ContactAccount) { + c.Account = account + c.require(contactFieldAccount) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetOwner(owner *ContactOwner) { + c.Owner = owner + c.require(contactFieldOwner) +} + +// SetAddresses sets the Addresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetAddresses(addresses []*Address) { + c.Addresses = addresses + c.require(contactFieldAddresses) +} + +// SetEmailAddresses sets the EmailAddresses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetEmailAddresses(emailAddresses []*EmailAddress) { + c.EmailAddresses = emailAddresses + c.require(contactFieldEmailAddresses) +} + +// SetPhoneNumbers sets the PhoneNumbers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetPhoneNumbers(phoneNumbers []*PhoneNumber) { + c.PhoneNumbers = phoneNumbers + c.require(contactFieldPhoneNumbers) +} + +// SetLastActivityAt sets the LastActivityAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetLastActivityAt(lastActivityAt *time.Time) { + c.LastActivityAt = lastActivityAt + c.require(contactFieldLastActivityAt) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + c.RemoteCreatedAt = remoteCreatedAt + c.require(contactFieldRemoteCreatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(contactFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(contactFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(contactFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteFields(remoteFields []*RemoteField) { + c.RemoteFields = remoteFields + c.require(contactFieldRemoteFields) +} + func (c *Contact) UnmarshalJSON(data []byte) error { type embed Contact var unmarshaler = struct { @@ -2654,7 +3396,8 @@ func (c *Contact) MarshalJSON() ([]byte, error) { LastActivityAt: internal.NewOptionalDateTime(c.LastActivityAt), RemoteCreatedAt: internal.NewOptionalDateTime(c.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *Contact) String() string { @@ -3813,6 +4556,17 @@ func (c CountryEnum) Ptr() *CountryEnum { // // ### Usage Example // Create a `DataPassthrough` to get team hierarchies from your Rippling integration. +var ( + dataPassthroughRequestFieldMethod = big.NewInt(1 << 0) + dataPassthroughRequestFieldPath = big.NewInt(1 << 1) + dataPassthroughRequestFieldBaseUrlOverride = big.NewInt(1 << 2) + dataPassthroughRequestFieldData = big.NewInt(1 << 3) + dataPassthroughRequestFieldMultipartFormData = big.NewInt(1 << 4) + dataPassthroughRequestFieldHeaders = big.NewInt(1 << 5) + dataPassthroughRequestFieldRequestFormat = big.NewInt(1 << 6) + dataPassthroughRequestFieldNormalizeResponse = big.NewInt(1 << 7) +) + type DataPassthroughRequest struct { Method MethodEnum `json:"method" url:"method"` // The path of the request in the third party's platform. @@ -3829,6 +4583,9 @@ type DataPassthroughRequest struct { // 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`. NormalizeResponse *bool `json:"normalize_response,omitempty" url:"normalize_response,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3893,6 +4650,69 @@ func (d *DataPassthroughRequest) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DataPassthroughRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMethod(method MethodEnum) { + d.Method = method + d.require(dataPassthroughRequestFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetPath(path string) { + d.Path = path + d.require(dataPassthroughRequestFieldPath) +} + +// SetBaseUrlOverride sets the BaseUrlOverride field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetBaseUrlOverride(baseUrlOverride *string) { + d.BaseUrlOverride = baseUrlOverride + d.require(dataPassthroughRequestFieldBaseUrlOverride) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetData(data *string) { + d.Data = data + d.require(dataPassthroughRequestFieldData) +} + +// SetMultipartFormData sets the MultipartFormData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMultipartFormData(multipartFormData []*MultipartFormFieldRequest) { + d.MultipartFormData = multipartFormData + d.require(dataPassthroughRequestFieldMultipartFormData) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetHeaders(headers map[string]interface{}) { + d.Headers = headers + d.require(dataPassthroughRequestFieldHeaders) +} + +// SetRequestFormat sets the RequestFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetRequestFormat(requestFormat *RequestFormatEnum) { + d.RequestFormat = requestFormat + d.require(dataPassthroughRequestFieldRequestFormat) +} + +// SetNormalizeResponse sets the NormalizeResponse field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetNormalizeResponse(normalizeResponse *bool) { + d.NormalizeResponse = normalizeResponse + d.require(dataPassthroughRequestFieldNormalizeResponse) +} + func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { type unmarshaler DataPassthroughRequest var value unmarshaler @@ -3909,6 +4729,17 @@ func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { return nil } +func (d *DataPassthroughRequest) MarshalJSON() ([]byte, error) { + type embed DataPassthroughRequest + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DataPassthroughRequest) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -3921,11 +4752,20 @@ func (d *DataPassthroughRequest) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModeLogFieldLogId = big.NewInt(1 << 0) + debugModeLogFieldDashboardView = big.NewInt(1 << 1) + debugModeLogFieldLogSummary = big.NewInt(1 << 2) +) + type DebugModeLog struct { LogId string `json:"log_id" url:"log_id"` DashboardView string `json:"dashboard_view" url:"dashboard_view"` LogSummary *DebugModelLogSummary `json:"log_summary" url:"log_summary"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3955,6 +4795,34 @@ func (d *DebugModeLog) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModeLog) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetLogId sets the LogId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogId(logId string) { + d.LogId = logId + d.require(debugModeLogFieldLogId) +} + +// SetDashboardView sets the DashboardView field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetDashboardView(dashboardView string) { + d.DashboardView = dashboardView + d.require(debugModeLogFieldDashboardView) +} + +// SetLogSummary sets the LogSummary field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogSummary(logSummary *DebugModelLogSummary) { + d.LogSummary = logSummary + d.require(debugModeLogFieldLogSummary) +} + func (d *DebugModeLog) UnmarshalJSON(data []byte) error { type unmarshaler DebugModeLog var value unmarshaler @@ -3971,10 +4839,21 @@ func (d *DebugModeLog) UnmarshalJSON(data []byte) error { return nil } -func (d *DebugModeLog) String() string { - if len(d.rawJSON) > 0 { - if value, err := internal.StringifyJSON(d.rawJSON); err == nil { - return value +func (d *DebugModeLog) MarshalJSON() ([]byte, error) { + type embed DebugModeLog + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DebugModeLog) String() string { + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value } } if value, err := internal.StringifyJSON(d); err == nil { @@ -3983,11 +4862,20 @@ func (d *DebugModeLog) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModelLogSummaryFieldUrl = big.NewInt(1 << 0) + debugModelLogSummaryFieldMethod = big.NewInt(1 << 1) + debugModelLogSummaryFieldStatusCode = big.NewInt(1 << 2) +) + type DebugModelLogSummary struct { Url string `json:"url" url:"url"` Method string `json:"method" url:"method"` StatusCode int `json:"status_code" url:"status_code"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4017,6 +4905,34 @@ func (d *DebugModelLogSummary) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModelLogSummary) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetUrl sets the Url field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetUrl(url string) { + d.Url = url + d.require(debugModelLogSummaryFieldUrl) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetMethod(method string) { + d.Method = method + d.require(debugModelLogSummaryFieldMethod) +} + +// SetStatusCode sets the StatusCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetStatusCode(statusCode int) { + d.StatusCode = statusCode + d.require(debugModelLogSummaryFieldStatusCode) +} + func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { type unmarshaler DebugModelLogSummary var value unmarshaler @@ -4033,6 +4949,17 @@ func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModelLogSummary) MarshalJSON() ([]byte, error) { + type embed DebugModelLogSummary + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModelLogSummary) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -4050,6 +4977,13 @@ func (d *DebugModelLogSummary) String() string { // 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. +var ( + emailAddressFieldCreatedAt = big.NewInt(1 << 0) + emailAddressFieldModifiedAt = big.NewInt(1 << 1) + emailAddressFieldEmailAddress = big.NewInt(1 << 2) + emailAddressFieldEmailAddressType = big.NewInt(1 << 3) +) + type EmailAddress struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -4060,6 +4994,9 @@ type EmailAddress struct { // The email address's type. EmailAddressType *string `json:"email_address_type,omitempty" url:"email_address_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4096,6 +5033,41 @@ func (e *EmailAddress) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EmailAddress) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddress) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(emailAddressFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddress) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(emailAddressFieldModifiedAt) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddress) SetEmailAddress(emailAddress *string) { + e.EmailAddress = emailAddress + e.require(emailAddressFieldEmailAddress) +} + +// SetEmailAddressType sets the EmailAddressType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddress) SetEmailAddressType(emailAddressType *string) { + e.EmailAddressType = emailAddressType + e.require(emailAddressFieldEmailAddressType) +} + func (e *EmailAddress) UnmarshalJSON(data []byte) error { type embed EmailAddress var unmarshaler = struct { @@ -4131,7 +5103,8 @@ func (e *EmailAddress) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(e.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(e.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *EmailAddress) String() string { @@ -4151,6 +5124,13 @@ func (e *EmailAddress) String() string { // 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. +var ( + emailAddressRequestFieldEmailAddress = big.NewInt(1 << 0) + emailAddressRequestFieldEmailAddressType = big.NewInt(1 << 1) + emailAddressRequestFieldIntegrationParams = big.NewInt(1 << 2) + emailAddressRequestFieldLinkedAccountParams = big.NewInt(1 << 3) +) + type EmailAddressRequest struct { // The email address. EmailAddress *string `json:"email_address,omitempty" url:"email_address,omitempty"` @@ -4159,6 +5139,9 @@ type EmailAddressRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4195,6 +5178,41 @@ func (e *EmailAddressRequest) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EmailAddressRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddressRequest) SetEmailAddress(emailAddress *string) { + e.EmailAddress = emailAddress + e.require(emailAddressRequestFieldEmailAddress) +} + +// SetEmailAddressType sets the EmailAddressType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddressRequest) SetEmailAddressType(emailAddressType *string) { + e.EmailAddressType = emailAddressType + e.require(emailAddressRequestFieldEmailAddressType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddressRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + e.IntegrationParams = integrationParams + e.require(emailAddressRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmailAddressRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + e.LinkedAccountParams = linkedAccountParams + e.require(emailAddressRequestFieldLinkedAccountParams) +} + func (e *EmailAddressRequest) UnmarshalJSON(data []byte) error { type unmarshaler EmailAddressRequest var value unmarshaler @@ -4211,6 +5229,17 @@ func (e *EmailAddressRequest) UnmarshalJSON(data []byte) error { return nil } +func (e *EmailAddressRequest) MarshalJSON() ([]byte, error) { + type embed EmailAddressRequest + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *EmailAddressRequest) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -4256,6 +5285,16 @@ func (e EncodingEnum) Ptr() *EncodingEnum { // 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 +var ( + engagementTypeFieldId = big.NewInt(1 << 0) + engagementTypeFieldRemoteId = big.NewInt(1 << 1) + engagementTypeFieldCreatedAt = big.NewInt(1 << 2) + engagementTypeFieldModifiedAt = big.NewInt(1 << 3) + engagementTypeFieldActivityType = big.NewInt(1 << 4) + engagementTypeFieldName = big.NewInt(1 << 5) + engagementTypeFieldRemoteFields = big.NewInt(1 << 6) +) + type EngagementType struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -4274,6 +5313,9 @@ type EngagementType struct { Name *string `json:"name,omitempty" url:"name,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4331,6 +5373,62 @@ func (e *EngagementType) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EngagementType) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementType) SetId(id *string) { + e.Id = id + e.require(engagementTypeFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementType) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(engagementTypeFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementType) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(engagementTypeFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementType) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(engagementTypeFieldModifiedAt) +} + +// SetActivityType sets the ActivityType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementType) SetActivityType(activityType *EngagementTypeActivityType) { + e.ActivityType = activityType + e.require(engagementTypeFieldActivityType) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementType) SetName(name *string) { + e.Name = name + e.require(engagementTypeFieldName) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EngagementType) SetRemoteFields(remoteFields []*RemoteField) { + e.RemoteFields = remoteFields + e.require(engagementTypeFieldRemoteFields) +} + func (e *EngagementType) UnmarshalJSON(data []byte) error { type embed EngagementType var unmarshaler = struct { @@ -4366,7 +5464,8 @@ func (e *EngagementType) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(e.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(e.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *EngagementType) String() string { @@ -4448,12 +5547,22 @@ func (e *EngagementTypeActivityType) Accept(visitor EngagementTypeActivityTypeVi return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + errorValidationProblemFieldSource = big.NewInt(1 << 0) + errorValidationProblemFieldTitle = big.NewInt(1 << 1) + errorValidationProblemFieldDetail = big.NewInt(1 << 2) + errorValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type ErrorValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4490,6 +5599,41 @@ func (e *ErrorValidationProblem) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ErrorValidationProblem) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetSource(source *ValidationProblemSource) { + e.Source = source + e.require(errorValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetTitle(title string) { + e.Title = title + e.require(errorValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetDetail(detail string) { + e.Detail = detail + e.require(errorValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetProblemType(problemType string) { + e.ProblemType = problemType + e.require(errorValidationProblemFieldProblemType) +} + func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler ErrorValidationProblem var value unmarshaler @@ -4506,6 +5650,17 @@ func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (e *ErrorValidationProblem) MarshalJSON() ([]byte, error) { + type embed ErrorValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ErrorValidationProblem) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -4558,10 +5713,18 @@ func (f FieldFormatEnum) Ptr() *FieldFormatEnum { return &f } +var ( + fieldPermissionDeserializerRequestFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerRequestFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializerRequest struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4584,6 +5747,27 @@ func (f *FieldPermissionDeserializerRequest) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldPermissionDeserializerRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerRequestFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerRequestFieldDisabledFields) +} + func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializerRequest var value unmarshaler @@ -4600,6 +5784,17 @@ func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializerRequest) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -4652,10 +5847,18 @@ func (f FieldTypeEnum) Ptr() *FieldTypeEnum { return &f } +var ( + ignoreCommonModelRequestFieldReason = big.NewInt(1 << 0) + ignoreCommonModelRequestFieldMessage = big.NewInt(1 << 1) +) + type IgnoreCommonModelRequest struct { Reason *IgnoreCommonModelRequestReason `json:"reason" url:"reason"` Message *string `json:"message,omitempty" url:"message,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4678,6 +5881,27 @@ func (i *IgnoreCommonModelRequest) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *IgnoreCommonModelRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IgnoreCommonModelRequest) SetReason(reason *IgnoreCommonModelRequestReason) { + i.Reason = reason + i.require(ignoreCommonModelRequestFieldReason) +} + +// SetMessage sets the Message field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IgnoreCommonModelRequest) SetMessage(message *string) { + i.Message = message + i.require(ignoreCommonModelRequestFieldMessage) +} + func (i *IgnoreCommonModelRequest) UnmarshalJSON(data []byte) error { type unmarshaler IgnoreCommonModelRequest var value unmarshaler @@ -4694,6 +5918,17 @@ func (i *IgnoreCommonModelRequest) UnmarshalJSON(data []byte) error { return nil } +func (i *IgnoreCommonModelRequest) MarshalJSON() ([]byte, error) { + type embed IgnoreCommonModelRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IgnoreCommonModelRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -4768,11 +6003,20 @@ func (i *IgnoreCommonModelRequestReason) Accept(visitor IgnoreCommonModelRequest return fmt.Errorf("type %T does not include a non-empty union type", i) } +var ( + individualCommonModelScopeDeserializerRequestFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerRequestFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerRequestFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializerRequest struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4802,6 +6046,34 @@ func (i *IndividualCommonModelScopeDeserializerRequest) GetExtraProperties() map return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializerRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerRequestFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializerRequest) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializerRequest) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializerRequest var value unmarshaler @@ -4818,6 +6090,17 @@ func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byt return nil } +func (i *IndividualCommonModelScopeDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializerRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -4870,11 +6153,20 @@ func (i ItemFormatEnum) Ptr() *ItemFormatEnum { return &i } +var ( + itemSchemaFieldItemType = big.NewInt(1 << 0) + itemSchemaFieldItemFormat = big.NewInt(1 << 1) + itemSchemaFieldItemChoices = big.NewInt(1 << 2) +) + type ItemSchema struct { ItemType *ItemTypeEnum `json:"item_type,omitempty" url:"item_type,omitempty"` ItemFormat *ItemFormatEnum `json:"item_format,omitempty" url:"item_format,omitempty"` ItemChoices []string `json:"item_choices,omitempty" url:"item_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4904,6 +6196,34 @@ func (i *ItemSchema) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *ItemSchema) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetItemType sets the ItemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemSchema) SetItemType(itemType *ItemTypeEnum) { + i.ItemType = itemType + i.require(itemSchemaFieldItemType) +} + +// SetItemFormat sets the ItemFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemSchema) SetItemFormat(itemFormat *ItemFormatEnum) { + i.ItemFormat = itemFormat + i.require(itemSchemaFieldItemFormat) +} + +// SetItemChoices sets the ItemChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemSchema) SetItemChoices(itemChoices []string) { + i.ItemChoices = itemChoices + i.require(itemSchemaFieldItemChoices) +} + func (i *ItemSchema) UnmarshalJSON(data []byte) error { type unmarshaler ItemSchema var value unmarshaler @@ -4920,6 +6240,17 @@ func (i *ItemSchema) UnmarshalJSON(data []byte) error { return nil } +func (i *ItemSchema) MarshalJSON() ([]byte, error) { + type embed ItemSchema + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *ItemSchema) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -5012,10 +6343,18 @@ func (l LastSyncResultEnum) Ptr() *LastSyncResultEnum { return &l } +var ( + linkedAccountStatusFieldLinkedAccountStatus = big.NewInt(1 << 0) + linkedAccountStatusFieldCanMakeRequest = big.NewInt(1 << 1) +) + type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status" url:"linked_account_status"` CanMakeRequest bool `json:"can_make_request" url:"can_make_request"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5038,6 +6377,27 @@ func (l *LinkedAccountStatus) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkedAccountStatus) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkedAccountStatus sets the LinkedAccountStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetLinkedAccountStatus(linkedAccountStatus string) { + l.LinkedAccountStatus = linkedAccountStatus + l.require(linkedAccountStatusFieldLinkedAccountStatus) +} + +// SetCanMakeRequest sets the CanMakeRequest field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetCanMakeRequest(canMakeRequest bool) { + l.CanMakeRequest = canMakeRequest + l.require(linkedAccountStatusFieldCanMakeRequest) +} + func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { type unmarshaler LinkedAccountStatus var value unmarshaler @@ -5054,6 +6414,17 @@ func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkedAccountStatus) MarshalJSON() ([]byte, error) { + type embed LinkedAccountStatus + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkedAccountStatus) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { @@ -5066,6 +6437,14 @@ func (l *LinkedAccountStatus) String() string { return fmt.Sprintf("%#v", l) } +var ( + metaResponseFieldRequestSchema = big.NewInt(1 << 0) + metaResponseFieldRemoteFieldClasses = big.NewInt(1 << 1) + metaResponseFieldStatus = big.NewInt(1 << 2) + metaResponseFieldHasConditionalParams = big.NewInt(1 << 3) + metaResponseFieldHasRequiredLinkedAccountParams = big.NewInt(1 << 4) +) + type MetaResponse struct { RequestSchema map[string]interface{} `json:"request_schema" url:"request_schema"` RemoteFieldClasses map[string]interface{} `json:"remote_field_classes,omitempty" url:"remote_field_classes,omitempty"` @@ -5073,6 +6452,9 @@ type MetaResponse struct { HasConditionalParams bool `json:"has_conditional_params" url:"has_conditional_params"` HasRequiredLinkedAccountParams bool `json:"has_required_linked_account_params" url:"has_required_linked_account_params"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5116,6 +6498,48 @@ func (m *MetaResponse) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *MetaResponse) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetRequestSchema sets the RequestSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRequestSchema(requestSchema map[string]interface{}) { + m.RequestSchema = requestSchema + m.require(metaResponseFieldRequestSchema) +} + +// SetRemoteFieldClasses sets the RemoteFieldClasses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRemoteFieldClasses(remoteFieldClasses map[string]interface{}) { + m.RemoteFieldClasses = remoteFieldClasses + m.require(metaResponseFieldRemoteFieldClasses) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetStatus(status *LinkedAccountStatus) { + m.Status = status + m.require(metaResponseFieldStatus) +} + +// SetHasConditionalParams sets the HasConditionalParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasConditionalParams(hasConditionalParams bool) { + m.HasConditionalParams = hasConditionalParams + m.require(metaResponseFieldHasConditionalParams) +} + +// SetHasRequiredLinkedAccountParams sets the HasRequiredLinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasRequiredLinkedAccountParams(hasRequiredLinkedAccountParams bool) { + m.HasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams + m.require(metaResponseFieldHasRequiredLinkedAccountParams) +} + func (m *MetaResponse) UnmarshalJSON(data []byte) error { type unmarshaler MetaResponse var value unmarshaler @@ -5132,6 +6556,17 @@ func (m *MetaResponse) UnmarshalJSON(data []byte) error { return nil } +func (m *MetaResponse) MarshalJSON() ([]byte, error) { + type embed MetaResponse + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MetaResponse) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -5194,12 +6629,22 @@ func (m MethodEnum) Ptr() *MethodEnum { // // ### Usage Example // View what operations are supported for the `Candidate` endpoint. +var ( + modelOperationFieldModelName = big.NewInt(1 << 0) + modelOperationFieldAvailableOperations = big.NewInt(1 << 1) + modelOperationFieldRequiredPostParameters = big.NewInt(1 << 2) + modelOperationFieldSupportedFields = big.NewInt(1 << 3) +) + type ModelOperation struct { ModelName string `json:"model_name" url:"model_name"` AvailableOperations []string `json:"available_operations" url:"available_operations"` RequiredPostParameters []string `json:"required_post_parameters" url:"required_post_parameters"` SupportedFields []string `json:"supported_fields" url:"supported_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5236,6 +6681,41 @@ func (m *ModelOperation) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *ModelOperation) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetModelName(modelName string) { + m.ModelName = modelName + m.require(modelOperationFieldModelName) +} + +// SetAvailableOperations sets the AvailableOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetAvailableOperations(availableOperations []string) { + m.AvailableOperations = availableOperations + m.require(modelOperationFieldAvailableOperations) +} + +// SetRequiredPostParameters sets the RequiredPostParameters field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetRequiredPostParameters(requiredPostParameters []string) { + m.RequiredPostParameters = requiredPostParameters + m.require(modelOperationFieldRequiredPostParameters) +} + +// SetSupportedFields sets the SupportedFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetSupportedFields(supportedFields []string) { + m.SupportedFields = supportedFields + m.require(modelOperationFieldSupportedFields) +} + func (m *ModelOperation) UnmarshalJSON(data []byte) error { type unmarshaler ModelOperation var value unmarshaler @@ -5252,6 +6732,17 @@ func (m *ModelOperation) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelOperation) MarshalJSON() ([]byte, error) { + type embed ModelOperation + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelOperation) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -5264,9 +6755,16 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +var ( + modelPermissionDeserializerRequestFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializerRequest struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5282,6 +6780,20 @@ func (m *ModelPermissionDeserializerRequest) GetExtraProperties() map[string]int return m.extraProperties } +func (m *ModelPermissionDeserializerRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializerRequest) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerRequestFieldIsEnabled) +} + func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializerRequest var value unmarshaler @@ -5298,6 +6810,17 @@ func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializerRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -5316,6 +6839,14 @@ func (m *ModelPermissionDeserializerRequest) String() string { // // ### Usage Example // Create a `MultipartFormField` to define a multipart form entry. +var ( + multipartFormFieldRequestFieldName = big.NewInt(1 << 0) + multipartFormFieldRequestFieldData = big.NewInt(1 << 1) + multipartFormFieldRequestFieldEncoding = big.NewInt(1 << 2) + multipartFormFieldRequestFieldFileName = big.NewInt(1 << 3) + multipartFormFieldRequestFieldContentType = big.NewInt(1 << 4) +) + type MultipartFormFieldRequest struct { // The name of the form field Name string `json:"name" url:"name"` @@ -5332,6 +6863,9 @@ type MultipartFormFieldRequest struct { // The MIME type of the file, if the field is for a file. ContentType *string `json:"content_type,omitempty" url:"content_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5375,6 +6909,48 @@ func (m *MultipartFormFieldRequest) GetExtraProperties() map[string]interface{} return m.extraProperties } +func (m *MultipartFormFieldRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetName(name string) { + m.Name = name + m.require(multipartFormFieldRequestFieldName) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetData(data string) { + m.Data = data + m.require(multipartFormFieldRequestFieldData) +} + +// SetEncoding sets the Encoding field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetEncoding(encoding *MultipartFormFieldRequestEncoding) { + m.Encoding = encoding + m.require(multipartFormFieldRequestFieldEncoding) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetFileName(fileName *string) { + m.FileName = fileName + m.require(multipartFormFieldRequestFieldFileName) +} + +// SetContentType sets the ContentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetContentType(contentType *string) { + m.ContentType = contentType + m.require(multipartFormFieldRequestFieldContentType) +} + func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { type unmarshaler MultipartFormFieldRequest var value unmarshaler @@ -5391,6 +6967,17 @@ func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *MultipartFormFieldRequest) MarshalJSON() ([]byte, error) { + type embed MultipartFormFieldRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MultipartFormFieldRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -5475,6 +7062,27 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq // The `Opportunity` object is used to represent a deal opportunity in a CRM system. // ### Usage Example // TODO +var ( + opportunityFieldId = big.NewInt(1 << 0) + opportunityFieldRemoteId = big.NewInt(1 << 1) + opportunityFieldCreatedAt = big.NewInt(1 << 2) + opportunityFieldModifiedAt = big.NewInt(1 << 3) + opportunityFieldName = big.NewInt(1 << 4) + opportunityFieldDescription = big.NewInt(1 << 5) + opportunityFieldAmount = big.NewInt(1 << 6) + opportunityFieldOwner = big.NewInt(1 << 7) + opportunityFieldAccount = big.NewInt(1 << 8) + opportunityFieldStage = big.NewInt(1 << 9) + opportunityFieldStatus = big.NewInt(1 << 10) + opportunityFieldLastActivityAt = big.NewInt(1 << 11) + opportunityFieldCloseDate = big.NewInt(1 << 12) + opportunityFieldRemoteCreatedAt = big.NewInt(1 << 13) + opportunityFieldRemoteWasDeleted = big.NewInt(1 << 14) + opportunityFieldFieldMappings = big.NewInt(1 << 15) + opportunityFieldRemoteData = big.NewInt(1 << 16) + opportunityFieldRemoteFields = big.NewInt(1 << 17) +) + type Opportunity struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -5513,6 +7121,9 @@ type Opportunity struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5647,6 +7258,139 @@ func (o *Opportunity) GetExtraProperties() map[string]interface{} { return o.extraProperties } +func (o *Opportunity) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetId(id *string) { + o.Id = id + o.require(opportunityFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetRemoteId(remoteId *string) { + o.RemoteId = remoteId + o.require(opportunityFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetCreatedAt(createdAt *time.Time) { + o.CreatedAt = createdAt + o.require(opportunityFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetModifiedAt(modifiedAt *time.Time) { + o.ModifiedAt = modifiedAt + o.require(opportunityFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetName(name *string) { + o.Name = name + o.require(opportunityFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetDescription(description *string) { + o.Description = description + o.require(opportunityFieldDescription) +} + +// SetAmount sets the Amount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetAmount(amount *int) { + o.Amount = amount + o.require(opportunityFieldAmount) +} + +// SetOwner sets the Owner field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetOwner(owner *OpportunityOwner) { + o.Owner = owner + o.require(opportunityFieldOwner) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetAccount(account *OpportunityAccount) { + o.Account = account + o.require(opportunityFieldAccount) +} + +// SetStage sets the Stage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetStage(stage *OpportunityStage) { + o.Stage = stage + o.require(opportunityFieldStage) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetStatus(status *OpportunityStatus) { + o.Status = status + o.require(opportunityFieldStatus) +} + +// SetLastActivityAt sets the LastActivityAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetLastActivityAt(lastActivityAt *time.Time) { + o.LastActivityAt = lastActivityAt + o.require(opportunityFieldLastActivityAt) +} + +// SetCloseDate sets the CloseDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetCloseDate(closeDate *time.Time) { + o.CloseDate = closeDate + o.require(opportunityFieldCloseDate) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + o.RemoteCreatedAt = remoteCreatedAt + o.require(opportunityFieldRemoteCreatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetRemoteWasDeleted(remoteWasDeleted *bool) { + o.RemoteWasDeleted = remoteWasDeleted + o.require(opportunityFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetFieldMappings(fieldMappings map[string]interface{}) { + o.FieldMappings = fieldMappings + o.require(opportunityFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetRemoteData(remoteData []*RemoteData) { + o.RemoteData = remoteData + o.require(opportunityFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *Opportunity) SetRemoteFields(remoteFields []*RemoteField) { + o.RemoteFields = remoteFields + o.require(opportunityFieldRemoteFields) +} + func (o *Opportunity) UnmarshalJSON(data []byte) error { type embed Opportunity var unmarshaler = struct { @@ -5694,7 +7438,8 @@ func (o *Opportunity) MarshalJSON() ([]byte, error) { CloseDate: internal.NewOptionalDateTime(o.CloseDate), RemoteCreatedAt: internal.NewOptionalDateTime(o.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields) + return json.Marshal(explicitMarshaler) } func (o *Opportunity) String() string { @@ -5993,11 +7738,20 @@ func (o OpportunityStatusEnum) Ptr() *OpportunityStatusEnum { return &o } +var ( + paginatedRemoteFieldClassListFieldNext = big.NewInt(1 << 0) + paginatedRemoteFieldClassListFieldPrevious = big.NewInt(1 << 1) + paginatedRemoteFieldClassListFieldResults = big.NewInt(1 << 2) +) + type PaginatedRemoteFieldClassList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*RemoteFieldClass `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6027,6 +7781,34 @@ func (p *PaginatedRemoteFieldClassList) GetExtraProperties() map[string]interfac return p.extraProperties } +func (p *PaginatedRemoteFieldClassList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteFieldClassList) SetNext(next *string) { + p.Next = next + p.require(paginatedRemoteFieldClassListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteFieldClassList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedRemoteFieldClassListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteFieldClassList) SetResults(results []*RemoteFieldClass) { + p.Results = results + p.require(paginatedRemoteFieldClassListFieldResults) +} + func (p *PaginatedRemoteFieldClassList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedRemoteFieldClassList var value unmarshaler @@ -6043,6 +7825,17 @@ func (p *PaginatedRemoteFieldClassList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedRemoteFieldClassList) MarshalJSON() ([]byte, error) { + type embed PaginatedRemoteFieldClassList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedRemoteFieldClassList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -6060,6 +7853,13 @@ func (p *PaginatedRemoteFieldClassList) String() string { // 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. +var ( + phoneNumberFieldCreatedAt = big.NewInt(1 << 0) + phoneNumberFieldModifiedAt = big.NewInt(1 << 1) + phoneNumberFieldPhoneNumber = big.NewInt(1 << 2) + phoneNumberFieldPhoneNumberType = big.NewInt(1 << 3) +) + type PhoneNumber struct { // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` @@ -6070,6 +7870,9 @@ type PhoneNumber struct { // The phone number's type. PhoneNumberType *string `json:"phone_number_type,omitempty" url:"phone_number_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6106,6 +7909,41 @@ func (p *PhoneNumber) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PhoneNumber) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumber) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(phoneNumberFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumber) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(phoneNumberFieldModifiedAt) +} + +// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumber) SetPhoneNumber(phoneNumber *string) { + p.PhoneNumber = phoneNumber + p.require(phoneNumberFieldPhoneNumber) +} + +// SetPhoneNumberType sets the PhoneNumberType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumber) SetPhoneNumberType(phoneNumberType *string) { + p.PhoneNumberType = phoneNumberType + p.require(phoneNumberFieldPhoneNumberType) +} + func (p *PhoneNumber) UnmarshalJSON(data []byte) error { type embed PhoneNumber var unmarshaler = struct { @@ -6141,7 +7979,8 @@ func (p *PhoneNumber) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(p.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PhoneNumber) String() string { @@ -6161,6 +8000,13 @@ func (p *PhoneNumber) String() string { // 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. +var ( + phoneNumberRequestFieldPhoneNumber = big.NewInt(1 << 0) + phoneNumberRequestFieldPhoneNumberType = big.NewInt(1 << 1) + phoneNumberRequestFieldIntegrationParams = big.NewInt(1 << 2) + phoneNumberRequestFieldLinkedAccountParams = big.NewInt(1 << 3) +) + type PhoneNumberRequest struct { // The phone number. PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` @@ -6169,6 +8015,9 @@ type PhoneNumberRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6205,6 +8054,41 @@ func (p *PhoneNumberRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PhoneNumberRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumberRequest) SetPhoneNumber(phoneNumber *string) { + p.PhoneNumber = phoneNumber + p.require(phoneNumberRequestFieldPhoneNumber) +} + +// SetPhoneNumberType sets the PhoneNumberType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumberRequest) SetPhoneNumberType(phoneNumberType *string) { + p.PhoneNumberType = phoneNumberType + p.require(phoneNumberRequestFieldPhoneNumberType) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumberRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(phoneNumberRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PhoneNumberRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(phoneNumberRequestFieldLinkedAccountParams) +} + func (p *PhoneNumberRequest) UnmarshalJSON(data []byte) error { type unmarshaler PhoneNumberRequest var value unmarshaler @@ -6221,6 +8105,17 @@ func (p *PhoneNumberRequest) UnmarshalJSON(data []byte) error { return nil } +func (p *PhoneNumberRequest) MarshalJSON() ([]byte, error) { + type embed PhoneNumberRequest + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PhoneNumberRequest) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -6267,11 +8162,19 @@ func (r ReasonEnum) Ptr() *ReasonEnum { // // ### Usage Example // TODO +var ( + remoteDataFieldPath = big.NewInt(1 << 0) + remoteDataFieldData = big.NewInt(1 << 1) +) + type RemoteData struct { // The third-party API path that is being called. Path string `json:"path" url:"path"` Data interface{} `json:"data,omitempty" url:"data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6294,6 +8197,27 @@ func (r *RemoteData) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteData) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetPath(path string) { + r.Path = path + r.require(remoteDataFieldPath) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetData(data interface{}) { + r.Data = data + r.require(remoteDataFieldData) +} + func (r *RemoteData) UnmarshalJSON(data []byte) error { type unmarshaler RemoteData var value unmarshaler @@ -6310,6 +8234,17 @@ func (r *RemoteData) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteData) MarshalJSON() ([]byte, error) { + type embed RemoteData + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteData) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -6322,10 +8257,18 @@ func (r *RemoteData) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldFieldRemoteFieldClass = big.NewInt(1 << 0) + remoteFieldFieldValue = big.NewInt(1 << 1) +) + type RemoteField struct { RemoteFieldClass *RemoteFieldRemoteFieldClass `json:"remote_field_class" url:"remote_field_class"` Value interface{} `json:"value,omitempty" url:"value,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6348,6 +8291,27 @@ func (r *RemoteField) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteField) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetRemoteFieldClass sets the RemoteFieldClass field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteField) SetRemoteFieldClass(remoteFieldClass *RemoteFieldRemoteFieldClass) { + r.RemoteFieldClass = remoteFieldClass + r.require(remoteFieldFieldRemoteFieldClass) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteField) SetValue(value interface{}) { + r.Value = value + r.require(remoteFieldFieldValue) +} + func (r *RemoteField) UnmarshalJSON(data []byte) error { type unmarshaler RemoteField var value unmarshaler @@ -6364,6 +8328,17 @@ func (r *RemoteField) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteField) MarshalJSON() ([]byte, error) { + type embed RemoteField + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteField) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -6376,6 +8351,19 @@ func (r *RemoteField) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldClassFieldId = big.NewInt(1 << 0) + remoteFieldClassFieldDisplayName = big.NewInt(1 << 1) + remoteFieldClassFieldRemoteKeyName = big.NewInt(1 << 2) + remoteFieldClassFieldDescription = big.NewInt(1 << 3) + remoteFieldClassFieldIsCustom = big.NewInt(1 << 4) + remoteFieldClassFieldIsRequired = big.NewInt(1 << 5) + remoteFieldClassFieldFieldType = big.NewInt(1 << 6) + remoteFieldClassFieldFieldFormat = big.NewInt(1 << 7) + remoteFieldClassFieldFieldChoices = big.NewInt(1 << 8) + remoteFieldClassFieldItemSchema = big.NewInt(1 << 9) +) + type RemoteFieldClass struct { Id *string `json:"id,omitempty" url:"id,omitempty"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` @@ -6388,6 +8376,9 @@ type RemoteFieldClass struct { FieldChoices []*RemoteFieldClassFieldChoicesItem `json:"field_choices,omitempty" url:"field_choices,omitempty"` ItemSchema *ItemSchema `json:"item_schema,omitempty" url:"item_schema,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6466,6 +8457,83 @@ func (r *RemoteFieldClass) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldClass) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetId(id *string) { + r.Id = id + r.require(remoteFieldClassFieldId) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetDisplayName(displayName *string) { + r.DisplayName = displayName + r.require(remoteFieldClassFieldDisplayName) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetRemoteKeyName(remoteKeyName *string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldClassFieldRemoteKeyName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetDescription(description *string) { + r.Description = description + r.require(remoteFieldClassFieldDescription) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetIsCustom(isCustom *bool) { + r.IsCustom = isCustom + r.require(remoteFieldClassFieldIsCustom) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetIsRequired(isRequired *bool) { + r.IsRequired = isRequired + r.require(remoteFieldClassFieldIsRequired) +} + +// SetFieldType sets the FieldType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetFieldType(fieldType *FieldTypeEnum) { + r.FieldType = fieldType + r.require(remoteFieldClassFieldFieldType) +} + +// SetFieldFormat sets the FieldFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetFieldFormat(fieldFormat *FieldFormatEnum) { + r.FieldFormat = fieldFormat + r.require(remoteFieldClassFieldFieldFormat) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetFieldChoices(fieldChoices []*RemoteFieldClassFieldChoicesItem) { + r.FieldChoices = fieldChoices + r.require(remoteFieldClassFieldFieldChoices) +} + +// SetItemSchema sets the ItemSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetItemSchema(itemSchema *ItemSchema) { + r.ItemSchema = itemSchema + r.require(remoteFieldClassFieldItemSchema) +} + func (r *RemoteFieldClass) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldClass var value unmarshaler @@ -6482,6 +8550,17 @@ func (r *RemoteFieldClass) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldClass) MarshalJSON() ([]byte, error) { + type embed RemoteFieldClass + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldClass) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -6494,10 +8573,18 @@ func (r *RemoteFieldClass) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldClassFieldChoicesItemFieldValue = big.NewInt(1 << 0) + remoteFieldClassFieldChoicesItemFieldDisplayName = big.NewInt(1 << 1) +) + type RemoteFieldClassFieldChoicesItem struct { Value interface{} `json:"value,omitempty" url:"value,omitempty"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6520,6 +8607,27 @@ func (r *RemoteFieldClassFieldChoicesItem) GetExtraProperties() map[string]inter return r.extraProperties } +func (r *RemoteFieldClassFieldChoicesItem) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassFieldChoicesItem) SetValue(value interface{}) { + r.Value = value + r.require(remoteFieldClassFieldChoicesItemFieldValue) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassFieldChoicesItem) SetDisplayName(displayName *string) { + r.DisplayName = displayName + r.require(remoteFieldClassFieldChoicesItemFieldDisplayName) +} + func (r *RemoteFieldClassFieldChoicesItem) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldClassFieldChoicesItem var value unmarshaler @@ -6536,6 +8644,17 @@ func (r *RemoteFieldClassFieldChoicesItem) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldClassFieldChoicesItem) MarshalJSON() ([]byte, error) { + type embed RemoteFieldClassFieldChoicesItem + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldClassFieldChoicesItem) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -6610,10 +8729,18 @@ func (r *RemoteFieldRemoteFieldClass) Accept(visitor RemoteFieldRemoteFieldClass return fmt.Errorf("type %T does not include a non-empty union type", r) } +var ( + remoteFieldRequestFieldRemoteFieldClass = big.NewInt(1 << 0) + remoteFieldRequestFieldValue = big.NewInt(1 << 1) +) + type RemoteFieldRequest struct { RemoteFieldClass *RemoteFieldRequestRemoteFieldClass `json:"remote_field_class" url:"remote_field_class"` Value interface{} `json:"value,omitempty" url:"value,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6636,6 +8763,27 @@ func (r *RemoteFieldRequest) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetRemoteFieldClass sets the RemoteFieldClass field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldRequest) SetRemoteFieldClass(remoteFieldClass *RemoteFieldRequestRemoteFieldClass) { + r.RemoteFieldClass = remoteFieldClass + r.require(remoteFieldRequestFieldRemoteFieldClass) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldRequest) SetValue(value interface{}) { + r.Value = value + r.require(remoteFieldRequestFieldValue) +} + func (r *RemoteFieldRequest) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldRequest var value unmarshaler @@ -6652,6 +8800,17 @@ func (r *RemoteFieldRequest) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldRequest) MarshalJSON() ([]byte, error) { + type embed RemoteFieldRequest + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldRequest) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -6732,10 +8891,18 @@ func (r *RemoteFieldRequestRemoteFieldClass) Accept(visitor RemoteFieldRequestRe // // ### Usage Example // Post a `GenerateRemoteKey` to receive a new `RemoteKey`. +var ( + remoteKeyFieldName = big.NewInt(1 << 0) + remoteKeyFieldKey = big.NewInt(1 << 1) +) + type RemoteKey struct { Name string `json:"name" url:"name"` Key string `json:"key" url:"key"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6758,6 +8925,27 @@ func (r *RemoteKey) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteKey) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetName(name string) { + r.Name = name + r.require(remoteKeyFieldName) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetKey(key string) { + r.Key = key + r.require(remoteKeyFieldKey) +} + func (r *RemoteKey) UnmarshalJSON(data []byte) error { type unmarshaler RemoteKey var value unmarshaler @@ -6774,6 +8962,17 @@ func (r *RemoteKey) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteKey) MarshalJSON() ([]byte, error) { + type embed RemoteKey + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteKey) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -6792,6 +8991,16 @@ func (r *RemoteKey) String() string { // // ### Usage Example // View the `RemoteResponse` returned from your `DataPassthrough`. +var ( + remoteResponseFieldMethod = big.NewInt(1 << 0) + remoteResponseFieldPath = big.NewInt(1 << 1) + remoteResponseFieldStatus = big.NewInt(1 << 2) + remoteResponseFieldResponse = big.NewInt(1 << 3) + remoteResponseFieldResponseHeaders = big.NewInt(1 << 4) + remoteResponseFieldResponseType = big.NewInt(1 << 5) + remoteResponseFieldHeaders = big.NewInt(1 << 6) +) + type RemoteResponse struct { Method string `json:"method" url:"method"` Path string `json:"path" url:"path"` @@ -6801,6 +9010,9 @@ type RemoteResponse struct { ResponseType *RemoteResponseResponseType `json:"response_type,omitempty" url:"response_type,omitempty"` Headers map[string]interface{} `json:"headers,omitempty" url:"headers,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6858,6 +9070,62 @@ func (r *RemoteResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetMethod(method string) { + r.Method = method + r.require(remoteResponseFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetPath(path string) { + r.Path = path + r.require(remoteResponseFieldPath) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetStatus(status int) { + r.Status = status + r.require(remoteResponseFieldStatus) +} + +// SetResponse sets the Response field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponse(response interface{}) { + r.Response = response + r.require(remoteResponseFieldResponse) +} + +// SetResponseHeaders sets the ResponseHeaders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseHeaders(responseHeaders map[string]interface{}) { + r.ResponseHeaders = responseHeaders + r.require(remoteResponseFieldResponseHeaders) +} + +// SetResponseType sets the ResponseType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseType(responseType *RemoteResponseResponseType) { + r.ResponseType = responseType + r.require(remoteResponseFieldResponseType) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetHeaders(headers map[string]interface{}) { + r.Headers = headers + r.require(remoteResponseFieldHeaders) +} + func (r *RemoteResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteResponse var value unmarshaler @@ -6874,6 +9142,17 @@ func (r *RemoteResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteResponse) MarshalJSON() ([]byte, error) { + type embed RemoteResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -7029,6 +9308,18 @@ func (s SelectiveSyncConfigurationsUsageEnum) Ptr() *SelectiveSyncConfigurations // The `Stage` object is used to represent the stage of an opportunity. // ### Usage Example // TODO +var ( + stageFieldId = big.NewInt(1 << 0) + stageFieldRemoteId = big.NewInt(1 << 1) + stageFieldCreatedAt = big.NewInt(1 << 2) + stageFieldModifiedAt = big.NewInt(1 << 3) + stageFieldName = big.NewInt(1 << 4) + stageFieldRemoteWasDeleted = big.NewInt(1 << 5) + stageFieldFieldMappings = big.NewInt(1 << 6) + stageFieldRemoteData = big.NewInt(1 << 7) + stageFieldRemoteFields = big.NewInt(1 << 8) +) + type Stage struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -7045,6 +9336,9 @@ type Stage struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7116,6 +9410,76 @@ func (s *Stage) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *Stage) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Stage) SetId(id *string) { + s.Id = id + s.require(stageFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Stage) SetRemoteId(remoteId *string) { + s.RemoteId = remoteId + s.require(stageFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Stage) SetCreatedAt(createdAt *time.Time) { + s.CreatedAt = createdAt + s.require(stageFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Stage) SetModifiedAt(modifiedAt *time.Time) { + s.ModifiedAt = modifiedAt + s.require(stageFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Stage) SetName(name *string) { + s.Name = name + s.require(stageFieldName) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Stage) SetRemoteWasDeleted(remoteWasDeleted *bool) { + s.RemoteWasDeleted = remoteWasDeleted + s.require(stageFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Stage) SetFieldMappings(fieldMappings map[string]interface{}) { + s.FieldMappings = fieldMappings + s.require(stageFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Stage) SetRemoteData(remoteData []*RemoteData) { + s.RemoteData = remoteData + s.require(stageFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *Stage) SetRemoteFields(remoteFields []*RemoteField) { + s.RemoteFields = remoteFields + s.require(stageFieldRemoteFields) +} + func (s *Stage) UnmarshalJSON(data []byte) error { type embed Stage var unmarshaler = struct { @@ -7151,7 +9515,8 @@ func (s *Stage) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(s.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(s.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *Stage) String() string { @@ -7212,6 +9577,18 @@ func (s StatusFd5Enum) Ptr() *StatusFd5Enum { // // ### Usage Example // View the `SyncStatus` for an account to see how recently its models were synced. +var ( + syncStatusFieldModelName = big.NewInt(1 << 0) + syncStatusFieldModelId = big.NewInt(1 << 1) + syncStatusFieldLastSyncStart = big.NewInt(1 << 2) + syncStatusFieldNextSyncStart = big.NewInt(1 << 3) + syncStatusFieldLastSyncResult = big.NewInt(1 << 4) + syncStatusFieldLastSyncFinished = big.NewInt(1 << 5) + syncStatusFieldStatus = big.NewInt(1 << 6) + syncStatusFieldIsInitialSync = big.NewInt(1 << 7) + syncStatusFieldSelectiveSyncConfigurationsUsage = big.NewInt(1 << 8) +) + type SyncStatus struct { ModelName string `json:"model_name" url:"model_name"` ModelId string `json:"model_id" url:"model_id"` @@ -7223,6 +9600,9 @@ type SyncStatus struct { IsInitialSync bool `json:"is_initial_sync" url:"is_initial_sync"` SelectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum `json:"selective_sync_configurations_usage,omitempty" url:"selective_sync_configurations_usage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7294,6 +9674,76 @@ func (s *SyncStatus) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *SyncStatus) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelName(modelName string) { + s.ModelName = modelName + s.require(syncStatusFieldModelName) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelId(modelId string) { + s.ModelId = modelId + s.require(syncStatusFieldModelId) +} + +// SetLastSyncStart sets the LastSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncStart(lastSyncStart *time.Time) { + s.LastSyncStart = lastSyncStart + s.require(syncStatusFieldLastSyncStart) +} + +// SetNextSyncStart sets the NextSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetNextSyncStart(nextSyncStart *time.Time) { + s.NextSyncStart = nextSyncStart + s.require(syncStatusFieldNextSyncStart) +} + +// SetLastSyncResult sets the LastSyncResult field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncResult(lastSyncResult *SyncStatusLastSyncResult) { + s.LastSyncResult = lastSyncResult + s.require(syncStatusFieldLastSyncResult) +} + +// SetLastSyncFinished sets the LastSyncFinished field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncFinished(lastSyncFinished *time.Time) { + s.LastSyncFinished = lastSyncFinished + s.require(syncStatusFieldLastSyncFinished) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetStatus(status *SyncStatusStatus) { + s.Status = status + s.require(syncStatusFieldStatus) +} + +// SetIsInitialSync sets the IsInitialSync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetIsInitialSync(isInitialSync bool) { + s.IsInitialSync = isInitialSync + s.require(syncStatusFieldIsInitialSync) +} + +// SetSelectiveSyncConfigurationsUsage sets the SelectiveSyncConfigurationsUsage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetSelectiveSyncConfigurationsUsage(selectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum) { + s.SelectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage + s.require(syncStatusFieldSelectiveSyncConfigurationsUsage) +} + func (s *SyncStatus) UnmarshalJSON(data []byte) error { type embed SyncStatus var unmarshaler = struct { @@ -7333,7 +9783,8 @@ func (s *SyncStatus) MarshalJSON() ([]byte, error) { NextSyncStart: internal.NewOptionalDateTime(s.NextSyncStart), LastSyncFinished: internal.NewOptionalDateTime(s.LastSyncFinished), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *SyncStatus) String() string { @@ -7477,6 +9928,20 @@ func (s *SyncStatusStatus) Accept(visitor SyncStatusStatusVisitor) error { // The `User` object is used to represent a user with a login to the CRM system. // ### Usage Example // TODO +var ( + userFieldId = big.NewInt(1 << 0) + userFieldRemoteId = big.NewInt(1 << 1) + userFieldCreatedAt = big.NewInt(1 << 2) + userFieldModifiedAt = big.NewInt(1 << 3) + userFieldName = big.NewInt(1 << 4) + userFieldEmail = big.NewInt(1 << 5) + userFieldIsActive = big.NewInt(1 << 6) + userFieldRemoteWasDeleted = big.NewInt(1 << 7) + userFieldFieldMappings = big.NewInt(1 << 8) + userFieldRemoteData = big.NewInt(1 << 9) + userFieldRemoteFields = big.NewInt(1 << 10) +) + type User struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -7497,6 +9962,9 @@ type User struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7582,6 +10050,90 @@ func (u *User) GetExtraProperties() map[string]interface{} { return u.extraProperties } +func (u *User) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetId(id *string) { + u.Id = id + u.require(userFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteId(remoteId *string) { + u.RemoteId = remoteId + u.require(userFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetCreatedAt(createdAt *time.Time) { + u.CreatedAt = createdAt + u.require(userFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetModifiedAt(modifiedAt *time.Time) { + u.ModifiedAt = modifiedAt + u.require(userFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetName(name *string) { + u.Name = name + u.require(userFieldName) +} + +// SetEmail sets the Email field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetEmail(email *string) { + u.Email = email + u.require(userFieldEmail) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetIsActive(isActive *bool) { + u.IsActive = isActive + u.require(userFieldIsActive) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteWasDeleted(remoteWasDeleted *bool) { + u.RemoteWasDeleted = remoteWasDeleted + u.require(userFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetFieldMappings(fieldMappings map[string]interface{}) { + u.FieldMappings = fieldMappings + u.require(userFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteData(remoteData []*RemoteData) { + u.RemoteData = remoteData + u.require(userFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteFields(remoteFields []*RemoteField) { + u.RemoteFields = remoteFields + u.require(userFieldRemoteFields) +} + func (u *User) UnmarshalJSON(data []byte) error { type embed User var unmarshaler = struct { @@ -7617,7 +10169,8 @@ func (u *User) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(u.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(u.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) } func (u *User) String() string { @@ -7632,9 +10185,16 @@ func (u *User) String() string { return fmt.Sprintf("%#v", u) } +var ( + validationProblemSourceFieldPointer = big.NewInt(1 << 0) +) + type ValidationProblemSource struct { Pointer string `json:"pointer" url:"pointer"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7650,6 +10210,20 @@ func (v *ValidationProblemSource) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *ValidationProblemSource) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetPointer sets the Pointer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *ValidationProblemSource) SetPointer(pointer string) { + v.Pointer = pointer + v.require(validationProblemSourceFieldPointer) +} + func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { type unmarshaler ValidationProblemSource var value unmarshaler @@ -7666,6 +10240,17 @@ func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { return nil } +func (v *ValidationProblemSource) MarshalJSON() ([]byte, error) { + type embed ValidationProblemSource + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (v *ValidationProblemSource) String() string { if len(v.rawJSON) > 0 { if value, err := internal.StringifyJSON(v.rawJSON); err == nil { @@ -7678,12 +10263,22 @@ func (v *ValidationProblemSource) String() string { return fmt.Sprintf("%#v", v) } +var ( + warningValidationProblemFieldSource = big.NewInt(1 << 0) + warningValidationProblemFieldTitle = big.NewInt(1 << 1) + warningValidationProblemFieldDetail = big.NewInt(1 << 2) + warningValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type WarningValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7720,6 +10315,41 @@ func (w *WarningValidationProblem) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WarningValidationProblem) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetSource(source *ValidationProblemSource) { + w.Source = source + w.require(warningValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetTitle(title string) { + w.Title = title + w.require(warningValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetDetail(detail string) { + w.Detail = detail + w.require(warningValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetProblemType(problemType string) { + w.ProblemType = problemType + w.require(warningValidationProblemFieldProblemType) +} + func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler WarningValidationProblem var value unmarshaler @@ -7736,6 +10366,17 @@ func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (w *WarningValidationProblem) MarshalJSON() ([]byte, error) { + type embed WarningValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WarningValidationProblem) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/crm/users.go b/crm/users.go index e1be1cc..b470d7d 100644 --- a/crm/users.go +++ b/crm/users.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + usersListRequestFieldCreatedAfter = big.NewInt(1 << 0) + usersListRequestFieldCreatedBefore = big.NewInt(1 << 1) + usersListRequestFieldCursor = big.NewInt(1 << 2) + usersListRequestFieldEmail = big.NewInt(1 << 3) + usersListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + usersListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + usersListRequestFieldIncludeRemoteFields = big.NewInt(1 << 6) + usersListRequestFieldIncludeShellData = big.NewInt(1 << 7) + usersListRequestFieldModifiedAfter = big.NewInt(1 << 8) + usersListRequestFieldModifiedBefore = big.NewInt(1 << 9) + usersListRequestFieldPageSize = big.NewInt(1 << 10) + usersListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type UsersListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -34,8 +50,113 @@ type UsersListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UsersListRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCreatedAfter(createdAfter *time.Time) { + u.CreatedAfter = createdAfter + u.require(usersListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCreatedBefore(createdBefore *time.Time) { + u.CreatedBefore = createdBefore + u.require(usersListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCursor(cursor *string) { + u.Cursor = cursor + u.require(usersListRequestFieldCursor) +} + +// SetEmail sets the Email field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetEmail(email *string) { + u.Email = email + u.require(usersListRequestFieldEmail) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + u.IncludeDeletedData = includeDeletedData + u.require(usersListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + u.IncludeRemoteData = includeRemoteData + u.require(usersListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + u.IncludeRemoteFields = includeRemoteFields + u.require(usersListRequestFieldIncludeRemoteFields) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeShellData(includeShellData *bool) { + u.IncludeShellData = includeShellData + u.require(usersListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + u.ModifiedAfter = modifiedAfter + u.require(usersListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + u.ModifiedBefore = modifiedBefore + u.require(usersListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetPageSize(pageSize *int) { + u.PageSize = pageSize + u.require(usersListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetRemoteId(remoteId *string) { + u.RemoteId = remoteId + u.require(usersListRequestFieldRemoteId) +} + +var ( + usersRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + usersRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 1) + usersRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 2) + usersRemoteFieldClassesListRequestFieldIncludeRemoteFields = big.NewInt(1 << 3) + usersRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + usersRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + usersRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + usersRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type UsersRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -53,8 +174,80 @@ type UsersRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UsersRemoteFieldClassesListRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRemoteFieldClassesListRequest) SetCursor(cursor *string) { + u.Cursor = cursor + u.require(usersRemoteFieldClassesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + u.IncludeDeletedData = includeDeletedData + u.require(usersRemoteFieldClassesListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + u.IncludeRemoteData = includeRemoteData + u.require(usersRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRemoteFieldClassesListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + u.IncludeRemoteFields = includeRemoteFields + u.require(usersRemoteFieldClassesListRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + u.IncludeShellData = includeShellData + u.require(usersRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + u.IsCommonModelField = isCommonModelField + u.require(usersRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + u.IsCustom = isCustom + u.require(usersRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + u.PageSize = pageSize + u.require(usersRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + usersRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + usersRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 1) + usersRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type UsersRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -62,13 +255,53 @@ type UsersRetrieveRequest struct { IncludeRemoteFields *bool `json:"-" url:"include_remote_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UsersRetrieveRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + u.IncludeRemoteData = includeRemoteData + u.require(usersRetrieveRequestFieldIncludeRemoteData) } +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + u.IncludeRemoteFields = includeRemoteFields + u.require(usersRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + u.IncludeShellData = includeShellData + u.require(usersRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedUserListFieldNext = big.NewInt(1 << 0) + paginatedUserListFieldPrevious = big.NewInt(1 << 1) + paginatedUserListFieldResults = big.NewInt(1 << 2) +) + type PaginatedUserList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*User `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -98,6 +331,34 @@ func (p *PaginatedUserList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedUserList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedUserList) SetNext(next *string) { + p.Next = next + p.require(paginatedUserListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedUserList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedUserListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedUserList) SetResults(results []*User) { + p.Results = results + p.require(paginatedUserListFieldResults) +} + func (p *PaginatedUserList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedUserList var value unmarshaler @@ -114,6 +375,17 @@ func (p *PaginatedUserList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedUserList) MarshalJSON() ([]byte, error) { + type embed PaginatedUserList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedUserList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/crm/users/client.go b/crm/users/client.go index eb2d0a0..499664b 100644 --- a/crm/users/client.go +++ b/crm/users/client.go @@ -4,7 +4,6 @@ package users import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *crm.UsersListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.User], error) { +) (*core.Page[*string, *crm.User], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedUserList) *internal.PageResponse[*string, *crm.User] { + readPageResponse := func(response *crm.PaginatedUserList) *core.PageResponse[*string, *crm.User] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.User]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.User]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,45 +98,16 @@ func (c *Client) Retrieve( request *crm.UsersRetrieveRequest, opts ...option.RequestOption, ) (*crm.User, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/users/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *crm.User - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -146,35 +117,13 @@ func (c *Client) IgnoreCreate( request *crm.IgnoreCommonModelRequest, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/crm/v1/users/ignore/%v", + _, err := c.WithRawResponse.IgnoreCreate( + ctx, modelId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - }, - ); err != nil { + if err != nil { return err } return nil @@ -185,7 +134,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *crm.UsersRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*crm.RemoteFieldClass], error) { +) (*core.Page[*string, *crm.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -198,13 +147,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -221,11 +169,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *crm.RemoteFieldClass] { + readPageResponse := func(response *crm.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *crm.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *crm.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *crm.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/crm/users/crm_users_test/crm_users_test.go b/crm/users/crm_users_test/crm_users_test.go new file mode 100644 index 0000000..2cc792a --- /dev/null +++ b/crm/users/crm_users_test/crm_users_test.go @@ -0,0 +1,229 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_users_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmUsersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.UsersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + Email: merge.String( + "email", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Crm.Users.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/users", map[string]string{"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"}, 1) +} + +func TestCrmUsersRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.UsersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Crm.Users.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/users/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true"}, 1) +} + +func TestCrmUsersIgnoreCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.IgnoreCommonModelRequest{ + Reason: &crm.IgnoreCommonModelRequestReason{ + ReasonEnum: crm.ReasonEnumGeneralCustomerRequest, + }, + } + invocationErr := client.Crm.Users.IgnoreCreate( + context.TODO(), + "model_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/users/ignore/model_id", nil, 1) +} + +func TestCrmUsersRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.UsersRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Crm.Users.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/users/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/crm/users/raw_client.go b/crm/users/raw_client.go new file mode 100644 index 0000000..a7dc845 --- /dev/null +++ b/crm/users/raw_client.go @@ -0,0 +1,125 @@ +// Code generated by Fern. DO NOT EDIT. + +package users + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *crm.UsersRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.User], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/users/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *crm.User + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.User]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) IgnoreCreate( + ctx context.Context, + modelId string, + request *crm.IgnoreCommonModelRequest, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/crm/v1/users/ignore/%v", + modelId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} diff --git a/crm/webhook_receivers.go b/crm/webhook_receivers.go index f66c2a9..754b688 100644 --- a/crm/webhook_receivers.go +++ b/crm/webhook_receivers.go @@ -6,19 +6,66 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + webhookReceiverRequestFieldEvent = big.NewInt(1 << 0) + webhookReceiverRequestFieldIsActive = big.NewInt(1 << 1) + webhookReceiverRequestFieldKey = big.NewInt(1 << 2) ) type WebhookReceiverRequest struct { Event string `json:"event" url:"-"` IsActive bool `json:"is_active" url:"-"` Key *string `json:"key,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (w *WebhookReceiverRequest) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverRequestFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverRequestFieldIsActive) } +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverRequestFieldKey) +} + +var ( + webhookReceiverFieldEvent = big.NewInt(1 << 0) + webhookReceiverFieldIsActive = big.NewInt(1 << 1) + webhookReceiverFieldKey = big.NewInt(1 << 2) +) + type WebhookReceiver struct { Event string `json:"event" url:"event"` IsActive bool `json:"is_active" url:"is_active"` Key *string `json:"key,omitempty" url:"key,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +95,34 @@ func (w *WebhookReceiver) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WebhookReceiver) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverFieldIsActive) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverFieldKey) +} + func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { type unmarshaler WebhookReceiver var value unmarshaler @@ -64,6 +139,17 @@ func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { return nil } +func (w *WebhookReceiver) MarshalJSON() ([]byte, error) { + type embed WebhookReceiver + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WebhookReceiver) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/crm/webhookreceivers/client.go b/crm/webhookreceivers/client.go index 459bbd3..7c8166d 100644 --- a/crm/webhookreceivers/client.go +++ b/crm/webhookreceivers/client.go @@ -8,26 +8,27 @@ import ( crm "github.com/merge-api/merge-go-client/v2/crm" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) List( ctx context.Context, opts ...option.RequestOption, ) ([]*crm.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*crm.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.List( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Creates a `WebhookReceiver` object with the given values. @@ -73,35 +53,13 @@ func (c *Client) Create( request *crm.WebhookReceiverRequest, opts ...option.RequestOption, ) (*crm.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/crm/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *crm.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/crm/webhookreceivers/crm_webhook_receivers_test/crm_webhook_receivers_test.go b/crm/webhookreceivers/crm_webhook_receivers_test/crm_webhook_receivers_test.go new file mode 100644 index 0000000..420d8f7 --- /dev/null +++ b/crm/webhookreceivers/crm_webhook_receivers_test/crm_webhook_receivers_test.go @@ -0,0 +1,103 @@ +// Code generated by Fern. DO NOT EDIT. + +package crm_webhook_receivers_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + crm "github.com/merge-api/merge-go-client/v2/crm" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestCrmWebhookReceiversListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Crm.WebhookReceivers.List( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/crm/v1/webhook-receivers", nil, 1) +} + +func TestCrmWebhookReceiversCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &crm.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } + _, invocationErr := client.Crm.WebhookReceivers.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/crm/v1/webhook-receivers", nil, 1) +} diff --git a/crm/webhookreceivers/raw_client.go b/crm/webhookreceivers/raw_client.go new file mode 100644 index 0000000..aa7b127 --- /dev/null +++ b/crm/webhookreceivers/raw_client.go @@ -0,0 +1,112 @@ +// Code generated by Fern. DO NOT EDIT. + +package webhookreceivers + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + crm "github.com/merge-api/merge-go-client/v2/crm" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*crm.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*crm.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*crm.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *crm.WebhookReceiverRequest, + opts ...option.RequestOption, +) (*core.Response[*crm.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/crm/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *crm.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*crm.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/error_codes.go b/error_codes.go new file mode 100644 index 0000000..b3ca487 --- /dev/null +++ b/error_codes.go @@ -0,0 +1,9 @@ +// Code generated by Fern. DO NOT EDIT. + +package merge + +import ( + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +var ErrorCodes internal.ErrorCodes = internal.ErrorCodes{} diff --git a/filestorage/account_details.go b/filestorage/account_details.go index 901374f..e3e0029 100644 --- a/filestorage/account_details.go +++ b/filestorage/account_details.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountDetailsFieldId = big.NewInt(1 << 0) + accountDetailsFieldIntegration = big.NewInt(1 << 1) + accountDetailsFieldIntegrationSlug = big.NewInt(1 << 2) + accountDetailsFieldCategory = big.NewInt(1 << 3) + accountDetailsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsFieldStatus = big.NewInt(1 << 7) + accountDetailsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsFieldAccountType = big.NewInt(1 << 10) + accountDetailsFieldCompletedAt = big.NewInt(1 << 11) +) + type AccountDetails struct { Id *string `json:"id,omitempty" url:"id,omitempty"` Integration *string `json:"integration,omitempty" url:"integration,omitempty"` @@ -25,6 +41,9 @@ type AccountDetails struct { // The time at which account completes the linking flow. CompletedAt *time.Time `json:"completed_at,omitempty" url:"completed_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -117,6 +136,97 @@ func (a *AccountDetails) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetails) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetId(id *string) { + a.Id = id + a.require(accountDetailsFieldId) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegration(integration *string) { + a.Integration = integration + a.require(accountDetailsFieldIntegration) +} + +// SetIntegrationSlug sets the IntegrationSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegrationSlug(integrationSlug *string) { + a.IntegrationSlug = integrationSlug + a.require(accountDetailsFieldIntegrationSlug) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCategory(category *AccountDetailsCategory) { + a.Category = category + a.require(accountDetailsFieldCategory) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOrganizationName(endUserOrganizationName *string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserEmailAddress(endUserEmailAddress *string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsFieldEndUserEmailAddress) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetStatus(status *string) { + a.Status = status + a.require(accountDetailsFieldStatus) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetWebhookListenerUrl(webhookListenerUrl *string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsFieldIsDuplicate) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetAccountType(accountType *string) { + a.AccountType = accountType + a.require(accountDetailsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCompletedAt(completedAt *time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsFieldCompletedAt) +} + func (a *AccountDetails) UnmarshalJSON(data []byte) error { type embed AccountDetails var unmarshaler = struct { @@ -148,7 +258,8 @@ func (a *AccountDetails) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewOptionalDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetails) String() string { diff --git a/filestorage/account_token.go b/filestorage/account_token.go index 7547f25..ab359cf 100644 --- a/filestorage/account_token.go +++ b/filestorage/account_token.go @@ -6,6 +6,13 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + accountTokenFieldAccountToken = big.NewInt(1 << 0) + accountTokenFieldIntegration = big.NewInt(1 << 1) + accountTokenFieldId = big.NewInt(1 << 2) ) type AccountToken struct { @@ -13,6 +20,9 @@ type AccountToken struct { Integration *AccountIntegration `json:"integration" url:"integration"` Id string `json:"id" url:"id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -42,6 +52,34 @@ func (a *AccountToken) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountToken) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetAccountToken(accountToken string) { + a.AccountToken = accountToken + a.require(accountTokenFieldAccountToken) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(accountTokenFieldIntegration) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetId(id string) { + a.Id = id + a.require(accountTokenFieldId) +} + func (a *AccountToken) UnmarshalJSON(data []byte) error { type unmarshaler AccountToken var value unmarshaler @@ -58,6 +96,17 @@ func (a *AccountToken) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountToken) MarshalJSON() ([]byte, error) { + type embed AccountToken + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountToken) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/filestorage/accountdetails/client.go b/filestorage/accountdetails/client.go index 0508d3b..31910cc 100644 --- a/filestorage/accountdetails/client.go +++ b/filestorage/accountdetails/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*filestorage.AccountDetails, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/account-details" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.AccountDetails - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/accountdetails/file_storage_account_details_test/file_storage_account_details_test.go b/filestorage/accountdetails/file_storage_account_details_test/file_storage_account_details_test.go new file mode 100644 index 0000000..e756963 --- /dev/null +++ b/filestorage/accountdetails/file_storage_account_details_test/file_storage_account_details_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_account_details_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageAccountDetailsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.AccountDetails.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/account-details", nil, 1) +} diff --git a/filestorage/accountdetails/raw_client.go b/filestorage/accountdetails/raw_client.go new file mode 100644 index 0000000..ac0264f --- /dev/null +++ b/filestorage/accountdetails/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package accountdetails + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*filestorage.AccountDetails], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/account-details" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.AccountDetails + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.AccountDetails]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/accounttoken/client.go b/filestorage/accounttoken/client.go index 28ad091..56ebe63 100644 --- a/filestorage/accounttoken/client.go +++ b/filestorage/accounttoken/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,36 +38,13 @@ func (c *Client) Retrieve( publicToken string, opts ...option.RequestOption, ) (*filestorage.AccountToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/account-token/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, publicToken, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.AccountToken - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/accounttoken/file_storage_account_token_test/file_storage_account_token_test.go b/filestorage/accounttoken/file_storage_account_token_test/file_storage_account_token_test.go new file mode 100644 index 0000000..d90bcc7 --- /dev/null +++ b/filestorage/accounttoken/file_storage_account_token_test/file_storage_account_token_test.go @@ -0,0 +1,80 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_account_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageAccountTokenRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/account-token/public_token", nil, 1) +} diff --git a/filestorage/accounttoken/raw_client.go b/filestorage/accounttoken/raw_client.go new file mode 100644 index 0000000..afda6d4 --- /dev/null +++ b/filestorage/accounttoken/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounttoken + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + publicToken string, + opts ...option.RequestOption, +) (*core.Response[*filestorage.AccountToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/account-token/%v", + publicToken, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.AccountToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.AccountToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/async_passthrough.go b/filestorage/async_passthrough.go index f3a8045..43a99d5 100644 --- a/filestorage/async_passthrough.go +++ b/filestorage/async_passthrough.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) type AsyncPassthroughRetrieveResponse struct { @@ -70,9 +71,16 @@ func (a *AsyncPassthroughRetrieveResponse) Accept(visitor AsyncPassthroughRetrie return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + asyncPassthroughRecieptFieldAsyncPassthroughReceiptId = big.NewInt(1 << 0) +) + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id" url:"async_passthrough_receipt_id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -88,6 +96,20 @@ func (a *AsyncPassthroughReciept) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AsyncPassthroughReciept) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAsyncPassthroughReceiptId sets the AsyncPassthroughReceiptId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPassthroughReciept) SetAsyncPassthroughReceiptId(asyncPassthroughReceiptId string) { + a.AsyncPassthroughReceiptId = asyncPassthroughReceiptId + a.require(asyncPassthroughRecieptFieldAsyncPassthroughReceiptId) +} + func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { type unmarshaler AsyncPassthroughReciept var value unmarshaler @@ -104,6 +126,17 @@ func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { return nil } +func (a *AsyncPassthroughReciept) MarshalJSON() ([]byte, error) { + type embed AsyncPassthroughReciept + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AsyncPassthroughReciept) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/filestorage/asyncpassthrough/client.go b/filestorage/asyncpassthrough/client.go index e55e1a4..ad04ea1 100644 --- a/filestorage/asyncpassthrough/client.go +++ b/filestorage/asyncpassthrough/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,37 +38,15 @@ func (c *Client) Create( request *filestorage.DataPassthroughRequest, opts ...option.RequestOption, ) (*filestorage.AsyncPassthroughReciept, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/async-passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.AsyncPassthroughReciept - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Retrieves data from earlier async-passthrough POST request @@ -76,36 +55,13 @@ func (c *Client) Retrieve( asyncPassthroughReceiptId string, opts ...option.RequestOption, ) (*filestorage.AsyncPassthroughRetrieveResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/async-passthrough/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, asyncPassthroughReceiptId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.AsyncPassthroughRetrieveResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/asyncpassthrough/file_storage_async_passthrough_test/file_storage_async_passthrough_test.go b/filestorage/asyncpassthrough/file_storage_async_passthrough_test/file_storage_async_passthrough_test.go new file mode 100644 index 0000000..74c6c43 --- /dev/null +++ b/filestorage/asyncpassthrough/file_storage_async_passthrough_test/file_storage_async_passthrough_test.go @@ -0,0 +1,104 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_async_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageAsyncPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.DataPassthroughRequest{ + Method: filestorage.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.FileStorage.AsyncPassthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/async-passthrough", nil, 1) +} + +func TestFileStorageAsyncPassthroughRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/async-passthrough/async_passthrough_receipt_id", nil, 1) +} diff --git a/filestorage/asyncpassthrough/raw_client.go b/filestorage/asyncpassthrough/raw_client.go new file mode 100644 index 0000000..07355e2 --- /dev/null +++ b/filestorage/asyncpassthrough/raw_client.go @@ -0,0 +1,115 @@ +// Code generated by Fern. DO NOT EDIT. + +package asyncpassthrough + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *filestorage.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.AsyncPassthroughReciept], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/async-passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.AsyncPassthroughReciept + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.AsyncPassthroughReciept]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + asyncPassthroughReceiptId string, + opts ...option.RequestOption, +) (*core.Response[*filestorage.AsyncPassthroughRetrieveResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/async-passthrough/%v", + asyncPassthroughReceiptId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.AsyncPassthroughRetrieveResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.AsyncPassthroughRetrieveResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/audit_trail.go b/filestorage/audit_trail.go index 1ca6148..e753ac4 100644 --- a/filestorage/audit_trail.go +++ b/filestorage/audit_trail.go @@ -6,9 +6,19 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + auditTrailListRequestFieldCursor = big.NewInt(1 << 0) + auditTrailListRequestFieldEndDate = big.NewInt(1 << 1) + auditTrailListRequestFieldEventType = big.NewInt(1 << 2) + auditTrailListRequestFieldPageSize = big.NewInt(1 << 3) + auditTrailListRequestFieldStartDate = big.NewInt(1 << 4) + auditTrailListRequestFieldUserEmail = big.NewInt(1 << 5) +) + type AuditTrailListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -22,8 +32,71 @@ type AuditTrailListRequest struct { StartDate *string `json:"-" url:"start_date,omitempty"` // 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. UserEmail *string `json:"-" url:"user_email,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AuditTrailListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(auditTrailListRequestFieldCursor) } +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEndDate(endDate *string) { + a.EndDate = endDate + a.require(auditTrailListRequestFieldEndDate) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEventType(eventType *string) { + a.EventType = eventType + a.require(auditTrailListRequestFieldEventType) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(auditTrailListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetStartDate(startDate *string) { + a.StartDate = startDate + a.require(auditTrailListRequestFieldStartDate) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditTrailListRequestFieldUserEmail) +} + +var ( + auditLogEventFieldId = big.NewInt(1 << 0) + auditLogEventFieldUserName = big.NewInt(1 << 1) + auditLogEventFieldUserEmail = big.NewInt(1 << 2) + auditLogEventFieldRole = big.NewInt(1 << 3) + auditLogEventFieldIpAddress = big.NewInt(1 << 4) + auditLogEventFieldEventType = big.NewInt(1 << 5) + auditLogEventFieldEventDescription = big.NewInt(1 << 6) + auditLogEventFieldCreatedAt = big.NewInt(1 << 7) +) + type AuditLogEvent struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The User's full name at the time of this Event occurring. @@ -89,6 +162,9 @@ type AuditLogEvent struct { EventDescription string `json:"event_description" url:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -153,6 +229,69 @@ func (a *AuditLogEvent) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AuditLogEvent) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetId(id *string) { + a.Id = id + a.require(auditLogEventFieldId) +} + +// SetUserName sets the UserName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserName(userName *string) { + a.UserName = userName + a.require(auditLogEventFieldUserName) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditLogEventFieldUserEmail) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetRole(role *AuditLogEventRole) { + a.Role = role + a.require(auditLogEventFieldRole) +} + +// SetIpAddress sets the IpAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetIpAddress(ipAddress string) { + a.IpAddress = ipAddress + a.require(auditLogEventFieldIpAddress) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventType(eventType *AuditLogEventEventType) { + a.EventType = eventType + a.require(auditLogEventFieldEventType) +} + +// SetEventDescription sets the EventDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventDescription(eventDescription string) { + a.EventDescription = eventDescription + a.require(auditLogEventFieldEventDescription) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(auditLogEventFieldCreatedAt) +} + func (a *AuditLogEvent) UnmarshalJSON(data []byte) error { type embed AuditLogEvent var unmarshaler = struct { @@ -184,7 +323,8 @@ func (a *AuditLogEvent) MarshalJSON() ([]byte, error) { embed: embed(*a), CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AuditLogEvent) String() string { @@ -564,11 +704,20 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +var ( + paginatedAuditLogEventListFieldNext = big.NewInt(1 << 0) + paginatedAuditLogEventListFieldPrevious = big.NewInt(1 << 1) + paginatedAuditLogEventListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAuditLogEventList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AuditLogEvent `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -598,6 +747,34 @@ func (p *PaginatedAuditLogEventList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedAuditLogEventList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetNext(next *string) { + p.Next = next + p.require(paginatedAuditLogEventListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAuditLogEventListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetResults(results []*AuditLogEvent) { + p.Results = results + p.require(paginatedAuditLogEventListFieldResults) +} + func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAuditLogEventList var value unmarshaler @@ -614,6 +791,17 @@ func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAuditLogEventList) MarshalJSON() ([]byte, error) { + type embed PaginatedAuditLogEventList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAuditLogEventList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/filestorage/audittrail/client.go b/filestorage/audittrail/client.go index d7c742a..f62794b 100644 --- a/filestorage/audittrail/client.go +++ b/filestorage/audittrail/client.go @@ -4,7 +4,6 @@ package audittrail import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *filestorage.AuditTrailListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.AuditLogEvent], error) { +) (*core.Page[*string, *filestorage.AuditLogEvent], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedAuditLogEventList) *internal.PageResponse[*string, *filestorage.AuditLogEvent] { + readPageResponse := func(response *filestorage.PaginatedAuditLogEventList) *core.PageResponse[*string, *filestorage.AuditLogEvent] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.AuditLogEvent]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.AuditLogEvent]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/filestorage/audittrail/file_storage_audit_trail_test/file_storage_audit_trail_test.go b/filestorage/audittrail/file_storage_audit_trail_test/file_storage_audit_trail_test.go new file mode 100644 index 0000000..3d034c3 --- /dev/null +++ b/filestorage/audittrail/file_storage_audit_trail_test/file_storage_audit_trail_test.go @@ -0,0 +1,102 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_audit_trail_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageAuditTrailListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } + _, invocationErr := client.FileStorage.AuditTrail.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/audit-trail", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "end_date": "end_date", "event_type": "event_type", "page_size": "1", "start_date": "start_date", "user_email": "user_email"}, 1) +} diff --git a/filestorage/audittrail/raw_client.go b/filestorage/audittrail/raw_client.go new file mode 100644 index 0000000..cce0cac --- /dev/null +++ b/filestorage/audittrail/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package audittrail + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/filestorage/available_actions.go b/filestorage/available_actions.go index c511dbe..51c60c4 100644 --- a/filestorage/available_actions.go +++ b/filestorage/available_actions.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) // # The AvailableActions Object @@ -14,11 +15,20 @@ import ( // // ### Usage Example // Fetch all the actions available for the `Zenefits` integration. +var ( + availableActionsFieldIntegration = big.NewInt(1 << 0) + availableActionsFieldPassthroughAvailable = big.NewInt(1 << 1) + availableActionsFieldAvailableModelOperations = big.NewInt(1 << 2) +) + type AvailableActions struct { Integration *AccountIntegration `json:"integration" url:"integration"` PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +58,34 @@ func (a *AvailableActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AvailableActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(availableActionsFieldIntegration) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(availableActionsFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(availableActionsFieldAvailableModelOperations) +} + func (a *AvailableActions) UnmarshalJSON(data []byte) error { type unmarshaler AvailableActions var value unmarshaler @@ -64,6 +102,17 @@ func (a *AvailableActions) UnmarshalJSON(data []byte) error { return nil } +func (a *AvailableActions) MarshalJSON() ([]byte, error) { + type embed AvailableActions + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AvailableActions) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/filestorage/availableactions/client.go b/filestorage/availableactions/client.go index a200712..9a71262 100644 --- a/filestorage/availableactions/client.go +++ b/filestorage/availableactions/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*filestorage.AvailableActions, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/available-actions" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.AvailableActions - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/availableactions/file_storage_available_actions_test/file_storage_available_actions_test.go b/filestorage/availableactions/file_storage_available_actions_test/file_storage_available_actions_test.go new file mode 100644 index 0000000..720ce6f --- /dev/null +++ b/filestorage/availableactions/file_storage_available_actions_test/file_storage_available_actions_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_available_actions_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageAvailableActionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.AvailableActions.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/available-actions", nil, 1) +} diff --git a/filestorage/availableactions/raw_client.go b/filestorage/availableactions/raw_client.go new file mode 100644 index 0000000..692e6a2 --- /dev/null +++ b/filestorage/availableactions/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package availableactions + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*filestorage.AvailableActions], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/available-actions" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.AvailableActions + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.AvailableActions]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/client/client.go b/filestorage/client/client.go index 943b543..eacf1f5 100644 --- a/filestorage/client/client.go +++ b/filestorage/client/client.go @@ -27,15 +27,9 @@ import ( users "github.com/merge-api/merge-go-client/v2/filestorage/users" webhookreceivers "github.com/merge-api/merge-go-client/v2/filestorage/webhookreceivers" internal "github.com/merge-api/merge-go-client/v2/internal" - option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { - baseURL string - caller *internal.Caller - header http.Header - AccountDetails *accountdetails.Client AccountToken *accounttoken.Client AsyncPassthrough *asyncpassthrough.Client @@ -58,40 +52,43 @@ type Client struct { ForceResync *forceresync.Client Users *users.Client WebhookReceivers *webhookreceivers.Client + + options *core.RequestOptions + baseURL string + caller *internal.Caller } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + AccountDetails: accountdetails.NewClient(options), + AccountToken: accounttoken.NewClient(options), + AsyncPassthrough: asyncpassthrough.NewClient(options), + AuditTrail: audittrail.NewClient(options), + AvailableActions: availableactions.NewClient(options), + Scopes: scopes.NewClient(options), + DeleteAccount: deleteaccount.NewClient(options), + Drives: drives.NewClient(options), + FieldMapping: fieldmapping.NewClient(options), + Files: files.NewClient(options), + Folders: folders.NewClient(options), + GenerateKey: generatekey.NewClient(options), + Groups: groups.NewClient(options), + Issues: issues.NewClient(options), + LinkToken: linktoken.NewClient(options), + LinkedAccounts: linkedaccounts.NewClient(options), + Passthrough: passthrough.NewClient(options), + RegenerateKey: regeneratekey.NewClient(options), + SyncStatus: syncstatus.NewClient(options), + ForceResync: forceresync.NewClient(options), + Users: users.NewClient(options), + WebhookReceivers: webhookreceivers.NewClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), - AccountDetails: accountdetails.NewClient(opts...), - AccountToken: accounttoken.NewClient(opts...), - AsyncPassthrough: asyncpassthrough.NewClient(opts...), - AuditTrail: audittrail.NewClient(opts...), - AvailableActions: availableactions.NewClient(opts...), - Scopes: scopes.NewClient(opts...), - DeleteAccount: deleteaccount.NewClient(opts...), - Drives: drives.NewClient(opts...), - FieldMapping: fieldmapping.NewClient(opts...), - Files: files.NewClient(opts...), - Folders: folders.NewClient(opts...), - GenerateKey: generatekey.NewClient(opts...), - Groups: groups.NewClient(opts...), - Issues: issues.NewClient(opts...), - LinkToken: linktoken.NewClient(opts...), - LinkedAccounts: linkedaccounts.NewClient(opts...), - Passthrough: passthrough.NewClient(opts...), - RegenerateKey: regeneratekey.NewClient(opts...), - SyncStatus: syncstatus.NewClient(opts...), - ForceResync: forceresync.NewClient(opts...), - Users: users.NewClient(opts...), - WebhookReceivers: webhookreceivers.NewClient(opts...), } } diff --git a/filestorage/deleteaccount/client.go b/filestorage/deleteaccount/client.go index 65beeeb..9f2d80e 100644 --- a/filestorage/deleteaccount/client.go +++ b/filestorage/deleteaccount/client.go @@ -7,26 +7,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -35,30 +36,11 @@ func (c *Client) Delete( ctx context.Context, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/delete-account" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - if err := c.caller.Call( + _, err := c.WithRawResponse.Delete( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - }, - ); err != nil { + opts..., + ) + if err != nil { return err } return nil diff --git a/filestorage/deleteaccount/file_storage_delete_account_test/file_storage_delete_account_test.go b/filestorage/deleteaccount/file_storage_delete_account_test/file_storage_delete_account_test.go new file mode 100644 index 0000000..0a4ff2e --- /dev/null +++ b/filestorage/deleteaccount/file_storage_delete_account_test/file_storage_delete_account_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_delete_account_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageDeleteAccountDeleteWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + invocationErr := client.FileStorage.DeleteAccount.Delete( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/delete-account", nil, 1) +} diff --git a/filestorage/deleteaccount/raw_client.go b/filestorage/deleteaccount/raw_client.go new file mode 100644 index 0000000..1283375 --- /dev/null +++ b/filestorage/deleteaccount/raw_client.go @@ -0,0 +1,67 @@ +// Code generated by Fern. DO NOT EDIT. + +package deleteaccount + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Delete( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/delete-account" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} diff --git a/filestorage/drives.go b/filestorage/drives.go index b51911f..c276c30 100644 --- a/filestorage/drives.go +++ b/filestorage/drives.go @@ -6,9 +6,24 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + drivesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + drivesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + drivesListRequestFieldCursor = big.NewInt(1 << 2) + drivesListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + drivesListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + drivesListRequestFieldIncludeShellData = big.NewInt(1 << 5) + drivesListRequestFieldModifiedAfter = big.NewInt(1 << 6) + drivesListRequestFieldModifiedBefore = big.NewInt(1 << 7) + drivesListRequestFieldName = big.NewInt(1 << 8) + drivesListRequestFieldPageSize = big.NewInt(1 << 9) + drivesListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type DrivesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -32,20 +47,145 @@ type DrivesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (d *DrivesListRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetCreatedAfter(createdAfter *time.Time) { + d.CreatedAfter = createdAfter + d.require(drivesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetCreatedBefore(createdBefore *time.Time) { + d.CreatedBefore = createdBefore + d.require(drivesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetCursor(cursor *string) { + d.Cursor = cursor + d.require(drivesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + d.IncludeDeletedData = includeDeletedData + d.require(drivesListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + d.IncludeRemoteData = includeRemoteData + d.require(drivesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetIncludeShellData(includeShellData *bool) { + d.IncludeShellData = includeShellData + d.require(drivesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + d.ModifiedAfter = modifiedAfter + d.require(drivesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + d.ModifiedBefore = modifiedBefore + d.require(drivesListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetName(name *string) { + d.Name = name + d.require(drivesListRequestFieldName) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetPageSize(pageSize *int) { + d.PageSize = pageSize + d.require(drivesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesListRequest) SetRemoteId(remoteId *string) { + d.RemoteId = remoteId + d.require(drivesListRequestFieldRemoteId) +} + +var ( + drivesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + drivesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type DrivesRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (d *DrivesRetrieveRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + d.IncludeRemoteData = includeRemoteData + d.require(drivesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DrivesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + d.IncludeShellData = includeShellData + d.require(drivesRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedDriveListFieldNext = big.NewInt(1 << 0) + paginatedDriveListFieldPrevious = big.NewInt(1 << 1) + paginatedDriveListFieldResults = big.NewInt(1 << 2) +) + type PaginatedDriveList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Drive `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -75,6 +215,34 @@ func (p *PaginatedDriveList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedDriveList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDriveList) SetNext(next *string) { + p.Next = next + p.require(paginatedDriveListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDriveList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedDriveListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDriveList) SetResults(results []*Drive) { + p.Results = results + p.require(paginatedDriveListFieldResults) +} + func (p *PaginatedDriveList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedDriveList var value unmarshaler @@ -91,6 +259,17 @@ func (p *PaginatedDriveList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedDriveList) MarshalJSON() ([]byte, error) { + type embed PaginatedDriveList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedDriveList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/filestorage/drives/client.go b/filestorage/drives/client.go index 858a927..0f6120f 100644 --- a/filestorage/drives/client.go +++ b/filestorage/drives/client.go @@ -4,7 +4,6 @@ package drives import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *filestorage.DrivesListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.Drive], error) { +) (*core.Page[*string, *filestorage.Drive], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedDriveList) *internal.PageResponse[*string, *filestorage.Drive] { + readPageResponse := func(response *filestorage.PaginatedDriveList) *core.PageResponse[*string, *filestorage.Drive] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.Drive]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.Drive]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *filestorage.DrivesRetrieveRequest, opts ...option.RequestOption, ) (*filestorage.Drive, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/drives/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.Drive - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/filestorage/drives/file_storage_drives_test/file_storage_drives_test.go b/filestorage/drives/file_storage_drives_test/file_storage_drives_test.go new file mode 100644 index 0000000..b12332e --- /dev/null +++ b/filestorage/drives/file_storage_drives_test/file_storage_drives_test.go @@ -0,0 +1,153 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_drives_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageDrivesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.DrivesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.FileStorage.Drives.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/drives", map[string]string{"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"}, 1) +} + +func TestFileStorageDrivesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.DrivesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.FileStorage.Drives.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/drives/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/filestorage/drives/raw_client.go b/filestorage/drives/raw_client.go new file mode 100644 index 0000000..0522fc1 --- /dev/null +++ b/filestorage/drives/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package drives + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *filestorage.DrivesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.Drive], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/drives/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.Drive + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.Drive]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/field_mapping.go b/filestorage/field_mapping.go index bed8896..6966162 100644 --- a/filestorage/field_mapping.go +++ b/filestorage/field_mapping.go @@ -6,6 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + createFieldMappingRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) + createFieldMappingRequestFieldTargetFieldName = big.NewInt(1 << 1) + createFieldMappingRequestFieldTargetFieldDescription = big.NewInt(1 << 2) + createFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 3) + createFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 4) + createFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 5) + createFieldMappingRequestFieldCommonModelName = big.NewInt(1 << 6) ) type CreateFieldMappingRequest struct { @@ -23,8 +34,73 @@ type CreateFieldMappingRequest struct { RemoteUrlPath string `json:"remote_url_path" url:"-"` // The name of the Common Model that the remote field corresponds to in a given category. CommonModelName string `json:"common_model_name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (c *CreateFieldMappingRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + c.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + c.require(createFieldMappingRequestFieldExcludeRemoteFieldMetadata) +} + +// SetTargetFieldName sets the TargetFieldName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldName(targetFieldName string) { + c.TargetFieldName = targetFieldName + c.require(createFieldMappingRequestFieldTargetFieldName) +} + +// SetTargetFieldDescription sets the TargetFieldDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldDescription(targetFieldDescription string) { + c.TargetFieldDescription = targetFieldDescription + c.require(createFieldMappingRequestFieldTargetFieldDescription) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + c.RemoteFieldTraversalPath = remoteFieldTraversalPath + c.require(createFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteMethod(remoteMethod string) { + c.RemoteMethod = remoteMethod + c.require(createFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath string) { + c.RemoteUrlPath = remoteUrlPath + c.require(createFieldMappingRequestFieldRemoteUrlPath) +} + +// SetCommonModelName sets the CommonModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetCommonModelName(commonModelName string) { + c.CommonModelName = commonModelName + c.require(createFieldMappingRequestFieldCommonModelName) +} + +var ( + patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 0) + patchedEditFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 1) + patchedEditFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 2) +) + type PatchedEditFieldMappingRequest struct { // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty" url:"-"` @@ -32,20 +108,110 @@ type PatchedEditFieldMappingRequest struct { RemoteMethod *string `json:"remote_method,omitempty" url:"-"` // The path of the remote endpoint where the remote field is coming from. RemoteUrlPath *string `json:"remote_url_path,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedEditFieldMappingRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + p.RemoteFieldTraversalPath = remoteFieldTraversalPath + p.require(patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteMethod(remoteMethod *string) { + p.RemoteMethod = remoteMethod + p.require(patchedEditFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath *string) { + p.RemoteUrlPath = remoteUrlPath + p.require(patchedEditFieldMappingRequestFieldRemoteUrlPath) } +var ( + fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) +) + type FieldMappingsRetrieveRequest struct { // 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. ExcludeRemoteFieldMetadata *bool `json:"-" url:"exclude_remote_field_metadata,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FieldMappingsRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingsRetrieveRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + f.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + f.require(fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata) } +var ( + remoteFieldsRetrieveRequestFieldCommonModels = big.NewInt(1 << 0) + remoteFieldsRetrieveRequestFieldIncludeExampleValues = big.NewInt(1 << 1) +) + type RemoteFieldsRetrieveRequest struct { // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. CommonModels *string `json:"-" url:"common_models,omitempty"` // 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. IncludeExampleValues *string `json:"-" url:"include_example_values,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteFieldsRetrieveRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetCommonModels(commonModels *string) { + r.CommonModels = commonModels + r.require(remoteFieldsRetrieveRequestFieldCommonModels) +} + +// SetIncludeExampleValues sets the IncludeExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetIncludeExampleValues(includeExampleValues *string) { + r.IncludeExampleValues = includeExampleValues + r.require(remoteFieldsRetrieveRequestFieldIncludeExampleValues) } +var ( + advancedMetadataFieldId = big.NewInt(1 << 0) + advancedMetadataFieldDisplayName = big.NewInt(1 << 1) + advancedMetadataFieldDescription = big.NewInt(1 << 2) + advancedMetadataFieldIsRequired = big.NewInt(1 << 3) + advancedMetadataFieldIsCustom = big.NewInt(1 << 4) + advancedMetadataFieldFieldChoices = big.NewInt(1 << 5) +) + type AdvancedMetadata struct { Id string `json:"id" url:"id"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` @@ -54,6 +220,9 @@ type AdvancedMetadata struct { IsCustom *bool `json:"is_custom,omitempty" url:"is_custom,omitempty"` FieldChoices []interface{} `json:"field_choices,omitempty" url:"field_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -104,6 +273,55 @@ func (a *AdvancedMetadata) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AdvancedMetadata) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetId(id string) { + a.Id = id + a.require(advancedMetadataFieldId) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDisplayName(displayName *string) { + a.DisplayName = displayName + a.require(advancedMetadataFieldDisplayName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDescription(description *string) { + a.Description = description + a.require(advancedMetadataFieldDescription) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsRequired(isRequired *bool) { + a.IsRequired = isRequired + a.require(advancedMetadataFieldIsRequired) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsCustom(isCustom *bool) { + a.IsCustom = isCustom + a.require(advancedMetadataFieldIsCustom) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetFieldChoices(fieldChoices []interface{}) { + a.FieldChoices = fieldChoices + a.require(advancedMetadataFieldFieldChoices) +} + func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { type unmarshaler AdvancedMetadata var value unmarshaler @@ -120,6 +338,17 @@ func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { return nil } +func (a *AdvancedMetadata) MarshalJSON() ([]byte, error) { + type embed AdvancedMetadata + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AdvancedMetadata) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -132,11 +361,20 @@ func (a *AdvancedMetadata) String() string { return fmt.Sprintf("%#v", a) } +var ( + externalTargetFieldApiFieldName = big.NewInt(1 << 0) + externalTargetFieldApiFieldDescription = big.NewInt(1 << 1) + externalTargetFieldApiFieldIsMapped = big.NewInt(1 << 2) +) + type ExternalTargetFieldApi struct { Name *string `json:"name,omitempty" url:"name,omitempty"` Description *string `json:"description,omitempty" url:"description,omitempty"` IsMapped *string `json:"is_mapped,omitempty" url:"is_mapped,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -166,6 +404,34 @@ func (e *ExternalTargetFieldApi) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExternalTargetFieldApi) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetName(name *string) { + e.Name = name + e.require(externalTargetFieldApiFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetDescription(description *string) { + e.Description = description + e.require(externalTargetFieldApiFieldDescription) +} + +// SetIsMapped sets the IsMapped field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetIsMapped(isMapped *string) { + e.IsMapped = isMapped + e.require(externalTargetFieldApiFieldIsMapped) +} + func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApi var value unmarshaler @@ -182,6 +448,17 @@ func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApi) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApi) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -194,6 +471,14 @@ func (e *ExternalTargetFieldApi) String() string { return fmt.Sprintf("%#v", e) } +var ( + externalTargetFieldApiResponseFieldFile = big.NewInt(1 << 0) + externalTargetFieldApiResponseFieldFolder = big.NewInt(1 << 1) + externalTargetFieldApiResponseFieldDrive = big.NewInt(1 << 2) + externalTargetFieldApiResponseFieldGroup = big.NewInt(1 << 3) + externalTargetFieldApiResponseFieldUser = big.NewInt(1 << 4) +) + type ExternalTargetFieldApiResponse struct { File []*ExternalTargetFieldApi `json:"File,omitempty" url:"File,omitempty"` Folder []*ExternalTargetFieldApi `json:"Folder,omitempty" url:"Folder,omitempty"` @@ -201,6 +486,9 @@ type ExternalTargetFieldApiResponse struct { Group []*ExternalTargetFieldApi `json:"Group,omitempty" url:"Group,omitempty"` User []*ExternalTargetFieldApi `json:"User,omitempty" url:"User,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -244,6 +532,48 @@ func (e *ExternalTargetFieldApiResponse) GetExtraProperties() map[string]interfa return e.extraProperties } +func (e *ExternalTargetFieldApiResponse) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetFile sets the File field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetFile(file []*ExternalTargetFieldApi) { + e.File = file + e.require(externalTargetFieldApiResponseFieldFile) +} + +// SetFolder sets the Folder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetFolder(folder []*ExternalTargetFieldApi) { + e.Folder = folder + e.require(externalTargetFieldApiResponseFieldFolder) +} + +// SetDrive sets the Drive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetDrive(drive []*ExternalTargetFieldApi) { + e.Drive = drive + e.require(externalTargetFieldApiResponseFieldDrive) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetGroup(group []*ExternalTargetFieldApi) { + e.Group = group + e.require(externalTargetFieldApiResponseFieldGroup) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetUser(user []*ExternalTargetFieldApi) { + e.User = user + e.require(externalTargetFieldApiResponseFieldUser) +} + func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApiResponse var value unmarshaler @@ -260,6 +590,17 @@ func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApiResponse) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -272,12 +613,22 @@ func (e *ExternalTargetFieldApiResponse) String() string { return fmt.Sprintf("%#v", e) } +var ( + fieldMappingApiInstanceFieldId = big.NewInt(1 << 0) + fieldMappingApiInstanceFieldIsIntegrationWide = big.NewInt(1 << 1) + fieldMappingApiInstanceFieldTargetField = big.NewInt(1 << 2) + fieldMappingApiInstanceFieldRemoteField = big.NewInt(1 << 3) +) + type FieldMappingApiInstance struct { Id *string `json:"id,omitempty" url:"id,omitempty"` IsIntegrationWide *bool `json:"is_integration_wide,omitempty" url:"is_integration_wide,omitempty"` TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty" url:"target_field,omitempty"` RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty" url:"remote_field,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -314,6 +665,41 @@ func (f *FieldMappingApiInstance) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *FieldMappingApiInstance) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetId(id *string) { + f.Id = id + f.require(fieldMappingApiInstanceFieldId) +} + +// SetIsIntegrationWide sets the IsIntegrationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetIsIntegrationWide(isIntegrationWide *bool) { + f.IsIntegrationWide = isIntegrationWide + f.require(fieldMappingApiInstanceFieldIsIntegrationWide) +} + +// SetTargetField sets the TargetField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetTargetField(targetField *FieldMappingApiInstanceTargetField) { + f.TargetField = targetField + f.require(fieldMappingApiInstanceFieldTargetField) +} + +// SetRemoteField sets the RemoteField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetRemoteField(remoteField *FieldMappingApiInstanceRemoteField) { + f.RemoteField = remoteField + f.require(fieldMappingApiInstanceFieldRemoteField) +} + func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstance var value unmarshaler @@ -330,6 +716,17 @@ func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstance) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstance + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstance) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -342,11 +739,20 @@ func (f *FieldMappingApiInstance) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldFieldSchema = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteField struct { RemoteKeyName *string `json:"remote_key_name,omitempty" url:"remote_key_name,omitempty"` Schema map[string]interface{} `json:"schema,omitempty" url:"schema,omitempty"` RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info" url:"remote_endpoint_info"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -376,6 +782,34 @@ func (f *FieldMappingApiInstanceRemoteField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteKeyName(remoteKeyName *string) { + f.RemoteKeyName = remoteKeyName + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetSchema(schema map[string]interface{}) { + f.Schema = schema + f.require(fieldMappingApiInstanceRemoteFieldFieldSchema) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteEndpointInfo(remoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) { + f.RemoteEndpointInfo = remoteEndpointInfo + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo) +} + func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteField var value unmarshaler @@ -392,6 +826,17 @@ func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceRemoteField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -404,11 +849,20 @@ func (f *FieldMappingApiInstanceRemoteField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { Method *string `json:"method,omitempty" url:"method,omitempty"` UrlPath *string `json:"url_path,omitempty" url:"url_path,omitempty"` FieldTraversalPath []string `json:"field_traversal_path,omitempty" url:"field_traversal_path,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -438,6 +892,34 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) GetExtraPropertie return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetMethod(method *string) { + f.Method = method + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetUrlPath(urlPath *string) { + f.UrlPath = urlPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []string) { + f.FieldTraversalPath = fieldTraversalPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo var value unmarshaler @@ -454,6 +936,17 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(dat return nil } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -466,6 +959,14 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceResponseFieldFile = big.NewInt(1 << 0) + fieldMappingApiInstanceResponseFieldFolder = big.NewInt(1 << 1) + fieldMappingApiInstanceResponseFieldDrive = big.NewInt(1 << 2) + fieldMappingApiInstanceResponseFieldGroup = big.NewInt(1 << 3) + fieldMappingApiInstanceResponseFieldUser = big.NewInt(1 << 4) +) + type FieldMappingApiInstanceResponse struct { File []*FieldMappingApiInstance `json:"File,omitempty" url:"File,omitempty"` Folder []*FieldMappingApiInstance `json:"Folder,omitempty" url:"Folder,omitempty"` @@ -473,6 +974,9 @@ type FieldMappingApiInstanceResponse struct { Group []*FieldMappingApiInstance `json:"Group,omitempty" url:"Group,omitempty"` User []*FieldMappingApiInstance `json:"User,omitempty" url:"User,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -516,6 +1020,48 @@ func (f *FieldMappingApiInstanceResponse) GetExtraProperties() map[string]interf return f.extraProperties } +func (f *FieldMappingApiInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetFile sets the File field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetFile(file []*FieldMappingApiInstance) { + f.File = file + f.require(fieldMappingApiInstanceResponseFieldFile) +} + +// SetFolder sets the Folder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetFolder(folder []*FieldMappingApiInstance) { + f.Folder = folder + f.require(fieldMappingApiInstanceResponseFieldFolder) +} + +// SetDrive sets the Drive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetDrive(drive []*FieldMappingApiInstance) { + f.Drive = drive + f.require(fieldMappingApiInstanceResponseFieldDrive) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetGroup(group []*FieldMappingApiInstance) { + f.Group = group + f.require(fieldMappingApiInstanceResponseFieldGroup) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetUser(user []*FieldMappingApiInstance) { + f.User = user + f.require(fieldMappingApiInstanceResponseFieldUser) +} + func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceResponse var value unmarshaler @@ -532,6 +1078,17 @@ func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -544,11 +1101,20 @@ func (f *FieldMappingApiInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceTargetFieldFieldName = big.NewInt(1 << 0) + fieldMappingApiInstanceTargetFieldFieldDescription = big.NewInt(1 << 1) + fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceTargetField struct { Name string `json:"name" url:"name"` Description string `json:"description" url:"description"` IsOrganizationWide bool `json:"is_organization_wide" url:"is_organization_wide"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -578,6 +1144,34 @@ func (f *FieldMappingApiInstanceTargetField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceTargetField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetName(name string) { + f.Name = name + f.require(fieldMappingApiInstanceTargetFieldFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetDescription(description string) { + f.Description = description + f.require(fieldMappingApiInstanceTargetFieldFieldDescription) +} + +// SetIsOrganizationWide sets the IsOrganizationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetIsOrganizationWide(isOrganizationWide bool) { + f.IsOrganizationWide = isOrganizationWide + f.require(fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide) +} + func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceTargetField var value unmarshaler @@ -594,6 +1188,17 @@ func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceTargetField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceTargetField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceTargetField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -606,12 +1211,22 @@ func (f *FieldMappingApiInstanceTargetField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingInstanceResponseFieldModel = big.NewInt(1 << 0) + fieldMappingInstanceResponseFieldWarnings = big.NewInt(1 << 1) + fieldMappingInstanceResponseFieldErrors = big.NewInt(1 << 2) + fieldMappingInstanceResponseFieldLogs = big.NewInt(1 << 3) +) + type FieldMappingInstanceResponse struct { Model *FieldMappingApiInstance `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -648,6 +1263,41 @@ func (f *FieldMappingInstanceResponse) GetExtraProperties() map[string]interface return f.extraProperties } +func (f *FieldMappingInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetModel(model *FieldMappingApiInstance) { + f.Model = model + f.require(fieldMappingInstanceResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetWarnings(warnings []*WarningValidationProblem) { + f.Warnings = warnings + f.require(fieldMappingInstanceResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetErrors(errors []*ErrorValidationProblem) { + f.Errors = errors + f.require(fieldMappingInstanceResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetLogs(logs []*DebugModeLog) { + f.Logs = logs + f.require(fieldMappingInstanceResponseFieldLogs) +} + func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingInstanceResponse var value unmarshaler @@ -664,6 +1314,17 @@ func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -676,11 +1337,20 @@ func (f *FieldMappingInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + remoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + remoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + remoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type RemoteEndpointInfo struct { Method string `json:"method" url:"method"` UrlPath string `json:"url_path" url:"url_path"` FieldTraversalPath []interface{} `json:"field_traversal_path" url:"field_traversal_path"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -710,6 +1380,34 @@ func (r *RemoteEndpointInfo) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteEndpointInfo) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetMethod(method string) { + r.Method = method + r.require(remoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetUrlPath(urlPath string) { + r.UrlPath = urlPath + r.require(remoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []interface{}) { + r.FieldTraversalPath = fieldTraversalPath + r.require(remoteEndpointInfoFieldFieldTraversalPath) +} + func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler RemoteEndpointInfo var value unmarshaler @@ -726,6 +1424,17 @@ func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed RemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteEndpointInfo) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -738,6 +1447,15 @@ func (r *RemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldApiFieldSchema = big.NewInt(1 << 0) + remoteFieldApiFieldRemoteKeyName = big.NewInt(1 << 1) + remoteFieldApiFieldRemoteEndpointInfo = big.NewInt(1 << 2) + remoteFieldApiFieldExampleValues = big.NewInt(1 << 3) + remoteFieldApiFieldAdvancedMetadata = big.NewInt(1 << 4) + remoteFieldApiFieldCoverage = big.NewInt(1 << 5) +) + type RemoteFieldApi struct { Schema map[string]interface{} `json:"schema" url:"schema"` RemoteKeyName string `json:"remote_key_name" url:"remote_key_name"` @@ -746,6 +1464,9 @@ type RemoteFieldApi struct { AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty" url:"advanced_metadata,omitempty"` Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty" url:"coverage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -796,6 +1517,55 @@ func (r *RemoteFieldApi) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApi) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetSchema(schema map[string]interface{}) { + r.Schema = schema + r.require(remoteFieldApiFieldSchema) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteKeyName(remoteKeyName string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldApiFieldRemoteKeyName) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteEndpointInfo(remoteEndpointInfo *RemoteEndpointInfo) { + r.RemoteEndpointInfo = remoteEndpointInfo + r.require(remoteFieldApiFieldRemoteEndpointInfo) +} + +// SetExampleValues sets the ExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetExampleValues(exampleValues []interface{}) { + r.ExampleValues = exampleValues + r.require(remoteFieldApiFieldExampleValues) +} + +// SetAdvancedMetadata sets the AdvancedMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetAdvancedMetadata(advancedMetadata *AdvancedMetadata) { + r.AdvancedMetadata = advancedMetadata + r.require(remoteFieldApiFieldAdvancedMetadata) +} + +// SetCoverage sets the Coverage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetCoverage(coverage *RemoteFieldApiCoverage) { + r.Coverage = coverage + r.require(remoteFieldApiFieldCoverage) +} + func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApi var value unmarshaler @@ -812,6 +1582,17 @@ func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApi) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApi) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -886,6 +1667,14 @@ func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) e return fmt.Errorf("type %T does not include a non-empty union type", r) } +var ( + remoteFieldApiResponseFieldFile = big.NewInt(1 << 0) + remoteFieldApiResponseFieldFolder = big.NewInt(1 << 1) + remoteFieldApiResponseFieldDrive = big.NewInt(1 << 2) + remoteFieldApiResponseFieldGroup = big.NewInt(1 << 3) + remoteFieldApiResponseFieldUser = big.NewInt(1 << 4) +) + type RemoteFieldApiResponse struct { File []*RemoteFieldApi `json:"File,omitempty" url:"File,omitempty"` Folder []*RemoteFieldApi `json:"Folder,omitempty" url:"Folder,omitempty"` @@ -893,6 +1682,9 @@ type RemoteFieldApiResponse struct { Group []*RemoteFieldApi `json:"Group,omitempty" url:"Group,omitempty"` User []*RemoteFieldApi `json:"User,omitempty" url:"User,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -936,6 +1728,48 @@ func (r *RemoteFieldApiResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApiResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetFile sets the File field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetFile(file []*RemoteFieldApi) { + r.File = file + r.require(remoteFieldApiResponseFieldFile) +} + +// SetFolder sets the Folder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetFolder(folder []*RemoteFieldApi) { + r.Folder = folder + r.require(remoteFieldApiResponseFieldFolder) +} + +// SetDrive sets the Drive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetDrive(drive []*RemoteFieldApi) { + r.Drive = drive + r.require(remoteFieldApiResponseFieldDrive) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetGroup(group []*RemoteFieldApi) { + r.Group = group + r.require(remoteFieldApiResponseFieldGroup) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetUser(user []*RemoteFieldApi) { + r.User = user + r.require(remoteFieldApiResponseFieldUser) +} + func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApiResponse var value unmarshaler @@ -952,6 +1786,17 @@ func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApiResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { diff --git a/filestorage/fieldmapping/client.go b/filestorage/fieldmapping/client.go index dedf160..5be9ab9 100644 --- a/filestorage/fieldmapping/client.go +++ b/filestorage/fieldmapping/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,42 +38,15 @@ func (c *Client) FieldMappingsRetrieve( request *filestorage.FieldMappingsRetrieveRequest, opts ...option.RequestOption, ) (*filestorage.FieldMappingApiInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/filestorage/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.FieldMappingApiInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -81,44 +55,15 @@ func (c *Client) FieldMappingsCreate( request *filestorage.CreateFieldMappingRequest, opts ...option.RequestOption, ) (*filestorage.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsCreate( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/filestorage/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -127,38 +72,15 @@ func (c *Client) FieldMappingsDestroy( fieldMappingId string, opts ...option.RequestOption, ) (*filestorage.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsDestroy( + ctx, fieldMappingId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodDelete, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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. @@ -168,40 +90,16 @@ func (c *Client) FieldMappingsPartialUpdate( request *filestorage.PatchedEditFieldMappingRequest, opts ...option.RequestOption, ) (*filestorage.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsPartialUpdate( + ctx, fieldMappingId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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/). @@ -210,42 +108,15 @@ func (c *Client) RemoteFieldsRetrieve( request *filestorage.RemoteFieldsRetrieveRequest, opts ...option.RequestOption, ) (*filestorage.RemoteFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.RemoteFieldsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/filestorage/v1/remote-fields" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.RemoteFieldApiResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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/). @@ -253,33 +124,12 @@ func (c *Client) TargetFieldsRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*filestorage.ExternalTargetFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/target-fields" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.ExternalTargetFieldApiResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.TargetFieldsRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/fieldmapping/file_storage_field_mapping_test/file_storage_field_mapping_test.go b/filestorage/fieldmapping/file_storage_field_mapping_test/file_storage_field_mapping_test.go new file mode 100644 index 0000000..74cfdb8 --- /dev/null +++ b/filestorage/fieldmapping/file_storage_field_mapping_test/file_storage_field_mapping_test.go @@ -0,0 +1,210 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_field_mapping_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageFieldMappingFieldMappingsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } + _, invocationErr := client.FileStorage.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestFileStorageFieldMappingFieldMappingsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } + _, invocationErr := client.FileStorage.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestFileStorageFieldMappingFieldMappingsDestroyWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + response, invocationErr := client.FileStorage.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) + + // DELETE operations may return nil response body, which is acceptable + if invocationErr != nil && response == nil { + // This is expected for DELETE operations that return 204 No Content + require.Contains(t, invocationErr.Error(), "but the server responded with nothing", "Expected empty response error") + } else { + require.NoError(t, invocationErr, "Client method call should succeed") + } + VerifyRequestCount(t, "DELETE", "/filestorage/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestFileStorageFieldMappingFieldMappingsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.PatchedEditFieldMappingRequest{} + _, invocationErr := client.FileStorage.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/filestorage/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestFileStorageFieldMappingRemoteFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } + _, invocationErr := client.FileStorage.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/remote-fields", map[string]string{"common_models": "common_models", "include_example_values": "include_example_values"}, 1) +} + +func TestFileStorageFieldMappingTargetFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/target-fields", nil, 1) +} diff --git a/filestorage/fieldmapping/raw_client.go b/filestorage/fieldmapping/raw_client.go new file mode 100644 index 0000000..80ffc08 --- /dev/null +++ b/filestorage/fieldmapping/raw_client.go @@ -0,0 +1,302 @@ +// Code generated by Fern. DO NOT EDIT. + +package fieldmapping + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) FieldMappingsRetrieve( + ctx context.Context, + request *filestorage.FieldMappingsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.FieldMappingApiInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.FieldMappingApiInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.FieldMappingApiInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsCreate( + ctx context.Context, + request *filestorage.CreateFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *filestorage.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsDestroy( + ctx context.Context, + fieldMappingId string, + opts ...option.RequestOption, +) (*core.Response[*filestorage.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsPartialUpdate( + ctx context.Context, + fieldMappingId string, + request *filestorage.PatchedEditFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *filestorage.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) RemoteFieldsRetrieve( + ctx context.Context, + request *filestorage.RemoteFieldsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.RemoteFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/remote-fields" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.RemoteFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.RemoteFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) TargetFieldsRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*filestorage.ExternalTargetFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/target-fields" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.ExternalTargetFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.ExternalTargetFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/files.go b/filestorage/files.go index eb075b4..26ce989 100644 --- a/filestorage/files.go +++ b/filestorage/files.go @@ -6,17 +6,67 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + fileStorageFileEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + fileStorageFileEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + fileStorageFileEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type FileStorageFileEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *FileRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (f *FileStorageFileEndpointRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFileEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + f.IsDebugMode = isDebugMode + f.require(fileStorageFileEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFileEndpointRequest) SetRunAsync(runAsync *bool) { + f.RunAsync = runAsync + f.require(fileStorageFileEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFileEndpointRequest) SetModel(model *FileRequest) { + f.Model = model + f.require(fileStorageFileEndpointRequestFieldModel) +} + +var ( + filesDownloadRequestMetaListRequestFieldCreatedAfter = big.NewInt(1 << 0) + filesDownloadRequestMetaListRequestFieldCreatedBefore = big.NewInt(1 << 1) + filesDownloadRequestMetaListRequestFieldCursor = big.NewInt(1 << 2) + filesDownloadRequestMetaListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + filesDownloadRequestMetaListRequestFieldMimeTypes = big.NewInt(1 << 4) + filesDownloadRequestMetaListRequestFieldModifiedAfter = big.NewInt(1 << 5) + filesDownloadRequestMetaListRequestFieldModifiedBefore = big.NewInt(1 << 6) + filesDownloadRequestMetaListRequestFieldOrderBy = big.NewInt(1 << 7) + filesDownloadRequestMetaListRequestFieldPageSize = big.NewInt(1 << 8) +) + type FilesDownloadRequestMetaListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *string `json:"-" url:"created_after,omitempty"` @@ -36,20 +86,162 @@ type FilesDownloadRequestMetaListRequest struct { OrderBy *FilesDownloadRequestMetaListRequestOrderBy `json:"-" url:"order_by,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FilesDownloadRequestMetaListRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaListRequest) SetCreatedAfter(createdAfter *string) { + f.CreatedAfter = createdAfter + f.require(filesDownloadRequestMetaListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaListRequest) SetCreatedBefore(createdBefore *string) { + f.CreatedBefore = createdBefore + f.require(filesDownloadRequestMetaListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaListRequest) SetCursor(cursor *string) { + f.Cursor = cursor + f.require(filesDownloadRequestMetaListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + f.IncludeDeletedData = includeDeletedData + f.require(filesDownloadRequestMetaListRequestFieldIncludeDeletedData) +} + +// SetMimeTypes sets the MimeTypes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaListRequest) SetMimeTypes(mimeTypes *string) { + f.MimeTypes = mimeTypes + f.require(filesDownloadRequestMetaListRequestFieldMimeTypes) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaListRequest) SetModifiedAfter(modifiedAfter *string) { + f.ModifiedAfter = modifiedAfter + f.require(filesDownloadRequestMetaListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaListRequest) SetModifiedBefore(modifiedBefore *string) { + f.ModifiedBefore = modifiedBefore + f.require(filesDownloadRequestMetaListRequestFieldModifiedBefore) +} + +// SetOrderBy sets the OrderBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaListRequest) SetOrderBy(orderBy *FilesDownloadRequestMetaListRequestOrderBy) { + f.OrderBy = orderBy + f.require(filesDownloadRequestMetaListRequestFieldOrderBy) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaListRequest) SetPageSize(pageSize *int) { + f.PageSize = pageSize + f.require(filesDownloadRequestMetaListRequestFieldPageSize) } +var ( + filesDownloadRequestMetaRetrieveRequestFieldMimeType = big.NewInt(1 << 0) +) + type FilesDownloadRequestMetaRetrieveRequest struct { // 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. MimeType *string `json:"-" url:"mime_type,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FilesDownloadRequestMetaRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) } +// SetMimeType sets the MimeType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRequestMetaRetrieveRequest) SetMimeType(mimeType *string) { + f.MimeType = mimeType + f.require(filesDownloadRequestMetaRetrieveRequestFieldMimeType) +} + +var ( + filesDownloadRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 0) + filesDownloadRetrieveRequestFieldMimeType = big.NewInt(1 << 1) +) + type FilesDownloadRetrieveRequest struct { // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // 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. MimeType *string `json:"-" url:"mime_type,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FilesDownloadRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + f.IncludeShellData = includeShellData + f.require(filesDownloadRetrieveRequestFieldIncludeShellData) +} + +// SetMimeType sets the MimeType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesDownloadRetrieveRequest) SetMimeType(mimeType *string) { + f.MimeType = mimeType + f.require(filesDownloadRetrieveRequestFieldMimeType) +} + +var ( + filesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + filesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + filesListRequestFieldCursor = big.NewInt(1 << 2) + filesListRequestFieldDriveId = big.NewInt(1 << 3) + filesListRequestFieldExpand = big.NewInt(1 << 4) + filesListRequestFieldFolderId = big.NewInt(1 << 5) + filesListRequestFieldIncludeDeletedData = big.NewInt(1 << 6) + filesListRequestFieldIncludeRemoteData = big.NewInt(1 << 7) + filesListRequestFieldIncludeShellData = big.NewInt(1 << 8) + filesListRequestFieldMimeType = big.NewInt(1 << 9) + filesListRequestFieldModifiedAfter = big.NewInt(1 << 10) + filesListRequestFieldModifiedBefore = big.NewInt(1 << 11) + filesListRequestFieldName = big.NewInt(1 << 12) + filesListRequestFieldOrderBy = big.NewInt(1 << 13) + filesListRequestFieldPageSize = big.NewInt(1 << 14) + filesListRequestFieldRemoteId = big.NewInt(1 << 15) +) + type FilesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -83,8 +275,136 @@ type FilesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FilesListRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetCreatedAfter(createdAfter *time.Time) { + f.CreatedAfter = createdAfter + f.require(filesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetCreatedBefore(createdBefore *time.Time) { + f.CreatedBefore = createdBefore + f.require(filesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetCursor(cursor *string) { + f.Cursor = cursor + f.require(filesListRequestFieldCursor) } +// SetDriveId sets the DriveId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetDriveId(driveId *string) { + f.DriveId = driveId + f.require(filesListRequestFieldDriveId) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetExpand(expand []*FilesListRequestExpandItem) { + f.Expand = expand + f.require(filesListRequestFieldExpand) +} + +// SetFolderId sets the FolderId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetFolderId(folderId *string) { + f.FolderId = folderId + f.require(filesListRequestFieldFolderId) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + f.IncludeDeletedData = includeDeletedData + f.require(filesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + f.IncludeRemoteData = includeRemoteData + f.require(filesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetIncludeShellData(includeShellData *bool) { + f.IncludeShellData = includeShellData + f.require(filesListRequestFieldIncludeShellData) +} + +// SetMimeType sets the MimeType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetMimeType(mimeType *string) { + f.MimeType = mimeType + f.require(filesListRequestFieldMimeType) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + f.ModifiedAfter = modifiedAfter + f.require(filesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + f.ModifiedBefore = modifiedBefore + f.require(filesListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetName(name *string) { + f.Name = name + f.require(filesListRequestFieldName) +} + +// SetOrderBy sets the OrderBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetOrderBy(orderBy *FilesListRequestOrderBy) { + f.OrderBy = orderBy + f.require(filesListRequestFieldOrderBy) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetPageSize(pageSize *int) { + f.PageSize = pageSize + f.require(filesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesListRequest) SetRemoteId(remoteId *string) { + f.RemoteId = remoteId + f.require(filesListRequestFieldRemoteId) +} + +var ( + filesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + filesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + filesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type FilesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*FilesRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -92,6 +412,37 @@ type FilesRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FilesRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesRetrieveRequest) SetExpand(expand []*FilesRetrieveRequestExpandItem) { + f.Expand = expand + f.require(filesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + f.IncludeRemoteData = includeRemoteData + f.require(filesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FilesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + f.IncludeShellData = includeShellData + f.require(filesRetrieveRequestFieldIncludeShellData) } type FilesDownloadRequestMetaListRequestOrderBy string @@ -200,12 +551,22 @@ func (f FilesRetrieveRequestExpandItem) Ptr() *FilesRetrieveRequestExpandItem { return &f } +var ( + downloadRequestMetaFieldId = big.NewInt(1 << 0) + downloadRequestMetaFieldUrl = big.NewInt(1 << 1) + downloadRequestMetaFieldMethod = big.NewInt(1 << 2) + downloadRequestMetaFieldHeaders = big.NewInt(1 << 3) +) + type DownloadRequestMeta struct { Id string `json:"id" url:"id"` Url string `json:"url" url:"url"` Method string `json:"method" url:"method"` Headers map[string]interface{} `json:"headers" url:"headers"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -242,6 +603,41 @@ func (d *DownloadRequestMeta) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DownloadRequestMeta) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DownloadRequestMeta) SetId(id string) { + d.Id = id + d.require(downloadRequestMetaFieldId) +} + +// SetUrl sets the Url field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DownloadRequestMeta) SetUrl(url string) { + d.Url = url + d.require(downloadRequestMetaFieldUrl) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DownloadRequestMeta) SetMethod(method string) { + d.Method = method + d.require(downloadRequestMetaFieldMethod) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DownloadRequestMeta) SetHeaders(headers map[string]interface{}) { + d.Headers = headers + d.require(downloadRequestMetaFieldHeaders) +} + func (d *DownloadRequestMeta) UnmarshalJSON(data []byte) error { type unmarshaler DownloadRequestMeta var value unmarshaler @@ -258,6 +654,17 @@ func (d *DownloadRequestMeta) UnmarshalJSON(data []byte) error { return nil } +func (d *DownloadRequestMeta) MarshalJSON() ([]byte, error) { + type embed DownloadRequestMeta + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DownloadRequestMeta) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -275,6 +682,28 @@ func (d *DownloadRequestMeta) String() string { // 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. +var ( + fileFieldId = big.NewInt(1 << 0) + fileFieldRemoteId = big.NewInt(1 << 1) + fileFieldCreatedAt = big.NewInt(1 << 2) + fileFieldModifiedAt = big.NewInt(1 << 3) + fileFieldName = big.NewInt(1 << 4) + fileFieldFileUrl = big.NewInt(1 << 5) + fileFieldFileThumbnailUrl = big.NewInt(1 << 6) + fileFieldSize = big.NewInt(1 << 7) + fileFieldMimeType = big.NewInt(1 << 8) + fileFieldDescription = big.NewInt(1 << 9) + fileFieldFolder = big.NewInt(1 << 10) + fileFieldChecksum = big.NewInt(1 << 11) + fileFieldPermissions = big.NewInt(1 << 12) + fileFieldDrive = big.NewInt(1 << 13) + fileFieldRemoteCreatedAt = big.NewInt(1 << 14) + fileFieldRemoteUpdatedAt = big.NewInt(1 << 15) + fileFieldRemoteWasDeleted = big.NewInt(1 << 16) + fileFieldFieldMappings = big.NewInt(1 << 17) + fileFieldRemoteData = big.NewInt(1 << 18) +) + type File struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -312,6 +741,9 @@ type File struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -453,6 +885,146 @@ func (f *File) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *File) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetId(id *string) { + f.Id = id + f.require(fileFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetRemoteId(remoteId *string) { + f.RemoteId = remoteId + f.require(fileFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetCreatedAt(createdAt *time.Time) { + f.CreatedAt = createdAt + f.require(fileFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetModifiedAt(modifiedAt *time.Time) { + f.ModifiedAt = modifiedAt + f.require(fileFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetName(name *string) { + f.Name = name + f.require(fileFieldName) +} + +// SetFileUrl sets the FileUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetFileUrl(fileUrl *string) { + f.FileUrl = fileUrl + f.require(fileFieldFileUrl) +} + +// SetFileThumbnailUrl sets the FileThumbnailUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetFileThumbnailUrl(fileThumbnailUrl *string) { + f.FileThumbnailUrl = fileThumbnailUrl + f.require(fileFieldFileThumbnailUrl) +} + +// SetSize sets the Size field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetSize(size *int64) { + f.Size = size + f.require(fileFieldSize) +} + +// SetMimeType sets the MimeType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetMimeType(mimeType *string) { + f.MimeType = mimeType + f.require(fileFieldMimeType) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetDescription(description *string) { + f.Description = description + f.require(fileFieldDescription) +} + +// SetFolder sets the Folder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetFolder(folder *FileFolder) { + f.Folder = folder + f.require(fileFieldFolder) +} + +// SetChecksum sets the Checksum field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetChecksum(checksum map[string]interface{}) { + f.Checksum = checksum + f.require(fileFieldChecksum) +} + +// SetPermissions sets the Permissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetPermissions(permissions *FilePermissions) { + f.Permissions = permissions + f.require(fileFieldPermissions) +} + +// SetDrive sets the Drive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetDrive(drive *FileDrive) { + f.Drive = drive + f.require(fileFieldDrive) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + f.RemoteCreatedAt = remoteCreatedAt + f.require(fileFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + f.RemoteUpdatedAt = remoteUpdatedAt + f.require(fileFieldRemoteUpdatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetRemoteWasDeleted(remoteWasDeleted *bool) { + f.RemoteWasDeleted = remoteWasDeleted + f.require(fileFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetFieldMappings(fieldMappings map[string]interface{}) { + f.FieldMappings = fieldMappings + f.require(fileFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *File) SetRemoteData(remoteData []*RemoteData) { + f.RemoteData = remoteData + f.require(fileFieldRemoteData) +} + func (f *File) UnmarshalJSON(data []byte) error { type embed File var unmarshaler = struct { @@ -496,7 +1068,8 @@ func (f *File) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(f.RemoteCreatedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(f.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) } func (f *File) String() string { @@ -788,6 +1361,21 @@ func (f *FilePermissionsItem) Accept(visitor FilePermissionsItemVisitor) error { // 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. +var ( + fileRequestFieldName = big.NewInt(1 << 0) + fileRequestFieldFileUrl = big.NewInt(1 << 1) + fileRequestFieldFileThumbnailUrl = big.NewInt(1 << 2) + fileRequestFieldSize = big.NewInt(1 << 3) + fileRequestFieldMimeType = big.NewInt(1 << 4) + fileRequestFieldDescription = big.NewInt(1 << 5) + fileRequestFieldFolder = big.NewInt(1 << 6) + fileRequestFieldChecksum = big.NewInt(1 << 7) + fileRequestFieldPermissions = big.NewInt(1 << 8) + fileRequestFieldDrive = big.NewInt(1 << 9) + fileRequestFieldIntegrationParams = big.NewInt(1 << 10) + fileRequestFieldLinkedAccountParams = big.NewInt(1 << 11) +) + type FileRequest struct { // The file's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -812,6 +1400,9 @@ type FileRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -904,6 +1495,97 @@ func (f *FileRequest) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *FileRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetName(name *string) { + f.Name = name + f.require(fileRequestFieldName) +} + +// SetFileUrl sets the FileUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetFileUrl(fileUrl *string) { + f.FileUrl = fileUrl + f.require(fileRequestFieldFileUrl) +} + +// SetFileThumbnailUrl sets the FileThumbnailUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetFileThumbnailUrl(fileThumbnailUrl *string) { + f.FileThumbnailUrl = fileThumbnailUrl + f.require(fileRequestFieldFileThumbnailUrl) +} + +// SetSize sets the Size field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetSize(size *int64) { + f.Size = size + f.require(fileRequestFieldSize) +} + +// SetMimeType sets the MimeType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetMimeType(mimeType *string) { + f.MimeType = mimeType + f.require(fileRequestFieldMimeType) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetDescription(description *string) { + f.Description = description + f.require(fileRequestFieldDescription) +} + +// SetFolder sets the Folder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetFolder(folder *FileRequestFolder) { + f.Folder = folder + f.require(fileRequestFieldFolder) +} + +// SetChecksum sets the Checksum field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetChecksum(checksum map[string]interface{}) { + f.Checksum = checksum + f.require(fileRequestFieldChecksum) +} + +// SetPermissions sets the Permissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetPermissions(permissions *FileRequestPermissions) { + f.Permissions = permissions + f.require(fileRequestFieldPermissions) +} + +// SetDrive sets the Drive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetDrive(drive *FileRequestDrive) { + f.Drive = drive + f.require(fileRequestFieldDrive) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + f.IntegrationParams = integrationParams + f.require(fileRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + f.LinkedAccountParams = linkedAccountParams + f.require(fileRequestFieldLinkedAccountParams) +} + func (f *FileRequest) UnmarshalJSON(data []byte) error { type unmarshaler FileRequest var value unmarshaler @@ -920,6 +1602,17 @@ func (f *FileRequest) UnmarshalJSON(data []byte) error { return nil } +func (f *FileRequest) MarshalJSON() ([]byte, error) { + type embed FileRequest + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FileRequest) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -1204,12 +1897,22 @@ func (f *FileRequestPermissionsItem) Accept(visitor FileRequestPermissionsItemVi return fmt.Errorf("type %T does not include a non-empty union type", f) } +var ( + fileStorageFileResponseFieldModel = big.NewInt(1 << 0) + fileStorageFileResponseFieldWarnings = big.NewInt(1 << 1) + fileStorageFileResponseFieldErrors = big.NewInt(1 << 2) + fileStorageFileResponseFieldLogs = big.NewInt(1 << 3) +) + type FileStorageFileResponse struct { Model *File `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1246,6 +1949,41 @@ func (f *FileStorageFileResponse) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *FileStorageFileResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFileResponse) SetModel(model *File) { + f.Model = model + f.require(fileStorageFileResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFileResponse) SetWarnings(warnings []*WarningValidationProblem) { + f.Warnings = warnings + f.require(fileStorageFileResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFileResponse) SetErrors(errors []*ErrorValidationProblem) { + f.Errors = errors + f.require(fileStorageFileResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFileResponse) SetLogs(logs []*DebugModeLog) { + f.Logs = logs + f.require(fileStorageFileResponseFieldLogs) +} + func (f *FileStorageFileResponse) UnmarshalJSON(data []byte) error { type unmarshaler FileStorageFileResponse var value unmarshaler @@ -1262,6 +2000,17 @@ func (f *FileStorageFileResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FileStorageFileResponse) MarshalJSON() ([]byte, error) { + type embed FileStorageFileResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FileStorageFileResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -1274,11 +2023,20 @@ func (f *FileStorageFileResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + paginatedDownloadRequestMetaListFieldNext = big.NewInt(1 << 0) + paginatedDownloadRequestMetaListFieldPrevious = big.NewInt(1 << 1) + paginatedDownloadRequestMetaListFieldResults = big.NewInt(1 << 2) +) + type PaginatedDownloadRequestMetaList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*DownloadRequestMeta `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1308,6 +2066,34 @@ func (p *PaginatedDownloadRequestMetaList) GetExtraProperties() map[string]inter return p.extraProperties } +func (p *PaginatedDownloadRequestMetaList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDownloadRequestMetaList) SetNext(next *string) { + p.Next = next + p.require(paginatedDownloadRequestMetaListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDownloadRequestMetaList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedDownloadRequestMetaListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDownloadRequestMetaList) SetResults(results []*DownloadRequestMeta) { + p.Results = results + p.require(paginatedDownloadRequestMetaListFieldResults) +} + func (p *PaginatedDownloadRequestMetaList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedDownloadRequestMetaList var value unmarshaler @@ -1324,6 +2110,17 @@ func (p *PaginatedDownloadRequestMetaList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedDownloadRequestMetaList) MarshalJSON() ([]byte, error) { + type embed PaginatedDownloadRequestMetaList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedDownloadRequestMetaList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -1336,11 +2133,20 @@ func (p *PaginatedDownloadRequestMetaList) String() string { return fmt.Sprintf("%#v", p) } +var ( + paginatedFileListFieldNext = big.NewInt(1 << 0) + paginatedFileListFieldPrevious = big.NewInt(1 << 1) + paginatedFileListFieldResults = big.NewInt(1 << 2) +) + type PaginatedFileList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*File `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1370,6 +2176,34 @@ func (p *PaginatedFileList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedFileList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedFileList) SetNext(next *string) { + p.Next = next + p.require(paginatedFileListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedFileList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedFileListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedFileList) SetResults(results []*File) { + p.Results = results + p.require(paginatedFileListFieldResults) +} + func (p *PaginatedFileList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedFileList var value unmarshaler @@ -1386,6 +2220,17 @@ func (p *PaginatedFileList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedFileList) MarshalJSON() ([]byte, error) { + type embed PaginatedFileList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedFileList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/filestorage/files/client.go b/filestorage/files/client.go index 73b3ba4..fae5b61 100644 --- a/filestorage/files/client.go +++ b/filestorage/files/client.go @@ -3,9 +3,7 @@ package files import ( - bytes "bytes" context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -15,22 +13,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -39,7 +39,7 @@ func (c *Client) List( ctx context.Context, request *filestorage.FilesListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.File], error) { +) (*core.Page[*string, *filestorage.File], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -52,13 +52,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -75,11 +74,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedFileList) *internal.PageResponse[*string, *filestorage.File] { + readPageResponse := func(response *filestorage.PaginatedFileList) *core.PageResponse[*string, *filestorage.File] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.File]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.File]{ Next: next, Results: results, Done: next == zeroValue, @@ -99,44 +98,15 @@ func (c *Client) Create( request *filestorage.FileStorageFileEndpointRequest, opts ...option.RequestOption, ) (*filestorage.FileStorageFileResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/filestorage/v1/files" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.FileStorageFileResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `File` object with the given `id`. @@ -146,45 +116,16 @@ func (c *Client) Retrieve( request *filestorage.FilesRetrieveRequest, opts ...option.RequestOption, ) (*filestorage.File, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/files/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.File - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns the `File` content with the given `id` as a stream of bytes. @@ -194,45 +135,16 @@ func (c *Client) DownloadRetrieve( request *filestorage.FilesDownloadRetrieveRequest, opts ...option.RequestOption, ) (io.Reader, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/files/%v/download", + response, err := c.WithRawResponse.DownloadRetrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - response := bytes.NewBuffer(nil) - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. @@ -242,45 +154,16 @@ func (c *Client) DownloadRequestMetaRetrieve( request *filestorage.FilesDownloadRequestMetaRetrieveRequest, opts ...option.RequestOption, ) (*filestorage.DownloadRequestMeta, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/files/%v/download/request-meta", + response, err := c.WithRawResponse.DownloadRequestMetaRetrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.DownloadRequestMeta - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. @@ -288,7 +171,7 @@ func (c *Client) DownloadRequestMetaList( ctx context.Context, request *filestorage.FilesDownloadRequestMetaListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.DownloadRequestMeta], error) { +) (*core.Page[*string, *filestorage.DownloadRequestMeta], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -301,13 +184,12 @@ func (c *Client) DownloadRequestMetaList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -324,11 +206,11 @@ func (c *Client) DownloadRequestMetaList( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedDownloadRequestMetaList) *internal.PageResponse[*string, *filestorage.DownloadRequestMeta] { + readPageResponse := func(response *filestorage.PaginatedDownloadRequestMetaList) *core.PageResponse[*string, *filestorage.DownloadRequestMeta] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.DownloadRequestMeta]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.DownloadRequestMeta]{ Next: next, Results: results, Done: next == zeroValue, @@ -347,33 +229,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*filestorage.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/files/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/files/file_storage_files_test/file_storage_files_test.go b/filestorage/files/file_storage_files_test/file_storage_files_test.go new file mode 100644 index 0000000..b82a50c --- /dev/null +++ b/filestorage/files/file_storage_files_test/file_storage_files_test.go @@ -0,0 +1,280 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_files_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageFilesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.FilesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + DriveId: merge.String( + "drive_id", + ), + FolderId: merge.String( + "folder_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + MimeType: merge.String( + "mime_type", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + OrderBy: filestorage.FilesListRequestOrderByCreatedAtDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.FileStorage.Files.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/files", map[string]string{"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"}, 1) +} + +func TestFileStorageFilesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.FileStorageFileEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &filestorage.FileRequest{}, + } + _, invocationErr := client.FileStorage.Files.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/files", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestFileStorageFilesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.FilesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.FileStorage.Files.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/files/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestFileStorageFilesDownloadRequestMetaRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.FilesDownloadRequestMetaRetrieveRequest{ + MimeType: merge.String( + "mime_type", + ), + } + _, invocationErr := client.FileStorage.Files.DownloadRequestMetaRetrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/files/id/download/request-meta", map[string]string{"mime_type": "mime_type"}, 1) +} + +func TestFileStorageFilesDownloadRequestMetaListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.FilesDownloadRequestMetaListRequest{ + CreatedAfter: merge.String( + "created_after", + ), + CreatedBefore: merge.String( + "created_before", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + MimeTypes: merge.String( + "mime_types", + ), + ModifiedAfter: merge.String( + "modified_after", + ), + ModifiedBefore: merge.String( + "modified_before", + ), + OrderBy: filestorage.FilesDownloadRequestMetaListRequestOrderByCreatedAtDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.FileStorage.Files.DownloadRequestMetaList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/files/download/request-meta", map[string]string{"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"}, 1) +} + +func TestFileStorageFilesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.Files.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/files/meta/post", nil, 1) +} diff --git a/filestorage/files/raw_client.go b/filestorage/files/raw_client.go new file mode 100644 index 0000000..bd40c91 --- /dev/null +++ b/filestorage/files/raw_client.go @@ -0,0 +1,274 @@ +// Code generated by Fern. DO NOT EDIT. + +package files + +import ( + bytes "bytes" + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + io "io" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *filestorage.FileStorageFileEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.FileStorageFileResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/files" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *filestorage.FileStorageFileResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.FileStorageFileResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *filestorage.FilesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.File], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/files/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.File + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.File]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) DownloadRetrieve( + ctx context.Context, + id string, + request *filestorage.FilesDownloadRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[io.Reader], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/files/%v/download", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + response := bytes.NewBuffer(nil) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[io.Reader]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) DownloadRequestMetaRetrieve( + ctx context.Context, + id string, + request *filestorage.FilesDownloadRequestMetaRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.DownloadRequestMeta], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/files/%v/download/request-meta", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.DownloadRequestMeta + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.DownloadRequestMeta]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*filestorage.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/files/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/folders.go b/filestorage/folders.go index f8e7cdf..2cc0e85 100644 --- a/filestorage/folders.go +++ b/filestorage/folders.go @@ -6,17 +6,72 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + fileStorageFolderEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + fileStorageFolderEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + fileStorageFolderEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type FileStorageFolderEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *FolderRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FileStorageFolderEndpointRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFolderEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + f.IsDebugMode = isDebugMode + f.require(fileStorageFolderEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFolderEndpointRequest) SetRunAsync(runAsync *bool) { + f.RunAsync = runAsync + f.require(fileStorageFolderEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFolderEndpointRequest) SetModel(model *FolderRequest) { + f.Model = model + f.require(fileStorageFolderEndpointRequestFieldModel) +} + +var ( + foldersListRequestFieldCreatedAfter = big.NewInt(1 << 0) + foldersListRequestFieldCreatedBefore = big.NewInt(1 << 1) + foldersListRequestFieldCursor = big.NewInt(1 << 2) + foldersListRequestFieldDriveId = big.NewInt(1 << 3) + foldersListRequestFieldExpand = big.NewInt(1 << 4) + foldersListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + foldersListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + foldersListRequestFieldIncludeShellData = big.NewInt(1 << 7) + foldersListRequestFieldModifiedAfter = big.NewInt(1 << 8) + foldersListRequestFieldModifiedBefore = big.NewInt(1 << 9) + foldersListRequestFieldName = big.NewInt(1 << 10) + foldersListRequestFieldPageSize = big.NewInt(1 << 11) + foldersListRequestFieldParentFolderId = big.NewInt(1 << 12) + foldersListRequestFieldRemoteId = big.NewInt(1 << 13) +) + type FoldersListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -46,8 +101,122 @@ type FoldersListRequest struct { ParentFolderId *string `json:"-" url:"parent_folder_id,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FoldersListRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetCreatedAfter(createdAfter *time.Time) { + f.CreatedAfter = createdAfter + f.require(foldersListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetCreatedBefore(createdBefore *time.Time) { + f.CreatedBefore = createdBefore + f.require(foldersListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetCursor(cursor *string) { + f.Cursor = cursor + f.require(foldersListRequestFieldCursor) +} + +// SetDriveId sets the DriveId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetDriveId(driveId *string) { + f.DriveId = driveId + f.require(foldersListRequestFieldDriveId) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetExpand(expand []*FoldersListRequestExpandItem) { + f.Expand = expand + f.require(foldersListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + f.IncludeDeletedData = includeDeletedData + f.require(foldersListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + f.IncludeRemoteData = includeRemoteData + f.require(foldersListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetIncludeShellData(includeShellData *bool) { + f.IncludeShellData = includeShellData + f.require(foldersListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + f.ModifiedAfter = modifiedAfter + f.require(foldersListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + f.ModifiedBefore = modifiedBefore + f.require(foldersListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetName(name *string) { + f.Name = name + f.require(foldersListRequestFieldName) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetPageSize(pageSize *int) { + f.PageSize = pageSize + f.require(foldersListRequestFieldPageSize) +} + +// SetParentFolderId sets the ParentFolderId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetParentFolderId(parentFolderId *string) { + f.ParentFolderId = parentFolderId + f.require(foldersListRequestFieldParentFolderId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersListRequest) SetRemoteId(remoteId *string) { + f.RemoteId = remoteId + f.require(foldersListRequestFieldRemoteId) +} + +var ( + foldersRetrieveRequestFieldExpand = big.NewInt(1 << 0) + foldersRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + foldersRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type FoldersRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*FoldersRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -55,6 +224,37 @@ type FoldersRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FoldersRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersRetrieveRequest) SetExpand(expand []*FoldersRetrieveRequestExpandItem) { + f.Expand = expand + f.require(foldersRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + f.IncludeRemoteData = includeRemoteData + f.require(foldersRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FoldersRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + f.IncludeShellData = includeShellData + f.require(foldersRetrieveRequestFieldIncludeShellData) } type FoldersListRequestExpandItem string @@ -107,12 +307,22 @@ func (f FoldersRetrieveRequestExpandItem) Ptr() *FoldersRetrieveRequestExpandIte return &f } +var ( + fileStorageFolderResponseFieldModel = big.NewInt(1 << 0) + fileStorageFolderResponseFieldWarnings = big.NewInt(1 << 1) + fileStorageFolderResponseFieldErrors = big.NewInt(1 << 2) + fileStorageFolderResponseFieldLogs = big.NewInt(1 << 3) +) + type FileStorageFolderResponse struct { Model *Folder `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -149,6 +359,41 @@ func (f *FileStorageFolderResponse) GetExtraProperties() map[string]interface{} return f.extraProperties } +func (f *FileStorageFolderResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFolderResponse) SetModel(model *Folder) { + f.Model = model + f.require(fileStorageFolderResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFolderResponse) SetWarnings(warnings []*WarningValidationProblem) { + f.Warnings = warnings + f.require(fileStorageFolderResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFolderResponse) SetErrors(errors []*ErrorValidationProblem) { + f.Errors = errors + f.require(fileStorageFolderResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FileStorageFolderResponse) SetLogs(logs []*DebugModeLog) { + f.Logs = logs + f.require(fileStorageFolderResponseFieldLogs) +} + func (f *FileStorageFolderResponse) UnmarshalJSON(data []byte) error { type unmarshaler FileStorageFolderResponse var value unmarshaler @@ -165,6 +410,17 @@ func (f *FileStorageFolderResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FileStorageFolderResponse) MarshalJSON() ([]byte, error) { + type embed FileStorageFolderResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FileStorageFolderResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -182,6 +438,18 @@ func (f *FileStorageFolderResponse) String() string { // 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. +var ( + folderRequestFieldName = big.NewInt(1 << 0) + folderRequestFieldFolderUrl = big.NewInt(1 << 1) + folderRequestFieldSize = big.NewInt(1 << 2) + folderRequestFieldDescription = big.NewInt(1 << 3) + folderRequestFieldParentFolder = big.NewInt(1 << 4) + folderRequestFieldDrive = big.NewInt(1 << 5) + folderRequestFieldPermissions = big.NewInt(1 << 6) + folderRequestFieldIntegrationParams = big.NewInt(1 << 7) + folderRequestFieldLinkedAccountParams = big.NewInt(1 << 8) +) + type FolderRequest struct { // The folder's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -200,6 +468,9 @@ type FolderRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -271,6 +542,76 @@ func (f *FolderRequest) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *FolderRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FolderRequest) SetName(name *string) { + f.Name = name + f.require(folderRequestFieldName) +} + +// SetFolderUrl sets the FolderUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FolderRequest) SetFolderUrl(folderUrl *string) { + f.FolderUrl = folderUrl + f.require(folderRequestFieldFolderUrl) +} + +// SetSize sets the Size field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FolderRequest) SetSize(size *int64) { + f.Size = size + f.require(folderRequestFieldSize) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FolderRequest) SetDescription(description *string) { + f.Description = description + f.require(folderRequestFieldDescription) +} + +// SetParentFolder sets the ParentFolder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FolderRequest) SetParentFolder(parentFolder *FolderRequestParentFolder) { + f.ParentFolder = parentFolder + f.require(folderRequestFieldParentFolder) +} + +// SetDrive sets the Drive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FolderRequest) SetDrive(drive *FolderRequestDrive) { + f.Drive = drive + f.require(folderRequestFieldDrive) +} + +// SetPermissions sets the Permissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FolderRequest) SetPermissions(permissions *FolderRequestPermissions) { + f.Permissions = permissions + f.require(folderRequestFieldPermissions) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FolderRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + f.IntegrationParams = integrationParams + f.require(folderRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FolderRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + f.LinkedAccountParams = linkedAccountParams + f.require(folderRequestFieldLinkedAccountParams) +} + func (f *FolderRequest) UnmarshalJSON(data []byte) error { type unmarshaler FolderRequest var value unmarshaler @@ -287,6 +628,17 @@ func (f *FolderRequest) UnmarshalJSON(data []byte) error { return nil } +func (f *FolderRequest) MarshalJSON() ([]byte, error) { + type embed FolderRequest + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FolderRequest) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -571,11 +923,20 @@ func (f *FolderRequestPermissionsItem) Accept(visitor FolderRequestPermissionsIt return fmt.Errorf("type %T does not include a non-empty union type", f) } +var ( + paginatedFolderListFieldNext = big.NewInt(1 << 0) + paginatedFolderListFieldPrevious = big.NewInt(1 << 1) + paginatedFolderListFieldResults = big.NewInt(1 << 2) +) + type PaginatedFolderList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Folder `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -605,6 +966,34 @@ func (p *PaginatedFolderList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedFolderList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedFolderList) SetNext(next *string) { + p.Next = next + p.require(paginatedFolderListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedFolderList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedFolderListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedFolderList) SetResults(results []*Folder) { + p.Results = results + p.require(paginatedFolderListFieldResults) +} + func (p *PaginatedFolderList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedFolderList var value unmarshaler @@ -621,6 +1010,17 @@ func (p *PaginatedFolderList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedFolderList) MarshalJSON() ([]byte, error) { + type embed PaginatedFolderList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedFolderList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/filestorage/folders/client.go b/filestorage/folders/client.go index e7eb7cc..942ab2d 100644 --- a/filestorage/folders/client.go +++ b/filestorage/folders/client.go @@ -4,7 +4,6 @@ package folders import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *filestorage.FoldersListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.Folder], error) { +) (*core.Page[*string, *filestorage.Folder], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedFolderList) *internal.PageResponse[*string, *filestorage.Folder] { + readPageResponse := func(response *filestorage.PaginatedFolderList) *core.PageResponse[*string, *filestorage.Folder] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.Folder]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.Folder]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *filestorage.FileStorageFolderEndpointRequest, opts ...option.RequestOption, ) (*filestorage.FileStorageFolderResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/filestorage/v1/folders" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.FileStorageFolderResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Folder` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *filestorage.FoldersRetrieveRequest, opts ...option.RequestOption, ) (*filestorage.Folder, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/folders/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.Folder - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `FileStorageFolder` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*filestorage.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/folders/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/folders/file_storage_folders_test/file_storage_folders_test.go b/filestorage/folders/file_storage_folders_test/file_storage_folders_test.go new file mode 100644 index 0000000..e5b7f67 --- /dev/null +++ b/filestorage/folders/file_storage_folders_test/file_storage_folders_test.go @@ -0,0 +1,205 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_folders_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageFoldersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.FoldersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + DriveId: merge.String( + "drive_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + ParentFolderId: merge.String( + "parent_folder_id", + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.FileStorage.Folders.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/folders", map[string]string{"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"}, 1) +} + +func TestFileStorageFoldersCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.FileStorageFolderEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &filestorage.FolderRequest{}, + } + _, invocationErr := client.FileStorage.Folders.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/folders", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestFileStorageFoldersRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.FoldersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.FileStorage.Folders.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/folders/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestFileStorageFoldersMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.Folders.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/folders/meta/post", nil, 1) +} diff --git a/filestorage/folders/raw_client.go b/filestorage/folders/raw_client.go new file mode 100644 index 0000000..c6dd536 --- /dev/null +++ b/filestorage/folders/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package folders + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *filestorage.FileStorageFolderEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.FileStorageFolderResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/folders" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *filestorage.FileStorageFolderResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.FileStorageFolderResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *filestorage.FoldersRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.Folder], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/folders/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.Folder + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.Folder]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*filestorage.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/folders/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/forceresync/client.go b/filestorage/forceresync/client.go index f987f79..8befe0a 100644 --- a/filestorage/forceresync/client.go +++ b/filestorage/forceresync/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) SyncStatusResyncCreate( ctx context.Context, opts ...option.RequestOption, ) ([]*filestorage.SyncStatus, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/sync-status/resync" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*filestorage.SyncStatus - if err := c.caller.Call( + response, err := c.WithRawResponse.SyncStatusResyncCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/forceresync/file_storage_force_resync_test/file_storage_force_resync_test.go b/filestorage/forceresync/file_storage_force_resync_test/file_storage_force_resync_test.go new file mode 100644 index 0000000..0bf3385 --- /dev/null +++ b/filestorage/forceresync/file_storage_force_resync_test/file_storage_force_resync_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_force_resync_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageForceResyncSyncStatusResyncCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/sync-status/resync", nil, 1) +} diff --git a/filestorage/forceresync/raw_client.go b/filestorage/forceresync/raw_client.go new file mode 100644 index 0000000..f90dcb0 --- /dev/null +++ b/filestorage/forceresync/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package forceresync + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) SyncStatusResyncCreate( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*filestorage.SyncStatus], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/sync-status/resync" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*filestorage.SyncStatus + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*filestorage.SyncStatus]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/generate_key.go b/filestorage/generate_key.go index de5834b..689f0ea 100644 --- a/filestorage/generate_key.go +++ b/filestorage/generate_key.go @@ -2,7 +2,32 @@ package filestorage +import ( + big "math/big" +) + +var ( + generateRemoteKeyRequestFieldName = big.NewInt(1 << 0) +) + type GenerateRemoteKeyRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GenerateRemoteKeyRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GenerateRemoteKeyRequest) SetName(name string) { + g.Name = name + g.require(generateRemoteKeyRequestFieldName) } diff --git a/filestorage/generatekey/client.go b/filestorage/generatekey/client.go index f99069b..d918310 100644 --- a/filestorage/generatekey/client.go +++ b/filestorage/generatekey/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *filestorage.GenerateRemoteKeyRequest, opts ...option.RequestOption, ) (*filestorage.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/generate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/generatekey/file_storage_generate_key_test/file_storage_generate_key_test.go b/filestorage/generatekey/file_storage_generate_key_test/file_storage_generate_key_test.go new file mode 100644 index 0000000..89624bc --- /dev/null +++ b/filestorage/generatekey/file_storage_generate_key_test/file_storage_generate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_generate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageGenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.FileStorage.GenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/generate-key", nil, 1) +} diff --git a/filestorage/generatekey/raw_client.go b/filestorage/generatekey/raw_client.go new file mode 100644 index 0000000..83e5805 --- /dev/null +++ b/filestorage/generatekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package generatekey + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *filestorage.GenerateRemoteKeyRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/generate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *filestorage.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/groups.go b/filestorage/groups.go index e4b078f..acfa61f 100644 --- a/filestorage/groups.go +++ b/filestorage/groups.go @@ -6,9 +6,24 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + groupsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + groupsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + groupsListRequestFieldCursor = big.NewInt(1 << 2) + groupsListRequestFieldExpand = big.NewInt(1 << 3) + groupsListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + groupsListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + groupsListRequestFieldIncludeShellData = big.NewInt(1 << 6) + groupsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + groupsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + groupsListRequestFieldPageSize = big.NewInt(1 << 9) + groupsListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type GroupsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -32,8 +47,101 @@ type GroupsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GroupsListRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetCreatedAfter(createdAfter *time.Time) { + g.CreatedAfter = createdAfter + g.require(groupsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetCreatedBefore(createdBefore *time.Time) { + g.CreatedBefore = createdBefore + g.require(groupsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetCursor(cursor *string) { + g.Cursor = cursor + g.require(groupsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetExpand(expand []*GroupsListRequestExpandItem) { + g.Expand = expand + g.require(groupsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + g.IncludeDeletedData = includeDeletedData + g.require(groupsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + g.IncludeRemoteData = includeRemoteData + g.require(groupsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetIncludeShellData(includeShellData *bool) { + g.IncludeShellData = includeShellData + g.require(groupsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + g.ModifiedAfter = modifiedAfter + g.require(groupsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + g.ModifiedBefore = modifiedBefore + g.require(groupsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetPageSize(pageSize *int) { + g.PageSize = pageSize + g.require(groupsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetRemoteId(remoteId *string) { + g.RemoteId = remoteId + g.require(groupsListRequestFieldRemoteId) } +var ( + groupsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + groupsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + groupsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type GroupsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*GroupsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -41,6 +149,37 @@ type GroupsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GroupsRetrieveRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsRetrieveRequest) SetExpand(expand []*GroupsRetrieveRequestExpandItem) { + g.Expand = expand + g.require(groupsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + g.IncludeRemoteData = includeRemoteData + g.require(groupsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + g.IncludeShellData = includeShellData + g.require(groupsRetrieveRequestFieldIncludeShellData) } type GroupsListRequestExpandItem string @@ -87,11 +226,20 @@ func (g GroupsRetrieveRequestExpandItem) Ptr() *GroupsRetrieveRequestExpandItem return &g } +var ( + paginatedGroupListFieldNext = big.NewInt(1 << 0) + paginatedGroupListFieldPrevious = big.NewInt(1 << 1) + paginatedGroupListFieldResults = big.NewInt(1 << 2) +) + type PaginatedGroupList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Group `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -121,6 +269,34 @@ func (p *PaginatedGroupList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedGroupList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedGroupList) SetNext(next *string) { + p.Next = next + p.require(paginatedGroupListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedGroupList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedGroupListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedGroupList) SetResults(results []*Group) { + p.Results = results + p.require(paginatedGroupListFieldResults) +} + func (p *PaginatedGroupList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedGroupList var value unmarshaler @@ -137,6 +313,17 @@ func (p *PaginatedGroupList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedGroupList) MarshalJSON() ([]byte, error) { + type embed PaginatedGroupList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedGroupList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/filestorage/groups/client.go b/filestorage/groups/client.go index c1e3774..ed10767 100644 --- a/filestorage/groups/client.go +++ b/filestorage/groups/client.go @@ -4,7 +4,6 @@ package groups import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *filestorage.GroupsListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.Group], error) { +) (*core.Page[*string, *filestorage.Group], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedGroupList) *internal.PageResponse[*string, *filestorage.Group] { + readPageResponse := func(response *filestorage.PaginatedGroupList) *core.PageResponse[*string, *filestorage.Group] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.Group]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.Group]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *filestorage.GroupsRetrieveRequest, opts ...option.RequestOption, ) (*filestorage.Group, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/groups/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.Group - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/filestorage/groups/file_storage_groups_test/file_storage_groups_test.go b/filestorage/groups/file_storage_groups_test/file_storage_groups_test.go new file mode 100644 index 0000000..a129a66 --- /dev/null +++ b/filestorage/groups/file_storage_groups_test/file_storage_groups_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_groups_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageGroupsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.GroupsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.FileStorage.Groups.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/groups", map[string]string{"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"}, 1) +} + +func TestFileStorageGroupsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.GroupsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.FileStorage.Groups.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/groups/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/filestorage/groups/raw_client.go b/filestorage/groups/raw_client.go new file mode 100644 index 0000000..cc2f9fa --- /dev/null +++ b/filestorage/groups/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package groups + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *filestorage.GroupsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.Group], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/groups/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.Group + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.Group]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/issues.go b/filestorage/issues.go index 60cff42..4eb05b5 100644 --- a/filestorage/issues.go +++ b/filestorage/issues.go @@ -6,9 +6,27 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + issuesListRequestFieldAccountToken = big.NewInt(1 << 0) + issuesListRequestFieldCursor = big.NewInt(1 << 1) + issuesListRequestFieldEndDate = big.NewInt(1 << 2) + issuesListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + issuesListRequestFieldFirstIncidentTimeAfter = big.NewInt(1 << 4) + issuesListRequestFieldFirstIncidentTimeBefore = big.NewInt(1 << 5) + issuesListRequestFieldIncludeMuted = big.NewInt(1 << 6) + issuesListRequestFieldIntegrationName = big.NewInt(1 << 7) + issuesListRequestFieldLastIncidentTimeAfter = big.NewInt(1 << 8) + issuesListRequestFieldLastIncidentTimeBefore = big.NewInt(1 << 9) + issuesListRequestFieldLinkedAccountId = big.NewInt(1 << 10) + issuesListRequestFieldPageSize = big.NewInt(1 << 11) + issuesListRequestFieldStartDate = big.NewInt(1 << 12) + issuesListRequestFieldStatus = big.NewInt(1 << 13) +) + type IssuesListRequest struct { AccountToken *string `json:"-" url:"account_token,omitempty"` // The pagination cursor value. @@ -38,6 +56,114 @@ type IssuesListRequest struct { // * `ONGOING` - ONGOING // * `RESOLVED` - RESOLVED Status *IssuesListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *IssuesListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetAccountToken(accountToken *string) { + i.AccountToken = accountToken + i.require(issuesListRequestFieldAccountToken) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(issuesListRequestFieldCursor) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndDate(endDate *string) { + i.EndDate = endDate + i.require(issuesListRequestFieldEndDate) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + i.EndUserOrganizationName = endUserOrganizationName + i.require(issuesListRequestFieldEndUserOrganizationName) +} + +// SetFirstIncidentTimeAfter sets the FirstIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeAfter(firstIncidentTimeAfter *time.Time) { + i.FirstIncidentTimeAfter = firstIncidentTimeAfter + i.require(issuesListRequestFieldFirstIncidentTimeAfter) +} + +// SetFirstIncidentTimeBefore sets the FirstIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeBefore(firstIncidentTimeBefore *time.Time) { + i.FirstIncidentTimeBefore = firstIncidentTimeBefore + i.require(issuesListRequestFieldFirstIncidentTimeBefore) +} + +// SetIncludeMuted sets the IncludeMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIncludeMuted(includeMuted *string) { + i.IncludeMuted = includeMuted + i.require(issuesListRequestFieldIncludeMuted) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIntegrationName(integrationName *string) { + i.IntegrationName = integrationName + i.require(issuesListRequestFieldIntegrationName) +} + +// SetLastIncidentTimeAfter sets the LastIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeAfter(lastIncidentTimeAfter *time.Time) { + i.LastIncidentTimeAfter = lastIncidentTimeAfter + i.require(issuesListRequestFieldLastIncidentTimeAfter) +} + +// SetLastIncidentTimeBefore sets the LastIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeBefore(lastIncidentTimeBefore *time.Time) { + i.LastIncidentTimeBefore = lastIncidentTimeBefore + i.require(issuesListRequestFieldLastIncidentTimeBefore) +} + +// SetLinkedAccountId sets the LinkedAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLinkedAccountId(linkedAccountId *string) { + i.LinkedAccountId = linkedAccountId + i.require(issuesListRequestFieldLinkedAccountId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(issuesListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStartDate(startDate *string) { + i.StartDate = startDate + i.require(issuesListRequestFieldStartDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStatus(status *IssuesListRequestStatus) { + i.Status = status + i.require(issuesListRequestFieldStatus) } type IssuesListRequestStatus string @@ -62,6 +188,17 @@ func (i IssuesListRequestStatus) Ptr() *IssuesListRequestStatus { return &i } +var ( + issueFieldId = big.NewInt(1 << 0) + issueFieldStatus = big.NewInt(1 << 1) + issueFieldErrorDescription = big.NewInt(1 << 2) + issueFieldEndUser = big.NewInt(1 << 3) + issueFieldFirstIncidentTime = big.NewInt(1 << 4) + issueFieldLastIncidentTime = big.NewInt(1 << 5) + issueFieldIsMuted = big.NewInt(1 << 6) + issueFieldErrorDetails = big.NewInt(1 << 7) +) + type Issue struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -76,6 +213,9 @@ type Issue struct { IsMuted *bool `json:"is_muted,omitempty" url:"is_muted,omitempty"` ErrorDetails []string `json:"error_details,omitempty" url:"error_details,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +280,69 @@ func (i *Issue) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *Issue) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetId(id *string) { + i.Id = id + i.require(issueFieldId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetStatus(status *IssueStatus) { + i.Status = status + i.require(issueFieldStatus) +} + +// SetErrorDescription sets the ErrorDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDescription(errorDescription string) { + i.ErrorDescription = errorDescription + i.require(issueFieldErrorDescription) +} + +// SetEndUser sets the EndUser field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetEndUser(endUser map[string]interface{}) { + i.EndUser = endUser + i.require(issueFieldEndUser) +} + +// SetFirstIncidentTime sets the FirstIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetFirstIncidentTime(firstIncidentTime *time.Time) { + i.FirstIncidentTime = firstIncidentTime + i.require(issueFieldFirstIncidentTime) +} + +// SetLastIncidentTime sets the LastIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetLastIncidentTime(lastIncidentTime *time.Time) { + i.LastIncidentTime = lastIncidentTime + i.require(issueFieldLastIncidentTime) +} + +// SetIsMuted sets the IsMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetIsMuted(isMuted *bool) { + i.IsMuted = isMuted + i.require(issueFieldIsMuted) +} + +// SetErrorDetails sets the ErrorDetails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDetails(errorDetails []string) { + i.ErrorDetails = errorDetails + i.require(issueFieldErrorDetails) +} + func (i *Issue) UnmarshalJSON(data []byte) error { type embed Issue var unmarshaler = struct { @@ -175,7 +378,8 @@ func (i *Issue) MarshalJSON() ([]byte, error) { FirstIncidentTime: internal.NewOptionalDateTime(i.FirstIncidentTime), LastIncidentTime: internal.NewOptionalDateTime(i.LastIncidentTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *Issue) String() string { @@ -280,11 +484,20 @@ func (i IssueStatusEnum) Ptr() *IssueStatusEnum { return &i } +var ( + paginatedIssueListFieldNext = big.NewInt(1 << 0) + paginatedIssueListFieldPrevious = big.NewInt(1 << 1) + paginatedIssueListFieldResults = big.NewInt(1 << 2) +) + type PaginatedIssueList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Issue `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -314,6 +527,34 @@ func (p *PaginatedIssueList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedIssueList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetNext(next *string) { + p.Next = next + p.require(paginatedIssueListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedIssueListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetResults(results []*Issue) { + p.Results = results + p.require(paginatedIssueListFieldResults) +} + func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedIssueList var value unmarshaler @@ -330,6 +571,17 @@ func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedIssueList) MarshalJSON() ([]byte, error) { + type embed PaginatedIssueList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedIssueList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/filestorage/issues/client.go b/filestorage/issues/client.go index a27eb7e..a862d17 100644 --- a/filestorage/issues/client.go +++ b/filestorage/issues/client.go @@ -4,7 +4,6 @@ package issues import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *filestorage.IssuesListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.Issue], error) { +) (*core.Page[*string, *filestorage.Issue], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedIssueList) *internal.PageResponse[*string, *filestorage.Issue] { + readPageResponse := func(response *filestorage.PaginatedIssueList) *core.PageResponse[*string, *filestorage.Issue] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.Issue]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.Issue]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,36 +97,13 @@ func (c *Client) Retrieve( id string, opts ...option.RequestOption, ) (*filestorage.Issue, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/issues/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.Issue - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/issues/file_storage_issues_test/file_storage_issues_test.go b/filestorage/issues/file_storage_issues_test/file_storage_issues_test.go new file mode 100644 index 0000000..c435169 --- /dev/null +++ b/filestorage/issues/file_storage_issues_test/file_storage_issues_test.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_issues_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageIssuesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: filestorage.IssuesListRequestStatusOngoing.Ptr(), + } + _, invocationErr := client.FileStorage.Issues.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/issues", map[string]string{"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"}, 1) +} + +func TestFileStorageIssuesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.Issues.Retrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/issues/id", nil, 1) +} diff --git a/filestorage/issues/raw_client.go b/filestorage/issues/raw_client.go new file mode 100644 index 0000000..419b077 --- /dev/null +++ b/filestorage/issues/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package issues + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*filestorage.Issue], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/issues/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.Issue + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.Issue]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/link_token.go b/filestorage/link_token.go index d167521..0edcaf3 100644 --- a/filestorage/link_token.go +++ b/filestorage/link_token.go @@ -6,6 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + endUserDetailsRequestFieldEndUserEmailAddress = big.NewInt(1 << 0) + endUserDetailsRequestFieldEndUserOrganizationName = big.NewInt(1 << 1) + endUserDetailsRequestFieldEndUserOriginId = big.NewInt(1 << 2) + endUserDetailsRequestFieldCategories = big.NewInt(1 << 3) + endUserDetailsRequestFieldIntegration = big.NewInt(1 << 4) + endUserDetailsRequestFieldLinkExpiryMins = big.NewInt(1 << 5) + endUserDetailsRequestFieldShouldCreateMagicLinkUrl = big.NewInt(1 << 6) + endUserDetailsRequestFieldHideAdminMagicLink = big.NewInt(1 << 7) + endUserDetailsRequestFieldCommonModels = big.NewInt(1 << 8) + endUserDetailsRequestFieldCategoryCommonModelScopes = big.NewInt(1 << 9) + endUserDetailsRequestFieldLanguage = big.NewInt(1 << 10) + endUserDetailsRequestFieldAreSyncsDisabled = big.NewInt(1 << 11) + endUserDetailsRequestFieldIntegrationSpecificConfig = big.NewInt(1 << 12) ) type EndUserDetailsRequest struct { @@ -38,6 +55,107 @@ type EndUserDetailsRequest struct { AreSyncsDisabled *bool `json:"are_syncs_disabled,omitempty" url:"-"` // A JSON object containing integration-specific configuration options. IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EndUserDetailsRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserEmailAddress(endUserEmailAddress string) { + e.EndUserEmailAddress = endUserEmailAddress + e.require(endUserDetailsRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOrganizationName(endUserOrganizationName string) { + e.EndUserOrganizationName = endUserOrganizationName + e.require(endUserDetailsRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOriginId(endUserOriginId string) { + e.EndUserOriginId = endUserOriginId + e.require(endUserDetailsRequestFieldEndUserOriginId) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategories(categories []CategoriesEnum) { + e.Categories = categories + e.require(endUserDetailsRequestFieldCategories) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegration(integration *string) { + e.Integration = integration + e.require(endUserDetailsRequestFieldIntegration) +} + +// SetLinkExpiryMins sets the LinkExpiryMins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLinkExpiryMins(linkExpiryMins *int) { + e.LinkExpiryMins = linkExpiryMins + e.require(endUserDetailsRequestFieldLinkExpiryMins) +} + +// SetShouldCreateMagicLinkUrl sets the ShouldCreateMagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetShouldCreateMagicLinkUrl(shouldCreateMagicLinkUrl *bool) { + e.ShouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl + e.require(endUserDetailsRequestFieldShouldCreateMagicLinkUrl) +} + +// SetHideAdminMagicLink sets the HideAdminMagicLink field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetHideAdminMagicLink(hideAdminMagicLink *bool) { + e.HideAdminMagicLink = hideAdminMagicLink + e.require(endUserDetailsRequestFieldHideAdminMagicLink) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCommonModels(commonModels []*CommonModelScopesBodyRequest) { + e.CommonModels = commonModels + e.require(endUserDetailsRequestFieldCommonModels) +} + +// SetCategoryCommonModelScopes sets the CategoryCommonModelScopes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategoryCommonModelScopes(categoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest) { + e.CategoryCommonModelScopes = categoryCommonModelScopes + e.require(endUserDetailsRequestFieldCategoryCommonModelScopes) +} + +// SetLanguage sets the Language field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLanguage(language *EndUserDetailsRequestLanguage) { + e.Language = language + e.require(endUserDetailsRequestFieldLanguage) +} + +// SetAreSyncsDisabled sets the AreSyncsDisabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetAreSyncsDisabled(areSyncsDisabled *bool) { + e.AreSyncsDisabled = areSyncsDisabled + e.require(endUserDetailsRequestFieldAreSyncsDisabled) +} + +// SetIntegrationSpecificConfig sets the IntegrationSpecificConfig field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegrationSpecificConfig(integrationSpecificConfig map[string]interface{}) { + e.IntegrationSpecificConfig = integrationSpecificConfig + e.require(endUserDetailsRequestFieldIntegrationSpecificConfig) } // The following subset of IETF language tags can be used to configure localization. @@ -106,11 +224,20 @@ func (e *EndUserDetailsRequestLanguage) Accept(visitor EndUserDetailsRequestLang return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + commonModelScopesBodyRequestFieldModelId = big.NewInt(1 << 0) + commonModelScopesBodyRequestFieldEnabledActions = big.NewInt(1 << 1) + commonModelScopesBodyRequestFieldDisabledFields = big.NewInt(1 << 2) +) + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id" url:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions" url:"enabled_actions"` DisabledFields []string `json:"disabled_fields" url:"disabled_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +267,34 @@ func (c *CommonModelScopesBodyRequest) GetExtraProperties() map[string]interface return c.extraProperties } +func (c *CommonModelScopesBodyRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetModelId(modelId string) { + c.ModelId = modelId + c.require(commonModelScopesBodyRequestFieldModelId) +} + +// SetEnabledActions sets the EnabledActions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetEnabledActions(enabledActions []EnabledActionsEnum) { + c.EnabledActions = enabledActions + c.require(commonModelScopesBodyRequestFieldEnabledActions) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetDisabledFields(disabledFields []string) { + c.DisabledFields = disabledFields + c.require(commonModelScopesBodyRequestFieldDisabledFields) +} + func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopesBodyRequest var value unmarshaler @@ -156,6 +311,17 @@ func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopesBodyRequest) MarshalJSON() ([]byte, error) { + type embed CommonModelScopesBodyRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopesBodyRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -216,11 +382,20 @@ func (l LanguageEnum) Ptr() *LanguageEnum { return &l } +var ( + linkTokenFieldLinkToken = big.NewInt(1 << 0) + linkTokenFieldIntegrationName = big.NewInt(1 << 1) + linkTokenFieldMagicLinkUrl = big.NewInt(1 << 2) +) + type LinkToken struct { LinkToken string `json:"link_token" url:"link_token"` IntegrationName *string `json:"integration_name,omitempty" url:"integration_name,omitempty"` MagicLinkUrl *string `json:"magic_link_url,omitempty" url:"magic_link_url,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -250,6 +425,34 @@ func (l *LinkToken) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkToken) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkToken sets the LinkToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetLinkToken(linkToken string) { + l.LinkToken = linkToken + l.require(linkTokenFieldLinkToken) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkTokenFieldIntegrationName) +} + +// SetMagicLinkUrl sets the MagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetMagicLinkUrl(magicLinkUrl *string) { + l.MagicLinkUrl = magicLinkUrl + l.require(linkTokenFieldMagicLinkUrl) +} + func (l *LinkToken) UnmarshalJSON(data []byte) error { type unmarshaler LinkToken var value unmarshaler @@ -266,6 +469,17 @@ func (l *LinkToken) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkToken) MarshalJSON() ([]byte, error) { + type embed LinkToken + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkToken) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { diff --git a/filestorage/linked_accounts.go b/filestorage/linked_accounts.go index d616714..295fa9f 100644 --- a/filestorage/linked_accounts.go +++ b/filestorage/linked_accounts.go @@ -6,9 +6,26 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + linkedAccountsListRequestFieldCategory = big.NewInt(1 << 0) + linkedAccountsListRequestFieldCursor = big.NewInt(1 << 1) + linkedAccountsListRequestFieldEndUserEmailAddress = big.NewInt(1 << 2) + linkedAccountsListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + linkedAccountsListRequestFieldEndUserOriginId = big.NewInt(1 << 4) + linkedAccountsListRequestFieldEndUserOriginIds = big.NewInt(1 << 5) + linkedAccountsListRequestFieldId = big.NewInt(1 << 6) + linkedAccountsListRequestFieldIds = big.NewInt(1 << 7) + linkedAccountsListRequestFieldIncludeDuplicates = big.NewInt(1 << 8) + linkedAccountsListRequestFieldIntegrationName = big.NewInt(1 << 9) + linkedAccountsListRequestFieldIsTestAccount = big.NewInt(1 << 10) + linkedAccountsListRequestFieldPageSize = big.NewInt(1 << 11) + linkedAccountsListRequestFieldStatus = big.NewInt(1 << 12) +) + type LinkedAccountsListRequest struct { // Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` // @@ -43,6 +60,107 @@ type LinkedAccountsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` Status *string `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountsListRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCategory(category *LinkedAccountsListRequestCategory) { + l.Category = category + l.require(linkedAccountsListRequestFieldCategory) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCursor(cursor *string) { + l.Cursor = cursor + l.require(linkedAccountsListRequestFieldCursor) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserEmailAddress(endUserEmailAddress *string) { + l.EndUserEmailAddress = endUserEmailAddress + l.require(linkedAccountsListRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + l.EndUserOrganizationName = endUserOrganizationName + l.require(linkedAccountsListRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginId(endUserOriginId *string) { + l.EndUserOriginId = endUserOriginId + l.require(linkedAccountsListRequestFieldEndUserOriginId) +} + +// SetEndUserOriginIds sets the EndUserOriginIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginIds(endUserOriginIds *string) { + l.EndUserOriginIds = endUserOriginIds + l.require(linkedAccountsListRequestFieldEndUserOriginIds) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetId(id *string) { + l.Id = id + l.require(linkedAccountsListRequestFieldId) +} + +// SetIds sets the Ids field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIds(ids *string) { + l.Ids = ids + l.require(linkedAccountsListRequestFieldIds) +} + +// SetIncludeDuplicates sets the IncludeDuplicates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIncludeDuplicates(includeDuplicates *bool) { + l.IncludeDuplicates = includeDuplicates + l.require(linkedAccountsListRequestFieldIncludeDuplicates) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkedAccountsListRequestFieldIntegrationName) +} + +// SetIsTestAccount sets the IsTestAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIsTestAccount(isTestAccount *string) { + l.IsTestAccount = isTestAccount + l.require(linkedAccountsListRequestFieldIsTestAccount) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetPageSize(pageSize *int) { + l.PageSize = pageSize + l.require(linkedAccountsListRequestFieldPageSize) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetStatus(status *string) { + l.Status = status + l.require(linkedAccountsListRequestFieldStatus) } type LinkedAccountsListRequestCategory string @@ -88,6 +206,22 @@ func (l LinkedAccountsListRequestCategory) Ptr() *LinkedAccountsListRequestCateg // // ### Usage Example // View a list of your organization's `LinkedAccount` objects. +var ( + accountDetailsAndActionsFieldId = big.NewInt(1 << 0) + accountDetailsAndActionsFieldCategory = big.NewInt(1 << 1) + accountDetailsAndActionsFieldStatus = big.NewInt(1 << 2) + accountDetailsAndActionsFieldStatusDetail = big.NewInt(1 << 3) + accountDetailsAndActionsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsAndActionsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsAndActionsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsAndActionsFieldSubdomain = big.NewInt(1 << 7) + accountDetailsAndActionsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsAndActionsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsAndActionsFieldIntegration = big.NewInt(1 << 10) + accountDetailsAndActionsFieldAccountType = big.NewInt(1 << 11) + accountDetailsAndActionsFieldCompletedAt = big.NewInt(1 << 12) +) + type AccountDetailsAndActions struct { Id string `json:"id" url:"id"` Category *AccountDetailsAndActionsCategory `json:"category,omitempty" url:"category,omitempty"` @@ -105,6 +239,9 @@ type AccountDetailsAndActions struct { AccountType string `json:"account_type" url:"account_type"` CompletedAt time.Time `json:"completed_at" url:"completed_at"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -204,6 +341,104 @@ func (a *AccountDetailsAndActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetailsAndActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetId(id string) { + a.Id = id + a.require(accountDetailsAndActionsFieldId) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCategory(category *AccountDetailsAndActionsCategory) { + a.Category = category + a.require(accountDetailsAndActionsFieldCategory) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatus(status *AccountDetailsAndActionsStatus) { + a.Status = status + a.require(accountDetailsAndActionsFieldStatus) +} + +// SetStatusDetail sets the StatusDetail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatusDetail(statusDetail *string) { + a.StatusDetail = statusDetail + a.require(accountDetailsAndActionsFieldStatusDetail) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsAndActionsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOrganizationName(endUserOrganizationName string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsAndActionsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserEmailAddress(endUserEmailAddress string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsAndActionsFieldEndUserEmailAddress) +} + +// SetSubdomain sets the Subdomain field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetSubdomain(subdomain *string) { + a.Subdomain = subdomain + a.require(accountDetailsAndActionsFieldSubdomain) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetWebhookListenerUrl(webhookListenerUrl string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsAndActionsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsAndActionsFieldIsDuplicate) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIntegration(integration *AccountDetailsAndActionsIntegration) { + a.Integration = integration + a.require(accountDetailsAndActionsFieldIntegration) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetAccountType(accountType string) { + a.AccountType = accountType + a.require(accountDetailsAndActionsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCompletedAt(completedAt time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsAndActionsFieldCompletedAt) +} + func (a *AccountDetailsAndActions) UnmarshalJSON(data []byte) error { type embed AccountDetailsAndActions var unmarshaler = struct { @@ -235,7 +470,8 @@ func (a *AccountDetailsAndActions) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetailsAndActions) String() string { @@ -312,6 +548,17 @@ func (a *AccountDetailsAndActionsCategory) Accept(visitor AccountDetailsAndActio return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + accountDetailsAndActionsIntegrationFieldName = big.NewInt(1 << 0) + accountDetailsAndActionsIntegrationFieldCategories = big.NewInt(1 << 1) + accountDetailsAndActionsIntegrationFieldImage = big.NewInt(1 << 2) + accountDetailsAndActionsIntegrationFieldSquareImage = big.NewInt(1 << 3) + accountDetailsAndActionsIntegrationFieldColor = big.NewInt(1 << 4) + accountDetailsAndActionsIntegrationFieldSlug = big.NewInt(1 << 5) + accountDetailsAndActionsIntegrationFieldPassthroughAvailable = big.NewInt(1 << 6) + accountDetailsAndActionsIntegrationFieldAvailableModelOperations = big.NewInt(1 << 7) +) + type AccountDetailsAndActionsIntegration struct { Name string `json:"name" url:"name"` Categories []CategoriesEnum `json:"categories" url:"categories"` @@ -322,6 +569,9 @@ type AccountDetailsAndActionsIntegration struct { PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -386,6 +636,69 @@ func (a *AccountDetailsAndActionsIntegration) GetExtraProperties() map[string]in return a.extraProperties } +func (a *AccountDetailsAndActionsIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetName(name string) { + a.Name = name + a.require(accountDetailsAndActionsIntegrationFieldName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountDetailsAndActionsIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetImage(image *string) { + a.Image = image + a.require(accountDetailsAndActionsIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountDetailsAndActionsIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetColor(color string) { + a.Color = color + a.require(accountDetailsAndActionsIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSlug(slug string) { + a.Slug = slug + a.require(accountDetailsAndActionsIntegrationFieldSlug) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(accountDetailsAndActionsIntegrationFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(accountDetailsAndActionsIntegrationFieldAvailableModelOperations) +} + func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountDetailsAndActionsIntegration var value unmarshaler @@ -402,6 +715,17 @@ func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountDetailsAndActionsIntegration) MarshalJSON() ([]byte, error) { + type embed AccountDetailsAndActionsIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountDetailsAndActionsIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -508,11 +832,20 @@ func (a AccountDetailsAndActionsStatusEnum) Ptr() *AccountDetailsAndActionsStatu return &a } +var ( + paginatedAccountDetailsAndActionsListFieldNext = big.NewInt(1 << 0) + paginatedAccountDetailsAndActionsListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountDetailsAndActionsListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AccountDetailsAndActions `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -542,6 +875,34 @@ func (p *PaginatedAccountDetailsAndActionsList) GetExtraProperties() map[string] return p.extraProperties } +func (p *PaginatedAccountDetailsAndActionsList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountDetailsAndActionsListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountDetailsAndActionsListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetResults(results []*AccountDetailsAndActions) { + p.Results = results + p.require(paginatedAccountDetailsAndActionsListFieldResults) +} + func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountDetailsAndActionsList var value unmarshaler @@ -558,6 +919,17 @@ func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error return nil } +func (p *PaginatedAccountDetailsAndActionsList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountDetailsAndActionsList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountDetailsAndActionsList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/filestorage/linkedaccounts/client.go b/filestorage/linkedaccounts/client.go index d303f4b..2563334 100644 --- a/filestorage/linkedaccounts/client.go +++ b/filestorage/linkedaccounts/client.go @@ -4,7 +4,6 @@ package linkedaccounts import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *filestorage.LinkedAccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.AccountDetailsAndActions], error) { +) (*core.Page[*string, *filestorage.AccountDetailsAndActions], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedAccountDetailsAndActionsList) *internal.PageResponse[*string, *filestorage.AccountDetailsAndActions] { + readPageResponse := func(response *filestorage.PaginatedAccountDetailsAndActionsList) *core.PageResponse[*string, *filestorage.AccountDetailsAndActions] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.AccountDetailsAndActions]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.AccountDetailsAndActions]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/filestorage/linkedaccounts/file_storage_linked_accounts_test/file_storage_linked_accounts_test.go b/filestorage/linkedaccounts/file_storage_linked_accounts_test/file_storage_linked_accounts_test.go new file mode 100644 index 0000000..c2ff9c7 --- /dev/null +++ b/filestorage/linkedaccounts/file_storage_linked_accounts_test/file_storage_linked_accounts_test.go @@ -0,0 +1,121 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_linked_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageLinkedAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.LinkedAccountsListRequest{ + Category: filestorage.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } + _, invocationErr := client.FileStorage.LinkedAccounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/linked-accounts", map[string]string{"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"}, 1) +} diff --git a/filestorage/linkedaccounts/raw_client.go b/filestorage/linkedaccounts/raw_client.go new file mode 100644 index 0000000..cb54205 --- /dev/null +++ b/filestorage/linkedaccounts/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package linkedaccounts + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/filestorage/linktoken/client.go b/filestorage/linktoken/client.go index 7692c72..b1ecc3c 100644 --- a/filestorage/linktoken/client.go +++ b/filestorage/linktoken/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *filestorage.EndUserDetailsRequest, opts ...option.RequestOption, ) (*filestorage.LinkToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/link-token" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.LinkToken - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/linktoken/file_storage_link_token_test/file_storage_link_token_test.go b/filestorage/linktoken/file_storage_link_token_test/file_storage_link_token_test.go new file mode 100644 index 0000000..ddb1ffb --- /dev/null +++ b/filestorage/linktoken/file_storage_link_token_test/file_storage_link_token_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_link_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageLinkTokenCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []filestorage.CategoriesEnum{ + filestorage.CategoriesEnumHris, + filestorage.CategoriesEnumAts, + }, + } + _, invocationErr := client.FileStorage.LinkToken.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/link-token", nil, 1) +} diff --git a/filestorage/linktoken/raw_client.go b/filestorage/linktoken/raw_client.go new file mode 100644 index 0000000..b910f70 --- /dev/null +++ b/filestorage/linktoken/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package linktoken + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *filestorage.EndUserDetailsRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.LinkToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/link-token" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *filestorage.LinkToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.LinkToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/passthrough/client.go b/filestorage/passthrough/client.go index f3fe712..bd692ac 100644 --- a/filestorage/passthrough/client.go +++ b/filestorage/passthrough/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *filestorage.DataPassthroughRequest, opts ...option.RequestOption, ) (*filestorage.RemoteResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.RemoteResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/passthrough/file_storage_passthrough_test/file_storage_passthrough_test.go b/filestorage/passthrough/file_storage_passthrough_test/file_storage_passthrough_test.go new file mode 100644 index 0000000..895bba2 --- /dev/null +++ b/filestorage/passthrough/file_storage_passthrough_test/file_storage_passthrough_test.go @@ -0,0 +1,85 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStoragePassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.DataPassthroughRequest{ + Method: filestorage.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.FileStorage.Passthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/passthrough", nil, 1) +} diff --git a/filestorage/passthrough/raw_client.go b/filestorage/passthrough/raw_client.go new file mode 100644 index 0000000..2c4832b --- /dev/null +++ b/filestorage/passthrough/raw_client.go @@ -0,0 +1,72 @@ +// Code generated by Fern. DO NOT EDIT. + +package passthrough + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *filestorage.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.RemoteResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.RemoteResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.RemoteResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/regenerate_key.go b/filestorage/regenerate_key.go index 8f02ddf..d42415b 100644 --- a/filestorage/regenerate_key.go +++ b/filestorage/regenerate_key.go @@ -2,7 +2,32 @@ package filestorage +import ( + big "math/big" +) + +var ( + remoteKeyForRegenerationRequestFieldName = big.NewInt(1 << 0) +) + type RemoteKeyForRegenerationRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteKeyForRegenerationRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKeyForRegenerationRequest) SetName(name string) { + r.Name = name + r.require(remoteKeyForRegenerationRequestFieldName) } diff --git a/filestorage/regeneratekey/client.go b/filestorage/regeneratekey/client.go index b01ab3f..0a96490 100644 --- a/filestorage/regeneratekey/client.go +++ b/filestorage/regeneratekey/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *filestorage.RemoteKeyForRegenerationRequest, opts ...option.RequestOption, ) (*filestorage.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/regenerate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/regeneratekey/file_storage_regenerate_key_test/file_storage_regenerate_key_test.go b/filestorage/regeneratekey/file_storage_regenerate_key_test/file_storage_regenerate_key_test.go new file mode 100644 index 0000000..a5a2b68 --- /dev/null +++ b/filestorage/regeneratekey/file_storage_regenerate_key_test/file_storage_regenerate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_regenerate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageRegenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.FileStorage.RegenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/regenerate-key", nil, 1) +} diff --git a/filestorage/regeneratekey/raw_client.go b/filestorage/regeneratekey/raw_client.go new file mode 100644 index 0000000..1d6d5eb --- /dev/null +++ b/filestorage/regeneratekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package regeneratekey + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *filestorage.RemoteKeyForRegenerationRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/regenerate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *filestorage.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/scopes.go b/filestorage/scopes.go index caabe73..2972ee6 100644 --- a/filestorage/scopes.go +++ b/filestorage/scopes.go @@ -6,17 +6,46 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels = big.NewInt(1 << 0) ) type LinkedAccountCommonModelScopeDeserializerRequest struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountCommonModelScopeDeserializerRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountCommonModelScopeDeserializerRequest) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializerRequest) { + l.CommonModels = commonModels + l.require(linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels) } +var ( + commonModelScopeApiFieldCommonModels = big.NewInt(1 << 0) +) + type CommonModelScopeApi struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models" url:"common_models"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -32,6 +61,20 @@ func (c *CommonModelScopeApi) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CommonModelScopeApi) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopeApi) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializer) { + c.CommonModels = commonModels + c.require(commonModelScopeApiFieldCommonModels) +} + func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopeApi var value unmarshaler @@ -48,6 +91,17 @@ func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopeApi) MarshalJSON() ([]byte, error) { + type embed CommonModelScopeApi + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopeApi) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -60,10 +114,18 @@ func (c *CommonModelScopeApi) String() string { return fmt.Sprintf("%#v", c) } +var ( + fieldPermissionDeserializerFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializer struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -86,6 +148,27 @@ func (f *FieldPermissionDeserializer) GetExtraProperties() map[string]interface{ return f.extraProperties } +func (f *FieldPermissionDeserializer) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerFieldDisabledFields) +} + func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializer var value unmarshaler @@ -102,6 +185,17 @@ func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializer) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -114,11 +208,20 @@ func (f *FieldPermissionDeserializer) String() string { return fmt.Sprintf("%#v", f) } +var ( + individualCommonModelScopeDeserializerFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializer struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -148,6 +251,34 @@ func (i *IndividualCommonModelScopeDeserializer) GetExtraProperties() map[string return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializer) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializer) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializer) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializer var value unmarshaler @@ -164,6 +295,17 @@ func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) erro return nil } +func (i *IndividualCommonModelScopeDeserializer) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializer) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -176,9 +318,16 @@ func (i *IndividualCommonModelScopeDeserializer) String() string { return fmt.Sprintf("%#v", i) } +var ( + modelPermissionDeserializerFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializer struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -194,6 +343,20 @@ func (m *ModelPermissionDeserializer) GetExtraProperties() map[string]interface{ return m.extraProperties } +func (m *ModelPermissionDeserializer) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializer) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerFieldIsEnabled) +} + func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializer var value unmarshaler @@ -210,6 +373,17 @@ func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializer) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { diff --git a/filestorage/scopes/client.go b/filestorage/scopes/client.go index 9e0beb0..8d6fbe0 100644 --- a/filestorage/scopes/client.go +++ b/filestorage/scopes/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) DefaultScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*filestorage.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/default-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.DefaultScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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). @@ -72,35 +52,14 @@ func (c *Client) LinkedAccountScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*filestorage.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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) @@ -109,35 +68,13 @@ func (c *Client) LinkedAccountScopesCreate( request *filestorage.LinkedAccountCommonModelScopeDeserializerRequest, opts ...option.RequestOption, ) (*filestorage.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/scopes/file_storage_scopes_test/file_storage_scopes_test.go b/filestorage/scopes/file_storage_scopes_test/file_storage_scopes_test.go new file mode 100644 index 0000000..b89e14b --- /dev/null +++ b/filestorage/scopes/file_storage_scopes_test/file_storage_scopes_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_scopes_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageScopesDefaultScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/default-scopes", nil, 1) +} + +func TestFileStorageScopesLinkedAccountScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/linked-account-scopes", nil, 1) +} + +func TestFileStorageScopesLinkedAccountScopesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*filestorage.IndividualCommonModelScopeDeserializerRequest{ + &filestorage.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*filestorage.ModelPermissionDeserializerRequest{ + "READ": &filestorage.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &filestorage.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &filestorage.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &filestorage.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*filestorage.ModelPermissionDeserializerRequest{ + "WRITE": &filestorage.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } + _, invocationErr := client.FileStorage.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/linked-account-scopes", nil, 1) +} diff --git a/filestorage/scopes/raw_client.go b/filestorage/scopes/raw_client.go new file mode 100644 index 0000000..176ebdc --- /dev/null +++ b/filestorage/scopes/raw_client.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package scopes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) DefaultScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*filestorage.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/default-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*filestorage.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesCreate( + ctx context.Context, + request *filestorage.LinkedAccountCommonModelScopeDeserializerRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *filestorage.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/sync_status.go b/filestorage/sync_status.go index 98427ac..180a9df 100644 --- a/filestorage/sync_status.go +++ b/filestorage/sync_status.go @@ -6,6 +6,12 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + syncStatusListRequestFieldCursor = big.NewInt(1 << 0) + syncStatusListRequestFieldPageSize = big.NewInt(1 << 1) ) type SyncStatusListRequest struct { @@ -13,13 +19,46 @@ type SyncStatusListRequest struct { Cursor *string `json:"-" url:"cursor,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (s *SyncStatusListRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetCursor(cursor *string) { + s.Cursor = cursor + s.require(syncStatusListRequestFieldCursor) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetPageSize(pageSize *int) { + s.PageSize = pageSize + s.require(syncStatusListRequestFieldPageSize) +} + +var ( + paginatedSyncStatusListFieldNext = big.NewInt(1 << 0) + paginatedSyncStatusListFieldPrevious = big.NewInt(1 << 1) + paginatedSyncStatusListFieldResults = big.NewInt(1 << 2) +) + type PaginatedSyncStatusList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*SyncStatus `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -49,6 +88,34 @@ func (p *PaginatedSyncStatusList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedSyncStatusList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetNext(next *string) { + p.Next = next + p.require(paginatedSyncStatusListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedSyncStatusListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetResults(results []*SyncStatus) { + p.Results = results + p.require(paginatedSyncStatusListFieldResults) +} + func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedSyncStatusList var value unmarshaler @@ -65,6 +132,17 @@ func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedSyncStatusList) MarshalJSON() ([]byte, error) { + type embed PaginatedSyncStatusList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedSyncStatusList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/filestorage/syncstatus/client.go b/filestorage/syncstatus/client.go index 4612e3c..e21ffec 100644 --- a/filestorage/syncstatus/client.go +++ b/filestorage/syncstatus/client.go @@ -4,7 +4,6 @@ package syncstatus import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *filestorage.SyncStatusListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.SyncStatus], error) { +) (*core.Page[*string, *filestorage.SyncStatus], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedSyncStatusList) *internal.PageResponse[*string, *filestorage.SyncStatus] { + readPageResponse := func(response *filestorage.PaginatedSyncStatusList) *core.PageResponse[*string, *filestorage.SyncStatus] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.SyncStatus]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.SyncStatus]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/filestorage/syncstatus/file_storage_sync_status_test/file_storage_sync_status_test.go b/filestorage/syncstatus/file_storage_sync_status_test/file_storage_sync_status_test.go new file mode 100644 index 0000000..fd3240e --- /dev/null +++ b/filestorage/syncstatus/file_storage_sync_status_test/file_storage_sync_status_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_sync_status_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageSyncStatusListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.FileStorage.SyncStatus.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/sync-status", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "page_size": "1"}, 1) +} diff --git a/filestorage/syncstatus/raw_client.go b/filestorage/syncstatus/raw_client.go new file mode 100644 index 0000000..bf7298f --- /dev/null +++ b/filestorage/syncstatus/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package syncstatus + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/filestorage/types.go b/filestorage/types.go index 4c1e770..8086dad 100644 --- a/filestorage/types.go +++ b/filestorage/types.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountIntegrationFieldName = big.NewInt(1 << 0) + accountIntegrationFieldAbbreviatedName = big.NewInt(1 << 1) + accountIntegrationFieldCategories = big.NewInt(1 << 2) + accountIntegrationFieldImage = big.NewInt(1 << 3) + accountIntegrationFieldSquareImage = big.NewInt(1 << 4) + accountIntegrationFieldColor = big.NewInt(1 << 5) + accountIntegrationFieldSlug = big.NewInt(1 << 6) + accountIntegrationFieldApiEndpointsToDocumentationUrls = big.NewInt(1 << 7) + accountIntegrationFieldWebhookSetupGuideUrl = big.NewInt(1 << 8) + accountIntegrationFieldCategoryBetaStatus = big.NewInt(1 << 9) +) + type AccountIntegration struct { // Company name. Name string `json:"name" url:"name"` @@ -30,6 +44,9 @@ type AccountIntegration struct { // Category or categories this integration is in beta status for. CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty" url:"category_beta_status,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -108,6 +125,83 @@ func (a *AccountIntegration) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetName(name string) { + a.Name = name + a.require(accountIntegrationFieldName) +} + +// SetAbbreviatedName sets the AbbreviatedName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetAbbreviatedName(abbreviatedName *string) { + a.AbbreviatedName = abbreviatedName + a.require(accountIntegrationFieldAbbreviatedName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetImage(image *string) { + a.Image = image + a.require(accountIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetColor(color *string) { + a.Color = color + a.require(accountIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSlug(slug *string) { + a.Slug = slug + a.require(accountIntegrationFieldSlug) +} + +// SetApiEndpointsToDocumentationUrls sets the ApiEndpointsToDocumentationUrls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetApiEndpointsToDocumentationUrls(apiEndpointsToDocumentationUrls map[string]interface{}) { + a.ApiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls + a.require(accountIntegrationFieldApiEndpointsToDocumentationUrls) +} + +// SetWebhookSetupGuideUrl sets the WebhookSetupGuideUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetWebhookSetupGuideUrl(webhookSetupGuideUrl *string) { + a.WebhookSetupGuideUrl = webhookSetupGuideUrl + a.require(accountIntegrationFieldWebhookSetupGuideUrl) +} + +// SetCategoryBetaStatus sets the CategoryBetaStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategoryBetaStatus(categoryBetaStatus map[string]interface{}) { + a.CategoryBetaStatus = categoryBetaStatus + a.require(accountIntegrationFieldCategoryBetaStatus) +} + func (a *AccountIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountIntegration var value unmarshaler @@ -124,6 +218,17 @@ func (a *AccountIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountIntegration) MarshalJSON() ([]byte, error) { + type embed AccountIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -230,6 +335,17 @@ func (c CategoryEnum) Ptr() *CategoryEnum { // // ### Usage Example // Create a `DataPassthrough` to get team hierarchies from your Rippling integration. +var ( + dataPassthroughRequestFieldMethod = big.NewInt(1 << 0) + dataPassthroughRequestFieldPath = big.NewInt(1 << 1) + dataPassthroughRequestFieldBaseUrlOverride = big.NewInt(1 << 2) + dataPassthroughRequestFieldData = big.NewInt(1 << 3) + dataPassthroughRequestFieldMultipartFormData = big.NewInt(1 << 4) + dataPassthroughRequestFieldHeaders = big.NewInt(1 << 5) + dataPassthroughRequestFieldRequestFormat = big.NewInt(1 << 6) + dataPassthroughRequestFieldNormalizeResponse = big.NewInt(1 << 7) +) + type DataPassthroughRequest struct { Method MethodEnum `json:"method" url:"method"` // The path of the request in the third party's platform. @@ -246,6 +362,9 @@ type DataPassthroughRequest struct { // 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`. NormalizeResponse *bool `json:"normalize_response,omitempty" url:"normalize_response,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -310,6 +429,69 @@ func (d *DataPassthroughRequest) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DataPassthroughRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMethod(method MethodEnum) { + d.Method = method + d.require(dataPassthroughRequestFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetPath(path string) { + d.Path = path + d.require(dataPassthroughRequestFieldPath) +} + +// SetBaseUrlOverride sets the BaseUrlOverride field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetBaseUrlOverride(baseUrlOverride *string) { + d.BaseUrlOverride = baseUrlOverride + d.require(dataPassthroughRequestFieldBaseUrlOverride) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetData(data *string) { + d.Data = data + d.require(dataPassthroughRequestFieldData) +} + +// SetMultipartFormData sets the MultipartFormData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMultipartFormData(multipartFormData []*MultipartFormFieldRequest) { + d.MultipartFormData = multipartFormData + d.require(dataPassthroughRequestFieldMultipartFormData) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetHeaders(headers map[string]interface{}) { + d.Headers = headers + d.require(dataPassthroughRequestFieldHeaders) +} + +// SetRequestFormat sets the RequestFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetRequestFormat(requestFormat *RequestFormatEnum) { + d.RequestFormat = requestFormat + d.require(dataPassthroughRequestFieldRequestFormat) +} + +// SetNormalizeResponse sets the NormalizeResponse field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetNormalizeResponse(normalizeResponse *bool) { + d.NormalizeResponse = normalizeResponse + d.require(dataPassthroughRequestFieldNormalizeResponse) +} + func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { type unmarshaler DataPassthroughRequest var value unmarshaler @@ -326,6 +508,17 @@ func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { return nil } +func (d *DataPassthroughRequest) MarshalJSON() ([]byte, error) { + type embed DataPassthroughRequest + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DataPassthroughRequest) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -338,11 +531,20 @@ func (d *DataPassthroughRequest) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModeLogFieldLogId = big.NewInt(1 << 0) + debugModeLogFieldDashboardView = big.NewInt(1 << 1) + debugModeLogFieldLogSummary = big.NewInt(1 << 2) +) + type DebugModeLog struct { LogId string `json:"log_id" url:"log_id"` DashboardView string `json:"dashboard_view" url:"dashboard_view"` LogSummary *DebugModelLogSummary `json:"log_summary" url:"log_summary"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -372,6 +574,34 @@ func (d *DebugModeLog) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModeLog) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetLogId sets the LogId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogId(logId string) { + d.LogId = logId + d.require(debugModeLogFieldLogId) +} + +// SetDashboardView sets the DashboardView field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetDashboardView(dashboardView string) { + d.DashboardView = dashboardView + d.require(debugModeLogFieldDashboardView) +} + +// SetLogSummary sets the LogSummary field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogSummary(logSummary *DebugModelLogSummary) { + d.LogSummary = logSummary + d.require(debugModeLogFieldLogSummary) +} + func (d *DebugModeLog) UnmarshalJSON(data []byte) error { type unmarshaler DebugModeLog var value unmarshaler @@ -388,6 +618,17 @@ func (d *DebugModeLog) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModeLog) MarshalJSON() ([]byte, error) { + type embed DebugModeLog + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModeLog) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -400,11 +641,20 @@ func (d *DebugModeLog) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModelLogSummaryFieldUrl = big.NewInt(1 << 0) + debugModelLogSummaryFieldMethod = big.NewInt(1 << 1) + debugModelLogSummaryFieldStatusCode = big.NewInt(1 << 2) +) + type DebugModelLogSummary struct { Url string `json:"url" url:"url"` Method string `json:"method" url:"method"` StatusCode int `json:"status_code" url:"status_code"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -434,6 +684,34 @@ func (d *DebugModelLogSummary) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModelLogSummary) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetUrl sets the Url field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetUrl(url string) { + d.Url = url + d.require(debugModelLogSummaryFieldUrl) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetMethod(method string) { + d.Method = method + d.require(debugModelLogSummaryFieldMethod) +} + +// SetStatusCode sets the StatusCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetStatusCode(statusCode int) { + d.StatusCode = statusCode + d.require(debugModelLogSummaryFieldStatusCode) +} + func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { type unmarshaler DebugModelLogSummary var value unmarshaler @@ -450,6 +728,17 @@ func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModelLogSummary) MarshalJSON() ([]byte, error) { + type embed DebugModelLogSummary + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModelLogSummary) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -467,6 +756,19 @@ func (d *DebugModelLogSummary) String() string { // 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. +var ( + driveFieldId = big.NewInt(1 << 0) + driveFieldRemoteId = big.NewInt(1 << 1) + driveFieldCreatedAt = big.NewInt(1 << 2) + driveFieldModifiedAt = big.NewInt(1 << 3) + driveFieldName = big.NewInt(1 << 4) + driveFieldRemoteCreatedAt = big.NewInt(1 << 5) + driveFieldDriveUrl = big.NewInt(1 << 6) + driveFieldRemoteWasDeleted = big.NewInt(1 << 7) + driveFieldFieldMappings = big.NewInt(1 << 8) + driveFieldRemoteData = big.NewInt(1 << 9) +) + type Drive struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -486,6 +788,9 @@ type Drive struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -564,6 +869,83 @@ func (d *Drive) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *Drive) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetId(id *string) { + d.Id = id + d.require(driveFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetRemoteId(remoteId *string) { + d.RemoteId = remoteId + d.require(driveFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetCreatedAt(createdAt *time.Time) { + d.CreatedAt = createdAt + d.require(driveFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetModifiedAt(modifiedAt *time.Time) { + d.ModifiedAt = modifiedAt + d.require(driveFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetName(name *string) { + d.Name = name + d.require(driveFieldName) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + d.RemoteCreatedAt = remoteCreatedAt + d.require(driveFieldRemoteCreatedAt) +} + +// SetDriveUrl sets the DriveUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetDriveUrl(driveUrl *string) { + d.DriveUrl = driveUrl + d.require(driveFieldDriveUrl) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetRemoteWasDeleted(remoteWasDeleted *bool) { + d.RemoteWasDeleted = remoteWasDeleted + d.require(driveFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetFieldMappings(fieldMappings map[string]interface{}) { + d.FieldMappings = fieldMappings + d.require(driveFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Drive) SetRemoteData(remoteData []*RemoteData) { + d.RemoteData = remoteData + d.require(driveFieldRemoteData) +} + func (d *Drive) UnmarshalJSON(data []byte) error { type embed Drive var unmarshaler = struct { @@ -603,7 +985,8 @@ func (d *Drive) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(d.ModifiedAt), RemoteCreatedAt: internal.NewOptionalDateTime(d.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) } func (d *Drive) String() string { @@ -646,12 +1029,22 @@ func (e EncodingEnum) Ptr() *EncodingEnum { return &e } +var ( + errorValidationProblemFieldSource = big.NewInt(1 << 0) + errorValidationProblemFieldTitle = big.NewInt(1 << 1) + errorValidationProblemFieldDetail = big.NewInt(1 << 2) + errorValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type ErrorValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -688,6 +1081,41 @@ func (e *ErrorValidationProblem) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ErrorValidationProblem) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetSource(source *ValidationProblemSource) { + e.Source = source + e.require(errorValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetTitle(title string) { + e.Title = title + e.require(errorValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetDetail(detail string) { + e.Detail = detail + e.require(errorValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetProblemType(problemType string) { + e.ProblemType = problemType + e.require(errorValidationProblemFieldProblemType) +} + func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler ErrorValidationProblem var value unmarshaler @@ -704,6 +1132,17 @@ func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (e *ErrorValidationProblem) MarshalJSON() ([]byte, error) { + type embed ErrorValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ErrorValidationProblem) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -716,10 +1155,18 @@ func (e *ErrorValidationProblem) String() string { return fmt.Sprintf("%#v", e) } +var ( + fieldPermissionDeserializerRequestFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerRequestFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializerRequest struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -742,6 +1189,27 @@ func (f *FieldPermissionDeserializerRequest) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldPermissionDeserializerRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerRequestFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerRequestFieldDisabledFields) +} + func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializerRequest var value unmarshaler @@ -758,6 +1226,17 @@ func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializerRequest) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -775,6 +1254,25 @@ func (f *FieldPermissionDeserializerRequest) String() string { // 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. +var ( + folderFieldId = big.NewInt(1 << 0) + folderFieldRemoteId = big.NewInt(1 << 1) + folderFieldCreatedAt = big.NewInt(1 << 2) + folderFieldModifiedAt = big.NewInt(1 << 3) + folderFieldName = big.NewInt(1 << 4) + folderFieldFolderUrl = big.NewInt(1 << 5) + folderFieldSize = big.NewInt(1 << 6) + folderFieldDescription = big.NewInt(1 << 7) + folderFieldParentFolder = big.NewInt(1 << 8) + folderFieldDrive = big.NewInt(1 << 9) + folderFieldPermissions = big.NewInt(1 << 10) + folderFieldRemoteCreatedAt = big.NewInt(1 << 11) + folderFieldRemoteUpdatedAt = big.NewInt(1 << 12) + folderFieldRemoteWasDeleted = big.NewInt(1 << 13) + folderFieldFieldMappings = big.NewInt(1 << 14) + folderFieldRemoteData = big.NewInt(1 << 15) +) + type Folder struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -806,6 +1304,9 @@ type Folder struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -926,6 +1427,125 @@ func (f *Folder) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *Folder) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetId(id *string) { + f.Id = id + f.require(folderFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetRemoteId(remoteId *string) { + f.RemoteId = remoteId + f.require(folderFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetCreatedAt(createdAt *time.Time) { + f.CreatedAt = createdAt + f.require(folderFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetModifiedAt(modifiedAt *time.Time) { + f.ModifiedAt = modifiedAt + f.require(folderFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetName(name *string) { + f.Name = name + f.require(folderFieldName) +} + +// SetFolderUrl sets the FolderUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetFolderUrl(folderUrl *string) { + f.FolderUrl = folderUrl + f.require(folderFieldFolderUrl) +} + +// SetSize sets the Size field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetSize(size *int64) { + f.Size = size + f.require(folderFieldSize) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetDescription(description *string) { + f.Description = description + f.require(folderFieldDescription) +} + +// SetParentFolder sets the ParentFolder field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetParentFolder(parentFolder *FolderParentFolder) { + f.ParentFolder = parentFolder + f.require(folderFieldParentFolder) +} + +// SetDrive sets the Drive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetDrive(drive *FolderDrive) { + f.Drive = drive + f.require(folderFieldDrive) +} + +// SetPermissions sets the Permissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetPermissions(permissions *FolderPermissions) { + f.Permissions = permissions + f.require(folderFieldPermissions) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + f.RemoteCreatedAt = remoteCreatedAt + f.require(folderFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + f.RemoteUpdatedAt = remoteUpdatedAt + f.require(folderFieldRemoteUpdatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetRemoteWasDeleted(remoteWasDeleted *bool) { + f.RemoteWasDeleted = remoteWasDeleted + f.require(folderFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetFieldMappings(fieldMappings map[string]interface{}) { + f.FieldMappings = fieldMappings + f.require(folderFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *Folder) SetRemoteData(remoteData []*RemoteData) { + f.RemoteData = remoteData + f.require(folderFieldRemoteData) +} + func (f *Folder) UnmarshalJSON(data []byte) error { type embed Folder var unmarshaler = struct { @@ -969,7 +1589,8 @@ func (f *Folder) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(f.RemoteCreatedAt), RemoteUpdatedAt: internal.NewOptionalDateTime(f.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) } func (f *Folder) String() string { @@ -1261,6 +1882,19 @@ func (f *FolderPermissionsItem) Accept(visitor FolderPermissionsItemVisitor) err // 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. +var ( + groupFieldId = big.NewInt(1 << 0) + groupFieldRemoteId = big.NewInt(1 << 1) + groupFieldCreatedAt = big.NewInt(1 << 2) + groupFieldModifiedAt = big.NewInt(1 << 3) + groupFieldName = big.NewInt(1 << 4) + groupFieldUsers = big.NewInt(1 << 5) + groupFieldChildGroups = big.NewInt(1 << 6) + groupFieldRemoteWasDeleted = big.NewInt(1 << 7) + groupFieldFieldMappings = big.NewInt(1 << 8) + groupFieldRemoteData = big.NewInt(1 << 9) +) + type Group struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -1280,6 +1914,9 @@ type Group struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1358,6 +1995,83 @@ func (g *Group) GetExtraProperties() map[string]interface{} { return g.extraProperties } +func (g *Group) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetId(id *string) { + g.Id = id + g.require(groupFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetRemoteId(remoteId *string) { + g.RemoteId = remoteId + g.require(groupFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetCreatedAt(createdAt *time.Time) { + g.CreatedAt = createdAt + g.require(groupFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetModifiedAt(modifiedAt *time.Time) { + g.ModifiedAt = modifiedAt + g.require(groupFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetName(name *string) { + g.Name = name + g.require(groupFieldName) +} + +// SetUsers sets the Users field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetUsers(users []string) { + g.Users = users + g.require(groupFieldUsers) +} + +// SetChildGroups sets the ChildGroups field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetChildGroups(childGroups []*GroupChildGroupsItem) { + g.ChildGroups = childGroups + g.require(groupFieldChildGroups) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetRemoteWasDeleted(remoteWasDeleted *bool) { + g.RemoteWasDeleted = remoteWasDeleted + g.require(groupFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetFieldMappings(fieldMappings map[string]interface{}) { + g.FieldMappings = fieldMappings + g.require(groupFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetRemoteData(remoteData []*RemoteData) { + g.RemoteData = remoteData + g.require(groupFieldRemoteData) +} + func (g *Group) UnmarshalJSON(data []byte) error { type embed Group var unmarshaler = struct { @@ -1393,7 +2107,8 @@ func (g *Group) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(g.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(g.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, g.explicitFields) + return json.Marshal(explicitMarshaler) } func (g *Group) String() string { @@ -1470,11 +2185,20 @@ func (g *GroupChildGroupsItem) Accept(visitor GroupChildGroupsItemVisitor) error return fmt.Errorf("type %T does not include a non-empty union type", g) } +var ( + individualCommonModelScopeDeserializerRequestFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerRequestFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerRequestFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializerRequest struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1504,6 +2228,34 @@ func (i *IndividualCommonModelScopeDeserializerRequest) GetExtraProperties() map return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializerRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerRequestFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializerRequest) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializerRequest) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializerRequest var value unmarshaler @@ -1520,6 +2272,17 @@ func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byt return nil } +func (i *IndividualCommonModelScopeDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializerRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -1572,10 +2335,18 @@ func (l LastSyncResultEnum) Ptr() *LastSyncResultEnum { return &l } +var ( + linkedAccountStatusFieldLinkedAccountStatus = big.NewInt(1 << 0) + linkedAccountStatusFieldCanMakeRequest = big.NewInt(1 << 1) +) + type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status" url:"linked_account_status"` CanMakeRequest bool `json:"can_make_request" url:"can_make_request"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1598,6 +2369,27 @@ func (l *LinkedAccountStatus) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkedAccountStatus) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkedAccountStatus sets the LinkedAccountStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetLinkedAccountStatus(linkedAccountStatus string) { + l.LinkedAccountStatus = linkedAccountStatus + l.require(linkedAccountStatusFieldLinkedAccountStatus) +} + +// SetCanMakeRequest sets the CanMakeRequest field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetCanMakeRequest(canMakeRequest bool) { + l.CanMakeRequest = canMakeRequest + l.require(linkedAccountStatusFieldCanMakeRequest) +} + func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { type unmarshaler LinkedAccountStatus var value unmarshaler @@ -1614,6 +2406,17 @@ func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkedAccountStatus) MarshalJSON() ([]byte, error) { + type embed LinkedAccountStatus + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkedAccountStatus) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { @@ -1626,6 +2429,14 @@ func (l *LinkedAccountStatus) String() string { return fmt.Sprintf("%#v", l) } +var ( + metaResponseFieldRequestSchema = big.NewInt(1 << 0) + metaResponseFieldRemoteFieldClasses = big.NewInt(1 << 1) + metaResponseFieldStatus = big.NewInt(1 << 2) + metaResponseFieldHasConditionalParams = big.NewInt(1 << 3) + metaResponseFieldHasRequiredLinkedAccountParams = big.NewInt(1 << 4) +) + type MetaResponse struct { RequestSchema map[string]interface{} `json:"request_schema" url:"request_schema"` RemoteFieldClasses map[string]interface{} `json:"remote_field_classes,omitempty" url:"remote_field_classes,omitempty"` @@ -1633,6 +2444,9 @@ type MetaResponse struct { HasConditionalParams bool `json:"has_conditional_params" url:"has_conditional_params"` HasRequiredLinkedAccountParams bool `json:"has_required_linked_account_params" url:"has_required_linked_account_params"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1672,8 +2486,50 @@ func (m *MetaResponse) GetHasRequiredLinkedAccountParams() bool { return m.HasRequiredLinkedAccountParams } -func (m *MetaResponse) GetExtraProperties() map[string]interface{} { - return m.extraProperties +func (m *MetaResponse) GetExtraProperties() map[string]interface{} { + return m.extraProperties +} + +func (m *MetaResponse) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetRequestSchema sets the RequestSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRequestSchema(requestSchema map[string]interface{}) { + m.RequestSchema = requestSchema + m.require(metaResponseFieldRequestSchema) +} + +// SetRemoteFieldClasses sets the RemoteFieldClasses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRemoteFieldClasses(remoteFieldClasses map[string]interface{}) { + m.RemoteFieldClasses = remoteFieldClasses + m.require(metaResponseFieldRemoteFieldClasses) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetStatus(status *LinkedAccountStatus) { + m.Status = status + m.require(metaResponseFieldStatus) +} + +// SetHasConditionalParams sets the HasConditionalParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasConditionalParams(hasConditionalParams bool) { + m.HasConditionalParams = hasConditionalParams + m.require(metaResponseFieldHasConditionalParams) +} + +// SetHasRequiredLinkedAccountParams sets the HasRequiredLinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasRequiredLinkedAccountParams(hasRequiredLinkedAccountParams bool) { + m.HasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams + m.require(metaResponseFieldHasRequiredLinkedAccountParams) } func (m *MetaResponse) UnmarshalJSON(data []byte) error { @@ -1692,6 +2548,17 @@ func (m *MetaResponse) UnmarshalJSON(data []byte) error { return nil } +func (m *MetaResponse) MarshalJSON() ([]byte, error) { + type embed MetaResponse + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MetaResponse) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -1754,12 +2621,22 @@ func (m MethodEnum) Ptr() *MethodEnum { // // ### Usage Example // View what operations are supported for the `Candidate` endpoint. +var ( + modelOperationFieldModelName = big.NewInt(1 << 0) + modelOperationFieldAvailableOperations = big.NewInt(1 << 1) + modelOperationFieldRequiredPostParameters = big.NewInt(1 << 2) + modelOperationFieldSupportedFields = big.NewInt(1 << 3) +) + type ModelOperation struct { ModelName string `json:"model_name" url:"model_name"` AvailableOperations []string `json:"available_operations" url:"available_operations"` RequiredPostParameters []string `json:"required_post_parameters" url:"required_post_parameters"` SupportedFields []string `json:"supported_fields" url:"supported_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1796,6 +2673,41 @@ func (m *ModelOperation) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *ModelOperation) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetModelName(modelName string) { + m.ModelName = modelName + m.require(modelOperationFieldModelName) +} + +// SetAvailableOperations sets the AvailableOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetAvailableOperations(availableOperations []string) { + m.AvailableOperations = availableOperations + m.require(modelOperationFieldAvailableOperations) +} + +// SetRequiredPostParameters sets the RequiredPostParameters field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetRequiredPostParameters(requiredPostParameters []string) { + m.RequiredPostParameters = requiredPostParameters + m.require(modelOperationFieldRequiredPostParameters) +} + +// SetSupportedFields sets the SupportedFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetSupportedFields(supportedFields []string) { + m.SupportedFields = supportedFields + m.require(modelOperationFieldSupportedFields) +} + func (m *ModelOperation) UnmarshalJSON(data []byte) error { type unmarshaler ModelOperation var value unmarshaler @@ -1812,6 +2724,17 @@ func (m *ModelOperation) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelOperation) MarshalJSON() ([]byte, error) { + type embed ModelOperation + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelOperation) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -1824,9 +2747,16 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +var ( + modelPermissionDeserializerRequestFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializerRequest struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1842,6 +2772,20 @@ func (m *ModelPermissionDeserializerRequest) GetExtraProperties() map[string]int return m.extraProperties } +func (m *ModelPermissionDeserializerRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializerRequest) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerRequestFieldIsEnabled) +} + func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializerRequest var value unmarshaler @@ -1858,6 +2802,17 @@ func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializerRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -1876,6 +2831,14 @@ func (m *ModelPermissionDeserializerRequest) String() string { // // ### Usage Example // Create a `MultipartFormField` to define a multipart form entry. +var ( + multipartFormFieldRequestFieldName = big.NewInt(1 << 0) + multipartFormFieldRequestFieldData = big.NewInt(1 << 1) + multipartFormFieldRequestFieldEncoding = big.NewInt(1 << 2) + multipartFormFieldRequestFieldFileName = big.NewInt(1 << 3) + multipartFormFieldRequestFieldContentType = big.NewInt(1 << 4) +) + type MultipartFormFieldRequest struct { // The name of the form field Name string `json:"name" url:"name"` @@ -1892,6 +2855,9 @@ type MultipartFormFieldRequest struct { // The MIME type of the file, if the field is for a file. ContentType *string `json:"content_type,omitempty" url:"content_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1935,6 +2901,48 @@ func (m *MultipartFormFieldRequest) GetExtraProperties() map[string]interface{} return m.extraProperties } +func (m *MultipartFormFieldRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetName(name string) { + m.Name = name + m.require(multipartFormFieldRequestFieldName) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetData(data string) { + m.Data = data + m.require(multipartFormFieldRequestFieldData) +} + +// SetEncoding sets the Encoding field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetEncoding(encoding *MultipartFormFieldRequestEncoding) { + m.Encoding = encoding + m.require(multipartFormFieldRequestFieldEncoding) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetFileName(fileName *string) { + m.FileName = fileName + m.require(multipartFormFieldRequestFieldFileName) +} + +// SetContentType sets the ContentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetContentType(contentType *string) { + m.ContentType = contentType + m.require(multipartFormFieldRequestFieldContentType) +} + func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { type unmarshaler MultipartFormFieldRequest var value unmarshaler @@ -1951,6 +2959,17 @@ func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *MultipartFormFieldRequest) MarshalJSON() ([]byte, error) { + type embed MultipartFormFieldRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MultipartFormFieldRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -2036,6 +3055,17 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq // // ### 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. +var ( + permissionFieldId = big.NewInt(1 << 0) + permissionFieldRemoteId = big.NewInt(1 << 1) + permissionFieldCreatedAt = big.NewInt(1 << 2) + permissionFieldModifiedAt = big.NewInt(1 << 3) + permissionFieldUser = big.NewInt(1 << 4) + permissionFieldGroup = big.NewInt(1 << 5) + permissionFieldType = big.NewInt(1 << 6) + permissionFieldRoles = big.NewInt(1 << 7) +) + type Permission struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -2058,6 +3088,9 @@ type Permission struct { // 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. Roles []*PermissionRolesItem `json:"roles,omitempty" url:"roles,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2122,6 +3155,69 @@ func (p *Permission) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *Permission) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Permission) SetId(id *string) { + p.Id = id + p.require(permissionFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Permission) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(permissionFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Permission) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(permissionFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Permission) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(permissionFieldModifiedAt) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Permission) SetUser(user *PermissionUser) { + p.User = user + p.require(permissionFieldUser) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Permission) SetGroup(group *PermissionGroup) { + p.Group = group + p.require(permissionFieldGroup) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Permission) SetType(type_ *PermissionType) { + p.Type = type_ + p.require(permissionFieldType) +} + +// SetRoles sets the Roles field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Permission) SetRoles(roles []*PermissionRolesItem) { + p.Roles = roles + p.require(permissionFieldRoles) +} + func (p *Permission) UnmarshalJSON(data []byte) error { type embed Permission var unmarshaler = struct { @@ -2157,7 +3253,8 @@ func (p *Permission) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(p.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *Permission) String() string { @@ -2241,6 +3338,16 @@ func (p *PermissionGroup) Accept(visitor PermissionGroupVisitor) error { // // ### 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. +var ( + permissionRequestFieldRemoteId = big.NewInt(1 << 0) + permissionRequestFieldUser = big.NewInt(1 << 1) + permissionRequestFieldGroup = big.NewInt(1 << 2) + permissionRequestFieldType = big.NewInt(1 << 3) + permissionRequestFieldRoles = big.NewInt(1 << 4) + permissionRequestFieldIntegrationParams = big.NewInt(1 << 5) + permissionRequestFieldLinkedAccountParams = big.NewInt(1 << 6) +) + type PermissionRequest struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -2260,6 +3367,9 @@ type PermissionRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2317,6 +3427,62 @@ func (p *PermissionRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PermissionRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PermissionRequest) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(permissionRequestFieldRemoteId) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PermissionRequest) SetUser(user *PermissionRequestUser) { + p.User = user + p.require(permissionRequestFieldUser) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PermissionRequest) SetGroup(group *PermissionRequestGroup) { + p.Group = group + p.require(permissionRequestFieldGroup) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PermissionRequest) SetType(type_ *PermissionRequestType) { + p.Type = type_ + p.require(permissionRequestFieldType) +} + +// SetRoles sets the Roles field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PermissionRequest) SetRoles(roles []*PermissionRequestRolesItem) { + p.Roles = roles + p.require(permissionRequestFieldRoles) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PermissionRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(permissionRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PermissionRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(permissionRequestFieldLinkedAccountParams) +} + func (p *PermissionRequest) UnmarshalJSON(data []byte) error { type unmarshaler PermissionRequest var value unmarshaler @@ -2333,6 +3499,17 @@ func (p *PermissionRequest) UnmarshalJSON(data []byte) error { return nil } +func (p *PermissionRequest) MarshalJSON() ([]byte, error) { + type embed PermissionRequest + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PermissionRequest) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -2810,11 +3987,19 @@ func (p *PermissionUser) Accept(visitor PermissionUserVisitor) error { // // ### Usage Example // TODO +var ( + remoteDataFieldPath = big.NewInt(1 << 0) + remoteDataFieldData = big.NewInt(1 << 1) +) + type RemoteData struct { // The third-party API path that is being called. Path string `json:"path" url:"path"` Data interface{} `json:"data,omitempty" url:"data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2837,6 +4022,27 @@ func (r *RemoteData) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteData) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetPath(path string) { + r.Path = path + r.require(remoteDataFieldPath) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetData(data interface{}) { + r.Data = data + r.require(remoteDataFieldData) +} + func (r *RemoteData) UnmarshalJSON(data []byte) error { type unmarshaler RemoteData var value unmarshaler @@ -2853,6 +4059,17 @@ func (r *RemoteData) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteData) MarshalJSON() ([]byte, error) { + type embed RemoteData + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteData) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -2871,10 +4088,18 @@ func (r *RemoteData) String() string { // // ### Usage Example // Post a `GenerateRemoteKey` to receive a new `RemoteKey`. +var ( + remoteKeyFieldName = big.NewInt(1 << 0) + remoteKeyFieldKey = big.NewInt(1 << 1) +) + type RemoteKey struct { Name string `json:"name" url:"name"` Key string `json:"key" url:"key"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2897,6 +4122,27 @@ func (r *RemoteKey) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteKey) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetName(name string) { + r.Name = name + r.require(remoteKeyFieldName) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetKey(key string) { + r.Key = key + r.require(remoteKeyFieldKey) +} + func (r *RemoteKey) UnmarshalJSON(data []byte) error { type unmarshaler RemoteKey var value unmarshaler @@ -2913,6 +4159,17 @@ func (r *RemoteKey) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteKey) MarshalJSON() ([]byte, error) { + type embed RemoteKey + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteKey) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -2931,6 +4188,16 @@ func (r *RemoteKey) String() string { // // ### Usage Example // View the `RemoteResponse` returned from your `DataPassthrough`. +var ( + remoteResponseFieldMethod = big.NewInt(1 << 0) + remoteResponseFieldPath = big.NewInt(1 << 1) + remoteResponseFieldStatus = big.NewInt(1 << 2) + remoteResponseFieldResponse = big.NewInt(1 << 3) + remoteResponseFieldResponseHeaders = big.NewInt(1 << 4) + remoteResponseFieldResponseType = big.NewInt(1 << 5) + remoteResponseFieldHeaders = big.NewInt(1 << 6) +) + type RemoteResponse struct { Method string `json:"method" url:"method"` Path string `json:"path" url:"path"` @@ -2940,6 +4207,9 @@ type RemoteResponse struct { ResponseType *RemoteResponseResponseType `json:"response_type,omitempty" url:"response_type,omitempty"` Headers map[string]interface{} `json:"headers,omitempty" url:"headers,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2997,6 +4267,62 @@ func (r *RemoteResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetMethod(method string) { + r.Method = method + r.require(remoteResponseFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetPath(path string) { + r.Path = path + r.require(remoteResponseFieldPath) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetStatus(status int) { + r.Status = status + r.require(remoteResponseFieldStatus) +} + +// SetResponse sets the Response field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponse(response interface{}) { + r.Response = response + r.require(remoteResponseFieldResponse) +} + +// SetResponseHeaders sets the ResponseHeaders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseHeaders(responseHeaders map[string]interface{}) { + r.ResponseHeaders = responseHeaders + r.require(remoteResponseFieldResponseHeaders) +} + +// SetResponseType sets the ResponseType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseType(responseType *RemoteResponseResponseType) { + r.ResponseType = responseType + r.require(remoteResponseFieldResponseType) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetHeaders(headers map[string]interface{}) { + r.Headers = headers + r.require(remoteResponseFieldHeaders) +} + func (r *RemoteResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteResponse var value unmarshaler @@ -3013,6 +4339,17 @@ func (r *RemoteResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteResponse) MarshalJSON() ([]byte, error) { + type embed RemoteResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -3237,6 +4574,18 @@ func (s StatusFd5Enum) Ptr() *StatusFd5Enum { // // ### Usage Example // View the `SyncStatus` for an account to see how recently its models were synced. +var ( + syncStatusFieldModelName = big.NewInt(1 << 0) + syncStatusFieldModelId = big.NewInt(1 << 1) + syncStatusFieldLastSyncStart = big.NewInt(1 << 2) + syncStatusFieldNextSyncStart = big.NewInt(1 << 3) + syncStatusFieldLastSyncResult = big.NewInt(1 << 4) + syncStatusFieldLastSyncFinished = big.NewInt(1 << 5) + syncStatusFieldStatus = big.NewInt(1 << 6) + syncStatusFieldIsInitialSync = big.NewInt(1 << 7) + syncStatusFieldSelectiveSyncConfigurationsUsage = big.NewInt(1 << 8) +) + type SyncStatus struct { ModelName string `json:"model_name" url:"model_name"` ModelId string `json:"model_id" url:"model_id"` @@ -3248,6 +4597,9 @@ type SyncStatus struct { IsInitialSync bool `json:"is_initial_sync" url:"is_initial_sync"` SelectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum `json:"selective_sync_configurations_usage,omitempty" url:"selective_sync_configurations_usage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3319,6 +4671,76 @@ func (s *SyncStatus) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *SyncStatus) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelName(modelName string) { + s.ModelName = modelName + s.require(syncStatusFieldModelName) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelId(modelId string) { + s.ModelId = modelId + s.require(syncStatusFieldModelId) +} + +// SetLastSyncStart sets the LastSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncStart(lastSyncStart *time.Time) { + s.LastSyncStart = lastSyncStart + s.require(syncStatusFieldLastSyncStart) +} + +// SetNextSyncStart sets the NextSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetNextSyncStart(nextSyncStart *time.Time) { + s.NextSyncStart = nextSyncStart + s.require(syncStatusFieldNextSyncStart) +} + +// SetLastSyncResult sets the LastSyncResult field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncResult(lastSyncResult *SyncStatusLastSyncResult) { + s.LastSyncResult = lastSyncResult + s.require(syncStatusFieldLastSyncResult) +} + +// SetLastSyncFinished sets the LastSyncFinished field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncFinished(lastSyncFinished *time.Time) { + s.LastSyncFinished = lastSyncFinished + s.require(syncStatusFieldLastSyncFinished) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetStatus(status *SyncStatusStatus) { + s.Status = status + s.require(syncStatusFieldStatus) +} + +// SetIsInitialSync sets the IsInitialSync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetIsInitialSync(isInitialSync bool) { + s.IsInitialSync = isInitialSync + s.require(syncStatusFieldIsInitialSync) +} + +// SetSelectiveSyncConfigurationsUsage sets the SelectiveSyncConfigurationsUsage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetSelectiveSyncConfigurationsUsage(selectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum) { + s.SelectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage + s.require(syncStatusFieldSelectiveSyncConfigurationsUsage) +} + func (s *SyncStatus) UnmarshalJSON(data []byte) error { type embed SyncStatus var unmarshaler = struct { @@ -3358,7 +4780,8 @@ func (s *SyncStatus) MarshalJSON() ([]byte, error) { NextSyncStart: internal.NewOptionalDateTime(s.NextSyncStart), LastSyncFinished: internal.NewOptionalDateTime(s.LastSyncFinished), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *SyncStatus) String() string { @@ -3534,6 +4957,19 @@ func (t TypeEnum) Ptr() *TypeEnum { // 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. +var ( + userFieldId = big.NewInt(1 << 0) + userFieldRemoteId = big.NewInt(1 << 1) + userFieldCreatedAt = big.NewInt(1 << 2) + userFieldModifiedAt = big.NewInt(1 << 3) + userFieldName = big.NewInt(1 << 4) + userFieldEmailAddress = big.NewInt(1 << 5) + userFieldIsMe = big.NewInt(1 << 6) + userFieldRemoteWasDeleted = big.NewInt(1 << 7) + userFieldFieldMappings = big.NewInt(1 << 8) + userFieldRemoteData = big.NewInt(1 << 9) +) + type User struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -3553,6 +4989,9 @@ type User struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3631,6 +5070,83 @@ func (u *User) GetExtraProperties() map[string]interface{} { return u.extraProperties } +func (u *User) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetId(id *string) { + u.Id = id + u.require(userFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteId(remoteId *string) { + u.RemoteId = remoteId + u.require(userFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetCreatedAt(createdAt *time.Time) { + u.CreatedAt = createdAt + u.require(userFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetModifiedAt(modifiedAt *time.Time) { + u.ModifiedAt = modifiedAt + u.require(userFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetName(name *string) { + u.Name = name + u.require(userFieldName) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetEmailAddress(emailAddress *string) { + u.EmailAddress = emailAddress + u.require(userFieldEmailAddress) +} + +// SetIsMe sets the IsMe field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetIsMe(isMe *bool) { + u.IsMe = isMe + u.require(userFieldIsMe) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteWasDeleted(remoteWasDeleted *bool) { + u.RemoteWasDeleted = remoteWasDeleted + u.require(userFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetFieldMappings(fieldMappings map[string]interface{}) { + u.FieldMappings = fieldMappings + u.require(userFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteData(remoteData []*RemoteData) { + u.RemoteData = remoteData + u.require(userFieldRemoteData) +} + func (u *User) UnmarshalJSON(data []byte) error { type embed User var unmarshaler = struct { @@ -3666,7 +5182,8 @@ func (u *User) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(u.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(u.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) } func (u *User) String() string { @@ -3681,9 +5198,16 @@ func (u *User) String() string { return fmt.Sprintf("%#v", u) } +var ( + validationProblemSourceFieldPointer = big.NewInt(1 << 0) +) + type ValidationProblemSource struct { Pointer string `json:"pointer" url:"pointer"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3699,6 +5223,20 @@ func (v *ValidationProblemSource) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *ValidationProblemSource) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetPointer sets the Pointer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *ValidationProblemSource) SetPointer(pointer string) { + v.Pointer = pointer + v.require(validationProblemSourceFieldPointer) +} + func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { type unmarshaler ValidationProblemSource var value unmarshaler @@ -3715,6 +5253,17 @@ func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { return nil } +func (v *ValidationProblemSource) MarshalJSON() ([]byte, error) { + type embed ValidationProblemSource + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (v *ValidationProblemSource) String() string { if len(v.rawJSON) > 0 { if value, err := internal.StringifyJSON(v.rawJSON); err == nil { @@ -3727,12 +5276,22 @@ func (v *ValidationProblemSource) String() string { return fmt.Sprintf("%#v", v) } +var ( + warningValidationProblemFieldSource = big.NewInt(1 << 0) + warningValidationProblemFieldTitle = big.NewInt(1 << 1) + warningValidationProblemFieldDetail = big.NewInt(1 << 2) + warningValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type WarningValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3769,6 +5328,41 @@ func (w *WarningValidationProblem) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WarningValidationProblem) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetSource(source *ValidationProblemSource) { + w.Source = source + w.require(warningValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetTitle(title string) { + w.Title = title + w.require(warningValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetDetail(detail string) { + w.Detail = detail + w.require(warningValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetProblemType(problemType string) { + w.ProblemType = problemType + w.require(warningValidationProblemFieldProblemType) +} + func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler WarningValidationProblem var value unmarshaler @@ -3785,6 +5379,17 @@ func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (w *WarningValidationProblem) MarshalJSON() ([]byte, error) { + type embed WarningValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WarningValidationProblem) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/filestorage/users.go b/filestorage/users.go index 86ba6dc..20b6fed 100644 --- a/filestorage/users.go +++ b/filestorage/users.go @@ -6,9 +6,24 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + usersListRequestFieldCreatedAfter = big.NewInt(1 << 0) + usersListRequestFieldCreatedBefore = big.NewInt(1 << 1) + usersListRequestFieldCursor = big.NewInt(1 << 2) + usersListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + usersListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + usersListRequestFieldIncludeShellData = big.NewInt(1 << 5) + usersListRequestFieldIsMe = big.NewInt(1 << 6) + usersListRequestFieldModifiedAfter = big.NewInt(1 << 7) + usersListRequestFieldModifiedBefore = big.NewInt(1 << 8) + usersListRequestFieldPageSize = big.NewInt(1 << 9) + usersListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type UsersListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -32,20 +47,145 @@ type UsersListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UsersListRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCreatedAfter(createdAfter *time.Time) { + u.CreatedAfter = createdAfter + u.require(usersListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCreatedBefore(createdBefore *time.Time) { + u.CreatedBefore = createdBefore + u.require(usersListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCursor(cursor *string) { + u.Cursor = cursor + u.require(usersListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + u.IncludeDeletedData = includeDeletedData + u.require(usersListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + u.IncludeRemoteData = includeRemoteData + u.require(usersListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeShellData(includeShellData *bool) { + u.IncludeShellData = includeShellData + u.require(usersListRequestFieldIncludeShellData) +} + +// SetIsMe sets the IsMe field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIsMe(isMe *string) { + u.IsMe = isMe + u.require(usersListRequestFieldIsMe) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + u.ModifiedAfter = modifiedAfter + u.require(usersListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + u.ModifiedBefore = modifiedBefore + u.require(usersListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetPageSize(pageSize *int) { + u.PageSize = pageSize + u.require(usersListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetRemoteId(remoteId *string) { + u.RemoteId = remoteId + u.require(usersListRequestFieldRemoteId) +} + +var ( + usersRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + usersRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type UsersRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UsersRetrieveRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + u.IncludeRemoteData = includeRemoteData + u.require(usersRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + u.IncludeShellData = includeShellData + u.require(usersRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedUserListFieldNext = big.NewInt(1 << 0) + paginatedUserListFieldPrevious = big.NewInt(1 << 1) + paginatedUserListFieldResults = big.NewInt(1 << 2) +) + type PaginatedUserList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*User `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -75,6 +215,34 @@ func (p *PaginatedUserList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedUserList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedUserList) SetNext(next *string) { + p.Next = next + p.require(paginatedUserListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedUserList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedUserListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedUserList) SetResults(results []*User) { + p.Results = results + p.require(paginatedUserListFieldResults) +} + func (p *PaginatedUserList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedUserList var value unmarshaler @@ -91,6 +259,17 @@ func (p *PaginatedUserList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedUserList) MarshalJSON() ([]byte, error) { + type embed PaginatedUserList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedUserList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/filestorage/users/client.go b/filestorage/users/client.go index 9dd4d92..34f7491 100644 --- a/filestorage/users/client.go +++ b/filestorage/users/client.go @@ -4,7 +4,6 @@ package users import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *filestorage.UsersListRequest, opts ...option.RequestOption, -) (*core.Page[*filestorage.User], error) { +) (*core.Page[*string, *filestorage.User], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *filestorage.PaginatedUserList) *internal.PageResponse[*string, *filestorage.User] { + readPageResponse := func(response *filestorage.PaginatedUserList) *core.PageResponse[*string, *filestorage.User] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *filestorage.User]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *filestorage.User]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *filestorage.UsersRetrieveRequest, opts ...option.RequestOption, ) (*filestorage.User, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/filestorage/v1/users/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *filestorage.User - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/filestorage/users/file_storage_users_test/file_storage_users_test.go b/filestorage/users/file_storage_users_test/file_storage_users_test.go new file mode 100644 index 0000000..72b916e --- /dev/null +++ b/filestorage/users/file_storage_users_test/file_storage_users_test.go @@ -0,0 +1,153 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_users_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageUsersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.UsersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsMe: merge.String( + "is_me", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.FileStorage.Users.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/users", map[string]string{"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"}, 1) +} + +func TestFileStorageUsersRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.UsersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.FileStorage.Users.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/users/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/filestorage/users/raw_client.go b/filestorage/users/raw_client.go new file mode 100644 index 0000000..aaa6d86 --- /dev/null +++ b/filestorage/users/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package users + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *filestorage.UsersRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.User], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/filestorage/v1/users/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *filestorage.User + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.User]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/filestorage/webhook_receivers.go b/filestorage/webhook_receivers.go index 1d9c0f7..3479a47 100644 --- a/filestorage/webhook_receivers.go +++ b/filestorage/webhook_receivers.go @@ -6,19 +6,66 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + webhookReceiverRequestFieldEvent = big.NewInt(1 << 0) + webhookReceiverRequestFieldIsActive = big.NewInt(1 << 1) + webhookReceiverRequestFieldKey = big.NewInt(1 << 2) ) type WebhookReceiverRequest struct { Event string `json:"event" url:"-"` IsActive bool `json:"is_active" url:"-"` Key *string `json:"key,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (w *WebhookReceiverRequest) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverRequestFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverRequestFieldIsActive) } +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverRequestFieldKey) +} + +var ( + webhookReceiverFieldEvent = big.NewInt(1 << 0) + webhookReceiverFieldIsActive = big.NewInt(1 << 1) + webhookReceiverFieldKey = big.NewInt(1 << 2) +) + type WebhookReceiver struct { Event string `json:"event" url:"event"` IsActive bool `json:"is_active" url:"is_active"` Key *string `json:"key,omitempty" url:"key,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +95,34 @@ func (w *WebhookReceiver) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WebhookReceiver) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverFieldIsActive) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverFieldKey) +} + func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { type unmarshaler WebhookReceiver var value unmarshaler @@ -64,6 +139,17 @@ func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { return nil } +func (w *WebhookReceiver) MarshalJSON() ([]byte, error) { + type embed WebhookReceiver + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WebhookReceiver) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/filestorage/webhookreceivers/client.go b/filestorage/webhookreceivers/client.go index 86e828e..de94cbe 100644 --- a/filestorage/webhookreceivers/client.go +++ b/filestorage/webhookreceivers/client.go @@ -8,26 +8,27 @@ import ( filestorage "github.com/merge-api/merge-go-client/v2/filestorage" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) List( ctx context.Context, opts ...option.RequestOption, ) ([]*filestorage.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*filestorage.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.List( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Creates a `WebhookReceiver` object with the given values. @@ -73,35 +53,13 @@ func (c *Client) Create( request *filestorage.WebhookReceiverRequest, opts ...option.RequestOption, ) (*filestorage.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/filestorage/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *filestorage.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/filestorage/webhookreceivers/file_storage_webhook_receivers_test/file_storage_webhook_receivers_test.go b/filestorage/webhookreceivers/file_storage_webhook_receivers_test/file_storage_webhook_receivers_test.go new file mode 100644 index 0000000..f80de5f --- /dev/null +++ b/filestorage/webhookreceivers/file_storage_webhook_receivers_test/file_storage_webhook_receivers_test.go @@ -0,0 +1,103 @@ +// Code generated by Fern. DO NOT EDIT. + +package file_storage_webhook_receivers_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestFileStorageWebhookReceiversListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.FileStorage.WebhookReceivers.List( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/filestorage/v1/webhook-receivers", nil, 1) +} + +func TestFileStorageWebhookReceiversCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &filestorage.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } + _, invocationErr := client.FileStorage.WebhookReceivers.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/filestorage/v1/webhook-receivers", nil, 1) +} diff --git a/filestorage/webhookreceivers/raw_client.go b/filestorage/webhookreceivers/raw_client.go new file mode 100644 index 0000000..269272f --- /dev/null +++ b/filestorage/webhookreceivers/raw_client.go @@ -0,0 +1,112 @@ +// Code generated by Fern. DO NOT EDIT. + +package webhookreceivers + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + filestorage "github.com/merge-api/merge-go-client/v2/filestorage" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*filestorage.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*filestorage.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*filestorage.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *filestorage.WebhookReceiverRequest, + opts ...option.RequestOption, +) (*core.Response[*filestorage.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/filestorage/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *filestorage.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*filestorage.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/go.mod b/go.mod index a0a2b27..5511af7 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,16 @@ module github.com/merge-api/merge-go-client/v2 -go 1.18 +go 1.21 -require ( - github.com/google/uuid v1.4.0 - github.com/stretchr/testify v1.7.0 -) +toolchain go1.23.8 + +require github.com/google/uuid v1.6.0 + +require github.com/stretchr/testify v1.8.4 + +require gopkg.in/yaml.v3 v3.0.1 // indirect require ( - github.com/davecgh/go-spew v1.1.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index b3766d4..fcca6d1 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,12 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/hris/account_details.go b/hris/account_details.go index 23261b3..dbe59ec 100644 --- a/hris/account_details.go +++ b/hris/account_details.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountDetailsFieldId = big.NewInt(1 << 0) + accountDetailsFieldIntegration = big.NewInt(1 << 1) + accountDetailsFieldIntegrationSlug = big.NewInt(1 << 2) + accountDetailsFieldCategory = big.NewInt(1 << 3) + accountDetailsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsFieldStatus = big.NewInt(1 << 7) + accountDetailsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsFieldAccountType = big.NewInt(1 << 10) + accountDetailsFieldCompletedAt = big.NewInt(1 << 11) +) + type AccountDetails struct { Id *string `json:"id,omitempty" url:"id,omitempty"` Integration *string `json:"integration,omitempty" url:"integration,omitempty"` @@ -25,6 +41,9 @@ type AccountDetails struct { // The time at which account completes the linking flow. CompletedAt *time.Time `json:"completed_at,omitempty" url:"completed_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -117,6 +136,97 @@ func (a *AccountDetails) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetails) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetId(id *string) { + a.Id = id + a.require(accountDetailsFieldId) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegration(integration *string) { + a.Integration = integration + a.require(accountDetailsFieldIntegration) +} + +// SetIntegrationSlug sets the IntegrationSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegrationSlug(integrationSlug *string) { + a.IntegrationSlug = integrationSlug + a.require(accountDetailsFieldIntegrationSlug) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCategory(category *AccountDetailsCategory) { + a.Category = category + a.require(accountDetailsFieldCategory) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOrganizationName(endUserOrganizationName *string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserEmailAddress(endUserEmailAddress *string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsFieldEndUserEmailAddress) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetStatus(status *string) { + a.Status = status + a.require(accountDetailsFieldStatus) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetWebhookListenerUrl(webhookListenerUrl *string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsFieldIsDuplicate) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetAccountType(accountType *string) { + a.AccountType = accountType + a.require(accountDetailsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCompletedAt(completedAt *time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsFieldCompletedAt) +} + func (a *AccountDetails) UnmarshalJSON(data []byte) error { type embed AccountDetails var unmarshaler = struct { @@ -148,7 +258,8 @@ func (a *AccountDetails) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewOptionalDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetails) String() string { diff --git a/hris/account_token.go b/hris/account_token.go index ccb77f0..1bdcf0d 100644 --- a/hris/account_token.go +++ b/hris/account_token.go @@ -6,6 +6,13 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + accountTokenFieldAccountToken = big.NewInt(1 << 0) + accountTokenFieldIntegration = big.NewInt(1 << 1) + accountTokenFieldId = big.NewInt(1 << 2) ) type AccountToken struct { @@ -13,6 +20,9 @@ type AccountToken struct { Integration *AccountIntegration `json:"integration" url:"integration"` Id string `json:"id" url:"id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -42,6 +52,34 @@ func (a *AccountToken) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountToken) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetAccountToken(accountToken string) { + a.AccountToken = accountToken + a.require(accountTokenFieldAccountToken) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(accountTokenFieldIntegration) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetId(id string) { + a.Id = id + a.require(accountTokenFieldId) +} + func (a *AccountToken) UnmarshalJSON(data []byte) error { type unmarshaler AccountToken var value unmarshaler @@ -58,6 +96,17 @@ func (a *AccountToken) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountToken) MarshalJSON() ([]byte, error) { + type embed AccountToken + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountToken) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/hris/accountdetails/client.go b/hris/accountdetails/client.go index 323f703..86077ed 100644 --- a/hris/accountdetails/client.go +++ b/hris/accountdetails/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*hris.AccountDetails, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/account-details" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.AccountDetails - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/accountdetails/hris_account_details_test/hris_account_details_test.go b/hris/accountdetails/hris_account_details_test/hris_account_details_test.go new file mode 100644 index 0000000..8a8c157 --- /dev/null +++ b/hris/accountdetails/hris_account_details_test/hris_account_details_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_account_details_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisAccountDetailsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.AccountDetails.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/account-details", nil, 1) +} diff --git a/hris/accountdetails/raw_client.go b/hris/accountdetails/raw_client.go new file mode 100644 index 0000000..5fbf21a --- /dev/null +++ b/hris/accountdetails/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package accountdetails + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*hris.AccountDetails], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/account-details" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.AccountDetails + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.AccountDetails]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/accounttoken/client.go b/hris/accounttoken/client.go index 4434263..c2f8a1f 100644 --- a/hris/accounttoken/client.go +++ b/hris/accounttoken/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,36 +38,13 @@ func (c *Client) Retrieve( publicToken string, opts ...option.RequestOption, ) (*hris.AccountToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/account-token/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, publicToken, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.AccountToken - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/accounttoken/hris_account_token_test/hris_account_token_test.go b/hris/accounttoken/hris_account_token_test/hris_account_token_test.go new file mode 100644 index 0000000..24bd6f4 --- /dev/null +++ b/hris/accounttoken/hris_account_token_test/hris_account_token_test.go @@ -0,0 +1,80 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_account_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisAccountTokenRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/account-token/public_token", nil, 1) +} diff --git a/hris/accounttoken/raw_client.go b/hris/accounttoken/raw_client.go new file mode 100644 index 0000000..108c168 --- /dev/null +++ b/hris/accounttoken/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounttoken + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + publicToken string, + opts ...option.RequestOption, +) (*core.Response[*hris.AccountToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/account-token/%v", + publicToken, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.AccountToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.AccountToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/async_passthrough.go b/hris/async_passthrough.go index d8451d3..75c772a 100644 --- a/hris/async_passthrough.go +++ b/hris/async_passthrough.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) type AsyncPassthroughRetrieveResponse struct { @@ -70,9 +71,16 @@ func (a *AsyncPassthroughRetrieveResponse) Accept(visitor AsyncPassthroughRetrie return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + asyncPassthroughRecieptFieldAsyncPassthroughReceiptId = big.NewInt(1 << 0) +) + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id" url:"async_passthrough_receipt_id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -88,6 +96,20 @@ func (a *AsyncPassthroughReciept) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AsyncPassthroughReciept) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAsyncPassthroughReceiptId sets the AsyncPassthroughReceiptId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPassthroughReciept) SetAsyncPassthroughReceiptId(asyncPassthroughReceiptId string) { + a.AsyncPassthroughReceiptId = asyncPassthroughReceiptId + a.require(asyncPassthroughRecieptFieldAsyncPassthroughReceiptId) +} + func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { type unmarshaler AsyncPassthroughReciept var value unmarshaler @@ -104,6 +126,17 @@ func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { return nil } +func (a *AsyncPassthroughReciept) MarshalJSON() ([]byte, error) { + type embed AsyncPassthroughReciept + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AsyncPassthroughReciept) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/hris/asyncpassthrough/client.go b/hris/asyncpassthrough/client.go index 3960c30..063dae8 100644 --- a/hris/asyncpassthrough/client.go +++ b/hris/asyncpassthrough/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,37 +38,15 @@ func (c *Client) Create( request *hris.DataPassthroughRequest, opts ...option.RequestOption, ) (*hris.AsyncPassthroughReciept, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/async-passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.AsyncPassthroughReciept - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Retrieves data from earlier async-passthrough POST request @@ -76,36 +55,13 @@ func (c *Client) Retrieve( asyncPassthroughReceiptId string, opts ...option.RequestOption, ) (*hris.AsyncPassthroughRetrieveResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/async-passthrough/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, asyncPassthroughReceiptId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.AsyncPassthroughRetrieveResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/asyncpassthrough/hris_async_passthrough_test/hris_async_passthrough_test.go b/hris/asyncpassthrough/hris_async_passthrough_test/hris_async_passthrough_test.go new file mode 100644 index 0000000..cc8ebd3 --- /dev/null +++ b/hris/asyncpassthrough/hris_async_passthrough_test/hris_async_passthrough_test.go @@ -0,0 +1,104 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_async_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisAsyncPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.DataPassthroughRequest{ + Method: hris.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Hris.AsyncPassthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/async-passthrough", nil, 1) +} + +func TestHrisAsyncPassthroughRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/async-passthrough/async_passthrough_receipt_id", nil, 1) +} diff --git a/hris/asyncpassthrough/raw_client.go b/hris/asyncpassthrough/raw_client.go new file mode 100644 index 0000000..7117439 --- /dev/null +++ b/hris/asyncpassthrough/raw_client.go @@ -0,0 +1,115 @@ +// Code generated by Fern. DO NOT EDIT. + +package asyncpassthrough + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *hris.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.AsyncPassthroughReciept], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/async-passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.AsyncPassthroughReciept + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.AsyncPassthroughReciept]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + asyncPassthroughReceiptId string, + opts ...option.RequestOption, +) (*core.Response[*hris.AsyncPassthroughRetrieveResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/async-passthrough/%v", + asyncPassthroughReceiptId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.AsyncPassthroughRetrieveResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.AsyncPassthroughRetrieveResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/audit_trail.go b/hris/audit_trail.go index 18ab4cb..e3ec630 100644 --- a/hris/audit_trail.go +++ b/hris/audit_trail.go @@ -6,9 +6,19 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + auditTrailListRequestFieldCursor = big.NewInt(1 << 0) + auditTrailListRequestFieldEndDate = big.NewInt(1 << 1) + auditTrailListRequestFieldEventType = big.NewInt(1 << 2) + auditTrailListRequestFieldPageSize = big.NewInt(1 << 3) + auditTrailListRequestFieldStartDate = big.NewInt(1 << 4) + auditTrailListRequestFieldUserEmail = big.NewInt(1 << 5) +) + type AuditTrailListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -22,8 +32,71 @@ type AuditTrailListRequest struct { StartDate *string `json:"-" url:"start_date,omitempty"` // 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. UserEmail *string `json:"-" url:"user_email,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AuditTrailListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(auditTrailListRequestFieldCursor) } +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEndDate(endDate *string) { + a.EndDate = endDate + a.require(auditTrailListRequestFieldEndDate) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEventType(eventType *string) { + a.EventType = eventType + a.require(auditTrailListRequestFieldEventType) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(auditTrailListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetStartDate(startDate *string) { + a.StartDate = startDate + a.require(auditTrailListRequestFieldStartDate) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditTrailListRequestFieldUserEmail) +} + +var ( + auditLogEventFieldId = big.NewInt(1 << 0) + auditLogEventFieldUserName = big.NewInt(1 << 1) + auditLogEventFieldUserEmail = big.NewInt(1 << 2) + auditLogEventFieldRole = big.NewInt(1 << 3) + auditLogEventFieldIpAddress = big.NewInt(1 << 4) + auditLogEventFieldEventType = big.NewInt(1 << 5) + auditLogEventFieldEventDescription = big.NewInt(1 << 6) + auditLogEventFieldCreatedAt = big.NewInt(1 << 7) +) + type AuditLogEvent struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The User's full name at the time of this Event occurring. @@ -89,6 +162,9 @@ type AuditLogEvent struct { EventDescription string `json:"event_description" url:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -153,6 +229,69 @@ func (a *AuditLogEvent) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AuditLogEvent) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetId(id *string) { + a.Id = id + a.require(auditLogEventFieldId) +} + +// SetUserName sets the UserName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserName(userName *string) { + a.UserName = userName + a.require(auditLogEventFieldUserName) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditLogEventFieldUserEmail) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetRole(role *AuditLogEventRole) { + a.Role = role + a.require(auditLogEventFieldRole) +} + +// SetIpAddress sets the IpAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetIpAddress(ipAddress string) { + a.IpAddress = ipAddress + a.require(auditLogEventFieldIpAddress) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventType(eventType *AuditLogEventEventType) { + a.EventType = eventType + a.require(auditLogEventFieldEventType) +} + +// SetEventDescription sets the EventDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventDescription(eventDescription string) { + a.EventDescription = eventDescription + a.require(auditLogEventFieldEventDescription) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(auditLogEventFieldCreatedAt) +} + func (a *AuditLogEvent) UnmarshalJSON(data []byte) error { type embed AuditLogEvent var unmarshaler = struct { @@ -184,7 +323,8 @@ func (a *AuditLogEvent) MarshalJSON() ([]byte, error) { embed: embed(*a), CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AuditLogEvent) String() string { @@ -564,11 +704,20 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +var ( + paginatedAuditLogEventListFieldNext = big.NewInt(1 << 0) + paginatedAuditLogEventListFieldPrevious = big.NewInt(1 << 1) + paginatedAuditLogEventListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAuditLogEventList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AuditLogEvent `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -598,6 +747,34 @@ func (p *PaginatedAuditLogEventList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedAuditLogEventList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetNext(next *string) { + p.Next = next + p.require(paginatedAuditLogEventListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAuditLogEventListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetResults(results []*AuditLogEvent) { + p.Results = results + p.require(paginatedAuditLogEventListFieldResults) +} + func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAuditLogEventList var value unmarshaler @@ -614,6 +791,17 @@ func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAuditLogEventList) MarshalJSON() ([]byte, error) { + type embed PaginatedAuditLogEventList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAuditLogEventList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/audittrail/client.go b/hris/audittrail/client.go index 993fe5f..5eff82e 100644 --- a/hris/audittrail/client.go +++ b/hris/audittrail/client.go @@ -4,7 +4,6 @@ package audittrail import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.AuditTrailListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.AuditLogEvent], error) { +) (*core.Page[*string, *hris.AuditLogEvent], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedAuditLogEventList) *internal.PageResponse[*string, *hris.AuditLogEvent] { + readPageResponse := func(response *hris.PaginatedAuditLogEventList) *core.PageResponse[*string, *hris.AuditLogEvent] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.AuditLogEvent]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.AuditLogEvent]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/hris/audittrail/hris_audit_trail_test/hris_audit_trail_test.go b/hris/audittrail/hris_audit_trail_test/hris_audit_trail_test.go new file mode 100644 index 0000000..5d7161c --- /dev/null +++ b/hris/audittrail/hris_audit_trail_test/hris_audit_trail_test.go @@ -0,0 +1,102 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_audit_trail_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisAuditTrailListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } + _, invocationErr := client.Hris.AuditTrail.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/audit-trail", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "end_date": "end_date", "event_type": "event_type", "page_size": "1", "start_date": "start_date", "user_email": "user_email"}, 1) +} diff --git a/hris/audittrail/raw_client.go b/hris/audittrail/raw_client.go new file mode 100644 index 0000000..cce0cac --- /dev/null +++ b/hris/audittrail/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package audittrail + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/hris/available_actions.go b/hris/available_actions.go index 987aadf..2401522 100644 --- a/hris/available_actions.go +++ b/hris/available_actions.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) // # The AvailableActions Object @@ -14,11 +15,20 @@ import ( // // ### Usage Example // Fetch all the actions available for the `Zenefits` integration. +var ( + availableActionsFieldIntegration = big.NewInt(1 << 0) + availableActionsFieldPassthroughAvailable = big.NewInt(1 << 1) + availableActionsFieldAvailableModelOperations = big.NewInt(1 << 2) +) + type AvailableActions struct { Integration *AccountIntegration `json:"integration" url:"integration"` PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +58,34 @@ func (a *AvailableActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AvailableActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(availableActionsFieldIntegration) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(availableActionsFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(availableActionsFieldAvailableModelOperations) +} + func (a *AvailableActions) UnmarshalJSON(data []byte) error { type unmarshaler AvailableActions var value unmarshaler @@ -64,6 +102,17 @@ func (a *AvailableActions) UnmarshalJSON(data []byte) error { return nil } +func (a *AvailableActions) MarshalJSON() ([]byte, error) { + type embed AvailableActions + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AvailableActions) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/hris/availableactions/client.go b/hris/availableactions/client.go index 0c3c1f1..6ee1bb9 100644 --- a/hris/availableactions/client.go +++ b/hris/availableactions/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*hris.AvailableActions, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/available-actions" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.AvailableActions - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/availableactions/hris_available_actions_test/hris_available_actions_test.go b/hris/availableactions/hris_available_actions_test/hris_available_actions_test.go new file mode 100644 index 0000000..b8d5428 --- /dev/null +++ b/hris/availableactions/hris_available_actions_test/hris_available_actions_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_available_actions_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisAvailableActionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.AvailableActions.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/available-actions", nil, 1) +} diff --git a/hris/availableactions/raw_client.go b/hris/availableactions/raw_client.go new file mode 100644 index 0000000..aca4f41 --- /dev/null +++ b/hris/availableactions/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package availableactions + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*hris.AvailableActions], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/available-actions" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.AvailableActions + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.AvailableActions]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/bank_info.go b/hris/bank_info.go index 470477a..2a9023f 100644 --- a/hris/bank_info.go +++ b/hris/bank_info.go @@ -6,9 +6,30 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + bankInfoListRequestFieldAccountType = big.NewInt(1 << 0) + bankInfoListRequestFieldBankName = big.NewInt(1 << 1) + bankInfoListRequestFieldCreatedAfter = big.NewInt(1 << 2) + bankInfoListRequestFieldCreatedBefore = big.NewInt(1 << 3) + bankInfoListRequestFieldCursor = big.NewInt(1 << 4) + bankInfoListRequestFieldEmployeeId = big.NewInt(1 << 5) + bankInfoListRequestFieldExpand = big.NewInt(1 << 6) + bankInfoListRequestFieldIncludeDeletedData = big.NewInt(1 << 7) + bankInfoListRequestFieldIncludeRemoteData = big.NewInt(1 << 8) + bankInfoListRequestFieldIncludeShellData = big.NewInt(1 << 9) + bankInfoListRequestFieldModifiedAfter = big.NewInt(1 << 10) + bankInfoListRequestFieldModifiedBefore = big.NewInt(1 << 11) + bankInfoListRequestFieldOrderBy = big.NewInt(1 << 12) + bankInfoListRequestFieldPageSize = big.NewInt(1 << 13) + bankInfoListRequestFieldRemoteFields = big.NewInt(1 << 14) + bankInfoListRequestFieldRemoteId = big.NewInt(1 << 15) + bankInfoListRequestFieldShowEnumOrigins = big.NewInt(1 << 16) +) + type BankInfoListRequest struct { // If provided, will only return BankInfo's with this account type. Options: ('SAVINGS', 'CHECKING') // @@ -47,8 +68,145 @@ type BankInfoListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BankInfoListRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetAccountType(accountType *BankInfoListRequestAccountType) { + b.AccountType = accountType + b.require(bankInfoListRequestFieldAccountType) +} + +// SetBankName sets the BankName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetBankName(bankName *string) { + b.BankName = bankName + b.require(bankInfoListRequestFieldBankName) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetCreatedAfter(createdAfter *time.Time) { + b.CreatedAfter = createdAfter + b.require(bankInfoListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetCreatedBefore(createdBefore *time.Time) { + b.CreatedBefore = createdBefore + b.require(bankInfoListRequestFieldCreatedBefore) } +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetCursor(cursor *string) { + b.Cursor = cursor + b.require(bankInfoListRequestFieldCursor) +} + +// SetEmployeeId sets the EmployeeId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetEmployeeId(employeeId *string) { + b.EmployeeId = employeeId + b.require(bankInfoListRequestFieldEmployeeId) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetExpand(expand []*string) { + b.Expand = expand + b.require(bankInfoListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + b.IncludeDeletedData = includeDeletedData + b.require(bankInfoListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(bankInfoListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(bankInfoListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + b.ModifiedAfter = modifiedAfter + b.require(bankInfoListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + b.ModifiedBefore = modifiedBefore + b.require(bankInfoListRequestFieldModifiedBefore) +} + +// SetOrderBy sets the OrderBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetOrderBy(orderBy *BankInfoListRequestOrderBy) { + b.OrderBy = orderBy + b.require(bankInfoListRequestFieldOrderBy) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetPageSize(pageSize *int) { + b.PageSize = pageSize + b.require(bankInfoListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetRemoteFields(remoteFields *string) { + b.RemoteFields = remoteFields + b.require(bankInfoListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetRemoteId(remoteId *string) { + b.RemoteId = remoteId + b.require(bankInfoListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + b.ShowEnumOrigins = showEnumOrigins + b.require(bankInfoListRequestFieldShowEnumOrigins) +} + +var ( + bankInfoRetrieveRequestFieldExpand = big.NewInt(1 << 0) + bankInfoRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + bankInfoRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + bankInfoRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + bankInfoRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type BankInfoRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -60,6 +218,51 @@ type BankInfoRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BankInfoRetrieveRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoRetrieveRequest) SetExpand(expand []*string) { + b.Expand = expand + b.require(bankInfoRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(bankInfoRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(bankInfoRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoRetrieveRequest) SetRemoteFields(remoteFields *string) { + b.RemoteFields = remoteFields + b.require(bankInfoRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfoRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + b.ShowEnumOrigins = showEnumOrigins + b.require(bankInfoRetrieveRequestFieldShowEnumOrigins) } type BankInfoListRequestAccountType string @@ -136,6 +339,22 @@ func (a AccountTypeEnum) Ptr() *AccountTypeEnum { // // ### Usage Example // Fetch from the `LIST BankInfo` endpoint and filter by `ID` to show all bank information. +var ( + bankInfoFieldId = big.NewInt(1 << 0) + bankInfoFieldRemoteId = big.NewInt(1 << 1) + bankInfoFieldCreatedAt = big.NewInt(1 << 2) + bankInfoFieldModifiedAt = big.NewInt(1 << 3) + bankInfoFieldEmployee = big.NewInt(1 << 4) + bankInfoFieldAccountNumber = big.NewInt(1 << 5) + bankInfoFieldRoutingNumber = big.NewInt(1 << 6) + bankInfoFieldBankName = big.NewInt(1 << 7) + bankInfoFieldAccountType = big.NewInt(1 << 8) + bankInfoFieldRemoteCreatedAt = big.NewInt(1 << 9) + bankInfoFieldRemoteWasDeleted = big.NewInt(1 << 10) + bankInfoFieldFieldMappings = big.NewInt(1 << 11) + bankInfoFieldRemoteData = big.NewInt(1 << 12) +) + type BankInfo struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -164,6 +383,9 @@ type BankInfo struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -263,6 +485,104 @@ func (b *BankInfo) GetExtraProperties() map[string]interface{} { return b.extraProperties } +func (b *BankInfo) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetId(id *string) { + b.Id = id + b.require(bankInfoFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetRemoteId(remoteId *string) { + b.RemoteId = remoteId + b.require(bankInfoFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetCreatedAt(createdAt *time.Time) { + b.CreatedAt = createdAt + b.require(bankInfoFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetModifiedAt(modifiedAt *time.Time) { + b.ModifiedAt = modifiedAt + b.require(bankInfoFieldModifiedAt) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetEmployee(employee *BankInfoEmployee) { + b.Employee = employee + b.require(bankInfoFieldEmployee) +} + +// SetAccountNumber sets the AccountNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetAccountNumber(accountNumber *string) { + b.AccountNumber = accountNumber + b.require(bankInfoFieldAccountNumber) +} + +// SetRoutingNumber sets the RoutingNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetRoutingNumber(routingNumber *string) { + b.RoutingNumber = routingNumber + b.require(bankInfoFieldRoutingNumber) +} + +// SetBankName sets the BankName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetBankName(bankName *string) { + b.BankName = bankName + b.require(bankInfoFieldBankName) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetAccountType(accountType *BankInfoAccountType) { + b.AccountType = accountType + b.require(bankInfoFieldAccountType) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + b.RemoteCreatedAt = remoteCreatedAt + b.require(bankInfoFieldRemoteCreatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetRemoteWasDeleted(remoteWasDeleted *bool) { + b.RemoteWasDeleted = remoteWasDeleted + b.require(bankInfoFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetFieldMappings(fieldMappings map[string]interface{}) { + b.FieldMappings = fieldMappings + b.require(bankInfoFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BankInfo) SetRemoteData(remoteData []*RemoteData) { + b.RemoteData = remoteData + b.require(bankInfoFieldRemoteData) +} + func (b *BankInfo) UnmarshalJSON(data []byte) error { type embed BankInfo var unmarshaler = struct { @@ -302,7 +622,8 @@ func (b *BankInfo) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(b.ModifiedAt), RemoteCreatedAt: internal.NewOptionalDateTime(b.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) } func (b *BankInfo) String() string { @@ -446,11 +767,20 @@ func (b *BankInfoEmployee) Accept(visitor BankInfoEmployeeVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", b) } +var ( + paginatedBankInfoListFieldNext = big.NewInt(1 << 0) + paginatedBankInfoListFieldPrevious = big.NewInt(1 << 1) + paginatedBankInfoListFieldResults = big.NewInt(1 << 2) +) + type PaginatedBankInfoList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*BankInfo `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -480,6 +810,34 @@ func (p *PaginatedBankInfoList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedBankInfoList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBankInfoList) SetNext(next *string) { + p.Next = next + p.require(paginatedBankInfoListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBankInfoList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedBankInfoListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBankInfoList) SetResults(results []*BankInfo) { + p.Results = results + p.require(paginatedBankInfoListFieldResults) +} + func (p *PaginatedBankInfoList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedBankInfoList var value unmarshaler @@ -496,6 +854,17 @@ func (p *PaginatedBankInfoList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedBankInfoList) MarshalJSON() ([]byte, error) { + type embed PaginatedBankInfoList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedBankInfoList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/bankinfo/client.go b/hris/bankinfo/client.go index 7cf54a6..654d5d4 100644 --- a/hris/bankinfo/client.go +++ b/hris/bankinfo/client.go @@ -4,7 +4,6 @@ package bankinfo import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.BankInfoListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.BankInfo], error) { +) (*core.Page[*string, *hris.BankInfo], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedBankInfoList) *internal.PageResponse[*string, *hris.BankInfo] { + readPageResponse := func(response *hris.PaginatedBankInfoList) *core.PageResponse[*string, *hris.BankInfo] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.BankInfo]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.BankInfo]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.BankInfoRetrieveRequest, opts ...option.RequestOption, ) (*hris.BankInfo, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/bank-info/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.BankInfo - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/bankinfo/hris_bank_info_test/hris_bank_info_test.go b/hris/bankinfo/hris_bank_info_test/hris_bank_info_test.go new file mode 100644 index 0000000..6fb766c --- /dev/null +++ b/hris/bankinfo/hris_bank_info_test/hris_bank_info_test.go @@ -0,0 +1,158 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_bank_info_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisBankInfoListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.BankInfoListRequest{ + AccountType: hris.BankInfoListRequestAccountTypeChecking.Ptr(), + BankName: merge.String( + "bank_name", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OrderBy: hris.BankInfoListRequestOrderByRemoteCreatedAtDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Hris.BankInfo.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/bank-info", map[string]string{"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"}, 1) +} + +func TestHrisBankInfoRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.BankInfoRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.BankInfo.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/bank-info/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "account_type", "show_enum_origins": "account_type"}, 1) +} diff --git a/hris/bankinfo/raw_client.go b/hris/bankinfo/raw_client.go new file mode 100644 index 0000000..93e8a3b --- /dev/null +++ b/hris/bankinfo/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package bankinfo + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.BankInfoRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.BankInfo], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/bank-info/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.BankInfo + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.BankInfo]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/benefits.go b/hris/benefits.go index 40b5517..4cc0fe4 100644 --- a/hris/benefits.go +++ b/hris/benefits.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + benefitsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + benefitsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + benefitsListRequestFieldCursor = big.NewInt(1 << 2) + benefitsListRequestFieldEmployeeId = big.NewInt(1 << 3) + benefitsListRequestFieldExpand = big.NewInt(1 << 4) + benefitsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + benefitsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + benefitsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + benefitsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + benefitsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + benefitsListRequestFieldPageSize = big.NewInt(1 << 10) + benefitsListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type BenefitsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -34,8 +50,108 @@ type BenefitsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BenefitsListRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetCreatedAfter(createdAfter *time.Time) { + b.CreatedAfter = createdAfter + b.require(benefitsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetCreatedBefore(createdBefore *time.Time) { + b.CreatedBefore = createdBefore + b.require(benefitsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetCursor(cursor *string) { + b.Cursor = cursor + b.require(benefitsListRequestFieldCursor) +} + +// SetEmployeeId sets the EmployeeId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetEmployeeId(employeeId *string) { + b.EmployeeId = employeeId + b.require(benefitsListRequestFieldEmployeeId) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetExpand(expand []*string) { + b.Expand = expand + b.require(benefitsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + b.IncludeDeletedData = includeDeletedData + b.require(benefitsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(benefitsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(benefitsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + b.ModifiedAfter = modifiedAfter + b.require(benefitsListRequestFieldModifiedAfter) } +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + b.ModifiedBefore = modifiedBefore + b.require(benefitsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetPageSize(pageSize *int) { + b.PageSize = pageSize + b.require(benefitsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsListRequest) SetRemoteId(remoteId *string) { + b.RemoteId = remoteId + b.require(benefitsListRequestFieldRemoteId) +} + +var ( + benefitsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + benefitsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + benefitsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type BenefitsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -43,6 +159,37 @@ type BenefitsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (b *BenefitsRetrieveRequest) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsRetrieveRequest) SetExpand(expand []*string) { + b.Expand = expand + b.require(benefitsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + b.IncludeRemoteData = includeRemoteData + b.require(benefitsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BenefitsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + b.IncludeShellData = includeShellData + b.require(benefitsRetrieveRequestFieldIncludeShellData) } // # The Benefit Object @@ -51,6 +198,24 @@ type BenefitsRetrieveRequest struct { // // ### Usage Example // Fetch from the `LIST Benefits` endpoint and filter by `ID` to show all benefits. +var ( + benefitFieldId = big.NewInt(1 << 0) + benefitFieldRemoteId = big.NewInt(1 << 1) + benefitFieldCreatedAt = big.NewInt(1 << 2) + benefitFieldModifiedAt = big.NewInt(1 << 3) + benefitFieldEmployee = big.NewInt(1 << 4) + benefitFieldProviderName = big.NewInt(1 << 5) + benefitFieldBenefitPlanType = big.NewInt(1 << 6) + benefitFieldEmployeeContribution = big.NewInt(1 << 7) + benefitFieldCompanyContribution = big.NewInt(1 << 8) + benefitFieldStartDate = big.NewInt(1 << 9) + benefitFieldEndDate = big.NewInt(1 << 10) + benefitFieldRemoteWasDeleted = big.NewInt(1 << 11) + benefitFieldEmployerBenefit = big.NewInt(1 << 12) + benefitFieldFieldMappings = big.NewInt(1 << 13) + benefitFieldRemoteData = big.NewInt(1 << 14) +) + type Benefit struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -80,6 +245,9 @@ type Benefit struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -193,6 +361,118 @@ func (b *Benefit) GetExtraProperties() map[string]interface{} { return b.extraProperties } +func (b *Benefit) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetId(id *string) { + b.Id = id + b.require(benefitFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetRemoteId(remoteId *string) { + b.RemoteId = remoteId + b.require(benefitFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetCreatedAt(createdAt *time.Time) { + b.CreatedAt = createdAt + b.require(benefitFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetModifiedAt(modifiedAt *time.Time) { + b.ModifiedAt = modifiedAt + b.require(benefitFieldModifiedAt) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetEmployee(employee *BenefitEmployee) { + b.Employee = employee + b.require(benefitFieldEmployee) +} + +// SetProviderName sets the ProviderName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetProviderName(providerName *string) { + b.ProviderName = providerName + b.require(benefitFieldProviderName) +} + +// SetBenefitPlanType sets the BenefitPlanType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetBenefitPlanType(benefitPlanType *string) { + b.BenefitPlanType = benefitPlanType + b.require(benefitFieldBenefitPlanType) +} + +// SetEmployeeContribution sets the EmployeeContribution field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetEmployeeContribution(employeeContribution *float64) { + b.EmployeeContribution = employeeContribution + b.require(benefitFieldEmployeeContribution) +} + +// SetCompanyContribution sets the CompanyContribution field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetCompanyContribution(companyContribution *float64) { + b.CompanyContribution = companyContribution + b.require(benefitFieldCompanyContribution) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetStartDate(startDate *time.Time) { + b.StartDate = startDate + b.require(benefitFieldStartDate) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetEndDate(endDate *time.Time) { + b.EndDate = endDate + b.require(benefitFieldEndDate) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetRemoteWasDeleted(remoteWasDeleted *bool) { + b.RemoteWasDeleted = remoteWasDeleted + b.require(benefitFieldRemoteWasDeleted) +} + +// SetEmployerBenefit sets the EmployerBenefit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetEmployerBenefit(employerBenefit *string) { + b.EmployerBenefit = employerBenefit + b.require(benefitFieldEmployerBenefit) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetFieldMappings(fieldMappings map[string]interface{}) { + b.FieldMappings = fieldMappings + b.require(benefitFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *Benefit) SetRemoteData(remoteData []*RemoteData) { + b.RemoteData = remoteData + b.require(benefitFieldRemoteData) +} + func (b *Benefit) UnmarshalJSON(data []byte) error { type embed Benefit var unmarshaler = struct { @@ -236,7 +516,8 @@ func (b *Benefit) MarshalJSON() ([]byte, error) { StartDate: internal.NewOptionalDateTime(b.StartDate), EndDate: internal.NewOptionalDateTime(b.EndDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) } func (b *Benefit) String() string { @@ -314,11 +595,20 @@ func (b *BenefitEmployee) Accept(visitor BenefitEmployeeVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", b) } +var ( + paginatedBenefitListFieldNext = big.NewInt(1 << 0) + paginatedBenefitListFieldPrevious = big.NewInt(1 << 1) + paginatedBenefitListFieldResults = big.NewInt(1 << 2) +) + type PaginatedBenefitList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Benefit `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -348,6 +638,34 @@ func (p *PaginatedBenefitList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedBenefitList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBenefitList) SetNext(next *string) { + p.Next = next + p.require(paginatedBenefitListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBenefitList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedBenefitListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedBenefitList) SetResults(results []*Benefit) { + p.Results = results + p.require(paginatedBenefitListFieldResults) +} + func (p *PaginatedBenefitList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedBenefitList var value unmarshaler @@ -364,6 +682,17 @@ func (p *PaginatedBenefitList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedBenefitList) MarshalJSON() ([]byte, error) { + type embed PaginatedBenefitList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedBenefitList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/benefits/client.go b/hris/benefits/client.go index 2e3224e..f010e87 100644 --- a/hris/benefits/client.go +++ b/hris/benefits/client.go @@ -4,7 +4,6 @@ package benefits import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.BenefitsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.Benefit], error) { +) (*core.Page[*string, *hris.Benefit], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedBenefitList) *internal.PageResponse[*string, *hris.Benefit] { + readPageResponse := func(response *hris.PaginatedBenefitList) *core.PageResponse[*string, *hris.Benefit] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.Benefit]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.Benefit]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.BenefitsRetrieveRequest, opts ...option.RequestOption, ) (*hris.Benefit, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/benefits/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.Benefit - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/benefits/hris_benefits_test/hris_benefits_test.go b/hris/benefits/hris_benefits_test/hris_benefits_test.go new file mode 100644 index 0000000..a3c452b --- /dev/null +++ b/hris/benefits/hris_benefits_test/hris_benefits_test.go @@ -0,0 +1,153 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_benefits_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisBenefitsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.BenefitsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Hris.Benefits.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/benefits", map[string]string{"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"}, 1) +} + +func TestHrisBenefitsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.BenefitsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.Benefits.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/benefits/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/hris/benefits/raw_client.go b/hris/benefits/raw_client.go new file mode 100644 index 0000000..5e946cc --- /dev/null +++ b/hris/benefits/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package benefits + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.BenefitsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.Benefit], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/benefits/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.Benefit + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.Benefit]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/client/client.go b/hris/client/client.go index 080a391..4a4929c 100644 --- a/hris/client/client.go +++ b/hris/client/client.go @@ -38,15 +38,9 @@ import ( timesheetentries "github.com/merge-api/merge-go-client/v2/hris/timesheetentries" webhookreceivers "github.com/merge-api/merge-go-client/v2/hris/webhookreceivers" internal "github.com/merge-api/merge-go-client/v2/internal" - option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { - baseURL string - caller *internal.Caller - header http.Header - AccountDetails *accountdetails.Client AccountToken *accounttoken.Client AsyncPassthrough *asyncpassthrough.Client @@ -80,51 +74,54 @@ type Client struct { TimeOffBalances *timeoffbalances.Client TimesheetEntries *timesheetentries.Client WebhookReceivers *webhookreceivers.Client + + options *core.RequestOptions + baseURL string + caller *internal.Caller } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + AccountDetails: accountdetails.NewClient(options), + AccountToken: accounttoken.NewClient(options), + AsyncPassthrough: asyncpassthrough.NewClient(options), + AuditTrail: audittrail.NewClient(options), + AvailableActions: availableactions.NewClient(options), + BankInfo: bankinfo.NewClient(options), + Benefits: benefits.NewClient(options), + Companies: companies.NewClient(options), + Scopes: scopes.NewClient(options), + DeleteAccount: deleteaccount.NewClient(options), + Dependents: dependents.NewClient(options), + EmployeePayrollRuns: employeepayrollruns.NewClient(options), + Employees: employees.NewClient(options), + EmployerBenefits: employerbenefits.NewClient(options), + Employments: employments.NewClient(options), + FieldMapping: fieldmapping.NewClient(options), + GenerateKey: generatekey.NewClient(options), + Groups: groups.NewClient(options), + Issues: issues.NewClient(options), + LinkToken: linktoken.NewClient(options), + LinkedAccounts: linkedaccounts.NewClient(options), + Locations: locations.NewClient(options), + Passthrough: passthrough.NewClient(options), + PayGroups: paygroups.NewClient(options), + PayrollRuns: payrollruns.NewClient(options), + RegenerateKey: regeneratekey.NewClient(options), + SyncStatus: syncstatus.NewClient(options), + ForceResync: forceresync.NewClient(options), + Teams: teams.NewClient(options), + TimeOff: timeoff.NewClient(options), + TimeOffBalances: timeoffbalances.NewClient(options), + TimesheetEntries: timesheetentries.NewClient(options), + WebhookReceivers: webhookreceivers.NewClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), - AccountDetails: accountdetails.NewClient(opts...), - AccountToken: accounttoken.NewClient(opts...), - AsyncPassthrough: asyncpassthrough.NewClient(opts...), - AuditTrail: audittrail.NewClient(opts...), - AvailableActions: availableactions.NewClient(opts...), - BankInfo: bankinfo.NewClient(opts...), - Benefits: benefits.NewClient(opts...), - Companies: companies.NewClient(opts...), - Scopes: scopes.NewClient(opts...), - DeleteAccount: deleteaccount.NewClient(opts...), - Dependents: dependents.NewClient(opts...), - EmployeePayrollRuns: employeepayrollruns.NewClient(opts...), - Employees: employees.NewClient(opts...), - EmployerBenefits: employerbenefits.NewClient(opts...), - Employments: employments.NewClient(opts...), - FieldMapping: fieldmapping.NewClient(opts...), - GenerateKey: generatekey.NewClient(opts...), - Groups: groups.NewClient(opts...), - Issues: issues.NewClient(opts...), - LinkToken: linktoken.NewClient(opts...), - LinkedAccounts: linkedaccounts.NewClient(opts...), - Locations: locations.NewClient(opts...), - Passthrough: passthrough.NewClient(opts...), - PayGroups: paygroups.NewClient(opts...), - PayrollRuns: payrollruns.NewClient(opts...), - RegenerateKey: regeneratekey.NewClient(opts...), - SyncStatus: syncstatus.NewClient(opts...), - ForceResync: forceresync.NewClient(opts...), - Teams: teams.NewClient(opts...), - TimeOff: timeoff.NewClient(opts...), - TimeOffBalances: timeoffbalances.NewClient(opts...), - TimesheetEntries: timesheetentries.NewClient(opts...), - WebhookReceivers: webhookreceivers.NewClient(opts...), } } diff --git a/hris/companies.go b/hris/companies.go index 1b6a482..553840f 100644 --- a/hris/companies.go +++ b/hris/companies.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + companiesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + companiesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + companiesListRequestFieldCursor = big.NewInt(1 << 2) + companiesListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + companiesListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + companiesListRequestFieldIncludeShellData = big.NewInt(1 << 5) + companiesListRequestFieldModifiedAfter = big.NewInt(1 << 6) + companiesListRequestFieldModifiedBefore = big.NewInt(1 << 7) + companiesListRequestFieldPageSize = big.NewInt(1 << 8) + companiesListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type CompaniesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,20 +44,138 @@ type CompaniesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CompaniesListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(companiesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(companiesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(companiesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(companiesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(companiesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(companiesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(companiesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(companiesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(companiesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(companiesListRequestFieldRemoteId) } +var ( + companiesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + companiesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type CompaniesRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (c *CompaniesRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(companiesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CompaniesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(companiesRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedCompanyListFieldNext = big.NewInt(1 << 0) + paginatedCompanyListFieldPrevious = big.NewInt(1 << 1) + paginatedCompanyListFieldResults = big.NewInt(1 << 2) +) + type PaginatedCompanyList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Company `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -73,6 +205,34 @@ func (p *PaginatedCompanyList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedCompanyList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCompanyList) SetNext(next *string) { + p.Next = next + p.require(paginatedCompanyListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCompanyList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedCompanyListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCompanyList) SetResults(results []*Company) { + p.Results = results + p.require(paginatedCompanyListFieldResults) +} + func (p *PaginatedCompanyList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedCompanyList var value unmarshaler @@ -89,6 +249,17 @@ func (p *PaginatedCompanyList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedCompanyList) MarshalJSON() ([]byte, error) { + type embed PaginatedCompanyList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedCompanyList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/companies/client.go b/hris/companies/client.go index 5d455db..a9ba853 100644 --- a/hris/companies/client.go +++ b/hris/companies/client.go @@ -4,7 +4,6 @@ package companies import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.CompaniesListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.Company], error) { +) (*core.Page[*string, *hris.Company], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedCompanyList) *internal.PageResponse[*string, *hris.Company] { + readPageResponse := func(response *hris.PaginatedCompanyList) *core.PageResponse[*string, *hris.Company] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.Company]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.Company]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.CompaniesRetrieveRequest, opts ...option.RequestOption, ) (*hris.Company, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/companies/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.Company - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/companies/hris_companies_test/hris_companies_test.go b/hris/companies/hris_companies_test/hris_companies_test.go new file mode 100644 index 0000000..85172f6 --- /dev/null +++ b/hris/companies/hris_companies_test/hris_companies_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_companies_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisCompaniesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.CompaniesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Hris.Companies.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/companies", map[string]string{"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"}, 1) +} + +func TestHrisCompaniesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.CompaniesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.Companies.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/companies/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/hris/companies/raw_client.go b/hris/companies/raw_client.go new file mode 100644 index 0000000..6aa2274 --- /dev/null +++ b/hris/companies/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package companies + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.CompaniesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.Company], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/companies/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.Company + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.Company]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/deleteaccount/client.go b/hris/deleteaccount/client.go index 22f131b..9f2d80e 100644 --- a/hris/deleteaccount/client.go +++ b/hris/deleteaccount/client.go @@ -7,26 +7,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -35,30 +36,11 @@ func (c *Client) Delete( ctx context.Context, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/delete-account" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - if err := c.caller.Call( + _, err := c.WithRawResponse.Delete( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - }, - ); err != nil { + opts..., + ) + if err != nil { return err } return nil diff --git a/hris/deleteaccount/hris_delete_account_test/hris_delete_account_test.go b/hris/deleteaccount/hris_delete_account_test/hris_delete_account_test.go new file mode 100644 index 0000000..63107d4 --- /dev/null +++ b/hris/deleteaccount/hris_delete_account_test/hris_delete_account_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_delete_account_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisDeleteAccountDeleteWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + invocationErr := client.Hris.DeleteAccount.Delete( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/delete-account", nil, 1) +} diff --git a/hris/deleteaccount/raw_client.go b/hris/deleteaccount/raw_client.go new file mode 100644 index 0000000..dc51724 --- /dev/null +++ b/hris/deleteaccount/raw_client.go @@ -0,0 +1,67 @@ +// Code generated by Fern. DO NOT EDIT. + +package deleteaccount + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Delete( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/delete-account" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} diff --git a/hris/dependents.go b/hris/dependents.go index d32b9f6..95b4831 100644 --- a/hris/dependents.go +++ b/hris/dependents.go @@ -6,9 +6,24 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + dependentsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + dependentsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + dependentsListRequestFieldCursor = big.NewInt(1 << 2) + dependentsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + dependentsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + dependentsListRequestFieldIncludeSensitiveFields = big.NewInt(1 << 5) + dependentsListRequestFieldIncludeShellData = big.NewInt(1 << 6) + dependentsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + dependentsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + dependentsListRequestFieldPageSize = big.NewInt(1 << 9) + dependentsListRequestFieldRemoteId = big.NewInt(1 << 10) +) + type DependentsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -32,8 +47,101 @@ type DependentsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (d *DependentsListRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetCreatedAfter(createdAfter *time.Time) { + d.CreatedAfter = createdAfter + d.require(dependentsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetCreatedBefore(createdBefore *time.Time) { + d.CreatedBefore = createdBefore + d.require(dependentsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetCursor(cursor *string) { + d.Cursor = cursor + d.require(dependentsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + d.IncludeDeletedData = includeDeletedData + d.require(dependentsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + d.IncludeRemoteData = includeRemoteData + d.require(dependentsListRequestFieldIncludeRemoteData) +} + +// SetIncludeSensitiveFields sets the IncludeSensitiveFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetIncludeSensitiveFields(includeSensitiveFields *bool) { + d.IncludeSensitiveFields = includeSensitiveFields + d.require(dependentsListRequestFieldIncludeSensitiveFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetIncludeShellData(includeShellData *bool) { + d.IncludeShellData = includeShellData + d.require(dependentsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + d.ModifiedAfter = modifiedAfter + d.require(dependentsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + d.ModifiedBefore = modifiedBefore + d.require(dependentsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetPageSize(pageSize *int) { + d.PageSize = pageSize + d.require(dependentsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsListRequest) SetRemoteId(remoteId *string) { + d.RemoteId = remoteId + d.require(dependentsListRequestFieldRemoteId) } +var ( + dependentsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + dependentsRetrieveRequestFieldIncludeSensitiveFields = big.NewInt(1 << 1) + dependentsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type DependentsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -41,6 +149,37 @@ type DependentsRetrieveRequest struct { IncludeSensitiveFields *bool `json:"-" url:"include_sensitive_fields,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (d *DependentsRetrieveRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + d.IncludeRemoteData = includeRemoteData + d.require(dependentsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeSensitiveFields sets the IncludeSensitiveFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsRetrieveRequest) SetIncludeSensitiveFields(includeSensitiveFields *bool) { + d.IncludeSensitiveFields = includeSensitiveFields + d.require(dependentsRetrieveRequestFieldIncludeSensitiveFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DependentsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + d.IncludeShellData = includeShellData + d.require(dependentsRetrieveRequestFieldIncludeShellData) } // # The Dependent Object @@ -49,6 +188,27 @@ type DependentsRetrieveRequest struct { // // ### Usage Example // Fetch from the `LIST Dependents` endpoint and filter by `ID` to show all dependents. +var ( + dependentFieldId = big.NewInt(1 << 0) + dependentFieldRemoteId = big.NewInt(1 << 1) + dependentFieldCreatedAt = big.NewInt(1 << 2) + dependentFieldModifiedAt = big.NewInt(1 << 3) + dependentFieldFirstName = big.NewInt(1 << 4) + dependentFieldMiddleName = big.NewInt(1 << 5) + dependentFieldLastName = big.NewInt(1 << 6) + dependentFieldRelationship = big.NewInt(1 << 7) + dependentFieldEmployee = big.NewInt(1 << 8) + dependentFieldDateOfBirth = big.NewInt(1 << 9) + dependentFieldGender = big.NewInt(1 << 10) + dependentFieldPhoneNumber = big.NewInt(1 << 11) + dependentFieldHomeLocation = big.NewInt(1 << 12) + dependentFieldIsStudent = big.NewInt(1 << 13) + dependentFieldSsn = big.NewInt(1 << 14) + dependentFieldRemoteWasDeleted = big.NewInt(1 << 15) + dependentFieldFieldMappings = big.NewInt(1 << 16) + dependentFieldRemoteData = big.NewInt(1 << 17) +) + type Dependent struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -94,6 +254,9 @@ type Dependent struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -228,6 +391,139 @@ func (d *Dependent) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *Dependent) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetId(id *string) { + d.Id = id + d.require(dependentFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetRemoteId(remoteId *string) { + d.RemoteId = remoteId + d.require(dependentFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetCreatedAt(createdAt *time.Time) { + d.CreatedAt = createdAt + d.require(dependentFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetModifiedAt(modifiedAt *time.Time) { + d.ModifiedAt = modifiedAt + d.require(dependentFieldModifiedAt) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetFirstName(firstName *string) { + d.FirstName = firstName + d.require(dependentFieldFirstName) +} + +// SetMiddleName sets the MiddleName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetMiddleName(middleName *string) { + d.MiddleName = middleName + d.require(dependentFieldMiddleName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetLastName(lastName *string) { + d.LastName = lastName + d.require(dependentFieldLastName) +} + +// SetRelationship sets the Relationship field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetRelationship(relationship *DependentRelationship) { + d.Relationship = relationship + d.require(dependentFieldRelationship) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetEmployee(employee *string) { + d.Employee = employee + d.require(dependentFieldEmployee) +} + +// SetDateOfBirth sets the DateOfBirth field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetDateOfBirth(dateOfBirth *time.Time) { + d.DateOfBirth = dateOfBirth + d.require(dependentFieldDateOfBirth) +} + +// SetGender sets the Gender field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetGender(gender *DependentGender) { + d.Gender = gender + d.require(dependentFieldGender) +} + +// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetPhoneNumber(phoneNumber *string) { + d.PhoneNumber = phoneNumber + d.require(dependentFieldPhoneNumber) +} + +// SetHomeLocation sets the HomeLocation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetHomeLocation(homeLocation *string) { + d.HomeLocation = homeLocation + d.require(dependentFieldHomeLocation) +} + +// SetIsStudent sets the IsStudent field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetIsStudent(isStudent *bool) { + d.IsStudent = isStudent + d.require(dependentFieldIsStudent) +} + +// SetSsn sets the Ssn field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetSsn(ssn *string) { + d.Ssn = ssn + d.require(dependentFieldSsn) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetRemoteWasDeleted(remoteWasDeleted *bool) { + d.RemoteWasDeleted = remoteWasDeleted + d.require(dependentFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetFieldMappings(fieldMappings map[string]interface{}) { + d.FieldMappings = fieldMappings + d.require(dependentFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Dependent) SetRemoteData(remoteData []*RemoteData) { + d.RemoteData = remoteData + d.require(dependentFieldRemoteData) +} + func (d *Dependent) UnmarshalJSON(data []byte) error { type embed Dependent var unmarshaler = struct { @@ -267,7 +563,8 @@ func (d *Dependent) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(d.ModifiedAt), DateOfBirth: internal.NewOptionalDateTime(d.DateOfBirth), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) } func (d *Dependent) String() string { @@ -418,11 +715,20 @@ func (d *DependentRelationship) Accept(visitor DependentRelationshipVisitor) err return fmt.Errorf("type %T does not include a non-empty union type", d) } +var ( + paginatedDependentListFieldNext = big.NewInt(1 << 0) + paginatedDependentListFieldPrevious = big.NewInt(1 << 1) + paginatedDependentListFieldResults = big.NewInt(1 << 2) +) + type PaginatedDependentList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Dependent `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -452,6 +758,34 @@ func (p *PaginatedDependentList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedDependentList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDependentList) SetNext(next *string) { + p.Next = next + p.require(paginatedDependentListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDependentList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedDependentListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedDependentList) SetResults(results []*Dependent) { + p.Results = results + p.require(paginatedDependentListFieldResults) +} + func (p *PaginatedDependentList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedDependentList var value unmarshaler @@ -468,6 +802,17 @@ func (p *PaginatedDependentList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedDependentList) MarshalJSON() ([]byte, error) { + type embed PaginatedDependentList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedDependentList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/dependents/client.go b/hris/dependents/client.go index ffcfed6..cf957a5 100644 --- a/hris/dependents/client.go +++ b/hris/dependents/client.go @@ -4,7 +4,6 @@ package dependents import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.DependentsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.Dependent], error) { +) (*core.Page[*string, *hris.Dependent], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedDependentList) *internal.PageResponse[*string, *hris.Dependent] { + readPageResponse := func(response *hris.PaginatedDependentList) *core.PageResponse[*string, *hris.Dependent] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.Dependent]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.Dependent]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.DependentsRetrieveRequest, opts ...option.RequestOption, ) (*hris.Dependent, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/dependents/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.Dependent - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/dependents/hris_dependents_test/hris_dependents_test.go b/hris/dependents/hris_dependents_test/hris_dependents_test.go new file mode 100644 index 0000000..546ece1 --- /dev/null +++ b/hris/dependents/hris_dependents_test/hris_dependents_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_dependents_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisDependentsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.DependentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeSensitiveFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Hris.Dependents.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/dependents", map[string]string{"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"}, 1) +} + +func TestHrisDependentsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.DependentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeSensitiveFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.Dependents.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/dependents/id", map[string]string{"include_remote_data": "true", "include_sensitive_fields": "true", "include_shell_data": "true"}, 1) +} diff --git a/hris/dependents/raw_client.go b/hris/dependents/raw_client.go new file mode 100644 index 0000000..33b922b --- /dev/null +++ b/hris/dependents/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package dependents + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.DependentsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.Dependent], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/dependents/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.Dependent + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.Dependent]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/employee_payroll_runs.go b/hris/employee_payroll_runs.go index 91045e0..7a27c41 100644 --- a/hris/employee_payroll_runs.go +++ b/hris/employee_payroll_runs.go @@ -6,9 +6,30 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + employeePayrollRunsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + employeePayrollRunsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + employeePayrollRunsListRequestFieldCursor = big.NewInt(1 << 2) + employeePayrollRunsListRequestFieldEmployeeId = big.NewInt(1 << 3) + employeePayrollRunsListRequestFieldEndedAfter = big.NewInt(1 << 4) + employeePayrollRunsListRequestFieldEndedBefore = big.NewInt(1 << 5) + employeePayrollRunsListRequestFieldExpand = big.NewInt(1 << 6) + employeePayrollRunsListRequestFieldIncludeDeletedData = big.NewInt(1 << 7) + employeePayrollRunsListRequestFieldIncludeRemoteData = big.NewInt(1 << 8) + employeePayrollRunsListRequestFieldIncludeShellData = big.NewInt(1 << 9) + employeePayrollRunsListRequestFieldModifiedAfter = big.NewInt(1 << 10) + employeePayrollRunsListRequestFieldModifiedBefore = big.NewInt(1 << 11) + employeePayrollRunsListRequestFieldPageSize = big.NewInt(1 << 12) + employeePayrollRunsListRequestFieldPayrollRunId = big.NewInt(1 << 13) + employeePayrollRunsListRequestFieldRemoteId = big.NewInt(1 << 14) + employeePayrollRunsListRequestFieldStartedAfter = big.NewInt(1 << 15) + employeePayrollRunsListRequestFieldStartedBefore = big.NewInt(1 << 16) +) + type EmployeePayrollRunsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -44,8 +65,143 @@ type EmployeePayrollRunsListRequest struct { StartedAfter *time.Time `json:"-" url:"started_after,omitempty"` // If provided, will only return employee payroll runs started before this datetime. StartedBefore *time.Time `json:"-" url:"started_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmployeePayrollRunsListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetCreatedAfter(createdAfter *time.Time) { + e.CreatedAfter = createdAfter + e.require(employeePayrollRunsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetCreatedBefore(createdBefore *time.Time) { + e.CreatedBefore = createdBefore + e.require(employeePayrollRunsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(employeePayrollRunsListRequestFieldCursor) +} + +// SetEmployeeId sets the EmployeeId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetEmployeeId(employeeId *string) { + e.EmployeeId = employeeId + e.require(employeePayrollRunsListRequestFieldEmployeeId) +} + +// SetEndedAfter sets the EndedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetEndedAfter(endedAfter *time.Time) { + e.EndedAfter = endedAfter + e.require(employeePayrollRunsListRequestFieldEndedAfter) +} + +// SetEndedBefore sets the EndedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetEndedBefore(endedBefore *time.Time) { + e.EndedBefore = endedBefore + e.require(employeePayrollRunsListRequestFieldEndedBefore) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetExpand(expand []*EmployeePayrollRunsListRequestExpandItem) { + e.Expand = expand + e.require(employeePayrollRunsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(employeePayrollRunsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employeePayrollRunsListRequestFieldIncludeRemoteData) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employeePayrollRunsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + e.ModifiedAfter = modifiedAfter + e.require(employeePayrollRunsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + e.ModifiedBefore = modifiedBefore + e.require(employeePayrollRunsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(employeePayrollRunsListRequestFieldPageSize) +} + +// SetPayrollRunId sets the PayrollRunId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetPayrollRunId(payrollRunId *string) { + e.PayrollRunId = payrollRunId + e.require(employeePayrollRunsListRequestFieldPayrollRunId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(employeePayrollRunsListRequestFieldRemoteId) +} + +// SetStartedAfter sets the StartedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetStartedAfter(startedAfter *time.Time) { + e.StartedAfter = startedAfter + e.require(employeePayrollRunsListRequestFieldStartedAfter) +} + +// SetStartedBefore sets the StartedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsListRequest) SetStartedBefore(startedBefore *time.Time) { + e.StartedBefore = startedBefore + e.require(employeePayrollRunsListRequestFieldStartedBefore) +} + +var ( + employeePayrollRunsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + employeePayrollRunsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + employeePayrollRunsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type EmployeePayrollRunsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*EmployeePayrollRunsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -53,6 +209,37 @@ type EmployeePayrollRunsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmployeePayrollRunsRetrieveRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsRetrieveRequest) SetExpand(expand []*EmployeePayrollRunsRetrieveRequestExpandItem) { + e.Expand = expand + e.require(employeePayrollRunsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employeePayrollRunsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRunsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employeePayrollRunsRetrieveRequestFieldIncludeShellData) } type EmployeePayrollRunsListRequestExpandItem string @@ -105,6 +292,20 @@ func (e EmployeePayrollRunsRetrieveRequestExpandItem) Ptr() *EmployeePayrollRuns // // ### Usage Example // Fetch from the `LIST Deductions` endpoint and filter by `ID` to show all deductions. +var ( + deductionFieldId = big.NewInt(1 << 0) + deductionFieldRemoteId = big.NewInt(1 << 1) + deductionFieldCreatedAt = big.NewInt(1 << 2) + deductionFieldModifiedAt = big.NewInt(1 << 3) + deductionFieldEmployeePayrollRun = big.NewInt(1 << 4) + deductionFieldName = big.NewInt(1 << 5) + deductionFieldEmployeeDeduction = big.NewInt(1 << 6) + deductionFieldCompanyDeduction = big.NewInt(1 << 7) + deductionFieldRemoteWasDeleted = big.NewInt(1 << 8) + deductionFieldFieldMappings = big.NewInt(1 << 9) + deductionFieldRemoteData = big.NewInt(1 << 10) +) + type Deduction struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -125,6 +326,9 @@ type Deduction struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -210,6 +414,90 @@ func (d *Deduction) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *Deduction) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetId(id *string) { + d.Id = id + d.require(deductionFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetRemoteId(remoteId *string) { + d.RemoteId = remoteId + d.require(deductionFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetCreatedAt(createdAt *time.Time) { + d.CreatedAt = createdAt + d.require(deductionFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetModifiedAt(modifiedAt *time.Time) { + d.ModifiedAt = modifiedAt + d.require(deductionFieldModifiedAt) +} + +// SetEmployeePayrollRun sets the EmployeePayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetEmployeePayrollRun(employeePayrollRun *string) { + d.EmployeePayrollRun = employeePayrollRun + d.require(deductionFieldEmployeePayrollRun) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetName(name *string) { + d.Name = name + d.require(deductionFieldName) +} + +// SetEmployeeDeduction sets the EmployeeDeduction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetEmployeeDeduction(employeeDeduction *float64) { + d.EmployeeDeduction = employeeDeduction + d.require(deductionFieldEmployeeDeduction) +} + +// SetCompanyDeduction sets the CompanyDeduction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetCompanyDeduction(companyDeduction *float64) { + d.CompanyDeduction = companyDeduction + d.require(deductionFieldCompanyDeduction) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetRemoteWasDeleted(remoteWasDeleted *bool) { + d.RemoteWasDeleted = remoteWasDeleted + d.require(deductionFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetFieldMappings(fieldMappings map[string]interface{}) { + d.FieldMappings = fieldMappings + d.require(deductionFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *Deduction) SetRemoteData(remoteData []*RemoteData) { + d.RemoteData = remoteData + d.require(deductionFieldRemoteData) +} + func (d *Deduction) UnmarshalJSON(data []byte) error { type embed Deduction var unmarshaler = struct { @@ -245,7 +533,8 @@ func (d *Deduction) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(d.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(d.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) } func (d *Deduction) String() string { @@ -266,6 +555,19 @@ func (d *Deduction) String() string { // // ### Usage Example // Fetch from the `LIST Earnings` endpoint and filter by `ID` to show all earnings. +var ( + earningFieldId = big.NewInt(1 << 0) + earningFieldRemoteId = big.NewInt(1 << 1) + earningFieldCreatedAt = big.NewInt(1 << 2) + earningFieldModifiedAt = big.NewInt(1 << 3) + earningFieldEmployeePayrollRun = big.NewInt(1 << 4) + earningFieldAmount = big.NewInt(1 << 5) + earningFieldType = big.NewInt(1 << 6) + earningFieldRemoteWasDeleted = big.NewInt(1 << 7) + earningFieldFieldMappings = big.NewInt(1 << 8) + earningFieldRemoteData = big.NewInt(1 << 9) +) + type Earning struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -289,6 +591,9 @@ type Earning struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -367,6 +672,83 @@ func (e *Earning) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *Earning) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetId(id *string) { + e.Id = id + e.require(earningFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(earningFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(earningFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(earningFieldModifiedAt) +} + +// SetEmployeePayrollRun sets the EmployeePayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetEmployeePayrollRun(employeePayrollRun *string) { + e.EmployeePayrollRun = employeePayrollRun + e.require(earningFieldEmployeePayrollRun) +} + +// SetAmount sets the Amount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetAmount(amount *float64) { + e.Amount = amount + e.require(earningFieldAmount) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetType(type_ *EarningType) { + e.Type = type_ + e.require(earningFieldType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(earningFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetFieldMappings(fieldMappings map[string]interface{}) { + e.FieldMappings = fieldMappings + e.require(earningFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Earning) SetRemoteData(remoteData []*RemoteData) { + e.RemoteData = remoteData + e.require(earningFieldRemoteData) +} + func (e *Earning) UnmarshalJSON(data []byte) error { type embed Earning var unmarshaler = struct { @@ -402,7 +784,8 @@ func (e *Earning) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(e.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(e.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *Earning) String() string { @@ -523,6 +906,26 @@ func (e EarningTypeEnum) Ptr() *EarningTypeEnum { // // ### Usage Example // Fetch from the `LIST EmployeePayrollRun` endpoint and filter by `ID` to show all employee payroll runs. +var ( + employeePayrollRunFieldId = big.NewInt(1 << 0) + employeePayrollRunFieldRemoteId = big.NewInt(1 << 1) + employeePayrollRunFieldCreatedAt = big.NewInt(1 << 2) + employeePayrollRunFieldModifiedAt = big.NewInt(1 << 3) + employeePayrollRunFieldEmployee = big.NewInt(1 << 4) + employeePayrollRunFieldPayrollRun = big.NewInt(1 << 5) + employeePayrollRunFieldGrossPay = big.NewInt(1 << 6) + employeePayrollRunFieldNetPay = big.NewInt(1 << 7) + employeePayrollRunFieldStartDate = big.NewInt(1 << 8) + employeePayrollRunFieldEndDate = big.NewInt(1 << 9) + employeePayrollRunFieldCheckDate = big.NewInt(1 << 10) + employeePayrollRunFieldEarnings = big.NewInt(1 << 11) + employeePayrollRunFieldDeductions = big.NewInt(1 << 12) + employeePayrollRunFieldTaxes = big.NewInt(1 << 13) + employeePayrollRunFieldRemoteWasDeleted = big.NewInt(1 << 14) + employeePayrollRunFieldFieldMappings = big.NewInt(1 << 15) + employeePayrollRunFieldRemoteData = big.NewInt(1 << 16) +) + type EmployeePayrollRun struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -553,6 +956,9 @@ type EmployeePayrollRun struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -680,6 +1086,132 @@ func (e *EmployeePayrollRun) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EmployeePayrollRun) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetId(id *string) { + e.Id = id + e.require(employeePayrollRunFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(employeePayrollRunFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(employeePayrollRunFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(employeePayrollRunFieldModifiedAt) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetEmployee(employee *EmployeePayrollRunEmployee) { + e.Employee = employee + e.require(employeePayrollRunFieldEmployee) +} + +// SetPayrollRun sets the PayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetPayrollRun(payrollRun *EmployeePayrollRunPayrollRun) { + e.PayrollRun = payrollRun + e.require(employeePayrollRunFieldPayrollRun) +} + +// SetGrossPay sets the GrossPay field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetGrossPay(grossPay *float64) { + e.GrossPay = grossPay + e.require(employeePayrollRunFieldGrossPay) +} + +// SetNetPay sets the NetPay field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetNetPay(netPay *float64) { + e.NetPay = netPay + e.require(employeePayrollRunFieldNetPay) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetStartDate(startDate *time.Time) { + e.StartDate = startDate + e.require(employeePayrollRunFieldStartDate) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetEndDate(endDate *time.Time) { + e.EndDate = endDate + e.require(employeePayrollRunFieldEndDate) +} + +// SetCheckDate sets the CheckDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetCheckDate(checkDate *time.Time) { + e.CheckDate = checkDate + e.require(employeePayrollRunFieldCheckDate) +} + +// SetEarnings sets the Earnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetEarnings(earnings []*Earning) { + e.Earnings = earnings + e.require(employeePayrollRunFieldEarnings) +} + +// SetDeductions sets the Deductions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetDeductions(deductions []*Deduction) { + e.Deductions = deductions + e.require(employeePayrollRunFieldDeductions) +} + +// SetTaxes sets the Taxes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetTaxes(taxes []*Tax) { + e.Taxes = taxes + e.require(employeePayrollRunFieldTaxes) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(employeePayrollRunFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetFieldMappings(fieldMappings map[string]interface{}) { + e.FieldMappings = fieldMappings + e.require(employeePayrollRunFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeePayrollRun) SetRemoteData(remoteData []*RemoteData) { + e.RemoteData = remoteData + e.require(employeePayrollRunFieldRemoteData) +} + func (e *EmployeePayrollRun) UnmarshalJSON(data []byte) error { type embed EmployeePayrollRun var unmarshaler = struct { @@ -727,7 +1259,8 @@ func (e *EmployeePayrollRun) MarshalJSON() ([]byte, error) { EndDate: internal.NewOptionalDateTime(e.EndDate), CheckDate: internal.NewOptionalDateTime(e.CheckDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *EmployeePayrollRun) String() string { @@ -868,11 +1401,20 @@ func (e *EmployeePayrollRunPayrollRun) Accept(visitor EmployeePayrollRunPayrollR return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + paginatedEmployeePayrollRunListFieldNext = big.NewInt(1 << 0) + paginatedEmployeePayrollRunListFieldPrevious = big.NewInt(1 << 1) + paginatedEmployeePayrollRunListFieldResults = big.NewInt(1 << 2) +) + type PaginatedEmployeePayrollRunList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*EmployeePayrollRun `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -902,6 +1444,34 @@ func (p *PaginatedEmployeePayrollRunList) GetExtraProperties() map[string]interf return p.extraProperties } +func (p *PaginatedEmployeePayrollRunList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployeePayrollRunList) SetNext(next *string) { + p.Next = next + p.require(paginatedEmployeePayrollRunListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployeePayrollRunList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedEmployeePayrollRunListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployeePayrollRunList) SetResults(results []*EmployeePayrollRun) { + p.Results = results + p.require(paginatedEmployeePayrollRunListFieldResults) +} + func (p *PaginatedEmployeePayrollRunList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedEmployeePayrollRunList var value unmarshaler @@ -918,6 +1488,17 @@ func (p *PaginatedEmployeePayrollRunList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedEmployeePayrollRunList) MarshalJSON() ([]byte, error) { + type embed PaginatedEmployeePayrollRunList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedEmployeePayrollRunList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -936,6 +1517,20 @@ func (p *PaginatedEmployeePayrollRunList) String() string { // // ### Usage Example // Fetch from the `LIST Taxes` endpoint and filter by `ID` to show all taxes. +var ( + taxFieldId = big.NewInt(1 << 0) + taxFieldRemoteId = big.NewInt(1 << 1) + taxFieldCreatedAt = big.NewInt(1 << 2) + taxFieldModifiedAt = big.NewInt(1 << 3) + taxFieldEmployeePayrollRun = big.NewInt(1 << 4) + taxFieldName = big.NewInt(1 << 5) + taxFieldAmount = big.NewInt(1 << 6) + taxFieldEmployerTax = big.NewInt(1 << 7) + taxFieldRemoteWasDeleted = big.NewInt(1 << 8) + taxFieldFieldMappings = big.NewInt(1 << 9) + taxFieldRemoteData = big.NewInt(1 << 10) +) + type Tax struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -956,6 +1551,9 @@ type Tax struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1041,6 +1639,90 @@ func (t *Tax) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *Tax) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetId(id *string) { + t.Id = id + t.require(taxFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(taxFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(taxFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(taxFieldModifiedAt) +} + +// SetEmployeePayrollRun sets the EmployeePayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetEmployeePayrollRun(employeePayrollRun *string) { + t.EmployeePayrollRun = employeePayrollRun + t.require(taxFieldEmployeePayrollRun) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetName(name *string) { + t.Name = name + t.require(taxFieldName) +} + +// SetAmount sets the Amount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetAmount(amount *float64) { + t.Amount = amount + t.require(taxFieldAmount) +} + +// SetEmployerTax sets the EmployerTax field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetEmployerTax(employerTax *bool) { + t.EmployerTax = employerTax + t.require(taxFieldEmployerTax) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(taxFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(taxFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tax) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(taxFieldRemoteData) +} + func (t *Tax) UnmarshalJSON(data []byte) error { type embed Tax var unmarshaler = struct { @@ -1076,7 +1758,8 @@ func (t *Tax) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *Tax) String() string { diff --git a/hris/employeepayrollruns/client.go b/hris/employeepayrollruns/client.go index 244b58f..55a1d2d 100644 --- a/hris/employeepayrollruns/client.go +++ b/hris/employeepayrollruns/client.go @@ -4,7 +4,6 @@ package employeepayrollruns import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.EmployeePayrollRunsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.EmployeePayrollRun], error) { +) (*core.Page[*string, *hris.EmployeePayrollRun], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedEmployeePayrollRunList) *internal.PageResponse[*string, *hris.EmployeePayrollRun] { + readPageResponse := func(response *hris.PaginatedEmployeePayrollRunList) *core.PageResponse[*string, *hris.EmployeePayrollRun] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.EmployeePayrollRun]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.EmployeePayrollRun]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.EmployeePayrollRunsRetrieveRequest, opts ...option.RequestOption, ) (*hris.EmployeePayrollRun, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/employee-payroll-runs/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.EmployeePayrollRun - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/employeepayrollruns/hris_employee_payroll_runs_test/hris_employee_payroll_runs_test.go b/hris/employeepayrollruns/hris_employee_payroll_runs_test/hris_employee_payroll_runs_test.go new file mode 100644 index 0000000..9a8c164 --- /dev/null +++ b/hris/employeepayrollruns/hris_employee_payroll_runs_test/hris_employee_payroll_runs_test.go @@ -0,0 +1,176 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_employee_payroll_runs_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisEmployeePayrollRunsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EmployeePayrollRunsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + EndedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + EndedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PayrollRunId: merge.String( + "payroll_run_id", + ), + RemoteId: merge.String( + "remote_id", + ), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Hris.EmployeePayrollRuns.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/employee-payroll-runs", map[string]string{"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"}, 1) +} + +func TestHrisEmployeePayrollRunsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EmployeePayrollRunsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.EmployeePayrollRuns.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/employee-payroll-runs/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/hris/employeepayrollruns/raw_client.go b/hris/employeepayrollruns/raw_client.go new file mode 100644 index 0000000..dda98c8 --- /dev/null +++ b/hris/employeepayrollruns/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package employeepayrollruns + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.EmployeePayrollRunsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.EmployeePayrollRun], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/employee-payroll-runs/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.EmployeePayrollRun + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.EmployeePayrollRun]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/employees.go b/hris/employees.go index 12c615d..3347c18 100644 --- a/hris/employees.go +++ b/hris/employees.go @@ -6,16 +6,90 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + employeeEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + employeeEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + employeeEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type EmployeeEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *EmployeeRequest `json:"model,omitempty" url:"-"` -} + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmployeeEndpointRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + e.IsDebugMode = isDebugMode + e.require(employeeEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeEndpointRequest) SetRunAsync(runAsync *bool) { + e.RunAsync = runAsync + e.require(employeeEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeEndpointRequest) SetModel(model *EmployeeRequest) { + e.Model = model + e.require(employeeEndpointRequestFieldModel) +} + +var ( + employeesListRequestFieldCompanyId = big.NewInt(1 << 0) + employeesListRequestFieldCreatedAfter = big.NewInt(1 << 1) + employeesListRequestFieldCreatedBefore = big.NewInt(1 << 2) + employeesListRequestFieldCursor = big.NewInt(1 << 3) + employeesListRequestFieldDisplayFullName = big.NewInt(1 << 4) + employeesListRequestFieldEmploymentStatus = big.NewInt(1 << 5) + employeesListRequestFieldEmploymentType = big.NewInt(1 << 6) + employeesListRequestFieldExpand = big.NewInt(1 << 7) + employeesListRequestFieldFirstName = big.NewInt(1 << 8) + employeesListRequestFieldGroups = big.NewInt(1 << 9) + employeesListRequestFieldHomeLocationId = big.NewInt(1 << 10) + employeesListRequestFieldIncludeDeletedData = big.NewInt(1 << 11) + employeesListRequestFieldIncludeRemoteData = big.NewInt(1 << 12) + employeesListRequestFieldIncludeSensitiveFields = big.NewInt(1 << 13) + employeesListRequestFieldIncludeShellData = big.NewInt(1 << 14) + employeesListRequestFieldJobTitle = big.NewInt(1 << 15) + employeesListRequestFieldLastName = big.NewInt(1 << 16) + employeesListRequestFieldManagerId = big.NewInt(1 << 17) + employeesListRequestFieldModifiedAfter = big.NewInt(1 << 18) + employeesListRequestFieldModifiedBefore = big.NewInt(1 << 19) + employeesListRequestFieldPageSize = big.NewInt(1 << 20) + employeesListRequestFieldPayGroupId = big.NewInt(1 << 21) + employeesListRequestFieldPersonalEmail = big.NewInt(1 << 22) + employeesListRequestFieldRemoteFields = big.NewInt(1 << 23) + employeesListRequestFieldRemoteId = big.NewInt(1 << 24) + employeesListRequestFieldShowEnumOrigins = big.NewInt(1 << 25) + employeesListRequestFieldStartedAfter = big.NewInt(1 << 26) + employeesListRequestFieldStartedBefore = big.NewInt(1 << 27) + employeesListRequestFieldTeamId = big.NewInt(1 << 28) + employeesListRequestFieldTerminatedAfter = big.NewInt(1 << 29) + employeesListRequestFieldTerminatedBefore = big.NewInt(1 << 30) + employeesListRequestFieldWorkEmail = big.NewInt(1 << 31) + employeesListRequestFieldWorkLocationId = big.NewInt(1 << 32) +) type EmployeesListRequest struct { // If provided, will only return employees for this company. @@ -88,8 +162,258 @@ type EmployeesListRequest struct { WorkEmail *string `json:"-" url:"work_email,omitempty"` // If provided, will only return employees for this location. WorkLocationId *string `json:"-" url:"work_location_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmployeesListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCompanyId sets the CompanyId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetCompanyId(companyId *string) { + e.CompanyId = companyId + e.require(employeesListRequestFieldCompanyId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetCreatedAfter(createdAfter *time.Time) { + e.CreatedAfter = createdAfter + e.require(employeesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetCreatedBefore(createdBefore *time.Time) { + e.CreatedBefore = createdBefore + e.require(employeesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(employeesListRequestFieldCursor) +} + +// SetDisplayFullName sets the DisplayFullName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetDisplayFullName(displayFullName *string) { + e.DisplayFullName = displayFullName + e.require(employeesListRequestFieldDisplayFullName) +} + +// SetEmploymentStatus sets the EmploymentStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetEmploymentStatus(employmentStatus *EmployeesListRequestEmploymentStatus) { + e.EmploymentStatus = employmentStatus + e.require(employeesListRequestFieldEmploymentStatus) +} + +// SetEmploymentType sets the EmploymentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetEmploymentType(employmentType *string) { + e.EmploymentType = employmentType + e.require(employeesListRequestFieldEmploymentType) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetExpand(expand []*EmployeesListRequestExpandItem) { + e.Expand = expand + e.require(employeesListRequestFieldExpand) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetFirstName(firstName *string) { + e.FirstName = firstName + e.require(employeesListRequestFieldFirstName) +} + +// SetGroups sets the Groups field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetGroups(groups *string) { + e.Groups = groups + e.require(employeesListRequestFieldGroups) +} + +// SetHomeLocationId sets the HomeLocationId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetHomeLocationId(homeLocationId *string) { + e.HomeLocationId = homeLocationId + e.require(employeesListRequestFieldHomeLocationId) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(employeesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employeesListRequestFieldIncludeRemoteData) +} + +// SetIncludeSensitiveFields sets the IncludeSensitiveFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetIncludeSensitiveFields(includeSensitiveFields *bool) { + e.IncludeSensitiveFields = includeSensitiveFields + e.require(employeesListRequestFieldIncludeSensitiveFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employeesListRequestFieldIncludeShellData) +} + +// SetJobTitle sets the JobTitle field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetJobTitle(jobTitle *string) { + e.JobTitle = jobTitle + e.require(employeesListRequestFieldJobTitle) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetLastName(lastName *string) { + e.LastName = lastName + e.require(employeesListRequestFieldLastName) +} + +// SetManagerId sets the ManagerId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetManagerId(managerId *string) { + e.ManagerId = managerId + e.require(employeesListRequestFieldManagerId) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + e.ModifiedAfter = modifiedAfter + e.require(employeesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + e.ModifiedBefore = modifiedBefore + e.require(employeesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(employeesListRequestFieldPageSize) +} + +// SetPayGroupId sets the PayGroupId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetPayGroupId(payGroupId *string) { + e.PayGroupId = payGroupId + e.require(employeesListRequestFieldPayGroupId) } +// SetPersonalEmail sets the PersonalEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetPersonalEmail(personalEmail *string) { + e.PersonalEmail = personalEmail + e.require(employeesListRequestFieldPersonalEmail) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetRemoteFields(remoteFields *EmployeesListRequestRemoteFields) { + e.RemoteFields = remoteFields + e.require(employeesListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(employeesListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetShowEnumOrigins(showEnumOrigins *EmployeesListRequestShowEnumOrigins) { + e.ShowEnumOrigins = showEnumOrigins + e.require(employeesListRequestFieldShowEnumOrigins) +} + +// SetStartedAfter sets the StartedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetStartedAfter(startedAfter *time.Time) { + e.StartedAfter = startedAfter + e.require(employeesListRequestFieldStartedAfter) +} + +// SetStartedBefore sets the StartedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetStartedBefore(startedBefore *time.Time) { + e.StartedBefore = startedBefore + e.require(employeesListRequestFieldStartedBefore) +} + +// SetTeamId sets the TeamId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetTeamId(teamId *string) { + e.TeamId = teamId + e.require(employeesListRequestFieldTeamId) +} + +// SetTerminatedAfter sets the TerminatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetTerminatedAfter(terminatedAfter *time.Time) { + e.TerminatedAfter = terminatedAfter + e.require(employeesListRequestFieldTerminatedAfter) +} + +// SetTerminatedBefore sets the TerminatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetTerminatedBefore(terminatedBefore *time.Time) { + e.TerminatedBefore = terminatedBefore + e.require(employeesListRequestFieldTerminatedBefore) +} + +// SetWorkEmail sets the WorkEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetWorkEmail(workEmail *string) { + e.WorkEmail = workEmail + e.require(employeesListRequestFieldWorkEmail) +} + +// SetWorkLocationId sets the WorkLocationId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesListRequest) SetWorkLocationId(workLocationId *string) { + e.WorkLocationId = workLocationId + e.require(employeesListRequestFieldWorkLocationId) +} + +var ( + employeesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + employeesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + employeesRetrieveRequestFieldIncludeSensitiveFields = big.NewInt(1 << 2) + employeesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) + employeesRetrieveRequestFieldRemoteFields = big.NewInt(1 << 4) + employeesRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 5) +) + type EmployeesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*EmployeesRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -103,6 +427,58 @@ type EmployeesRetrieveRequest struct { RemoteFields *EmployeesRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *EmployeesRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmployeesRetrieveRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesRetrieveRequest) SetExpand(expand []*EmployeesRetrieveRequestExpandItem) { + e.Expand = expand + e.require(employeesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employeesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeSensitiveFields sets the IncludeSensitiveFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesRetrieveRequest) SetIncludeSensitiveFields(includeSensitiveFields *bool) { + e.IncludeSensitiveFields = includeSensitiveFields + e.require(employeesRetrieveRequestFieldIncludeSensitiveFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employeesRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesRetrieveRequest) SetRemoteFields(remoteFields *EmployeesRetrieveRequestRemoteFields) { + e.RemoteFields = remoteFields + e.require(employeesRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeesRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *EmployeesRetrieveRequestShowEnumOrigins) { + e.ShowEnumOrigins = showEnumOrigins + e.require(employeesRetrieveRequestFieldShowEnumOrigins) } type EmployeesListRequestEmploymentStatus string @@ -460,6 +836,38 @@ func (e EmployeesRetrieveRequestShowEnumOrigins) Ptr() *EmployeesRetrieveRequest // // ### Usage Example // Fetch from the `LIST Employee` endpoint and filter by `ID` to show all employees. +var ( + employeeRequestFieldEmployeeNumber = big.NewInt(1 << 0) + employeeRequestFieldCompany = big.NewInt(1 << 1) + employeeRequestFieldFirstName = big.NewInt(1 << 2) + employeeRequestFieldLastName = big.NewInt(1 << 3) + employeeRequestFieldPreferredName = big.NewInt(1 << 4) + employeeRequestFieldDisplayFullName = big.NewInt(1 << 5) + employeeRequestFieldUsername = big.NewInt(1 << 6) + employeeRequestFieldGroups = big.NewInt(1 << 7) + employeeRequestFieldWorkEmail = big.NewInt(1 << 8) + employeeRequestFieldPersonalEmail = big.NewInt(1 << 9) + employeeRequestFieldMobilePhoneNumber = big.NewInt(1 << 10) + employeeRequestFieldEmployments = big.NewInt(1 << 11) + employeeRequestFieldHomeLocation = big.NewInt(1 << 12) + employeeRequestFieldWorkLocation = big.NewInt(1 << 13) + employeeRequestFieldManager = big.NewInt(1 << 14) + employeeRequestFieldTeam = big.NewInt(1 << 15) + employeeRequestFieldPayGroup = big.NewInt(1 << 16) + employeeRequestFieldSsn = big.NewInt(1 << 17) + employeeRequestFieldGender = big.NewInt(1 << 18) + employeeRequestFieldEthnicity = big.NewInt(1 << 19) + employeeRequestFieldMaritalStatus = big.NewInt(1 << 20) + employeeRequestFieldDateOfBirth = big.NewInt(1 << 21) + employeeRequestFieldHireDate = big.NewInt(1 << 22) + employeeRequestFieldStartDate = big.NewInt(1 << 23) + employeeRequestFieldEmploymentStatus = big.NewInt(1 << 24) + employeeRequestFieldTerminationDate = big.NewInt(1 << 25) + employeeRequestFieldAvatar = big.NewInt(1 << 26) + employeeRequestFieldIntegrationParams = big.NewInt(1 << 27) + employeeRequestFieldLinkedAccountParams = big.NewInt(1 << 28) +) + type EmployeeRequest struct { // The employee's number that appears in the third-party integration's UI. EmployeeNumber *string `json:"employee_number,omitempty" url:"employee_number,omitempty"` @@ -542,6 +950,9 @@ type EmployeeRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -753,6 +1164,216 @@ func (e *EmployeeRequest) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EmployeeRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetEmployeeNumber sets the EmployeeNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetEmployeeNumber(employeeNumber *string) { + e.EmployeeNumber = employeeNumber + e.require(employeeRequestFieldEmployeeNumber) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetCompany(company *EmployeeRequestCompany) { + e.Company = company + e.require(employeeRequestFieldCompany) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetFirstName(firstName *string) { + e.FirstName = firstName + e.require(employeeRequestFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetLastName(lastName *string) { + e.LastName = lastName + e.require(employeeRequestFieldLastName) +} + +// SetPreferredName sets the PreferredName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetPreferredName(preferredName *string) { + e.PreferredName = preferredName + e.require(employeeRequestFieldPreferredName) +} + +// SetDisplayFullName sets the DisplayFullName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetDisplayFullName(displayFullName *string) { + e.DisplayFullName = displayFullName + e.require(employeeRequestFieldDisplayFullName) +} + +// SetUsername sets the Username field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetUsername(username *string) { + e.Username = username + e.require(employeeRequestFieldUsername) +} + +// SetGroups sets the Groups field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetGroups(groups []*EmployeeRequestGroupsItem) { + e.Groups = groups + e.require(employeeRequestFieldGroups) +} + +// SetWorkEmail sets the WorkEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetWorkEmail(workEmail *string) { + e.WorkEmail = workEmail + e.require(employeeRequestFieldWorkEmail) +} + +// SetPersonalEmail sets the PersonalEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetPersonalEmail(personalEmail *string) { + e.PersonalEmail = personalEmail + e.require(employeeRequestFieldPersonalEmail) +} + +// SetMobilePhoneNumber sets the MobilePhoneNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetMobilePhoneNumber(mobilePhoneNumber *string) { + e.MobilePhoneNumber = mobilePhoneNumber + e.require(employeeRequestFieldMobilePhoneNumber) +} + +// SetEmployments sets the Employments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetEmployments(employments []*EmployeeRequestEmploymentsItem) { + e.Employments = employments + e.require(employeeRequestFieldEmployments) +} + +// SetHomeLocation sets the HomeLocation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetHomeLocation(homeLocation *EmployeeRequestHomeLocation) { + e.HomeLocation = homeLocation + e.require(employeeRequestFieldHomeLocation) +} + +// SetWorkLocation sets the WorkLocation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetWorkLocation(workLocation *EmployeeRequestWorkLocation) { + e.WorkLocation = workLocation + e.require(employeeRequestFieldWorkLocation) +} + +// SetManager sets the Manager field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetManager(manager *EmployeeRequestManager) { + e.Manager = manager + e.require(employeeRequestFieldManager) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetTeam(team *EmployeeRequestTeam) { + e.Team = team + e.require(employeeRequestFieldTeam) +} + +// SetPayGroup sets the PayGroup field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetPayGroup(payGroup *EmployeeRequestPayGroup) { + e.PayGroup = payGroup + e.require(employeeRequestFieldPayGroup) +} + +// SetSsn sets the Ssn field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetSsn(ssn *string) { + e.Ssn = ssn + e.require(employeeRequestFieldSsn) +} + +// SetGender sets the Gender field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetGender(gender *EmployeeRequestGender) { + e.Gender = gender + e.require(employeeRequestFieldGender) +} + +// SetEthnicity sets the Ethnicity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetEthnicity(ethnicity *EmployeeRequestEthnicity) { + e.Ethnicity = ethnicity + e.require(employeeRequestFieldEthnicity) +} + +// SetMaritalStatus sets the MaritalStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetMaritalStatus(maritalStatus *EmployeeRequestMaritalStatus) { + e.MaritalStatus = maritalStatus + e.require(employeeRequestFieldMaritalStatus) +} + +// SetDateOfBirth sets the DateOfBirth field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetDateOfBirth(dateOfBirth *time.Time) { + e.DateOfBirth = dateOfBirth + e.require(employeeRequestFieldDateOfBirth) +} + +// SetHireDate sets the HireDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetHireDate(hireDate *time.Time) { + e.HireDate = hireDate + e.require(employeeRequestFieldHireDate) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetStartDate(startDate *time.Time) { + e.StartDate = startDate + e.require(employeeRequestFieldStartDate) +} + +// SetEmploymentStatus sets the EmploymentStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetEmploymentStatus(employmentStatus *EmployeeRequestEmploymentStatus) { + e.EmploymentStatus = employmentStatus + e.require(employeeRequestFieldEmploymentStatus) +} + +// SetTerminationDate sets the TerminationDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetTerminationDate(terminationDate *time.Time) { + e.TerminationDate = terminationDate + e.require(employeeRequestFieldTerminationDate) +} + +// SetAvatar sets the Avatar field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetAvatar(avatar *string) { + e.Avatar = avatar + e.require(employeeRequestFieldAvatar) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + e.IntegrationParams = integrationParams + e.require(employeeRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + e.LinkedAccountParams = linkedAccountParams + e.require(employeeRequestFieldLinkedAccountParams) +} + func (e *EmployeeRequest) UnmarshalJSON(data []byte) error { type embed EmployeeRequest var unmarshaler = struct { @@ -796,7 +1417,8 @@ func (e *EmployeeRequest) MarshalJSON() ([]byte, error) { StartDate: internal.NewOptionalDateTime(e.StartDate), TerminationDate: internal.NewOptionalDateTime(e.TerminationDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *EmployeeRequest) String() string { @@ -1590,12 +2212,22 @@ func (e *EmployeeRequestWorkLocation) Accept(visitor EmployeeRequestWorkLocation return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + employeeResponseFieldModel = big.NewInt(1 << 0) + employeeResponseFieldWarnings = big.NewInt(1 << 1) + employeeResponseFieldErrors = big.NewInt(1 << 2) + employeeResponseFieldLogs = big.NewInt(1 << 3) +) + type EmployeeResponse struct { Model *Employee `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1632,6 +2264,41 @@ func (e *EmployeeResponse) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EmployeeResponse) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeResponse) SetModel(model *Employee) { + e.Model = model + e.require(employeeResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeResponse) SetWarnings(warnings []*WarningValidationProblem) { + e.Warnings = warnings + e.require(employeeResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeResponse) SetErrors(errors []*ErrorValidationProblem) { + e.Errors = errors + e.require(employeeResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployeeResponse) SetLogs(logs []*DebugModeLog) { + e.Logs = logs + e.require(employeeResponseFieldLogs) +} + func (e *EmployeeResponse) UnmarshalJSON(data []byte) error { type unmarshaler EmployeeResponse var value unmarshaler @@ -1648,6 +2315,17 @@ func (e *EmployeeResponse) UnmarshalJSON(data []byte) error { return nil } +func (e *EmployeeResponse) MarshalJSON() ([]byte, error) { + type embed EmployeeResponse + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *EmployeeResponse) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -1660,10 +2338,18 @@ func (e *EmployeeResponse) String() string { return fmt.Sprintf("%#v", e) } +var ( + ignoreCommonModelRequestFieldReason = big.NewInt(1 << 0) + ignoreCommonModelRequestFieldMessage = big.NewInt(1 << 1) +) + type IgnoreCommonModelRequest struct { Reason *IgnoreCommonModelRequestReason `json:"reason" url:"reason"` Message *string `json:"message,omitempty" url:"message,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1686,6 +2372,27 @@ func (i *IgnoreCommonModelRequest) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *IgnoreCommonModelRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IgnoreCommonModelRequest) SetReason(reason *IgnoreCommonModelRequestReason) { + i.Reason = reason + i.require(ignoreCommonModelRequestFieldReason) +} + +// SetMessage sets the Message field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IgnoreCommonModelRequest) SetMessage(message *string) { + i.Message = message + i.require(ignoreCommonModelRequestFieldMessage) +} + func (i *IgnoreCommonModelRequest) UnmarshalJSON(data []byte) error { type unmarshaler IgnoreCommonModelRequest var value unmarshaler @@ -1702,6 +2409,17 @@ func (i *IgnoreCommonModelRequest) UnmarshalJSON(data []byte) error { return nil } +func (i *IgnoreCommonModelRequest) MarshalJSON() ([]byte, error) { + type embed IgnoreCommonModelRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IgnoreCommonModelRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -1776,11 +2494,20 @@ func (i *IgnoreCommonModelRequestReason) Accept(visitor IgnoreCommonModelRequest return fmt.Errorf("type %T does not include a non-empty union type", i) } +var ( + paginatedEmployeeListFieldNext = big.NewInt(1 << 0) + paginatedEmployeeListFieldPrevious = big.NewInt(1 << 1) + paginatedEmployeeListFieldResults = big.NewInt(1 << 2) +) + type PaginatedEmployeeList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Employee `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1810,6 +2537,34 @@ func (p *PaginatedEmployeeList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedEmployeeList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployeeList) SetNext(next *string) { + p.Next = next + p.require(paginatedEmployeeListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployeeList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedEmployeeListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployeeList) SetResults(results []*Employee) { + p.Results = results + p.require(paginatedEmployeeListFieldResults) +} + func (p *PaginatedEmployeeList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedEmployeeList var value unmarshaler @@ -1826,6 +2581,17 @@ func (p *PaginatedEmployeeList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedEmployeeList) MarshalJSON() ([]byte, error) { + type embed PaginatedEmployeeList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedEmployeeList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/employees/client.go b/hris/employees/client.go index 1bc02a6..326cd89 100644 --- a/hris/employees/client.go +++ b/hris/employees/client.go @@ -4,7 +4,6 @@ package employees import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.EmployeesListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.Employee], error) { +) (*core.Page[*string, *hris.Employee], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedEmployeeList) *internal.PageResponse[*string, *hris.Employee] { + readPageResponse := func(response *hris.PaginatedEmployeeList) *core.PageResponse[*string, *hris.Employee] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.Employee]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.Employee]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *hris.EmployeeEndpointRequest, opts ...option.RequestOption, ) (*hris.EmployeeResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/hris/v1/employees" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.EmployeeResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Employee` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *hris.EmployeesRetrieveRequest, opts ...option.RequestOption, ) (*hris.Employee, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/employees/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.Employee - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -192,35 +134,13 @@ func (c *Client) IgnoreCreate( request *hris.IgnoreCommonModelRequest, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/employees/ignore/%v", + _, err := c.WithRawResponse.IgnoreCreate( + ctx, modelId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - }, - ); err != nil { + if err != nil { return err } return nil @@ -231,33 +151,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*hris.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/employees/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/employees/hris_employees_test/hris_employees_test.go b/hris/employees/hris_employees_test/hris_employees_test.go new file mode 100644 index 0000000..88a6c7e --- /dev/null +++ b/hris/employees/hris_employees_test/hris_employees_test.go @@ -0,0 +1,294 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_employees_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisEmployeesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EmployeesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + DisplayFullName: merge.String( + "display_full_name", + ), + EmploymentStatus: hris.EmployeesListRequestEmploymentStatusActive.Ptr(), + EmploymentType: merge.String( + "employment_type", + ), + FirstName: merge.String( + "first_name", + ), + Groups: merge.String( + "groups", + ), + HomeLocationId: merge.String( + "home_location_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeSensitiveFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + JobTitle: merge.String( + "job_title", + ), + LastName: merge.String( + "last_name", + ), + ManagerId: merge.String( + "manager_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PayGroupId: merge.String( + "pay_group_id", + ), + PersonalEmail: merge.String( + "personal_email", + ), + RemoteFields: hris.EmployeesListRequestRemoteFieldsEmploymentStatus.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: hris.EmployeesListRequestShowEnumOriginsEmploymentStatus.Ptr(), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TeamId: merge.String( + "team_id", + ), + TerminatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TerminatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + WorkEmail: merge.String( + "work_email", + ), + WorkLocationId: merge.String( + "work_location_id", + ), + } + _, invocationErr := client.Hris.Employees.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/employees", map[string]string{"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"}, 1) +} + +func TestHrisEmployeesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EmployeeEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &hris.EmployeeRequest{}, + } + _, invocationErr := client.Hris.Employees.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/employees", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestHrisEmployeesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EmployeesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeSensitiveFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.EmployeesRetrieveRequestRemoteFieldsEmploymentStatus.Ptr(), + ShowEnumOrigins: hris.EmployeesRetrieveRequestShowEnumOriginsEmploymentStatus.Ptr(), + } + _, invocationErr := client.Hris.Employees.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/employees/id", map[string]string{"include_remote_data": "true", "include_sensitive_fields": "true", "include_shell_data": "true", "remote_fields": "employment_status", "show_enum_origins": "employment_status"}, 1) +} + +func TestHrisEmployeesIgnoreCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.IgnoreCommonModelRequest{ + Reason: &hris.IgnoreCommonModelRequestReason{ + ReasonEnum: hris.ReasonEnumGeneralCustomerRequest, + }, + } + invocationErr := client.Hris.Employees.IgnoreCreate( + context.TODO(), + "model_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/employees/ignore/model_id", nil, 1) +} + +func TestHrisEmployeesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.Employees.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/employees/meta/post", nil, 1) +} diff --git a/hris/employees/raw_client.go b/hris/employees/raw_client.go new file mode 100644 index 0000000..9fb243a --- /dev/null +++ b/hris/employees/raw_client.go @@ -0,0 +1,213 @@ +// Code generated by Fern. DO NOT EDIT. + +package employees + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *hris.EmployeeEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.EmployeeResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/employees" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.EmployeeResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.EmployeeResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.EmployeesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.Employee], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/employees/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.Employee + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.Employee]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) IgnoreCreate( + ctx context.Context, + modelId string, + request *hris.IgnoreCommonModelRequest, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/employees/ignore/%v", + modelId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*hris.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/employees/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/employer_benefits.go b/hris/employer_benefits.go index 557661f..d2a182e 100644 --- a/hris/employer_benefits.go +++ b/hris/employer_benefits.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + employerBenefitsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + employerBenefitsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + employerBenefitsListRequestFieldCursor = big.NewInt(1 << 2) + employerBenefitsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + employerBenefitsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + employerBenefitsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + employerBenefitsListRequestFieldModifiedAfter = big.NewInt(1 << 6) + employerBenefitsListRequestFieldModifiedBefore = big.NewInt(1 << 7) + employerBenefitsListRequestFieldPageSize = big.NewInt(1 << 8) + employerBenefitsListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type EmployerBenefitsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,13 +44,122 @@ type EmployerBenefitsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmployerBenefitsListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) } +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetCreatedAfter(createdAfter *time.Time) { + e.CreatedAfter = createdAfter + e.require(employerBenefitsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetCreatedBefore(createdBefore *time.Time) { + e.CreatedBefore = createdBefore + e.require(employerBenefitsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(employerBenefitsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(employerBenefitsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employerBenefitsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employerBenefitsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + e.ModifiedAfter = modifiedAfter + e.require(employerBenefitsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + e.ModifiedBefore = modifiedBefore + e.require(employerBenefitsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(employerBenefitsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsListRequest) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(employerBenefitsListRequestFieldRemoteId) +} + +var ( + employerBenefitsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + employerBenefitsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type EmployerBenefitsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmployerBenefitsRetrieveRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employerBenefitsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefitsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employerBenefitsRetrieveRequestFieldIncludeShellData) } // * `MEDICAL` - MEDICAL @@ -81,6 +204,20 @@ func (b BenefitPlanTypeEnum) Ptr() *BenefitPlanTypeEnum { // // ### Usage Example // Fetch from the `LIST EmployerBenefits` endpoint and filter by `ID` to show all EmployerBenefits. +var ( + employerBenefitFieldId = big.NewInt(1 << 0) + employerBenefitFieldRemoteId = big.NewInt(1 << 1) + employerBenefitFieldCreatedAt = big.NewInt(1 << 2) + employerBenefitFieldModifiedAt = big.NewInt(1 << 3) + employerBenefitFieldBenefitPlanType = big.NewInt(1 << 4) + employerBenefitFieldName = big.NewInt(1 << 5) + employerBenefitFieldDescription = big.NewInt(1 << 6) + employerBenefitFieldDeductionCode = big.NewInt(1 << 7) + employerBenefitFieldRemoteWasDeleted = big.NewInt(1 << 8) + employerBenefitFieldFieldMappings = big.NewInt(1 << 9) + employerBenefitFieldRemoteData = big.NewInt(1 << 10) +) + type EmployerBenefit struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -108,6 +245,9 @@ type EmployerBenefit struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -193,6 +333,90 @@ func (e *EmployerBenefit) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *EmployerBenefit) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetId(id *string) { + e.Id = id + e.require(employerBenefitFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(employerBenefitFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(employerBenefitFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(employerBenefitFieldModifiedAt) +} + +// SetBenefitPlanType sets the BenefitPlanType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetBenefitPlanType(benefitPlanType *EmployerBenefitBenefitPlanType) { + e.BenefitPlanType = benefitPlanType + e.require(employerBenefitFieldBenefitPlanType) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetName(name *string) { + e.Name = name + e.require(employerBenefitFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetDescription(description *string) { + e.Description = description + e.require(employerBenefitFieldDescription) +} + +// SetDeductionCode sets the DeductionCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetDeductionCode(deductionCode *string) { + e.DeductionCode = deductionCode + e.require(employerBenefitFieldDeductionCode) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(employerBenefitFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetFieldMappings(fieldMappings map[string]interface{}) { + e.FieldMappings = fieldMappings + e.require(employerBenefitFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmployerBenefit) SetRemoteData(remoteData []*RemoteData) { + e.RemoteData = remoteData + e.require(employerBenefitFieldRemoteData) +} + func (e *EmployerBenefit) UnmarshalJSON(data []byte) error { type embed EmployerBenefit var unmarshaler = struct { @@ -228,7 +452,8 @@ func (e *EmployerBenefit) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(e.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(e.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *EmployerBenefit) String() string { @@ -312,11 +537,20 @@ func (e *EmployerBenefitBenefitPlanType) Accept(visitor EmployerBenefitBenefitPl return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + paginatedEmployerBenefitListFieldNext = big.NewInt(1 << 0) + paginatedEmployerBenefitListFieldPrevious = big.NewInt(1 << 1) + paginatedEmployerBenefitListFieldResults = big.NewInt(1 << 2) +) + type PaginatedEmployerBenefitList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*EmployerBenefit `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -346,6 +580,34 @@ func (p *PaginatedEmployerBenefitList) GetExtraProperties() map[string]interface return p.extraProperties } +func (p *PaginatedEmployerBenefitList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployerBenefitList) SetNext(next *string) { + p.Next = next + p.require(paginatedEmployerBenefitListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployerBenefitList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedEmployerBenefitListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmployerBenefitList) SetResults(results []*EmployerBenefit) { + p.Results = results + p.require(paginatedEmployerBenefitListFieldResults) +} + func (p *PaginatedEmployerBenefitList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedEmployerBenefitList var value unmarshaler @@ -362,6 +624,17 @@ func (p *PaginatedEmployerBenefitList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedEmployerBenefitList) MarshalJSON() ([]byte, error) { + type embed PaginatedEmployerBenefitList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedEmployerBenefitList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/employerbenefits/client.go b/hris/employerbenefits/client.go index cbf455b..afe4a34 100644 --- a/hris/employerbenefits/client.go +++ b/hris/employerbenefits/client.go @@ -4,7 +4,6 @@ package employerbenefits import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.EmployerBenefitsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.EmployerBenefit], error) { +) (*core.Page[*string, *hris.EmployerBenefit], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedEmployerBenefitList) *internal.PageResponse[*string, *hris.EmployerBenefit] { + readPageResponse := func(response *hris.PaginatedEmployerBenefitList) *core.PageResponse[*string, *hris.EmployerBenefit] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.EmployerBenefit]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.EmployerBenefit]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.EmployerBenefitsRetrieveRequest, opts ...option.RequestOption, ) (*hris.EmployerBenefit, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/employer-benefits/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.EmployerBenefit - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/employerbenefits/hris_employer_benefits_test/hris_employer_benefits_test.go b/hris/employerbenefits/hris_employer_benefits_test/hris_employer_benefits_test.go new file mode 100644 index 0000000..b109dc5 --- /dev/null +++ b/hris/employerbenefits/hris_employer_benefits_test/hris_employer_benefits_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_employer_benefits_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisEmployerBenefitsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EmployerBenefitsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Hris.EmployerBenefits.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/employer-benefits", map[string]string{"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"}, 1) +} + +func TestHrisEmployerBenefitsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EmployerBenefitsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.EmployerBenefits.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/employer-benefits/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/hris/employerbenefits/raw_client.go b/hris/employerbenefits/raw_client.go new file mode 100644 index 0000000..a09cad3 --- /dev/null +++ b/hris/employerbenefits/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package employerbenefits + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.EmployerBenefitsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.EmployerBenefit], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/employer-benefits/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.EmployerBenefit + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.EmployerBenefit]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/employments.go b/hris/employments.go index 7b2016c..693013c 100644 --- a/hris/employments.go +++ b/hris/employments.go @@ -6,9 +6,28 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + employmentsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + employmentsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + employmentsListRequestFieldCursor = big.NewInt(1 << 2) + employmentsListRequestFieldEmployeeId = big.NewInt(1 << 3) + employmentsListRequestFieldExpand = big.NewInt(1 << 4) + employmentsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + employmentsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + employmentsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + employmentsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + employmentsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + employmentsListRequestFieldOrderBy = big.NewInt(1 << 10) + employmentsListRequestFieldPageSize = big.NewInt(1 << 11) + employmentsListRequestFieldRemoteFields = big.NewInt(1 << 12) + employmentsListRequestFieldRemoteId = big.NewInt(1 << 13) + employmentsListRequestFieldShowEnumOrigins = big.NewInt(1 << 14) +) + type EmploymentsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -40,8 +59,131 @@ type EmploymentsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *EmploymentsListRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmploymentsListRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetCreatedAfter(createdAfter *time.Time) { + e.CreatedAfter = createdAfter + e.require(employmentsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetCreatedBefore(createdBefore *time.Time) { + e.CreatedBefore = createdBefore + e.require(employmentsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetCursor(cursor *string) { + e.Cursor = cursor + e.require(employmentsListRequestFieldCursor) +} + +// SetEmployeeId sets the EmployeeId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetEmployeeId(employeeId *string) { + e.EmployeeId = employeeId + e.require(employmentsListRequestFieldEmployeeId) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetExpand(expand []*EmploymentsListRequestExpandItem) { + e.Expand = expand + e.require(employmentsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + e.IncludeDeletedData = includeDeletedData + e.require(employmentsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employmentsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employmentsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + e.ModifiedAfter = modifiedAfter + e.require(employmentsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + e.ModifiedBefore = modifiedBefore + e.require(employmentsListRequestFieldModifiedBefore) +} + +// SetOrderBy sets the OrderBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetOrderBy(orderBy *EmploymentsListRequestOrderBy) { + e.OrderBy = orderBy + e.require(employmentsListRequestFieldOrderBy) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetPageSize(pageSize *int) { + e.PageSize = pageSize + e.require(employmentsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetRemoteFields(remoteFields *EmploymentsListRequestRemoteFields) { + e.RemoteFields = remoteFields + e.require(employmentsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(employmentsListRequestFieldRemoteId) } +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsListRequest) SetShowEnumOrigins(showEnumOrigins *EmploymentsListRequestShowEnumOrigins) { + e.ShowEnumOrigins = showEnumOrigins + e.require(employmentsListRequestFieldShowEnumOrigins) +} + +var ( + employmentsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + employmentsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + employmentsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + employmentsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + employmentsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type EmploymentsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*EmploymentsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -53,6 +195,51 @@ type EmploymentsRetrieveRequest struct { RemoteFields *EmploymentsRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *EmploymentsRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EmploymentsRetrieveRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsRetrieveRequest) SetExpand(expand []*EmploymentsRetrieveRequestExpandItem) { + e.Expand = expand + e.require(employmentsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + e.IncludeRemoteData = includeRemoteData + e.require(employmentsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + e.IncludeShellData = includeShellData + e.require(employmentsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsRetrieveRequest) SetRemoteFields(remoteFields *EmploymentsRetrieveRequestRemoteFields) { + e.RemoteFields = remoteFields + e.require(employmentsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EmploymentsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *EmploymentsRetrieveRequestShowEnumOrigins) { + e.ShowEnumOrigins = showEnumOrigins + e.require(employmentsRetrieveRequestFieldShowEnumOrigins) } type EmploymentsListRequestExpandItem string @@ -365,11 +552,20 @@ func (e EmploymentsRetrieveRequestShowEnumOrigins) Ptr() *EmploymentsRetrieveReq return &e } +var ( + paginatedEmploymentListFieldNext = big.NewInt(1 << 0) + paginatedEmploymentListFieldPrevious = big.NewInt(1 << 1) + paginatedEmploymentListFieldResults = big.NewInt(1 << 2) +) + type PaginatedEmploymentList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Employment `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -399,6 +595,34 @@ func (p *PaginatedEmploymentList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedEmploymentList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmploymentList) SetNext(next *string) { + p.Next = next + p.require(paginatedEmploymentListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmploymentList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedEmploymentListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedEmploymentList) SetResults(results []*Employment) { + p.Results = results + p.require(paginatedEmploymentListFieldResults) +} + func (p *PaginatedEmploymentList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedEmploymentList var value unmarshaler @@ -415,6 +639,17 @@ func (p *PaginatedEmploymentList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedEmploymentList) MarshalJSON() ([]byte, error) { + type embed PaginatedEmploymentList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedEmploymentList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/employments/client.go b/hris/employments/client.go index 144ea04..fa96cdb 100644 --- a/hris/employments/client.go +++ b/hris/employments/client.go @@ -4,7 +4,6 @@ package employments import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.EmploymentsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.Employment], error) { +) (*core.Page[*string, *hris.Employment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedEmploymentList) *internal.PageResponse[*string, *hris.Employment] { + readPageResponse := func(response *hris.PaginatedEmploymentList) *core.PageResponse[*string, *hris.Employment] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.Employment]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.Employment]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.EmploymentsRetrieveRequest, opts ...option.RequestOption, ) (*hris.Employment, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/employments/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.Employment - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/employments/hris_employments_test/hris_employments_test.go b/hris/employments/hris_employments_test/hris_employments_test.go new file mode 100644 index 0000000..58c7807 --- /dev/null +++ b/hris/employments/hris_employments_test/hris_employments_test.go @@ -0,0 +1,158 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_employments_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisEmploymentsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EmploymentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OrderBy: hris.EmploymentsListRequestOrderByEffectiveDateDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + RemoteFields: hris.EmploymentsListRequestRemoteFieldsEmploymentType.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: hris.EmploymentsListRequestShowEnumOriginsEmploymentType.Ptr(), + } + _, invocationErr := client.Hris.Employments.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/employments", map[string]string{"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"}, 1) +} + +func TestHrisEmploymentsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EmploymentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.EmploymentsRetrieveRequestRemoteFieldsEmploymentType.Ptr(), + ShowEnumOrigins: hris.EmploymentsRetrieveRequestShowEnumOriginsEmploymentType.Ptr(), + } + _, invocationErr := client.Hris.Employments.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/employments/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "employment_type", "show_enum_origins": "employment_type"}, 1) +} diff --git a/hris/employments/raw_client.go b/hris/employments/raw_client.go new file mode 100644 index 0000000..4a6a64b --- /dev/null +++ b/hris/employments/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package employments + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.EmploymentsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.Employment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/employments/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.Employment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.Employment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/field_mapping.go b/hris/field_mapping.go index 51c901d..d18b94a 100644 --- a/hris/field_mapping.go +++ b/hris/field_mapping.go @@ -6,6 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + createFieldMappingRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) + createFieldMappingRequestFieldTargetFieldName = big.NewInt(1 << 1) + createFieldMappingRequestFieldTargetFieldDescription = big.NewInt(1 << 2) + createFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 3) + createFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 4) + createFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 5) + createFieldMappingRequestFieldCommonModelName = big.NewInt(1 << 6) ) type CreateFieldMappingRequest struct { @@ -23,8 +34,73 @@ type CreateFieldMappingRequest struct { RemoteUrlPath string `json:"remote_url_path" url:"-"` // The name of the Common Model that the remote field corresponds to in a given category. CommonModelName string `json:"common_model_name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreateFieldMappingRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) } +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + c.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + c.require(createFieldMappingRequestFieldExcludeRemoteFieldMetadata) +} + +// SetTargetFieldName sets the TargetFieldName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldName(targetFieldName string) { + c.TargetFieldName = targetFieldName + c.require(createFieldMappingRequestFieldTargetFieldName) +} + +// SetTargetFieldDescription sets the TargetFieldDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldDescription(targetFieldDescription string) { + c.TargetFieldDescription = targetFieldDescription + c.require(createFieldMappingRequestFieldTargetFieldDescription) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + c.RemoteFieldTraversalPath = remoteFieldTraversalPath + c.require(createFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteMethod(remoteMethod string) { + c.RemoteMethod = remoteMethod + c.require(createFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath string) { + c.RemoteUrlPath = remoteUrlPath + c.require(createFieldMappingRequestFieldRemoteUrlPath) +} + +// SetCommonModelName sets the CommonModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetCommonModelName(commonModelName string) { + c.CommonModelName = commonModelName + c.require(createFieldMappingRequestFieldCommonModelName) +} + +var ( + patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 0) + patchedEditFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 1) + patchedEditFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 2) +) + type PatchedEditFieldMappingRequest struct { // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty" url:"-"` @@ -32,20 +108,110 @@ type PatchedEditFieldMappingRequest struct { RemoteMethod *string `json:"remote_method,omitempty" url:"-"` // The path of the remote endpoint where the remote field is coming from. RemoteUrlPath *string `json:"remote_url_path,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedEditFieldMappingRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + p.RemoteFieldTraversalPath = remoteFieldTraversalPath + p.require(patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteMethod(remoteMethod *string) { + p.RemoteMethod = remoteMethod + p.require(patchedEditFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath *string) { + p.RemoteUrlPath = remoteUrlPath + p.require(patchedEditFieldMappingRequestFieldRemoteUrlPath) } +var ( + fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) +) + type FieldMappingsRetrieveRequest struct { // 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. ExcludeRemoteFieldMetadata *bool `json:"-" url:"exclude_remote_field_metadata,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FieldMappingsRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) } +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingsRetrieveRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + f.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + f.require(fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata) +} + +var ( + remoteFieldsRetrieveRequestFieldCommonModels = big.NewInt(1 << 0) + remoteFieldsRetrieveRequestFieldIncludeExampleValues = big.NewInt(1 << 1) +) + type RemoteFieldsRetrieveRequest struct { // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. CommonModels *string `json:"-" url:"common_models,omitempty"` // 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. IncludeExampleValues *string `json:"-" url:"include_example_values,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteFieldsRetrieveRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) } +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetCommonModels(commonModels *string) { + r.CommonModels = commonModels + r.require(remoteFieldsRetrieveRequestFieldCommonModels) +} + +// SetIncludeExampleValues sets the IncludeExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetIncludeExampleValues(includeExampleValues *string) { + r.IncludeExampleValues = includeExampleValues + r.require(remoteFieldsRetrieveRequestFieldIncludeExampleValues) +} + +var ( + advancedMetadataFieldId = big.NewInt(1 << 0) + advancedMetadataFieldDisplayName = big.NewInt(1 << 1) + advancedMetadataFieldDescription = big.NewInt(1 << 2) + advancedMetadataFieldIsRequired = big.NewInt(1 << 3) + advancedMetadataFieldIsCustom = big.NewInt(1 << 4) + advancedMetadataFieldFieldChoices = big.NewInt(1 << 5) +) + type AdvancedMetadata struct { Id string `json:"id" url:"id"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` @@ -54,6 +220,9 @@ type AdvancedMetadata struct { IsCustom *bool `json:"is_custom,omitempty" url:"is_custom,omitempty"` FieldChoices []interface{} `json:"field_choices,omitempty" url:"field_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -104,6 +273,55 @@ func (a *AdvancedMetadata) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AdvancedMetadata) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetId(id string) { + a.Id = id + a.require(advancedMetadataFieldId) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDisplayName(displayName *string) { + a.DisplayName = displayName + a.require(advancedMetadataFieldDisplayName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDescription(description *string) { + a.Description = description + a.require(advancedMetadataFieldDescription) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsRequired(isRequired *bool) { + a.IsRequired = isRequired + a.require(advancedMetadataFieldIsRequired) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsCustom(isCustom *bool) { + a.IsCustom = isCustom + a.require(advancedMetadataFieldIsCustom) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetFieldChoices(fieldChoices []interface{}) { + a.FieldChoices = fieldChoices + a.require(advancedMetadataFieldFieldChoices) +} + func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { type unmarshaler AdvancedMetadata var value unmarshaler @@ -120,6 +338,17 @@ func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { return nil } +func (a *AdvancedMetadata) MarshalJSON() ([]byte, error) { + type embed AdvancedMetadata + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AdvancedMetadata) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -132,11 +361,20 @@ func (a *AdvancedMetadata) String() string { return fmt.Sprintf("%#v", a) } +var ( + externalTargetFieldApiFieldName = big.NewInt(1 << 0) + externalTargetFieldApiFieldDescription = big.NewInt(1 << 1) + externalTargetFieldApiFieldIsMapped = big.NewInt(1 << 2) +) + type ExternalTargetFieldApi struct { Name *string `json:"name,omitempty" url:"name,omitempty"` Description *string `json:"description,omitempty" url:"description,omitempty"` IsMapped *string `json:"is_mapped,omitempty" url:"is_mapped,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -166,6 +404,34 @@ func (e *ExternalTargetFieldApi) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExternalTargetFieldApi) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetName(name *string) { + e.Name = name + e.require(externalTargetFieldApiFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetDescription(description *string) { + e.Description = description + e.require(externalTargetFieldApiFieldDescription) +} + +// SetIsMapped sets the IsMapped field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetIsMapped(isMapped *string) { + e.IsMapped = isMapped + e.require(externalTargetFieldApiFieldIsMapped) +} + func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApi var value unmarshaler @@ -182,6 +448,17 @@ func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApi) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApi) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -194,6 +471,25 @@ func (e *ExternalTargetFieldApi) String() string { return fmt.Sprintf("%#v", e) } +var ( + externalTargetFieldApiResponseFieldBenefit = big.NewInt(1 << 0) + externalTargetFieldApiResponseFieldEmployerBenefit = big.NewInt(1 << 1) + externalTargetFieldApiResponseFieldCompany = big.NewInt(1 << 2) + externalTargetFieldApiResponseFieldEmployeePayrollRun = big.NewInt(1 << 3) + externalTargetFieldApiResponseFieldEmployee = big.NewInt(1 << 4) + externalTargetFieldApiResponseFieldEmployment = big.NewInt(1 << 5) + externalTargetFieldApiResponseFieldLocation = big.NewInt(1 << 6) + externalTargetFieldApiResponseFieldPayrollRun = big.NewInt(1 << 7) + externalTargetFieldApiResponseFieldTeam = big.NewInt(1 << 8) + externalTargetFieldApiResponseFieldTimeOff = big.NewInt(1 << 9) + externalTargetFieldApiResponseFieldTimeOffBalance = big.NewInt(1 << 10) + externalTargetFieldApiResponseFieldBankInfo = big.NewInt(1 << 11) + externalTargetFieldApiResponseFieldPayGroup = big.NewInt(1 << 12) + externalTargetFieldApiResponseFieldGroup = big.NewInt(1 << 13) + externalTargetFieldApiResponseFieldDependent = big.NewInt(1 << 14) + externalTargetFieldApiResponseFieldTimesheetEntry = big.NewInt(1 << 15) +) + type ExternalTargetFieldApiResponse struct { Benefit []*ExternalTargetFieldApi `json:"Benefit,omitempty" url:"Benefit,omitempty"` EmployerBenefit []*ExternalTargetFieldApi `json:"EmployerBenefit,omitempty" url:"EmployerBenefit,omitempty"` @@ -212,6 +508,9 @@ type ExternalTargetFieldApiResponse struct { Dependent []*ExternalTargetFieldApi `json:"Dependent,omitempty" url:"Dependent,omitempty"` TimesheetEntry []*ExternalTargetFieldApi `json:"TimesheetEntry,omitempty" url:"TimesheetEntry,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -332,6 +631,125 @@ func (e *ExternalTargetFieldApiResponse) GetExtraProperties() map[string]interfa return e.extraProperties } +func (e *ExternalTargetFieldApiResponse) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetBenefit sets the Benefit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetBenefit(benefit []*ExternalTargetFieldApi) { + e.Benefit = benefit + e.require(externalTargetFieldApiResponseFieldBenefit) +} + +// SetEmployerBenefit sets the EmployerBenefit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetEmployerBenefit(employerBenefit []*ExternalTargetFieldApi) { + e.EmployerBenefit = employerBenefit + e.require(externalTargetFieldApiResponseFieldEmployerBenefit) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetCompany(company []*ExternalTargetFieldApi) { + e.Company = company + e.require(externalTargetFieldApiResponseFieldCompany) +} + +// SetEmployeePayrollRun sets the EmployeePayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetEmployeePayrollRun(employeePayrollRun []*ExternalTargetFieldApi) { + e.EmployeePayrollRun = employeePayrollRun + e.require(externalTargetFieldApiResponseFieldEmployeePayrollRun) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetEmployee(employee []*ExternalTargetFieldApi) { + e.Employee = employee + e.require(externalTargetFieldApiResponseFieldEmployee) +} + +// SetEmployment sets the Employment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetEmployment(employment []*ExternalTargetFieldApi) { + e.Employment = employment + e.require(externalTargetFieldApiResponseFieldEmployment) +} + +// SetLocation sets the Location field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetLocation(location []*ExternalTargetFieldApi) { + e.Location = location + e.require(externalTargetFieldApiResponseFieldLocation) +} + +// SetPayrollRun sets the PayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetPayrollRun(payrollRun []*ExternalTargetFieldApi) { + e.PayrollRun = payrollRun + e.require(externalTargetFieldApiResponseFieldPayrollRun) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTeam(team []*ExternalTargetFieldApi) { + e.Team = team + e.require(externalTargetFieldApiResponseFieldTeam) +} + +// SetTimeOff sets the TimeOff field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTimeOff(timeOff []*ExternalTargetFieldApi) { + e.TimeOff = timeOff + e.require(externalTargetFieldApiResponseFieldTimeOff) +} + +// SetTimeOffBalance sets the TimeOffBalance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTimeOffBalance(timeOffBalance []*ExternalTargetFieldApi) { + e.TimeOffBalance = timeOffBalance + e.require(externalTargetFieldApiResponseFieldTimeOffBalance) +} + +// SetBankInfo sets the BankInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetBankInfo(bankInfo []*ExternalTargetFieldApi) { + e.BankInfo = bankInfo + e.require(externalTargetFieldApiResponseFieldBankInfo) +} + +// SetPayGroup sets the PayGroup field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetPayGroup(payGroup []*ExternalTargetFieldApi) { + e.PayGroup = payGroup + e.require(externalTargetFieldApiResponseFieldPayGroup) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetGroup(group []*ExternalTargetFieldApi) { + e.Group = group + e.require(externalTargetFieldApiResponseFieldGroup) +} + +// SetDependent sets the Dependent field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetDependent(dependent []*ExternalTargetFieldApi) { + e.Dependent = dependent + e.require(externalTargetFieldApiResponseFieldDependent) +} + +// SetTimesheetEntry sets the TimesheetEntry field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTimesheetEntry(timesheetEntry []*ExternalTargetFieldApi) { + e.TimesheetEntry = timesheetEntry + e.require(externalTargetFieldApiResponseFieldTimesheetEntry) +} + func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApiResponse var value unmarshaler @@ -348,6 +766,17 @@ func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApiResponse) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -360,12 +789,22 @@ func (e *ExternalTargetFieldApiResponse) String() string { return fmt.Sprintf("%#v", e) } +var ( + fieldMappingApiInstanceFieldId = big.NewInt(1 << 0) + fieldMappingApiInstanceFieldIsIntegrationWide = big.NewInt(1 << 1) + fieldMappingApiInstanceFieldTargetField = big.NewInt(1 << 2) + fieldMappingApiInstanceFieldRemoteField = big.NewInt(1 << 3) +) + type FieldMappingApiInstance struct { Id *string `json:"id,omitempty" url:"id,omitempty"` IsIntegrationWide *bool `json:"is_integration_wide,omitempty" url:"is_integration_wide,omitempty"` TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty" url:"target_field,omitempty"` RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty" url:"remote_field,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -402,6 +841,41 @@ func (f *FieldMappingApiInstance) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *FieldMappingApiInstance) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetId(id *string) { + f.Id = id + f.require(fieldMappingApiInstanceFieldId) +} + +// SetIsIntegrationWide sets the IsIntegrationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetIsIntegrationWide(isIntegrationWide *bool) { + f.IsIntegrationWide = isIntegrationWide + f.require(fieldMappingApiInstanceFieldIsIntegrationWide) +} + +// SetTargetField sets the TargetField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetTargetField(targetField *FieldMappingApiInstanceTargetField) { + f.TargetField = targetField + f.require(fieldMappingApiInstanceFieldTargetField) +} + +// SetRemoteField sets the RemoteField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetRemoteField(remoteField *FieldMappingApiInstanceRemoteField) { + f.RemoteField = remoteField + f.require(fieldMappingApiInstanceFieldRemoteField) +} + func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstance var value unmarshaler @@ -418,6 +892,17 @@ func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstance) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstance + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstance) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -430,11 +915,20 @@ func (f *FieldMappingApiInstance) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldFieldSchema = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteField struct { RemoteKeyName *string `json:"remote_key_name,omitempty" url:"remote_key_name,omitempty"` Schema map[string]interface{} `json:"schema,omitempty" url:"schema,omitempty"` RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info" url:"remote_endpoint_info"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -464,6 +958,34 @@ func (f *FieldMappingApiInstanceRemoteField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteKeyName(remoteKeyName *string) { + f.RemoteKeyName = remoteKeyName + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetSchema(schema map[string]interface{}) { + f.Schema = schema + f.require(fieldMappingApiInstanceRemoteFieldFieldSchema) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteEndpointInfo(remoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) { + f.RemoteEndpointInfo = remoteEndpointInfo + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo) +} + func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteField var value unmarshaler @@ -480,6 +1002,17 @@ func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceRemoteField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -492,11 +1025,20 @@ func (f *FieldMappingApiInstanceRemoteField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { Method *string `json:"method,omitempty" url:"method,omitempty"` UrlPath *string `json:"url_path,omitempty" url:"url_path,omitempty"` FieldTraversalPath []string `json:"field_traversal_path,omitempty" url:"field_traversal_path,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -526,6 +1068,34 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) GetExtraPropertie return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetMethod(method *string) { + f.Method = method + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetUrlPath(urlPath *string) { + f.UrlPath = urlPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []string) { + f.FieldTraversalPath = fieldTraversalPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo var value unmarshaler @@ -542,6 +1112,17 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(dat return nil } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -554,6 +1135,25 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceResponseFieldBenefit = big.NewInt(1 << 0) + fieldMappingApiInstanceResponseFieldEmployerBenefit = big.NewInt(1 << 1) + fieldMappingApiInstanceResponseFieldCompany = big.NewInt(1 << 2) + fieldMappingApiInstanceResponseFieldEmployeePayrollRun = big.NewInt(1 << 3) + fieldMappingApiInstanceResponseFieldEmployee = big.NewInt(1 << 4) + fieldMappingApiInstanceResponseFieldEmployment = big.NewInt(1 << 5) + fieldMappingApiInstanceResponseFieldLocation = big.NewInt(1 << 6) + fieldMappingApiInstanceResponseFieldPayrollRun = big.NewInt(1 << 7) + fieldMappingApiInstanceResponseFieldTeam = big.NewInt(1 << 8) + fieldMappingApiInstanceResponseFieldTimeOff = big.NewInt(1 << 9) + fieldMappingApiInstanceResponseFieldTimeOffBalance = big.NewInt(1 << 10) + fieldMappingApiInstanceResponseFieldBankInfo = big.NewInt(1 << 11) + fieldMappingApiInstanceResponseFieldPayGroup = big.NewInt(1 << 12) + fieldMappingApiInstanceResponseFieldGroup = big.NewInt(1 << 13) + fieldMappingApiInstanceResponseFieldDependent = big.NewInt(1 << 14) + fieldMappingApiInstanceResponseFieldTimesheetEntry = big.NewInt(1 << 15) +) + type FieldMappingApiInstanceResponse struct { Benefit []*FieldMappingApiInstance `json:"Benefit,omitempty" url:"Benefit,omitempty"` EmployerBenefit []*FieldMappingApiInstance `json:"EmployerBenefit,omitempty" url:"EmployerBenefit,omitempty"` @@ -572,6 +1172,9 @@ type FieldMappingApiInstanceResponse struct { Dependent []*FieldMappingApiInstance `json:"Dependent,omitempty" url:"Dependent,omitempty"` TimesheetEntry []*FieldMappingApiInstance `json:"TimesheetEntry,omitempty" url:"TimesheetEntry,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -692,6 +1295,125 @@ func (f *FieldMappingApiInstanceResponse) GetExtraProperties() map[string]interf return f.extraProperties } +func (f *FieldMappingApiInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetBenefit sets the Benefit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetBenefit(benefit []*FieldMappingApiInstance) { + f.Benefit = benefit + f.require(fieldMappingApiInstanceResponseFieldBenefit) +} + +// SetEmployerBenefit sets the EmployerBenefit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetEmployerBenefit(employerBenefit []*FieldMappingApiInstance) { + f.EmployerBenefit = employerBenefit + f.require(fieldMappingApiInstanceResponseFieldEmployerBenefit) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetCompany(company []*FieldMappingApiInstance) { + f.Company = company + f.require(fieldMappingApiInstanceResponseFieldCompany) +} + +// SetEmployeePayrollRun sets the EmployeePayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetEmployeePayrollRun(employeePayrollRun []*FieldMappingApiInstance) { + f.EmployeePayrollRun = employeePayrollRun + f.require(fieldMappingApiInstanceResponseFieldEmployeePayrollRun) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetEmployee(employee []*FieldMappingApiInstance) { + f.Employee = employee + f.require(fieldMappingApiInstanceResponseFieldEmployee) +} + +// SetEmployment sets the Employment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetEmployment(employment []*FieldMappingApiInstance) { + f.Employment = employment + f.require(fieldMappingApiInstanceResponseFieldEmployment) +} + +// SetLocation sets the Location field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetLocation(location []*FieldMappingApiInstance) { + f.Location = location + f.require(fieldMappingApiInstanceResponseFieldLocation) +} + +// SetPayrollRun sets the PayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetPayrollRun(payrollRun []*FieldMappingApiInstance) { + f.PayrollRun = payrollRun + f.require(fieldMappingApiInstanceResponseFieldPayrollRun) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTeam(team []*FieldMappingApiInstance) { + f.Team = team + f.require(fieldMappingApiInstanceResponseFieldTeam) +} + +// SetTimeOff sets the TimeOff field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTimeOff(timeOff []*FieldMappingApiInstance) { + f.TimeOff = timeOff + f.require(fieldMappingApiInstanceResponseFieldTimeOff) +} + +// SetTimeOffBalance sets the TimeOffBalance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTimeOffBalance(timeOffBalance []*FieldMappingApiInstance) { + f.TimeOffBalance = timeOffBalance + f.require(fieldMappingApiInstanceResponseFieldTimeOffBalance) +} + +// SetBankInfo sets the BankInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetBankInfo(bankInfo []*FieldMappingApiInstance) { + f.BankInfo = bankInfo + f.require(fieldMappingApiInstanceResponseFieldBankInfo) +} + +// SetPayGroup sets the PayGroup field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetPayGroup(payGroup []*FieldMappingApiInstance) { + f.PayGroup = payGroup + f.require(fieldMappingApiInstanceResponseFieldPayGroup) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetGroup(group []*FieldMappingApiInstance) { + f.Group = group + f.require(fieldMappingApiInstanceResponseFieldGroup) +} + +// SetDependent sets the Dependent field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetDependent(dependent []*FieldMappingApiInstance) { + f.Dependent = dependent + f.require(fieldMappingApiInstanceResponseFieldDependent) +} + +// SetTimesheetEntry sets the TimesheetEntry field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTimesheetEntry(timesheetEntry []*FieldMappingApiInstance) { + f.TimesheetEntry = timesheetEntry + f.require(fieldMappingApiInstanceResponseFieldTimesheetEntry) +} + func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceResponse var value unmarshaler @@ -708,6 +1430,17 @@ func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -720,11 +1453,20 @@ func (f *FieldMappingApiInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceTargetFieldFieldName = big.NewInt(1 << 0) + fieldMappingApiInstanceTargetFieldFieldDescription = big.NewInt(1 << 1) + fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceTargetField struct { Name string `json:"name" url:"name"` Description string `json:"description" url:"description"` IsOrganizationWide bool `json:"is_organization_wide" url:"is_organization_wide"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -754,6 +1496,34 @@ func (f *FieldMappingApiInstanceTargetField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceTargetField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetName(name string) { + f.Name = name + f.require(fieldMappingApiInstanceTargetFieldFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetDescription(description string) { + f.Description = description + f.require(fieldMappingApiInstanceTargetFieldFieldDescription) +} + +// SetIsOrganizationWide sets the IsOrganizationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetIsOrganizationWide(isOrganizationWide bool) { + f.IsOrganizationWide = isOrganizationWide + f.require(fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide) +} + func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceTargetField var value unmarshaler @@ -770,6 +1540,17 @@ func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceTargetField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceTargetField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceTargetField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -782,12 +1563,22 @@ func (f *FieldMappingApiInstanceTargetField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingInstanceResponseFieldModel = big.NewInt(1 << 0) + fieldMappingInstanceResponseFieldWarnings = big.NewInt(1 << 1) + fieldMappingInstanceResponseFieldErrors = big.NewInt(1 << 2) + fieldMappingInstanceResponseFieldLogs = big.NewInt(1 << 3) +) + type FieldMappingInstanceResponse struct { Model *FieldMappingApiInstance `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -824,6 +1615,41 @@ func (f *FieldMappingInstanceResponse) GetExtraProperties() map[string]interface return f.extraProperties } +func (f *FieldMappingInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetModel(model *FieldMappingApiInstance) { + f.Model = model + f.require(fieldMappingInstanceResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetWarnings(warnings []*WarningValidationProblem) { + f.Warnings = warnings + f.require(fieldMappingInstanceResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetErrors(errors []*ErrorValidationProblem) { + f.Errors = errors + f.require(fieldMappingInstanceResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetLogs(logs []*DebugModeLog) { + f.Logs = logs + f.require(fieldMappingInstanceResponseFieldLogs) +} + func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingInstanceResponse var value unmarshaler @@ -840,6 +1666,17 @@ func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -852,11 +1689,20 @@ func (f *FieldMappingInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + remoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + remoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + remoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type RemoteEndpointInfo struct { Method string `json:"method" url:"method"` UrlPath string `json:"url_path" url:"url_path"` FieldTraversalPath []interface{} `json:"field_traversal_path" url:"field_traversal_path"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -886,6 +1732,34 @@ func (r *RemoteEndpointInfo) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteEndpointInfo) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetMethod(method string) { + r.Method = method + r.require(remoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetUrlPath(urlPath string) { + r.UrlPath = urlPath + r.require(remoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []interface{}) { + r.FieldTraversalPath = fieldTraversalPath + r.require(remoteEndpointInfoFieldFieldTraversalPath) +} + func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler RemoteEndpointInfo var value unmarshaler @@ -902,6 +1776,17 @@ func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed RemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteEndpointInfo) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -914,6 +1799,15 @@ func (r *RemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldApiFieldSchema = big.NewInt(1 << 0) + remoteFieldApiFieldRemoteKeyName = big.NewInt(1 << 1) + remoteFieldApiFieldRemoteEndpointInfo = big.NewInt(1 << 2) + remoteFieldApiFieldExampleValues = big.NewInt(1 << 3) + remoteFieldApiFieldAdvancedMetadata = big.NewInt(1 << 4) + remoteFieldApiFieldCoverage = big.NewInt(1 << 5) +) + type RemoteFieldApi struct { Schema map[string]interface{} `json:"schema" url:"schema"` RemoteKeyName string `json:"remote_key_name" url:"remote_key_name"` @@ -922,6 +1816,9 @@ type RemoteFieldApi struct { AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty" url:"advanced_metadata,omitempty"` Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty" url:"coverage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -972,6 +1869,55 @@ func (r *RemoteFieldApi) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApi) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetSchema(schema map[string]interface{}) { + r.Schema = schema + r.require(remoteFieldApiFieldSchema) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteKeyName(remoteKeyName string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldApiFieldRemoteKeyName) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteEndpointInfo(remoteEndpointInfo *RemoteEndpointInfo) { + r.RemoteEndpointInfo = remoteEndpointInfo + r.require(remoteFieldApiFieldRemoteEndpointInfo) +} + +// SetExampleValues sets the ExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetExampleValues(exampleValues []interface{}) { + r.ExampleValues = exampleValues + r.require(remoteFieldApiFieldExampleValues) +} + +// SetAdvancedMetadata sets the AdvancedMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetAdvancedMetadata(advancedMetadata *AdvancedMetadata) { + r.AdvancedMetadata = advancedMetadata + r.require(remoteFieldApiFieldAdvancedMetadata) +} + +// SetCoverage sets the Coverage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetCoverage(coverage *RemoteFieldApiCoverage) { + r.Coverage = coverage + r.require(remoteFieldApiFieldCoverage) +} + func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApi var value unmarshaler @@ -988,6 +1934,17 @@ func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApi) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApi) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -1062,6 +2019,25 @@ func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) e return fmt.Errorf("type %T does not include a non-empty union type", r) } +var ( + remoteFieldApiResponseFieldBenefit = big.NewInt(1 << 0) + remoteFieldApiResponseFieldEmployerBenefit = big.NewInt(1 << 1) + remoteFieldApiResponseFieldCompany = big.NewInt(1 << 2) + remoteFieldApiResponseFieldEmployeePayrollRun = big.NewInt(1 << 3) + remoteFieldApiResponseFieldEmployee = big.NewInt(1 << 4) + remoteFieldApiResponseFieldEmployment = big.NewInt(1 << 5) + remoteFieldApiResponseFieldLocation = big.NewInt(1 << 6) + remoteFieldApiResponseFieldPayrollRun = big.NewInt(1 << 7) + remoteFieldApiResponseFieldTeam = big.NewInt(1 << 8) + remoteFieldApiResponseFieldTimeOff = big.NewInt(1 << 9) + remoteFieldApiResponseFieldTimeOffBalance = big.NewInt(1 << 10) + remoteFieldApiResponseFieldBankInfo = big.NewInt(1 << 11) + remoteFieldApiResponseFieldPayGroup = big.NewInt(1 << 12) + remoteFieldApiResponseFieldGroup = big.NewInt(1 << 13) + remoteFieldApiResponseFieldDependent = big.NewInt(1 << 14) + remoteFieldApiResponseFieldTimesheetEntry = big.NewInt(1 << 15) +) + type RemoteFieldApiResponse struct { Benefit []*RemoteFieldApi `json:"Benefit,omitempty" url:"Benefit,omitempty"` EmployerBenefit []*RemoteFieldApi `json:"EmployerBenefit,omitempty" url:"EmployerBenefit,omitempty"` @@ -1080,6 +2056,9 @@ type RemoteFieldApiResponse struct { Dependent []*RemoteFieldApi `json:"Dependent,omitempty" url:"Dependent,omitempty"` TimesheetEntry []*RemoteFieldApi `json:"TimesheetEntry,omitempty" url:"TimesheetEntry,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1200,6 +2179,125 @@ func (r *RemoteFieldApiResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApiResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetBenefit sets the Benefit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetBenefit(benefit []*RemoteFieldApi) { + r.Benefit = benefit + r.require(remoteFieldApiResponseFieldBenefit) +} + +// SetEmployerBenefit sets the EmployerBenefit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetEmployerBenefit(employerBenefit []*RemoteFieldApi) { + r.EmployerBenefit = employerBenefit + r.require(remoteFieldApiResponseFieldEmployerBenefit) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetCompany(company []*RemoteFieldApi) { + r.Company = company + r.require(remoteFieldApiResponseFieldCompany) +} + +// SetEmployeePayrollRun sets the EmployeePayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetEmployeePayrollRun(employeePayrollRun []*RemoteFieldApi) { + r.EmployeePayrollRun = employeePayrollRun + r.require(remoteFieldApiResponseFieldEmployeePayrollRun) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetEmployee(employee []*RemoteFieldApi) { + r.Employee = employee + r.require(remoteFieldApiResponseFieldEmployee) +} + +// SetEmployment sets the Employment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetEmployment(employment []*RemoteFieldApi) { + r.Employment = employment + r.require(remoteFieldApiResponseFieldEmployment) +} + +// SetLocation sets the Location field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetLocation(location []*RemoteFieldApi) { + r.Location = location + r.require(remoteFieldApiResponseFieldLocation) +} + +// SetPayrollRun sets the PayrollRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetPayrollRun(payrollRun []*RemoteFieldApi) { + r.PayrollRun = payrollRun + r.require(remoteFieldApiResponseFieldPayrollRun) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTeam(team []*RemoteFieldApi) { + r.Team = team + r.require(remoteFieldApiResponseFieldTeam) +} + +// SetTimeOff sets the TimeOff field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTimeOff(timeOff []*RemoteFieldApi) { + r.TimeOff = timeOff + r.require(remoteFieldApiResponseFieldTimeOff) +} + +// SetTimeOffBalance sets the TimeOffBalance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTimeOffBalance(timeOffBalance []*RemoteFieldApi) { + r.TimeOffBalance = timeOffBalance + r.require(remoteFieldApiResponseFieldTimeOffBalance) +} + +// SetBankInfo sets the BankInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetBankInfo(bankInfo []*RemoteFieldApi) { + r.BankInfo = bankInfo + r.require(remoteFieldApiResponseFieldBankInfo) +} + +// SetPayGroup sets the PayGroup field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetPayGroup(payGroup []*RemoteFieldApi) { + r.PayGroup = payGroup + r.require(remoteFieldApiResponseFieldPayGroup) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetGroup(group []*RemoteFieldApi) { + r.Group = group + r.require(remoteFieldApiResponseFieldGroup) +} + +// SetDependent sets the Dependent field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetDependent(dependent []*RemoteFieldApi) { + r.Dependent = dependent + r.require(remoteFieldApiResponseFieldDependent) +} + +// SetTimesheetEntry sets the TimesheetEntry field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTimesheetEntry(timesheetEntry []*RemoteFieldApi) { + r.TimesheetEntry = timesheetEntry + r.require(remoteFieldApiResponseFieldTimesheetEntry) +} + func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApiResponse var value unmarshaler @@ -1216,6 +2314,17 @@ func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApiResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { diff --git a/hris/fieldmapping/client.go b/hris/fieldmapping/client.go index 44d8a78..aeae6b5 100644 --- a/hris/fieldmapping/client.go +++ b/hris/fieldmapping/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,42 +38,15 @@ func (c *Client) FieldMappingsRetrieve( request *hris.FieldMappingsRetrieveRequest, opts ...option.RequestOption, ) (*hris.FieldMappingApiInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/hris/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.FieldMappingApiInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -81,44 +55,15 @@ func (c *Client) FieldMappingsCreate( request *hris.CreateFieldMappingRequest, opts ...option.RequestOption, ) (*hris.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsCreate( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/hris/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -127,38 +72,15 @@ func (c *Client) FieldMappingsDestroy( fieldMappingId string, opts ...option.RequestOption, ) (*hris.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsDestroy( + ctx, fieldMappingId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodDelete, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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. @@ -168,40 +90,16 @@ func (c *Client) FieldMappingsPartialUpdate( request *hris.PatchedEditFieldMappingRequest, opts ...option.RequestOption, ) (*hris.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsPartialUpdate( + ctx, fieldMappingId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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/). @@ -210,42 +108,15 @@ func (c *Client) RemoteFieldsRetrieve( request *hris.RemoteFieldsRetrieveRequest, opts ...option.RequestOption, ) (*hris.RemoteFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.RemoteFieldsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/hris/v1/remote-fields" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.RemoteFieldApiResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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/). @@ -253,33 +124,12 @@ func (c *Client) TargetFieldsRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*hris.ExternalTargetFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/target-fields" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.ExternalTargetFieldApiResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.TargetFieldsRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/fieldmapping/hris_field_mapping_test/hris_field_mapping_test.go b/hris/fieldmapping/hris_field_mapping_test/hris_field_mapping_test.go new file mode 100644 index 0000000..670eec2 --- /dev/null +++ b/hris/fieldmapping/hris_field_mapping_test/hris_field_mapping_test.go @@ -0,0 +1,210 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_field_mapping_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisFieldMappingFieldMappingsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestHrisFieldMappingFieldMappingsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } + _, invocationErr := client.Hris.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestHrisFieldMappingFieldMappingsDestroyWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + response, invocationErr := client.Hris.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) + + // DELETE operations may return nil response body, which is acceptable + if invocationErr != nil && response == nil { + // This is expected for DELETE operations that return 204 No Content + require.Contains(t, invocationErr.Error(), "but the server responded with nothing", "Expected empty response error") + } else { + require.NoError(t, invocationErr, "Client method call should succeed") + } + VerifyRequestCount(t, "DELETE", "/hris/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestHrisFieldMappingFieldMappingsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.PatchedEditFieldMappingRequest{} + _, invocationErr := client.Hris.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/hris/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestHrisFieldMappingRemoteFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } + _, invocationErr := client.Hris.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/remote-fields", map[string]string{"common_models": "common_models", "include_example_values": "include_example_values"}, 1) +} + +func TestHrisFieldMappingTargetFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/target-fields", nil, 1) +} diff --git a/hris/fieldmapping/raw_client.go b/hris/fieldmapping/raw_client.go new file mode 100644 index 0000000..c5405c9 --- /dev/null +++ b/hris/fieldmapping/raw_client.go @@ -0,0 +1,302 @@ +// Code generated by Fern. DO NOT EDIT. + +package fieldmapping + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) FieldMappingsRetrieve( + ctx context.Context, + request *hris.FieldMappingsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.FieldMappingApiInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.FieldMappingApiInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.FieldMappingApiInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsCreate( + ctx context.Context, + request *hris.CreateFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsDestroy( + ctx context.Context, + fieldMappingId string, + opts ...option.RequestOption, +) (*core.Response[*hris.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsPartialUpdate( + ctx context.Context, + fieldMappingId string, + request *hris.PatchedEditFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) RemoteFieldsRetrieve( + ctx context.Context, + request *hris.RemoteFieldsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.RemoteFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/remote-fields" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.RemoteFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.RemoteFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) TargetFieldsRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*hris.ExternalTargetFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/target-fields" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.ExternalTargetFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.ExternalTargetFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/forceresync/client.go b/hris/forceresync/client.go index c369763..43a6a8f 100644 --- a/hris/forceresync/client.go +++ b/hris/forceresync/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) SyncStatusResyncCreate( ctx context.Context, opts ...option.RequestOption, ) ([]*hris.SyncStatus, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/sync-status/resync" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*hris.SyncStatus - if err := c.caller.Call( + response, err := c.WithRawResponse.SyncStatusResyncCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/forceresync/hris_force_resync_test/hris_force_resync_test.go b/hris/forceresync/hris_force_resync_test/hris_force_resync_test.go new file mode 100644 index 0000000..d556b5f --- /dev/null +++ b/hris/forceresync/hris_force_resync_test/hris_force_resync_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_force_resync_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisForceResyncSyncStatusResyncCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/sync-status/resync", nil, 1) +} diff --git a/hris/forceresync/raw_client.go b/hris/forceresync/raw_client.go new file mode 100644 index 0000000..7426624 --- /dev/null +++ b/hris/forceresync/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package forceresync + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) SyncStatusResyncCreate( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*hris.SyncStatus], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/sync-status/resync" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*hris.SyncStatus + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*hris.SyncStatus]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/generate_key.go b/hris/generate_key.go index 922a1a2..ba89155 100644 --- a/hris/generate_key.go +++ b/hris/generate_key.go @@ -2,7 +2,32 @@ package hris +import ( + big "math/big" +) + +var ( + generateRemoteKeyRequestFieldName = big.NewInt(1 << 0) +) + type GenerateRemoteKeyRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GenerateRemoteKeyRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GenerateRemoteKeyRequest) SetName(name string) { + g.Name = name + g.require(generateRemoteKeyRequestFieldName) } diff --git a/hris/generatekey/client.go b/hris/generatekey/client.go index b3d7f10..fec0c44 100644 --- a/hris/generatekey/client.go +++ b/hris/generatekey/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *hris.GenerateRemoteKeyRequest, opts ...option.RequestOption, ) (*hris.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/generate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/generatekey/hris_generate_key_test/hris_generate_key_test.go b/hris/generatekey/hris_generate_key_test/hris_generate_key_test.go new file mode 100644 index 0000000..600a5d2 --- /dev/null +++ b/hris/generatekey/hris_generate_key_test/hris_generate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_generate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisGenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Hris.GenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/generate-key", nil, 1) +} diff --git a/hris/generatekey/raw_client.go b/hris/generatekey/raw_client.go new file mode 100644 index 0000000..15dae54 --- /dev/null +++ b/hris/generatekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package generatekey + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *hris.GenerateRemoteKeyRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/generate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/groups.go b/hris/groups.go index 4540b3b..b9d8cc4 100644 --- a/hris/groups.go +++ b/hris/groups.go @@ -6,9 +6,28 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + groupsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + groupsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + groupsListRequestFieldCursor = big.NewInt(1 << 2) + groupsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + groupsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + groupsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + groupsListRequestFieldIsCommonlyUsedAsTeam = big.NewInt(1 << 6) + groupsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + groupsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + groupsListRequestFieldNames = big.NewInt(1 << 9) + groupsListRequestFieldPageSize = big.NewInt(1 << 10) + groupsListRequestFieldRemoteFields = big.NewInt(1 << 11) + groupsListRequestFieldRemoteId = big.NewInt(1 << 12) + groupsListRequestFieldShowEnumOrigins = big.NewInt(1 << 13) + groupsListRequestFieldTypes = big.NewInt(1 << 14) +) + type GroupsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -40,8 +59,130 @@ type GroupsListRequest struct { ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` // If provided, will only return groups of these types. Multiple values can be separated by commas. Types *string `json:"-" url:"types,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (g *GroupsListRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetCreatedAfter(createdAfter *time.Time) { + g.CreatedAfter = createdAfter + g.require(groupsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetCreatedBefore(createdBefore *time.Time) { + g.CreatedBefore = createdBefore + g.require(groupsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetCursor(cursor *string) { + g.Cursor = cursor + g.require(groupsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + g.IncludeDeletedData = includeDeletedData + g.require(groupsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + g.IncludeRemoteData = includeRemoteData + g.require(groupsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetIncludeShellData(includeShellData *bool) { + g.IncludeShellData = includeShellData + g.require(groupsListRequestFieldIncludeShellData) +} + +// SetIsCommonlyUsedAsTeam sets the IsCommonlyUsedAsTeam field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetIsCommonlyUsedAsTeam(isCommonlyUsedAsTeam *string) { + g.IsCommonlyUsedAsTeam = isCommonlyUsedAsTeam + g.require(groupsListRequestFieldIsCommonlyUsedAsTeam) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + g.ModifiedAfter = modifiedAfter + g.require(groupsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + g.ModifiedBefore = modifiedBefore + g.require(groupsListRequestFieldModifiedBefore) +} + +// SetNames sets the Names field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetNames(names *string) { + g.Names = names + g.require(groupsListRequestFieldNames) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetPageSize(pageSize *int) { + g.PageSize = pageSize + g.require(groupsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetRemoteFields(remoteFields *string) { + g.RemoteFields = remoteFields + g.require(groupsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetRemoteId(remoteId *string) { + g.RemoteId = remoteId + g.require(groupsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + g.ShowEnumOrigins = showEnumOrigins + g.require(groupsListRequestFieldShowEnumOrigins) +} + +// SetTypes sets the Types field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsListRequest) SetTypes(types *string) { + g.Types = types + g.require(groupsListRequestFieldTypes) +} + +var ( + groupsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + groupsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) + groupsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 2) + groupsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 3) +) + type GroupsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -51,13 +192,60 @@ type GroupsRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GroupsRetrieveRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + g.IncludeRemoteData = includeRemoteData + g.require(groupsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + g.IncludeShellData = includeShellData + g.require(groupsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsRetrieveRequest) SetRemoteFields(remoteFields *string) { + g.RemoteFields = remoteFields + g.require(groupsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GroupsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + g.ShowEnumOrigins = showEnumOrigins + g.require(groupsRetrieveRequestFieldShowEnumOrigins) } +var ( + paginatedGroupListFieldNext = big.NewInt(1 << 0) + paginatedGroupListFieldPrevious = big.NewInt(1 << 1) + paginatedGroupListFieldResults = big.NewInt(1 << 2) +) + type PaginatedGroupList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Group `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -87,6 +275,34 @@ func (p *PaginatedGroupList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedGroupList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedGroupList) SetNext(next *string) { + p.Next = next + p.require(paginatedGroupListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedGroupList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedGroupListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedGroupList) SetResults(results []*Group) { + p.Results = results + p.require(paginatedGroupListFieldResults) +} + func (p *PaginatedGroupList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedGroupList var value unmarshaler @@ -103,6 +319,17 @@ func (p *PaginatedGroupList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedGroupList) MarshalJSON() ([]byte, error) { + type embed PaginatedGroupList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedGroupList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/groups/client.go b/hris/groups/client.go index e545f44..3997f81 100644 --- a/hris/groups/client.go +++ b/hris/groups/client.go @@ -4,7 +4,6 @@ package groups import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.GroupsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.Group], error) { +) (*core.Page[*string, *hris.Group], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedGroupList) *internal.PageResponse[*string, *hris.Group] { + readPageResponse := func(response *hris.PaginatedGroupList) *core.PageResponse[*string, *hris.Group] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.Group]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.Group]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.GroupsRetrieveRequest, opts ...option.RequestOption, ) (*hris.Group, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/groups/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.Group - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/groups/hris_groups_test/hris_groups_test.go b/hris/groups/hris_groups_test/hris_groups_test.go new file mode 100644 index 0000000..03d1677 --- /dev/null +++ b/hris/groups/hris_groups_test/hris_groups_test.go @@ -0,0 +1,159 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_groups_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisGroupsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.GroupsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonlyUsedAsTeam: merge.String( + "is_commonly_used_as_team", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Names: merge.String( + "names", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Types: merge.String( + "types", + ), + } + _, invocationErr := client.Hris.Groups.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/groups", map[string]string{"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"}, 1) +} + +func TestHrisGroupsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.GroupsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.Groups.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/groups/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "type", "show_enum_origins": "type"}, 1) +} diff --git a/hris/groups/raw_client.go b/hris/groups/raw_client.go new file mode 100644 index 0000000..61cb113 --- /dev/null +++ b/hris/groups/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package groups + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.GroupsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.Group], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/groups/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.Group + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.Group]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/issues.go b/hris/issues.go index e26293a..6b272bc 100644 --- a/hris/issues.go +++ b/hris/issues.go @@ -6,9 +6,27 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + issuesListRequestFieldAccountToken = big.NewInt(1 << 0) + issuesListRequestFieldCursor = big.NewInt(1 << 1) + issuesListRequestFieldEndDate = big.NewInt(1 << 2) + issuesListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + issuesListRequestFieldFirstIncidentTimeAfter = big.NewInt(1 << 4) + issuesListRequestFieldFirstIncidentTimeBefore = big.NewInt(1 << 5) + issuesListRequestFieldIncludeMuted = big.NewInt(1 << 6) + issuesListRequestFieldIntegrationName = big.NewInt(1 << 7) + issuesListRequestFieldLastIncidentTimeAfter = big.NewInt(1 << 8) + issuesListRequestFieldLastIncidentTimeBefore = big.NewInt(1 << 9) + issuesListRequestFieldLinkedAccountId = big.NewInt(1 << 10) + issuesListRequestFieldPageSize = big.NewInt(1 << 11) + issuesListRequestFieldStartDate = big.NewInt(1 << 12) + issuesListRequestFieldStatus = big.NewInt(1 << 13) +) + type IssuesListRequest struct { AccountToken *string `json:"-" url:"account_token,omitempty"` // The pagination cursor value. @@ -38,6 +56,114 @@ type IssuesListRequest struct { // * `ONGOING` - ONGOING // * `RESOLVED` - RESOLVED Status *IssuesListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *IssuesListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetAccountToken(accountToken *string) { + i.AccountToken = accountToken + i.require(issuesListRequestFieldAccountToken) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(issuesListRequestFieldCursor) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndDate(endDate *string) { + i.EndDate = endDate + i.require(issuesListRequestFieldEndDate) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + i.EndUserOrganizationName = endUserOrganizationName + i.require(issuesListRequestFieldEndUserOrganizationName) +} + +// SetFirstIncidentTimeAfter sets the FirstIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeAfter(firstIncidentTimeAfter *time.Time) { + i.FirstIncidentTimeAfter = firstIncidentTimeAfter + i.require(issuesListRequestFieldFirstIncidentTimeAfter) +} + +// SetFirstIncidentTimeBefore sets the FirstIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeBefore(firstIncidentTimeBefore *time.Time) { + i.FirstIncidentTimeBefore = firstIncidentTimeBefore + i.require(issuesListRequestFieldFirstIncidentTimeBefore) +} + +// SetIncludeMuted sets the IncludeMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIncludeMuted(includeMuted *string) { + i.IncludeMuted = includeMuted + i.require(issuesListRequestFieldIncludeMuted) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIntegrationName(integrationName *string) { + i.IntegrationName = integrationName + i.require(issuesListRequestFieldIntegrationName) +} + +// SetLastIncidentTimeAfter sets the LastIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeAfter(lastIncidentTimeAfter *time.Time) { + i.LastIncidentTimeAfter = lastIncidentTimeAfter + i.require(issuesListRequestFieldLastIncidentTimeAfter) +} + +// SetLastIncidentTimeBefore sets the LastIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeBefore(lastIncidentTimeBefore *time.Time) { + i.LastIncidentTimeBefore = lastIncidentTimeBefore + i.require(issuesListRequestFieldLastIncidentTimeBefore) +} + +// SetLinkedAccountId sets the LinkedAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLinkedAccountId(linkedAccountId *string) { + i.LinkedAccountId = linkedAccountId + i.require(issuesListRequestFieldLinkedAccountId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(issuesListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStartDate(startDate *string) { + i.StartDate = startDate + i.require(issuesListRequestFieldStartDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStatus(status *IssuesListRequestStatus) { + i.Status = status + i.require(issuesListRequestFieldStatus) } type IssuesListRequestStatus string @@ -62,6 +188,17 @@ func (i IssuesListRequestStatus) Ptr() *IssuesListRequestStatus { return &i } +var ( + issueFieldId = big.NewInt(1 << 0) + issueFieldStatus = big.NewInt(1 << 1) + issueFieldErrorDescription = big.NewInt(1 << 2) + issueFieldEndUser = big.NewInt(1 << 3) + issueFieldFirstIncidentTime = big.NewInt(1 << 4) + issueFieldLastIncidentTime = big.NewInt(1 << 5) + issueFieldIsMuted = big.NewInt(1 << 6) + issueFieldErrorDetails = big.NewInt(1 << 7) +) + type Issue struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -76,6 +213,9 @@ type Issue struct { IsMuted *bool `json:"is_muted,omitempty" url:"is_muted,omitempty"` ErrorDetails []string `json:"error_details,omitempty" url:"error_details,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +280,69 @@ func (i *Issue) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *Issue) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetId(id *string) { + i.Id = id + i.require(issueFieldId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetStatus(status *IssueStatus) { + i.Status = status + i.require(issueFieldStatus) +} + +// SetErrorDescription sets the ErrorDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDescription(errorDescription string) { + i.ErrorDescription = errorDescription + i.require(issueFieldErrorDescription) +} + +// SetEndUser sets the EndUser field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetEndUser(endUser map[string]interface{}) { + i.EndUser = endUser + i.require(issueFieldEndUser) +} + +// SetFirstIncidentTime sets the FirstIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetFirstIncidentTime(firstIncidentTime *time.Time) { + i.FirstIncidentTime = firstIncidentTime + i.require(issueFieldFirstIncidentTime) +} + +// SetLastIncidentTime sets the LastIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetLastIncidentTime(lastIncidentTime *time.Time) { + i.LastIncidentTime = lastIncidentTime + i.require(issueFieldLastIncidentTime) +} + +// SetIsMuted sets the IsMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetIsMuted(isMuted *bool) { + i.IsMuted = isMuted + i.require(issueFieldIsMuted) +} + +// SetErrorDetails sets the ErrorDetails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDetails(errorDetails []string) { + i.ErrorDetails = errorDetails + i.require(issueFieldErrorDetails) +} + func (i *Issue) UnmarshalJSON(data []byte) error { type embed Issue var unmarshaler = struct { @@ -175,7 +378,8 @@ func (i *Issue) MarshalJSON() ([]byte, error) { FirstIncidentTime: internal.NewOptionalDateTime(i.FirstIncidentTime), LastIncidentTime: internal.NewOptionalDateTime(i.LastIncidentTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *Issue) String() string { @@ -280,11 +484,20 @@ func (i IssueStatusEnum) Ptr() *IssueStatusEnum { return &i } +var ( + paginatedIssueListFieldNext = big.NewInt(1 << 0) + paginatedIssueListFieldPrevious = big.NewInt(1 << 1) + paginatedIssueListFieldResults = big.NewInt(1 << 2) +) + type PaginatedIssueList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Issue `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -314,6 +527,34 @@ func (p *PaginatedIssueList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedIssueList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetNext(next *string) { + p.Next = next + p.require(paginatedIssueListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedIssueListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetResults(results []*Issue) { + p.Results = results + p.require(paginatedIssueListFieldResults) +} + func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedIssueList var value unmarshaler @@ -330,6 +571,17 @@ func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedIssueList) MarshalJSON() ([]byte, error) { + type embed PaginatedIssueList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedIssueList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/issues/client.go b/hris/issues/client.go index 372391e..c8e938f 100644 --- a/hris/issues/client.go +++ b/hris/issues/client.go @@ -4,7 +4,6 @@ package issues import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.IssuesListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.Issue], error) { +) (*core.Page[*string, *hris.Issue], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedIssueList) *internal.PageResponse[*string, *hris.Issue] { + readPageResponse := func(response *hris.PaginatedIssueList) *core.PageResponse[*string, *hris.Issue] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.Issue]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.Issue]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,36 +97,13 @@ func (c *Client) Retrieve( id string, opts ...option.RequestOption, ) (*hris.Issue, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/issues/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.Issue - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/issues/hris_issues_test/hris_issues_test.go b/hris/issues/hris_issues_test/hris_issues_test.go new file mode 100644 index 0000000..a11e8b9 --- /dev/null +++ b/hris/issues/hris_issues_test/hris_issues_test.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_issues_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisIssuesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: hris.IssuesListRequestStatusOngoing.Ptr(), + } + _, invocationErr := client.Hris.Issues.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/issues", map[string]string{"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"}, 1) +} + +func TestHrisIssuesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.Issues.Retrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/issues/id", nil, 1) +} diff --git a/hris/issues/raw_client.go b/hris/issues/raw_client.go new file mode 100644 index 0000000..35dc6d5 --- /dev/null +++ b/hris/issues/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package issues + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*hris.Issue], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/issues/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.Issue + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.Issue]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/link_token.go b/hris/link_token.go index e69241e..7e30092 100644 --- a/hris/link_token.go +++ b/hris/link_token.go @@ -6,6 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + endUserDetailsRequestFieldEndUserEmailAddress = big.NewInt(1 << 0) + endUserDetailsRequestFieldEndUserOrganizationName = big.NewInt(1 << 1) + endUserDetailsRequestFieldEndUserOriginId = big.NewInt(1 << 2) + endUserDetailsRequestFieldCategories = big.NewInt(1 << 3) + endUserDetailsRequestFieldIntegration = big.NewInt(1 << 4) + endUserDetailsRequestFieldLinkExpiryMins = big.NewInt(1 << 5) + endUserDetailsRequestFieldShouldCreateMagicLinkUrl = big.NewInt(1 << 6) + endUserDetailsRequestFieldHideAdminMagicLink = big.NewInt(1 << 7) + endUserDetailsRequestFieldCommonModels = big.NewInt(1 << 8) + endUserDetailsRequestFieldCategoryCommonModelScopes = big.NewInt(1 << 9) + endUserDetailsRequestFieldLanguage = big.NewInt(1 << 10) + endUserDetailsRequestFieldAreSyncsDisabled = big.NewInt(1 << 11) + endUserDetailsRequestFieldIntegrationSpecificConfig = big.NewInt(1 << 12) ) type EndUserDetailsRequest struct { @@ -38,6 +55,107 @@ type EndUserDetailsRequest struct { AreSyncsDisabled *bool `json:"are_syncs_disabled,omitempty" url:"-"` // A JSON object containing integration-specific configuration options. IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EndUserDetailsRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserEmailAddress(endUserEmailAddress string) { + e.EndUserEmailAddress = endUserEmailAddress + e.require(endUserDetailsRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOrganizationName(endUserOrganizationName string) { + e.EndUserOrganizationName = endUserOrganizationName + e.require(endUserDetailsRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOriginId(endUserOriginId string) { + e.EndUserOriginId = endUserOriginId + e.require(endUserDetailsRequestFieldEndUserOriginId) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategories(categories []CategoriesEnum) { + e.Categories = categories + e.require(endUserDetailsRequestFieldCategories) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegration(integration *string) { + e.Integration = integration + e.require(endUserDetailsRequestFieldIntegration) +} + +// SetLinkExpiryMins sets the LinkExpiryMins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLinkExpiryMins(linkExpiryMins *int) { + e.LinkExpiryMins = linkExpiryMins + e.require(endUserDetailsRequestFieldLinkExpiryMins) +} + +// SetShouldCreateMagicLinkUrl sets the ShouldCreateMagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetShouldCreateMagicLinkUrl(shouldCreateMagicLinkUrl *bool) { + e.ShouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl + e.require(endUserDetailsRequestFieldShouldCreateMagicLinkUrl) +} + +// SetHideAdminMagicLink sets the HideAdminMagicLink field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetHideAdminMagicLink(hideAdminMagicLink *bool) { + e.HideAdminMagicLink = hideAdminMagicLink + e.require(endUserDetailsRequestFieldHideAdminMagicLink) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCommonModels(commonModels []*CommonModelScopesBodyRequest) { + e.CommonModels = commonModels + e.require(endUserDetailsRequestFieldCommonModels) +} + +// SetCategoryCommonModelScopes sets the CategoryCommonModelScopes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategoryCommonModelScopes(categoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest) { + e.CategoryCommonModelScopes = categoryCommonModelScopes + e.require(endUserDetailsRequestFieldCategoryCommonModelScopes) +} + +// SetLanguage sets the Language field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLanguage(language *EndUserDetailsRequestLanguage) { + e.Language = language + e.require(endUserDetailsRequestFieldLanguage) +} + +// SetAreSyncsDisabled sets the AreSyncsDisabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetAreSyncsDisabled(areSyncsDisabled *bool) { + e.AreSyncsDisabled = areSyncsDisabled + e.require(endUserDetailsRequestFieldAreSyncsDisabled) +} + +// SetIntegrationSpecificConfig sets the IntegrationSpecificConfig field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegrationSpecificConfig(integrationSpecificConfig map[string]interface{}) { + e.IntegrationSpecificConfig = integrationSpecificConfig + e.require(endUserDetailsRequestFieldIntegrationSpecificConfig) } // The following subset of IETF language tags can be used to configure localization. @@ -106,11 +224,20 @@ func (e *EndUserDetailsRequestLanguage) Accept(visitor EndUserDetailsRequestLang return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + commonModelScopesBodyRequestFieldModelId = big.NewInt(1 << 0) + commonModelScopesBodyRequestFieldEnabledActions = big.NewInt(1 << 1) + commonModelScopesBodyRequestFieldDisabledFields = big.NewInt(1 << 2) +) + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id" url:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions" url:"enabled_actions"` DisabledFields []string `json:"disabled_fields" url:"disabled_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +267,34 @@ func (c *CommonModelScopesBodyRequest) GetExtraProperties() map[string]interface return c.extraProperties } +func (c *CommonModelScopesBodyRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetModelId(modelId string) { + c.ModelId = modelId + c.require(commonModelScopesBodyRequestFieldModelId) +} + +// SetEnabledActions sets the EnabledActions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetEnabledActions(enabledActions []EnabledActionsEnum) { + c.EnabledActions = enabledActions + c.require(commonModelScopesBodyRequestFieldEnabledActions) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetDisabledFields(disabledFields []string) { + c.DisabledFields = disabledFields + c.require(commonModelScopesBodyRequestFieldDisabledFields) +} + func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopesBodyRequest var value unmarshaler @@ -156,6 +311,17 @@ func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopesBodyRequest) MarshalJSON() ([]byte, error) { + type embed CommonModelScopesBodyRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopesBodyRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -216,11 +382,20 @@ func (l LanguageEnum) Ptr() *LanguageEnum { return &l } +var ( + linkTokenFieldLinkToken = big.NewInt(1 << 0) + linkTokenFieldIntegrationName = big.NewInt(1 << 1) + linkTokenFieldMagicLinkUrl = big.NewInt(1 << 2) +) + type LinkToken struct { LinkToken string `json:"link_token" url:"link_token"` IntegrationName *string `json:"integration_name,omitempty" url:"integration_name,omitempty"` MagicLinkUrl *string `json:"magic_link_url,omitempty" url:"magic_link_url,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -250,6 +425,34 @@ func (l *LinkToken) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkToken) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkToken sets the LinkToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetLinkToken(linkToken string) { + l.LinkToken = linkToken + l.require(linkTokenFieldLinkToken) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkTokenFieldIntegrationName) +} + +// SetMagicLinkUrl sets the MagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetMagicLinkUrl(magicLinkUrl *string) { + l.MagicLinkUrl = magicLinkUrl + l.require(linkTokenFieldMagicLinkUrl) +} + func (l *LinkToken) UnmarshalJSON(data []byte) error { type unmarshaler LinkToken var value unmarshaler @@ -266,6 +469,17 @@ func (l *LinkToken) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkToken) MarshalJSON() ([]byte, error) { + type embed LinkToken + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkToken) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { diff --git a/hris/linked_accounts.go b/hris/linked_accounts.go index f8fd060..61da819 100644 --- a/hris/linked_accounts.go +++ b/hris/linked_accounts.go @@ -6,9 +6,26 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + linkedAccountsListRequestFieldCategory = big.NewInt(1 << 0) + linkedAccountsListRequestFieldCursor = big.NewInt(1 << 1) + linkedAccountsListRequestFieldEndUserEmailAddress = big.NewInt(1 << 2) + linkedAccountsListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + linkedAccountsListRequestFieldEndUserOriginId = big.NewInt(1 << 4) + linkedAccountsListRequestFieldEndUserOriginIds = big.NewInt(1 << 5) + linkedAccountsListRequestFieldId = big.NewInt(1 << 6) + linkedAccountsListRequestFieldIds = big.NewInt(1 << 7) + linkedAccountsListRequestFieldIncludeDuplicates = big.NewInt(1 << 8) + linkedAccountsListRequestFieldIntegrationName = big.NewInt(1 << 9) + linkedAccountsListRequestFieldIsTestAccount = big.NewInt(1 << 10) + linkedAccountsListRequestFieldPageSize = big.NewInt(1 << 11) + linkedAccountsListRequestFieldStatus = big.NewInt(1 << 12) +) + type LinkedAccountsListRequest struct { // Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` // @@ -43,6 +60,107 @@ type LinkedAccountsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` Status *string `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountsListRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCategory(category *LinkedAccountsListRequestCategory) { + l.Category = category + l.require(linkedAccountsListRequestFieldCategory) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCursor(cursor *string) { + l.Cursor = cursor + l.require(linkedAccountsListRequestFieldCursor) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserEmailAddress(endUserEmailAddress *string) { + l.EndUserEmailAddress = endUserEmailAddress + l.require(linkedAccountsListRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + l.EndUserOrganizationName = endUserOrganizationName + l.require(linkedAccountsListRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginId(endUserOriginId *string) { + l.EndUserOriginId = endUserOriginId + l.require(linkedAccountsListRequestFieldEndUserOriginId) +} + +// SetEndUserOriginIds sets the EndUserOriginIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginIds(endUserOriginIds *string) { + l.EndUserOriginIds = endUserOriginIds + l.require(linkedAccountsListRequestFieldEndUserOriginIds) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetId(id *string) { + l.Id = id + l.require(linkedAccountsListRequestFieldId) +} + +// SetIds sets the Ids field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIds(ids *string) { + l.Ids = ids + l.require(linkedAccountsListRequestFieldIds) +} + +// SetIncludeDuplicates sets the IncludeDuplicates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIncludeDuplicates(includeDuplicates *bool) { + l.IncludeDuplicates = includeDuplicates + l.require(linkedAccountsListRequestFieldIncludeDuplicates) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkedAccountsListRequestFieldIntegrationName) +} + +// SetIsTestAccount sets the IsTestAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIsTestAccount(isTestAccount *string) { + l.IsTestAccount = isTestAccount + l.require(linkedAccountsListRequestFieldIsTestAccount) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetPageSize(pageSize *int) { + l.PageSize = pageSize + l.require(linkedAccountsListRequestFieldPageSize) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetStatus(status *string) { + l.Status = status + l.require(linkedAccountsListRequestFieldStatus) } type LinkedAccountsListRequestCategory string @@ -88,6 +206,22 @@ func (l LinkedAccountsListRequestCategory) Ptr() *LinkedAccountsListRequestCateg // // ### Usage Example // View a list of your organization's `LinkedAccount` objects. +var ( + accountDetailsAndActionsFieldId = big.NewInt(1 << 0) + accountDetailsAndActionsFieldCategory = big.NewInt(1 << 1) + accountDetailsAndActionsFieldStatus = big.NewInt(1 << 2) + accountDetailsAndActionsFieldStatusDetail = big.NewInt(1 << 3) + accountDetailsAndActionsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsAndActionsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsAndActionsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsAndActionsFieldSubdomain = big.NewInt(1 << 7) + accountDetailsAndActionsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsAndActionsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsAndActionsFieldIntegration = big.NewInt(1 << 10) + accountDetailsAndActionsFieldAccountType = big.NewInt(1 << 11) + accountDetailsAndActionsFieldCompletedAt = big.NewInt(1 << 12) +) + type AccountDetailsAndActions struct { Id string `json:"id" url:"id"` Category *AccountDetailsAndActionsCategory `json:"category,omitempty" url:"category,omitempty"` @@ -105,6 +239,9 @@ type AccountDetailsAndActions struct { AccountType string `json:"account_type" url:"account_type"` CompletedAt time.Time `json:"completed_at" url:"completed_at"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -204,6 +341,104 @@ func (a *AccountDetailsAndActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetailsAndActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetId(id string) { + a.Id = id + a.require(accountDetailsAndActionsFieldId) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCategory(category *AccountDetailsAndActionsCategory) { + a.Category = category + a.require(accountDetailsAndActionsFieldCategory) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatus(status *AccountDetailsAndActionsStatus) { + a.Status = status + a.require(accountDetailsAndActionsFieldStatus) +} + +// SetStatusDetail sets the StatusDetail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatusDetail(statusDetail *string) { + a.StatusDetail = statusDetail + a.require(accountDetailsAndActionsFieldStatusDetail) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsAndActionsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOrganizationName(endUserOrganizationName string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsAndActionsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserEmailAddress(endUserEmailAddress string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsAndActionsFieldEndUserEmailAddress) +} + +// SetSubdomain sets the Subdomain field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetSubdomain(subdomain *string) { + a.Subdomain = subdomain + a.require(accountDetailsAndActionsFieldSubdomain) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetWebhookListenerUrl(webhookListenerUrl string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsAndActionsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsAndActionsFieldIsDuplicate) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIntegration(integration *AccountDetailsAndActionsIntegration) { + a.Integration = integration + a.require(accountDetailsAndActionsFieldIntegration) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetAccountType(accountType string) { + a.AccountType = accountType + a.require(accountDetailsAndActionsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCompletedAt(completedAt time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsAndActionsFieldCompletedAt) +} + func (a *AccountDetailsAndActions) UnmarshalJSON(data []byte) error { type embed AccountDetailsAndActions var unmarshaler = struct { @@ -235,7 +470,8 @@ func (a *AccountDetailsAndActions) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetailsAndActions) String() string { @@ -312,6 +548,17 @@ func (a *AccountDetailsAndActionsCategory) Accept(visitor AccountDetailsAndActio return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + accountDetailsAndActionsIntegrationFieldName = big.NewInt(1 << 0) + accountDetailsAndActionsIntegrationFieldCategories = big.NewInt(1 << 1) + accountDetailsAndActionsIntegrationFieldImage = big.NewInt(1 << 2) + accountDetailsAndActionsIntegrationFieldSquareImage = big.NewInt(1 << 3) + accountDetailsAndActionsIntegrationFieldColor = big.NewInt(1 << 4) + accountDetailsAndActionsIntegrationFieldSlug = big.NewInt(1 << 5) + accountDetailsAndActionsIntegrationFieldPassthroughAvailable = big.NewInt(1 << 6) + accountDetailsAndActionsIntegrationFieldAvailableModelOperations = big.NewInt(1 << 7) +) + type AccountDetailsAndActionsIntegration struct { Name string `json:"name" url:"name"` Categories []CategoriesEnum `json:"categories" url:"categories"` @@ -322,6 +569,9 @@ type AccountDetailsAndActionsIntegration struct { PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -386,6 +636,69 @@ func (a *AccountDetailsAndActionsIntegration) GetExtraProperties() map[string]in return a.extraProperties } +func (a *AccountDetailsAndActionsIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetName(name string) { + a.Name = name + a.require(accountDetailsAndActionsIntegrationFieldName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountDetailsAndActionsIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetImage(image *string) { + a.Image = image + a.require(accountDetailsAndActionsIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountDetailsAndActionsIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetColor(color string) { + a.Color = color + a.require(accountDetailsAndActionsIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSlug(slug string) { + a.Slug = slug + a.require(accountDetailsAndActionsIntegrationFieldSlug) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(accountDetailsAndActionsIntegrationFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(accountDetailsAndActionsIntegrationFieldAvailableModelOperations) +} + func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountDetailsAndActionsIntegration var value unmarshaler @@ -402,6 +715,17 @@ func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountDetailsAndActionsIntegration) MarshalJSON() ([]byte, error) { + type embed AccountDetailsAndActionsIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountDetailsAndActionsIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -508,11 +832,20 @@ func (a AccountDetailsAndActionsStatusEnum) Ptr() *AccountDetailsAndActionsStatu return &a } +var ( + paginatedAccountDetailsAndActionsListFieldNext = big.NewInt(1 << 0) + paginatedAccountDetailsAndActionsListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountDetailsAndActionsListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AccountDetailsAndActions `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -542,6 +875,34 @@ func (p *PaginatedAccountDetailsAndActionsList) GetExtraProperties() map[string] return p.extraProperties } +func (p *PaginatedAccountDetailsAndActionsList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountDetailsAndActionsListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountDetailsAndActionsListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetResults(results []*AccountDetailsAndActions) { + p.Results = results + p.require(paginatedAccountDetailsAndActionsListFieldResults) +} + func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountDetailsAndActionsList var value unmarshaler @@ -558,6 +919,17 @@ func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error return nil } +func (p *PaginatedAccountDetailsAndActionsList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountDetailsAndActionsList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountDetailsAndActionsList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/linkedaccounts/client.go b/hris/linkedaccounts/client.go index 2f90fa4..b47fd36 100644 --- a/hris/linkedaccounts/client.go +++ b/hris/linkedaccounts/client.go @@ -4,7 +4,6 @@ package linkedaccounts import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.LinkedAccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.AccountDetailsAndActions], error) { +) (*core.Page[*string, *hris.AccountDetailsAndActions], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedAccountDetailsAndActionsList) *internal.PageResponse[*string, *hris.AccountDetailsAndActions] { + readPageResponse := func(response *hris.PaginatedAccountDetailsAndActionsList) *core.PageResponse[*string, *hris.AccountDetailsAndActions] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.AccountDetailsAndActions]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.AccountDetailsAndActions]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/hris/linkedaccounts/hris_linked_accounts_test/hris_linked_accounts_test.go b/hris/linkedaccounts/hris_linked_accounts_test/hris_linked_accounts_test.go new file mode 100644 index 0000000..31b5ed6 --- /dev/null +++ b/hris/linkedaccounts/hris_linked_accounts_test/hris_linked_accounts_test.go @@ -0,0 +1,121 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_linked_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisLinkedAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.LinkedAccountsListRequest{ + Category: hris.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } + _, invocationErr := client.Hris.LinkedAccounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/linked-accounts", map[string]string{"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"}, 1) +} diff --git a/hris/linkedaccounts/raw_client.go b/hris/linkedaccounts/raw_client.go new file mode 100644 index 0000000..cb54205 --- /dev/null +++ b/hris/linkedaccounts/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package linkedaccounts + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/hris/linktoken/client.go b/hris/linktoken/client.go index 6a5cfca..90ada7b 100644 --- a/hris/linktoken/client.go +++ b/hris/linktoken/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *hris.EndUserDetailsRequest, opts ...option.RequestOption, ) (*hris.LinkToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/link-token" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.LinkToken - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/linktoken/hris_link_token_test/hris_link_token_test.go b/hris/linktoken/hris_link_token_test/hris_link_token_test.go new file mode 100644 index 0000000..e18471f --- /dev/null +++ b/hris/linktoken/hris_link_token_test/hris_link_token_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_link_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisLinkTokenCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []hris.CategoriesEnum{ + hris.CategoriesEnumHris, + hris.CategoriesEnumAts, + }, + } + _, invocationErr := client.Hris.LinkToken.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/link-token", nil, 1) +} diff --git a/hris/linktoken/raw_client.go b/hris/linktoken/raw_client.go new file mode 100644 index 0000000..c7ee8d0 --- /dev/null +++ b/hris/linktoken/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package linktoken + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *hris.EndUserDetailsRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.LinkToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/link-token" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.LinkToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.LinkToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/locations.go b/hris/locations.go index 7779040..d5c62c3 100644 --- a/hris/locations.go +++ b/hris/locations.go @@ -6,9 +6,26 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + locationsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + locationsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + locationsListRequestFieldCursor = big.NewInt(1 << 2) + locationsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + locationsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + locationsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + locationsListRequestFieldLocationType = big.NewInt(1 << 6) + locationsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + locationsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + locationsListRequestFieldPageSize = big.NewInt(1 << 9) + locationsListRequestFieldRemoteFields = big.NewInt(1 << 10) + locationsListRequestFieldRemoteId = big.NewInt(1 << 11) + locationsListRequestFieldShowEnumOrigins = big.NewInt(1 << 12) +) + type LocationsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -39,8 +56,116 @@ type LocationsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *LocationsListRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LocationsListRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetCreatedAfter(createdAfter *time.Time) { + l.CreatedAfter = createdAfter + l.require(locationsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetCreatedBefore(createdBefore *time.Time) { + l.CreatedBefore = createdBefore + l.require(locationsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetCursor(cursor *string) { + l.Cursor = cursor + l.require(locationsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + l.IncludeDeletedData = includeDeletedData + l.require(locationsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + l.IncludeRemoteData = includeRemoteData + l.require(locationsListRequestFieldIncludeRemoteData) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetIncludeShellData(includeShellData *bool) { + l.IncludeShellData = includeShellData + l.require(locationsListRequestFieldIncludeShellData) +} + +// SetLocationType sets the LocationType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetLocationType(locationType *LocationsListRequestLocationType) { + l.LocationType = locationType + l.require(locationsListRequestFieldLocationType) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + l.ModifiedAfter = modifiedAfter + l.require(locationsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + l.ModifiedBefore = modifiedBefore + l.require(locationsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetPageSize(pageSize *int) { + l.PageSize = pageSize + l.require(locationsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetRemoteFields(remoteFields *LocationsListRequestRemoteFields) { + l.RemoteFields = remoteFields + l.require(locationsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetRemoteId(remoteId *string) { + l.RemoteId = remoteId + l.require(locationsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsListRequest) SetShowEnumOrigins(showEnumOrigins *LocationsListRequestShowEnumOrigins) { + l.ShowEnumOrigins = showEnumOrigins + l.require(locationsListRequestFieldShowEnumOrigins) +} + +var ( + locationsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + locationsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) + locationsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 2) + locationsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 3) +) + type LocationsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -50,6 +175,44 @@ type LocationsRetrieveRequest struct { RemoteFields *LocationsRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *LocationsRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LocationsRetrieveRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + l.IncludeRemoteData = includeRemoteData + l.require(locationsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + l.IncludeShellData = includeShellData + l.require(locationsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsRetrieveRequest) SetRemoteFields(remoteFields *LocationsRetrieveRequestRemoteFields) { + l.RemoteFields = remoteFields + l.require(locationsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LocationsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *LocationsRetrieveRequestShowEnumOrigins) { + l.ShowEnumOrigins = showEnumOrigins + l.require(locationsRetrieveRequestFieldShowEnumOrigins) } type LocationsListRequestLocationType string @@ -174,11 +337,20 @@ func (l LocationsRetrieveRequestShowEnumOrigins) Ptr() *LocationsRetrieveRequest return &l } +var ( + paginatedLocationListFieldNext = big.NewInt(1 << 0) + paginatedLocationListFieldPrevious = big.NewInt(1 << 1) + paginatedLocationListFieldResults = big.NewInt(1 << 2) +) + type PaginatedLocationList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Location `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -208,6 +380,34 @@ func (p *PaginatedLocationList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedLocationList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedLocationList) SetNext(next *string) { + p.Next = next + p.require(paginatedLocationListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedLocationList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedLocationListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedLocationList) SetResults(results []*Location) { + p.Results = results + p.require(paginatedLocationListFieldResults) +} + func (p *PaginatedLocationList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedLocationList var value unmarshaler @@ -224,6 +424,17 @@ func (p *PaginatedLocationList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedLocationList) MarshalJSON() ([]byte, error) { + type embed PaginatedLocationList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedLocationList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/locations/client.go b/hris/locations/client.go index 46ac58f..749725f 100644 --- a/hris/locations/client.go +++ b/hris/locations/client.go @@ -4,7 +4,6 @@ package locations import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.LocationsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.Location], error) { +) (*core.Page[*string, *hris.Location], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedLocationList) *internal.PageResponse[*string, *hris.Location] { + readPageResponse := func(response *hris.PaginatedLocationList) *core.PageResponse[*string, *hris.Location] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.Location]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.Location]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.LocationsRetrieveRequest, opts ...option.RequestOption, ) (*hris.Location, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/locations/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.Location - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/locations/hris_locations_test/hris_locations_test.go b/hris/locations/hris_locations_test/hris_locations_test.go new file mode 100644 index 0000000..f3f83ce --- /dev/null +++ b/hris/locations/hris_locations_test/hris_locations_test.go @@ -0,0 +1,155 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_locations_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisLocationsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.LocationsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + LocationType: hris.LocationsListRequestLocationTypeHome.Ptr(), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: hris.LocationsListRequestRemoteFieldsCountry.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: hris.LocationsListRequestShowEnumOriginsCountry.Ptr(), + } + _, invocationErr := client.Hris.Locations.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/locations", map[string]string{"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"}, 1) +} + +func TestHrisLocationsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.LocationsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.LocationsRetrieveRequestRemoteFieldsCountry.Ptr(), + ShowEnumOrigins: hris.LocationsRetrieveRequestShowEnumOriginsCountry.Ptr(), + } + _, invocationErr := client.Hris.Locations.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/locations/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "country", "show_enum_origins": "country"}, 1) +} diff --git a/hris/locations/raw_client.go b/hris/locations/raw_client.go new file mode 100644 index 0000000..d53ef13 --- /dev/null +++ b/hris/locations/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package locations + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.LocationsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.Location], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/locations/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.Location + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.Location]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/passthrough/client.go b/hris/passthrough/client.go index 4a6f3a6..6edc831 100644 --- a/hris/passthrough/client.go +++ b/hris/passthrough/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *hris.DataPassthroughRequest, opts ...option.RequestOption, ) (*hris.RemoteResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.RemoteResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/passthrough/hris_passthrough_test/hris_passthrough_test.go b/hris/passthrough/hris_passthrough_test/hris_passthrough_test.go new file mode 100644 index 0000000..c8f9e34 --- /dev/null +++ b/hris/passthrough/hris_passthrough_test/hris_passthrough_test.go @@ -0,0 +1,85 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.DataPassthroughRequest{ + Method: hris.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Hris.Passthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/passthrough", nil, 1) +} diff --git a/hris/passthrough/raw_client.go b/hris/passthrough/raw_client.go new file mode 100644 index 0000000..a0e7383 --- /dev/null +++ b/hris/passthrough/raw_client.go @@ -0,0 +1,72 @@ +// Code generated by Fern. DO NOT EDIT. + +package passthrough + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *hris.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.RemoteResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.RemoteResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.RemoteResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/pay_groups.go b/hris/pay_groups.go index 773ee7f..656032b 100644 --- a/hris/pay_groups.go +++ b/hris/pay_groups.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + payGroupsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + payGroupsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + payGroupsListRequestFieldCursor = big.NewInt(1 << 2) + payGroupsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + payGroupsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + payGroupsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + payGroupsListRequestFieldModifiedAfter = big.NewInt(1 << 6) + payGroupsListRequestFieldModifiedBefore = big.NewInt(1 << 7) + payGroupsListRequestFieldPageSize = big.NewInt(1 << 8) + payGroupsListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type PayGroupsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,20 +44,138 @@ type PayGroupsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PayGroupsListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetCreatedAfter(createdAfter *time.Time) { + p.CreatedAfter = createdAfter + p.require(payGroupsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetCreatedBefore(createdBefore *time.Time) { + p.CreatedBefore = createdBefore + p.require(payGroupsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(payGroupsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(payGroupsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(payGroupsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(payGroupsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + p.ModifiedAfter = modifiedAfter + p.require(payGroupsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + p.ModifiedBefore = modifiedBefore + p.require(payGroupsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(payGroupsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsListRequest) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(payGroupsListRequestFieldRemoteId) } +var ( + payGroupsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + payGroupsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type PayGroupsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (p *PayGroupsRetrieveRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(payGroupsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroupsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(payGroupsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedPayGroupListFieldNext = big.NewInt(1 << 0) + paginatedPayGroupListFieldPrevious = big.NewInt(1 << 1) + paginatedPayGroupListFieldResults = big.NewInt(1 << 2) +) + type PaginatedPayGroupList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*PayGroup `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -73,6 +205,34 @@ func (p *PaginatedPayGroupList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedPayGroupList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPayGroupList) SetNext(next *string) { + p.Next = next + p.require(paginatedPayGroupListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPayGroupList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedPayGroupListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPayGroupList) SetResults(results []*PayGroup) { + p.Results = results + p.require(paginatedPayGroupListFieldResults) +} + func (p *PaginatedPayGroupList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedPayGroupList var value unmarshaler @@ -89,6 +249,17 @@ func (p *PaginatedPayGroupList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedPayGroupList) MarshalJSON() ([]byte, error) { + type embed PaginatedPayGroupList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedPayGroupList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/paygroups/client.go b/hris/paygroups/client.go index d90b683..928670b 100644 --- a/hris/paygroups/client.go +++ b/hris/paygroups/client.go @@ -4,7 +4,6 @@ package paygroups import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.PayGroupsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.PayGroup], error) { +) (*core.Page[*string, *hris.PayGroup], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedPayGroupList) *internal.PageResponse[*string, *hris.PayGroup] { + readPageResponse := func(response *hris.PaginatedPayGroupList) *core.PageResponse[*string, *hris.PayGroup] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.PayGroup]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.PayGroup]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.PayGroupsRetrieveRequest, opts ...option.RequestOption, ) (*hris.PayGroup, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/pay-groups/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.PayGroup - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/paygroups/hris_pay_groups_test/hris_pay_groups_test.go b/hris/paygroups/hris_pay_groups_test/hris_pay_groups_test.go new file mode 100644 index 0000000..db7d88c --- /dev/null +++ b/hris/paygroups/hris_pay_groups_test/hris_pay_groups_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_pay_groups_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisPayGroupsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.PayGroupsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Hris.PayGroups.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/pay-groups", map[string]string{"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"}, 1) +} + +func TestHrisPayGroupsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.PayGroupsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.PayGroups.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/pay-groups/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/hris/paygroups/raw_client.go b/hris/paygroups/raw_client.go new file mode 100644 index 0000000..0f280df --- /dev/null +++ b/hris/paygroups/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package paygroups + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.PayGroupsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.PayGroup], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/pay-groups/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.PayGroup + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.PayGroup]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/payroll_runs.go b/hris/payroll_runs.go index bd89e57..d59fa48 100644 --- a/hris/payroll_runs.go +++ b/hris/payroll_runs.go @@ -6,9 +6,30 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + payrollRunsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + payrollRunsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + payrollRunsListRequestFieldCursor = big.NewInt(1 << 2) + payrollRunsListRequestFieldEndedAfter = big.NewInt(1 << 3) + payrollRunsListRequestFieldEndedBefore = big.NewInt(1 << 4) + payrollRunsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + payrollRunsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + payrollRunsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + payrollRunsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + payrollRunsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + payrollRunsListRequestFieldPageSize = big.NewInt(1 << 10) + payrollRunsListRequestFieldRemoteFields = big.NewInt(1 << 11) + payrollRunsListRequestFieldRemoteId = big.NewInt(1 << 12) + payrollRunsListRequestFieldRunType = big.NewInt(1 << 13) + payrollRunsListRequestFieldShowEnumOrigins = big.NewInt(1 << 14) + payrollRunsListRequestFieldStartedAfter = big.NewInt(1 << 15) + payrollRunsListRequestFieldStartedBefore = big.NewInt(1 << 16) +) + type PayrollRunsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -50,8 +71,144 @@ type PayrollRunsListRequest struct { StartedAfter *time.Time `json:"-" url:"started_after,omitempty"` // If provided, will only return payroll runs started before this datetime. StartedBefore *time.Time `json:"-" url:"started_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PayrollRunsListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetCreatedAfter(createdAfter *time.Time) { + p.CreatedAfter = createdAfter + p.require(payrollRunsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetCreatedBefore(createdBefore *time.Time) { + p.CreatedBefore = createdBefore + p.require(payrollRunsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(payrollRunsListRequestFieldCursor) +} + +// SetEndedAfter sets the EndedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetEndedAfter(endedAfter *time.Time) { + p.EndedAfter = endedAfter + p.require(payrollRunsListRequestFieldEndedAfter) +} + +// SetEndedBefore sets the EndedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetEndedBefore(endedBefore *time.Time) { + p.EndedBefore = endedBefore + p.require(payrollRunsListRequestFieldEndedBefore) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(payrollRunsListRequestFieldIncludeDeletedData) } +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(payrollRunsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(payrollRunsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + p.ModifiedAfter = modifiedAfter + p.require(payrollRunsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + p.ModifiedBefore = modifiedBefore + p.require(payrollRunsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(payrollRunsListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetRemoteFields(remoteFields *PayrollRunsListRequestRemoteFields) { + p.RemoteFields = remoteFields + p.require(payrollRunsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(payrollRunsListRequestFieldRemoteId) +} + +// SetRunType sets the RunType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetRunType(runType *PayrollRunsListRequestRunType) { + p.RunType = runType + p.require(payrollRunsListRequestFieldRunType) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetShowEnumOrigins(showEnumOrigins *PayrollRunsListRequestShowEnumOrigins) { + p.ShowEnumOrigins = showEnumOrigins + p.require(payrollRunsListRequestFieldShowEnumOrigins) +} + +// SetStartedAfter sets the StartedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetStartedAfter(startedAfter *time.Time) { + p.StartedAfter = startedAfter + p.require(payrollRunsListRequestFieldStartedAfter) +} + +// SetStartedBefore sets the StartedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsListRequest) SetStartedBefore(startedBefore *time.Time) { + p.StartedBefore = startedBefore + p.require(payrollRunsListRequestFieldStartedBefore) +} + +var ( + payrollRunsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + payrollRunsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) + payrollRunsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 2) + payrollRunsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 3) +) + type PayrollRunsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` @@ -61,6 +218,44 @@ type PayrollRunsRetrieveRequest struct { RemoteFields *PayrollRunsRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *PayrollRunsRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PayrollRunsRetrieveRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(payrollRunsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(payrollRunsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsRetrieveRequest) SetRemoteFields(remoteFields *PayrollRunsRetrieveRequestRemoteFields) { + p.RemoteFields = remoteFields + p.require(payrollRunsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRunsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *PayrollRunsRetrieveRequestShowEnumOrigins) { + p.ShowEnumOrigins = showEnumOrigins + p.require(payrollRunsRetrieveRequestFieldShowEnumOrigins) } type PayrollRunsListRequestRemoteFields string @@ -194,11 +389,20 @@ func (p PayrollRunsRetrieveRequestShowEnumOrigins) Ptr() *PayrollRunsRetrieveReq return &p } +var ( + paginatedPayrollRunListFieldNext = big.NewInt(1 << 0) + paginatedPayrollRunListFieldPrevious = big.NewInt(1 << 1) + paginatedPayrollRunListFieldResults = big.NewInt(1 << 2) +) + type PaginatedPayrollRunList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*PayrollRun `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -228,6 +432,34 @@ func (p *PaginatedPayrollRunList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedPayrollRunList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPayrollRunList) SetNext(next *string) { + p.Next = next + p.require(paginatedPayrollRunListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPayrollRunList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedPayrollRunListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedPayrollRunList) SetResults(results []*PayrollRun) { + p.Results = results + p.require(paginatedPayrollRunListFieldResults) +} + func (p *PaginatedPayrollRunList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedPayrollRunList var value unmarshaler @@ -244,6 +476,17 @@ func (p *PaginatedPayrollRunList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedPayrollRunList) MarshalJSON() ([]byte, error) { + type embed PaginatedPayrollRunList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedPayrollRunList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/payrollruns/client.go b/hris/payrollruns/client.go index b36289d..25ef0e9 100644 --- a/hris/payrollruns/client.go +++ b/hris/payrollruns/client.go @@ -4,7 +4,6 @@ package payrollruns import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.PayrollRunsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.PayrollRun], error) { +) (*core.Page[*string, *hris.PayrollRun], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedPayrollRunList) *internal.PageResponse[*string, *hris.PayrollRun] { + readPageResponse := func(response *hris.PaginatedPayrollRunList) *core.PageResponse[*string, *hris.PayrollRun] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.PayrollRun]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.PayrollRun]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.PayrollRunsRetrieveRequest, opts ...option.RequestOption, ) (*hris.PayrollRun, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/payroll-runs/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.PayrollRun - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/payrollruns/hris_payroll_runs_test/hris_payroll_runs_test.go b/hris/payrollruns/hris_payroll_runs_test/hris_payroll_runs_test.go new file mode 100644 index 0000000..9d1e857 --- /dev/null +++ b/hris/payrollruns/hris_payroll_runs_test/hris_payroll_runs_test.go @@ -0,0 +1,175 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_payroll_runs_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisPayrollRunsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.PayrollRunsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + EndedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: hris.PayrollRunsListRequestRemoteFieldsRunState.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + RunType: hris.PayrollRunsListRequestRunTypeCorrection.Ptr(), + ShowEnumOrigins: hris.PayrollRunsListRequestShowEnumOriginsRunState.Ptr(), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Hris.PayrollRuns.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/payroll-runs", map[string]string{"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"}, 1) +} + +func TestHrisPayrollRunsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.PayrollRunsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.PayrollRunsRetrieveRequestRemoteFieldsRunState.Ptr(), + ShowEnumOrigins: hris.PayrollRunsRetrieveRequestShowEnumOriginsRunState.Ptr(), + } + _, invocationErr := client.Hris.PayrollRuns.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/payroll-runs/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "run_state", "show_enum_origins": "run_state"}, 1) +} diff --git a/hris/payrollruns/raw_client.go b/hris/payrollruns/raw_client.go new file mode 100644 index 0000000..2f28688 --- /dev/null +++ b/hris/payrollruns/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package payrollruns + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.PayrollRunsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.PayrollRun], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/payroll-runs/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.PayrollRun + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.PayrollRun]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/regenerate_key.go b/hris/regenerate_key.go index d966584..cafe1bc 100644 --- a/hris/regenerate_key.go +++ b/hris/regenerate_key.go @@ -2,7 +2,32 @@ package hris +import ( + big "math/big" +) + +var ( + remoteKeyForRegenerationRequestFieldName = big.NewInt(1 << 0) +) + type RemoteKeyForRegenerationRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteKeyForRegenerationRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKeyForRegenerationRequest) SetName(name string) { + r.Name = name + r.require(remoteKeyForRegenerationRequestFieldName) } diff --git a/hris/regeneratekey/client.go b/hris/regeneratekey/client.go index 3d3e8f2..0f22fdb 100644 --- a/hris/regeneratekey/client.go +++ b/hris/regeneratekey/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *hris.RemoteKeyForRegenerationRequest, opts ...option.RequestOption, ) (*hris.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/regenerate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/regeneratekey/hris_regenerate_key_test/hris_regenerate_key_test.go b/hris/regeneratekey/hris_regenerate_key_test/hris_regenerate_key_test.go new file mode 100644 index 0000000..ba6f38e --- /dev/null +++ b/hris/regeneratekey/hris_regenerate_key_test/hris_regenerate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_regenerate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisRegenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Hris.RegenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/regenerate-key", nil, 1) +} diff --git a/hris/regeneratekey/raw_client.go b/hris/regeneratekey/raw_client.go new file mode 100644 index 0000000..a2cf5fc --- /dev/null +++ b/hris/regeneratekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package regeneratekey + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *hris.RemoteKeyForRegenerationRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/regenerate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/scopes.go b/hris/scopes.go index c5918e3..9523c0d 100644 --- a/hris/scopes.go +++ b/hris/scopes.go @@ -6,17 +6,46 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels = big.NewInt(1 << 0) ) type LinkedAccountCommonModelScopeDeserializerRequest struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountCommonModelScopeDeserializerRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountCommonModelScopeDeserializerRequest) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializerRequest) { + l.CommonModels = commonModels + l.require(linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels) } +var ( + commonModelScopeApiFieldCommonModels = big.NewInt(1 << 0) +) + type CommonModelScopeApi struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models" url:"common_models"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -32,6 +61,20 @@ func (c *CommonModelScopeApi) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CommonModelScopeApi) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopeApi) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializer) { + c.CommonModels = commonModels + c.require(commonModelScopeApiFieldCommonModels) +} + func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopeApi var value unmarshaler @@ -48,6 +91,17 @@ func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopeApi) MarshalJSON() ([]byte, error) { + type embed CommonModelScopeApi + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopeApi) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -60,10 +114,18 @@ func (c *CommonModelScopeApi) String() string { return fmt.Sprintf("%#v", c) } +var ( + fieldPermissionDeserializerFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializer struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -86,6 +148,27 @@ func (f *FieldPermissionDeserializer) GetExtraProperties() map[string]interface{ return f.extraProperties } +func (f *FieldPermissionDeserializer) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerFieldDisabledFields) +} + func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializer var value unmarshaler @@ -102,6 +185,17 @@ func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializer) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -114,11 +208,20 @@ func (f *FieldPermissionDeserializer) String() string { return fmt.Sprintf("%#v", f) } +var ( + individualCommonModelScopeDeserializerFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializer struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -148,6 +251,34 @@ func (i *IndividualCommonModelScopeDeserializer) GetExtraProperties() map[string return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializer) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializer) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializer) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializer var value unmarshaler @@ -164,6 +295,17 @@ func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) erro return nil } +func (i *IndividualCommonModelScopeDeserializer) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializer) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -176,9 +318,16 @@ func (i *IndividualCommonModelScopeDeserializer) String() string { return fmt.Sprintf("%#v", i) } +var ( + modelPermissionDeserializerFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializer struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -194,6 +343,20 @@ func (m *ModelPermissionDeserializer) GetExtraProperties() map[string]interface{ return m.extraProperties } +func (m *ModelPermissionDeserializer) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializer) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerFieldIsEnabled) +} + func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializer var value unmarshaler @@ -210,6 +373,17 @@ func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializer) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { diff --git a/hris/scopes/client.go b/hris/scopes/client.go index 5d2c3ee..173c7e6 100644 --- a/hris/scopes/client.go +++ b/hris/scopes/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) DefaultScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*hris.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/default-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.DefaultScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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). @@ -72,35 +52,14 @@ func (c *Client) LinkedAccountScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*hris.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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) @@ -109,35 +68,13 @@ func (c *Client) LinkedAccountScopesCreate( request *hris.LinkedAccountCommonModelScopeDeserializerRequest, opts ...option.RequestOption, ) (*hris.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/scopes/hris_scopes_test/hris_scopes_test.go b/hris/scopes/hris_scopes_test/hris_scopes_test.go new file mode 100644 index 0000000..f89e084 --- /dev/null +++ b/hris/scopes/hris_scopes_test/hris_scopes_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_scopes_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisScopesDefaultScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/default-scopes", nil, 1) +} + +func TestHrisScopesLinkedAccountScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/linked-account-scopes", nil, 1) +} + +func TestHrisScopesLinkedAccountScopesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*hris.IndividualCommonModelScopeDeserializerRequest{ + &hris.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*hris.ModelPermissionDeserializerRequest{ + "READ": &hris.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &hris.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &hris.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &hris.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*hris.ModelPermissionDeserializerRequest{ + "WRITE": &hris.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } + _, invocationErr := client.Hris.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/linked-account-scopes", nil, 1) +} diff --git a/hris/scopes/raw_client.go b/hris/scopes/raw_client.go new file mode 100644 index 0000000..104c1a9 --- /dev/null +++ b/hris/scopes/raw_client.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package scopes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) DefaultScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*hris.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/default-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*hris.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesCreate( + ctx context.Context, + request *hris.LinkedAccountCommonModelScopeDeserializerRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/sync_status.go b/hris/sync_status.go index 5686784..cd41a8d 100644 --- a/hris/sync_status.go +++ b/hris/sync_status.go @@ -6,6 +6,12 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + syncStatusListRequestFieldCursor = big.NewInt(1 << 0) + syncStatusListRequestFieldPageSize = big.NewInt(1 << 1) ) type SyncStatusListRequest struct { @@ -13,13 +19,46 @@ type SyncStatusListRequest struct { Cursor *string `json:"-" url:"cursor,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (s *SyncStatusListRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetCursor(cursor *string) { + s.Cursor = cursor + s.require(syncStatusListRequestFieldCursor) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetPageSize(pageSize *int) { + s.PageSize = pageSize + s.require(syncStatusListRequestFieldPageSize) +} + +var ( + paginatedSyncStatusListFieldNext = big.NewInt(1 << 0) + paginatedSyncStatusListFieldPrevious = big.NewInt(1 << 1) + paginatedSyncStatusListFieldResults = big.NewInt(1 << 2) +) + type PaginatedSyncStatusList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*SyncStatus `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -49,6 +88,34 @@ func (p *PaginatedSyncStatusList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedSyncStatusList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetNext(next *string) { + p.Next = next + p.require(paginatedSyncStatusListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedSyncStatusListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetResults(results []*SyncStatus) { + p.Results = results + p.require(paginatedSyncStatusListFieldResults) +} + func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedSyncStatusList var value unmarshaler @@ -65,6 +132,17 @@ func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedSyncStatusList) MarshalJSON() ([]byte, error) { + type embed PaginatedSyncStatusList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedSyncStatusList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/syncstatus/client.go b/hris/syncstatus/client.go index 81998ef..aaa2fd0 100644 --- a/hris/syncstatus/client.go +++ b/hris/syncstatus/client.go @@ -4,7 +4,6 @@ package syncstatus import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.SyncStatusListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.SyncStatus], error) { +) (*core.Page[*string, *hris.SyncStatus], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedSyncStatusList) *internal.PageResponse[*string, *hris.SyncStatus] { + readPageResponse := func(response *hris.PaginatedSyncStatusList) *core.PageResponse[*string, *hris.SyncStatus] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.SyncStatus]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.SyncStatus]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/hris/syncstatus/hris_sync_status_test/hris_sync_status_test.go b/hris/syncstatus/hris_sync_status_test/hris_sync_status_test.go new file mode 100644 index 0000000..132f87a --- /dev/null +++ b/hris/syncstatus/hris_sync_status_test/hris_sync_status_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_sync_status_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisSyncStatusListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Hris.SyncStatus.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/sync-status", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "page_size": "1"}, 1) +} diff --git a/hris/syncstatus/raw_client.go b/hris/syncstatus/raw_client.go new file mode 100644 index 0000000..bf7298f --- /dev/null +++ b/hris/syncstatus/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package syncstatus + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/hris/teams.go b/hris/teams.go index 2b944f9..17dc4f1 100644 --- a/hris/teams.go +++ b/hris/teams.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + teamsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + teamsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + teamsListRequestFieldCursor = big.NewInt(1 << 2) + teamsListRequestFieldExpand = big.NewInt(1 << 3) + teamsListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + teamsListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + teamsListRequestFieldIncludeShellData = big.NewInt(1 << 6) + teamsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + teamsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + teamsListRequestFieldPageSize = big.NewInt(1 << 9) + teamsListRequestFieldParentTeamId = big.NewInt(1 << 10) + teamsListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type TeamsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -34,8 +50,108 @@ type TeamsListRequest struct { ParentTeamId *string `json:"-" url:"parent_team_id,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TeamsListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(teamsListRequestFieldCreatedAfter) } +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(teamsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(teamsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(teamsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(teamsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(teamsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(teamsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(teamsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(teamsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(teamsListRequestFieldPageSize) +} + +// SetParentTeamId sets the ParentTeamId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetParentTeamId(parentTeamId *string) { + t.ParentTeamId = parentTeamId + t.require(teamsListRequestFieldParentTeamId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(teamsListRequestFieldRemoteId) +} + +var ( + teamsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + teamsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + teamsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type TeamsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -43,13 +159,53 @@ type TeamsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TeamsRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) } +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsRetrieveRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(teamsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(teamsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(teamsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedTeamListFieldNext = big.NewInt(1 << 0) + paginatedTeamListFieldPrevious = big.NewInt(1 << 1) + paginatedTeamListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTeamList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Team `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -79,6 +235,34 @@ func (p *PaginatedTeamList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedTeamList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTeamList) SetNext(next *string) { + p.Next = next + p.require(paginatedTeamListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTeamList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTeamListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTeamList) SetResults(results []*Team) { + p.Results = results + p.require(paginatedTeamListFieldResults) +} + func (p *PaginatedTeamList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTeamList var value unmarshaler @@ -95,6 +279,17 @@ func (p *PaginatedTeamList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTeamList) MarshalJSON() ([]byte, error) { + type embed PaginatedTeamList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTeamList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/hris/teams/client.go b/hris/teams/client.go index e55efd7..ea86100 100644 --- a/hris/teams/client.go +++ b/hris/teams/client.go @@ -4,7 +4,6 @@ package teams import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.TeamsListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.Team], error) { +) (*core.Page[*string, *hris.Team], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedTeamList) *internal.PageResponse[*string, *hris.Team] { + readPageResponse := func(response *hris.PaginatedTeamList) *core.PageResponse[*string, *hris.Team] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.Team]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.Team]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.TeamsRetrieveRequest, opts ...option.RequestOption, ) (*hris.Team, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/teams/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.Team - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/teams/hris_teams_test/hris_teams_test.go b/hris/teams/hris_teams_test/hris_teams_test.go new file mode 100644 index 0000000..2f37be4 --- /dev/null +++ b/hris/teams/hris_teams_test/hris_teams_test.go @@ -0,0 +1,153 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_teams_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisTeamsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TeamsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + ParentTeamId: merge.String( + "parent_team_id", + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Hris.Teams.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/teams", map[string]string{"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"}, 1) +} + +func TestHrisTeamsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TeamsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.Teams.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/teams/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/hris/teams/raw_client.go b/hris/teams/raw_client.go new file mode 100644 index 0000000..6f8357d --- /dev/null +++ b/hris/teams/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package teams + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.TeamsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.Team], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/teams/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.Team + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.Team]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/time_off.go b/hris/time_off.go index 5bc7e39..03a0812 100644 --- a/hris/time_off.go +++ b/hris/time_off.go @@ -6,16 +6,78 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + timeOffEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + timeOffEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + timeOffEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type TimeOffEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *TimeOffRequest `json:"model,omitempty" url:"-"` -} + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TimeOffEndpointRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + t.IsDebugMode = isDebugMode + t.require(timeOffEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffEndpointRequest) SetRunAsync(runAsync *bool) { + t.RunAsync = runAsync + t.require(timeOffEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffEndpointRequest) SetModel(model *TimeOffRequest) { + t.Model = model + t.require(timeOffEndpointRequestFieldModel) +} + +var ( + timeOffListRequestFieldApproverId = big.NewInt(1 << 0) + timeOffListRequestFieldCreatedAfter = big.NewInt(1 << 1) + timeOffListRequestFieldCreatedBefore = big.NewInt(1 << 2) + timeOffListRequestFieldCursor = big.NewInt(1 << 3) + timeOffListRequestFieldEmployeeId = big.NewInt(1 << 4) + timeOffListRequestFieldEndedAfter = big.NewInt(1 << 5) + timeOffListRequestFieldEndedBefore = big.NewInt(1 << 6) + timeOffListRequestFieldExpand = big.NewInt(1 << 7) + timeOffListRequestFieldIncludeDeletedData = big.NewInt(1 << 8) + timeOffListRequestFieldIncludeRemoteData = big.NewInt(1 << 9) + timeOffListRequestFieldIncludeShellData = big.NewInt(1 << 10) + timeOffListRequestFieldModifiedAfter = big.NewInt(1 << 11) + timeOffListRequestFieldModifiedBefore = big.NewInt(1 << 12) + timeOffListRequestFieldPageSize = big.NewInt(1 << 13) + timeOffListRequestFieldRemoteFields = big.NewInt(1 << 14) + timeOffListRequestFieldRemoteId = big.NewInt(1 << 15) + timeOffListRequestFieldRequestType = big.NewInt(1 << 16) + timeOffListRequestFieldShowEnumOrigins = big.NewInt(1 << 17) + timeOffListRequestFieldStartedAfter = big.NewInt(1 << 18) + timeOffListRequestFieldStartedBefore = big.NewInt(1 << 19) + timeOffListRequestFieldStatus = big.NewInt(1 << 20) +) type TimeOffListRequest struct { // If provided, will only return time off for this approver. @@ -73,8 +135,173 @@ type TimeOffListRequest struct { // * `CANCELLED` - CANCELLED // * `DELETED` - DELETED Status *TimeOffListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TimeOffListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetApproverId sets the ApproverId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetApproverId(approverId *string) { + t.ApproverId = approverId + t.require(timeOffListRequestFieldApproverId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(timeOffListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(timeOffListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(timeOffListRequestFieldCursor) +} + +// SetEmployeeId sets the EmployeeId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetEmployeeId(employeeId *string) { + t.EmployeeId = employeeId + t.require(timeOffListRequestFieldEmployeeId) +} + +// SetEndedAfter sets the EndedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetEndedAfter(endedAfter *time.Time) { + t.EndedAfter = endedAfter + t.require(timeOffListRequestFieldEndedAfter) +} + +// SetEndedBefore sets the EndedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetEndedBefore(endedBefore *time.Time) { + t.EndedBefore = endedBefore + t.require(timeOffListRequestFieldEndedBefore) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetExpand(expand []*TimeOffListRequestExpandItem) { + t.Expand = expand + t.require(timeOffListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(timeOffListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(timeOffListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(timeOffListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(timeOffListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(timeOffListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(timeOffListRequestFieldPageSize) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetRemoteFields(remoteFields *TimeOffListRequestRemoteFields) { + t.RemoteFields = remoteFields + t.require(timeOffListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(timeOffListRequestFieldRemoteId) +} + +// SetRequestType sets the RequestType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetRequestType(requestType *TimeOffListRequestRequestType) { + t.RequestType = requestType + t.require(timeOffListRequestFieldRequestType) } +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetShowEnumOrigins(showEnumOrigins *TimeOffListRequestShowEnumOrigins) { + t.ShowEnumOrigins = showEnumOrigins + t.require(timeOffListRequestFieldShowEnumOrigins) +} + +// SetStartedAfter sets the StartedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetStartedAfter(startedAfter *time.Time) { + t.StartedAfter = startedAfter + t.require(timeOffListRequestFieldStartedAfter) +} + +// SetStartedBefore sets the StartedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetStartedBefore(startedBefore *time.Time) { + t.StartedBefore = startedBefore + t.require(timeOffListRequestFieldStartedBefore) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffListRequest) SetStatus(status *TimeOffListRequestStatus) { + t.Status = status + t.require(timeOffListRequestFieldStatus) +} + +var ( + timeOffRetrieveRequestFieldExpand = big.NewInt(1 << 0) + timeOffRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + timeOffRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + timeOffRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + timeOffRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type TimeOffRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*TimeOffRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -86,6 +313,51 @@ type TimeOffRetrieveRequest struct { RemoteFields *TimeOffRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *TimeOffRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TimeOffRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRetrieveRequest) SetExpand(expand []*TimeOffRetrieveRequestExpandItem) { + t.Expand = expand + t.require(timeOffRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(timeOffRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(timeOffRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRetrieveRequest) SetRemoteFields(remoteFields *TimeOffRetrieveRequestRemoteFields) { + t.RemoteFields = remoteFields + t.require(timeOffRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *TimeOffRetrieveRequestShowEnumOrigins) { + t.ShowEnumOrigins = showEnumOrigins + t.require(timeOffRetrieveRequestFieldShowEnumOrigins) } type TimeOffListRequestExpandItem string @@ -345,11 +617,20 @@ func (t TimeOffRetrieveRequestShowEnumOrigins) Ptr() *TimeOffRetrieveRequestShow return &t } +var ( + paginatedTimeOffListFieldNext = big.NewInt(1 << 0) + paginatedTimeOffListFieldPrevious = big.NewInt(1 << 1) + paginatedTimeOffListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTimeOffList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*TimeOff `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -379,6 +660,34 @@ func (p *PaginatedTimeOffList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedTimeOffList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTimeOffList) SetNext(next *string) { + p.Next = next + p.require(paginatedTimeOffListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTimeOffList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTimeOffListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTimeOffList) SetResults(results []*TimeOff) { + p.Results = results + p.require(paginatedTimeOffListFieldResults) +} + func (p *PaginatedTimeOffList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTimeOffList var value unmarshaler @@ -395,6 +704,17 @@ func (p *PaginatedTimeOffList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTimeOffList) MarshalJSON() ([]byte, error) { + type embed PaginatedTimeOffList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTimeOffList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -453,6 +773,25 @@ func (r RequestTypeEnum) Ptr() *RequestTypeEnum { // // ### Usage Example // Fetch from the `LIST TimeOffs` endpoint and filter by `ID` to show all time off requests. +var ( + timeOffFieldId = big.NewInt(1 << 0) + timeOffFieldRemoteId = big.NewInt(1 << 1) + timeOffFieldCreatedAt = big.NewInt(1 << 2) + timeOffFieldModifiedAt = big.NewInt(1 << 3) + timeOffFieldEmployee = big.NewInt(1 << 4) + timeOffFieldApprover = big.NewInt(1 << 5) + timeOffFieldStatus = big.NewInt(1 << 6) + timeOffFieldEmployeeNote = big.NewInt(1 << 7) + timeOffFieldUnits = big.NewInt(1 << 8) + timeOffFieldAmount = big.NewInt(1 << 9) + timeOffFieldRequestType = big.NewInt(1 << 10) + timeOffFieldStartTime = big.NewInt(1 << 11) + timeOffFieldEndTime = big.NewInt(1 << 12) + timeOffFieldRemoteWasDeleted = big.NewInt(1 << 13) + timeOffFieldFieldMappings = big.NewInt(1 << 14) + timeOffFieldRemoteData = big.NewInt(1 << 15) +) + type TimeOff struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -500,6 +839,9 @@ type TimeOff struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -620,6 +962,125 @@ func (t *TimeOff) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TimeOff) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetId(id *string) { + t.Id = id + t.require(timeOffFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(timeOffFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(timeOffFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(timeOffFieldModifiedAt) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetEmployee(employee *TimeOffEmployee) { + t.Employee = employee + t.require(timeOffFieldEmployee) +} + +// SetApprover sets the Approver field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetApprover(approver *TimeOffApprover) { + t.Approver = approver + t.require(timeOffFieldApprover) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetStatus(status *TimeOffStatus) { + t.Status = status + t.require(timeOffFieldStatus) +} + +// SetEmployeeNote sets the EmployeeNote field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetEmployeeNote(employeeNote *string) { + t.EmployeeNote = employeeNote + t.require(timeOffFieldEmployeeNote) +} + +// SetUnits sets the Units field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetUnits(units *TimeOffUnits) { + t.Units = units + t.require(timeOffFieldUnits) +} + +// SetAmount sets the Amount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetAmount(amount *float64) { + t.Amount = amount + t.require(timeOffFieldAmount) +} + +// SetRequestType sets the RequestType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetRequestType(requestType *TimeOffRequestType) { + t.RequestType = requestType + t.require(timeOffFieldRequestType) +} + +// SetStartTime sets the StartTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetStartTime(startTime *time.Time) { + t.StartTime = startTime + t.require(timeOffFieldStartTime) +} + +// SetEndTime sets the EndTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetEndTime(endTime *time.Time) { + t.EndTime = endTime + t.require(timeOffFieldEndTime) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(timeOffFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(timeOffFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOff) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(timeOffFieldRemoteData) +} + func (t *TimeOff) UnmarshalJSON(data []byte) error { type embed TimeOff var unmarshaler = struct { @@ -663,7 +1124,8 @@ func (t *TimeOff) MarshalJSON() ([]byte, error) { StartTime: internal.NewOptionalDateTime(t.StartTime), EndTime: internal.NewOptionalDateTime(t.EndTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TimeOff) String() string { @@ -810,6 +1272,20 @@ func (t *TimeOffEmployee) Accept(visitor TimeOffEmployeeVisitor) error { // // ### Usage Example // Fetch from the `LIST TimeOffs` endpoint and filter by `ID` to show all time off requests. +var ( + timeOffRequestFieldEmployee = big.NewInt(1 << 0) + timeOffRequestFieldApprover = big.NewInt(1 << 1) + timeOffRequestFieldStatus = big.NewInt(1 << 2) + timeOffRequestFieldEmployeeNote = big.NewInt(1 << 3) + timeOffRequestFieldUnits = big.NewInt(1 << 4) + timeOffRequestFieldAmount = big.NewInt(1 << 5) + timeOffRequestFieldRequestType = big.NewInt(1 << 6) + timeOffRequestFieldStartTime = big.NewInt(1 << 7) + timeOffRequestFieldEndTime = big.NewInt(1 << 8) + timeOffRequestFieldIntegrationParams = big.NewInt(1 << 9) + timeOffRequestFieldLinkedAccountParams = big.NewInt(1 << 10) +) + type TimeOffRequest struct { // The employee requesting time off. Employee *TimeOffRequestEmployee `json:"employee,omitempty" url:"employee,omitempty"` @@ -848,6 +1324,9 @@ type TimeOffRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -933,6 +1412,90 @@ func (t *TimeOffRequest) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TimeOffRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetEmployee(employee *TimeOffRequestEmployee) { + t.Employee = employee + t.require(timeOffRequestFieldEmployee) +} + +// SetApprover sets the Approver field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetApprover(approver *TimeOffRequestApprover) { + t.Approver = approver + t.require(timeOffRequestFieldApprover) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetStatus(status *TimeOffRequestStatus) { + t.Status = status + t.require(timeOffRequestFieldStatus) +} + +// SetEmployeeNote sets the EmployeeNote field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetEmployeeNote(employeeNote *string) { + t.EmployeeNote = employeeNote + t.require(timeOffRequestFieldEmployeeNote) +} + +// SetUnits sets the Units field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetUnits(units *TimeOffRequestUnits) { + t.Units = units + t.require(timeOffRequestFieldUnits) +} + +// SetAmount sets the Amount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetAmount(amount *float64) { + t.Amount = amount + t.require(timeOffRequestFieldAmount) +} + +// SetRequestType sets the RequestType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetRequestType(requestType *TimeOffRequestRequestType) { + t.RequestType = requestType + t.require(timeOffRequestFieldRequestType) +} + +// SetStartTime sets the StartTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetStartTime(startTime *time.Time) { + t.StartTime = startTime + t.require(timeOffRequestFieldStartTime) +} + +// SetEndTime sets the EndTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetEndTime(endTime *time.Time) { + t.EndTime = endTime + t.require(timeOffRequestFieldEndTime) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + t.IntegrationParams = integrationParams + t.require(timeOffRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + t.LinkedAccountParams = linkedAccountParams + t.require(timeOffRequestFieldLinkedAccountParams) +} + func (t *TimeOffRequest) UnmarshalJSON(data []byte) error { type embed TimeOffRequest var unmarshaler = struct { @@ -968,7 +1531,8 @@ func (t *TimeOffRequest) MarshalJSON() ([]byte, error) { StartTime: internal.NewOptionalDateTime(t.StartTime), EndTime: internal.NewOptionalDateTime(t.EndTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TimeOffRequest) String() string { @@ -1384,12 +1948,22 @@ func (t *TimeOffRequestUnits) Accept(visitor TimeOffRequestUnitsVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", t) } +var ( + timeOffResponseFieldModel = big.NewInt(1 << 0) + timeOffResponseFieldWarnings = big.NewInt(1 << 1) + timeOffResponseFieldErrors = big.NewInt(1 << 2) + timeOffResponseFieldLogs = big.NewInt(1 << 3) +) + type TimeOffResponse struct { Model *TimeOff `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1426,6 +2000,41 @@ func (t *TimeOffResponse) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TimeOffResponse) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffResponse) SetModel(model *TimeOff) { + t.Model = model + t.require(timeOffResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffResponse) SetWarnings(warnings []*WarningValidationProblem) { + t.Warnings = warnings + t.require(timeOffResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffResponse) SetErrors(errors []*ErrorValidationProblem) { + t.Errors = errors + t.require(timeOffResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffResponse) SetLogs(logs []*DebugModeLog) { + t.Logs = logs + t.require(timeOffResponseFieldLogs) +} + func (t *TimeOffResponse) UnmarshalJSON(data []byte) error { type unmarshaler TimeOffResponse var value unmarshaler @@ -1442,6 +2051,17 @@ func (t *TimeOffResponse) UnmarshalJSON(data []byte) error { return nil } +func (t *TimeOffResponse) MarshalJSON() ([]byte, error) { + type embed TimeOffResponse + var marshaler = struct { + embed + }{ + embed: embed(*t), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (t *TimeOffResponse) String() string { if len(t.rawJSON) > 0 { if value, err := internal.StringifyJSON(t.rawJSON); err == nil { diff --git a/hris/time_off_balances.go b/hris/time_off_balances.go index d9ad62f..0ecfc97 100644 --- a/hris/time_off_balances.go +++ b/hris/time_off_balances.go @@ -6,9 +6,28 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + timeOffBalancesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + timeOffBalancesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + timeOffBalancesListRequestFieldCursor = big.NewInt(1 << 2) + timeOffBalancesListRequestFieldEmployeeId = big.NewInt(1 << 3) + timeOffBalancesListRequestFieldExpand = big.NewInt(1 << 4) + timeOffBalancesListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + timeOffBalancesListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + timeOffBalancesListRequestFieldIncludeShellData = big.NewInt(1 << 7) + timeOffBalancesListRequestFieldModifiedAfter = big.NewInt(1 << 8) + timeOffBalancesListRequestFieldModifiedBefore = big.NewInt(1 << 9) + timeOffBalancesListRequestFieldPageSize = big.NewInt(1 << 10) + timeOffBalancesListRequestFieldPolicyType = big.NewInt(1 << 11) + timeOffBalancesListRequestFieldRemoteFields = big.NewInt(1 << 12) + timeOffBalancesListRequestFieldRemoteId = big.NewInt(1 << 13) + timeOffBalancesListRequestFieldShowEnumOrigins = big.NewInt(1 << 14) +) + type TimeOffBalancesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -47,8 +66,131 @@ type TimeOffBalancesListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (t *TimeOffBalancesListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(timeOffBalancesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(timeOffBalancesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(timeOffBalancesListRequestFieldCursor) +} + +// SetEmployeeId sets the EmployeeId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetEmployeeId(employeeId *string) { + t.EmployeeId = employeeId + t.require(timeOffBalancesListRequestFieldEmployeeId) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(timeOffBalancesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(timeOffBalancesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(timeOffBalancesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(timeOffBalancesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(timeOffBalancesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(timeOffBalancesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(timeOffBalancesListRequestFieldPageSize) +} + +// SetPolicyType sets the PolicyType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetPolicyType(policyType *TimeOffBalancesListRequestPolicyType) { + t.PolicyType = policyType + t.require(timeOffBalancesListRequestFieldPolicyType) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetRemoteFields(remoteFields *string) { + t.RemoteFields = remoteFields + t.require(timeOffBalancesListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(timeOffBalancesListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + t.ShowEnumOrigins = showEnumOrigins + t.require(timeOffBalancesListRequestFieldShowEnumOrigins) +} + +var ( + timeOffBalancesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + timeOffBalancesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + timeOffBalancesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + timeOffBalancesRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + timeOffBalancesRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type TimeOffBalancesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -60,6 +202,51 @@ type TimeOffBalancesRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TimeOffBalancesRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesRetrieveRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(timeOffBalancesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(timeOffBalancesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(timeOffBalancesRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesRetrieveRequest) SetRemoteFields(remoteFields *string) { + t.RemoteFields = remoteFields + t.require(timeOffBalancesRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalancesRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + t.ShowEnumOrigins = showEnumOrigins + t.require(timeOffBalancesRetrieveRequestFieldShowEnumOrigins) } type TimeOffBalancesListRequestPolicyType string @@ -96,11 +283,20 @@ func (t TimeOffBalancesListRequestPolicyType) Ptr() *TimeOffBalancesListRequestP return &t } +var ( + paginatedTimeOffBalanceListFieldNext = big.NewInt(1 << 0) + paginatedTimeOffBalanceListFieldPrevious = big.NewInt(1 << 1) + paginatedTimeOffBalanceListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTimeOffBalanceList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*TimeOffBalance `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -130,6 +326,34 @@ func (p *PaginatedTimeOffBalanceList) GetExtraProperties() map[string]interface{ return p.extraProperties } +func (p *PaginatedTimeOffBalanceList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTimeOffBalanceList) SetNext(next *string) { + p.Next = next + p.require(paginatedTimeOffBalanceListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTimeOffBalanceList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTimeOffBalanceListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTimeOffBalanceList) SetResults(results []*TimeOffBalance) { + p.Results = results + p.require(paginatedTimeOffBalanceListFieldResults) +} + func (p *PaginatedTimeOffBalanceList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTimeOffBalanceList var value unmarshaler @@ -146,6 +370,17 @@ func (p *PaginatedTimeOffBalanceList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTimeOffBalanceList) MarshalJSON() ([]byte, error) { + type embed PaginatedTimeOffBalanceList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTimeOffBalanceList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -204,6 +439,20 @@ func (p PolicyTypeEnum) Ptr() *PolicyTypeEnum { // // ### Usage Example // Fetch from the `LIST TimeOffBalances` endpoint and filter by `ID` to show all time off balances. +var ( + timeOffBalanceFieldId = big.NewInt(1 << 0) + timeOffBalanceFieldRemoteId = big.NewInt(1 << 1) + timeOffBalanceFieldCreatedAt = big.NewInt(1 << 2) + timeOffBalanceFieldModifiedAt = big.NewInt(1 << 3) + timeOffBalanceFieldEmployee = big.NewInt(1 << 4) + timeOffBalanceFieldBalance = big.NewInt(1 << 5) + timeOffBalanceFieldUsed = big.NewInt(1 << 6) + timeOffBalanceFieldPolicyType = big.NewInt(1 << 7) + timeOffBalanceFieldRemoteWasDeleted = big.NewInt(1 << 8) + timeOffBalanceFieldFieldMappings = big.NewInt(1 << 9) + timeOffBalanceFieldRemoteData = big.NewInt(1 << 10) +) + type TimeOffBalance struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -232,6 +481,9 @@ type TimeOffBalance struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -317,6 +569,90 @@ func (t *TimeOffBalance) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TimeOffBalance) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetId(id *string) { + t.Id = id + t.require(timeOffBalanceFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(timeOffBalanceFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(timeOffBalanceFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(timeOffBalanceFieldModifiedAt) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetEmployee(employee *TimeOffBalanceEmployee) { + t.Employee = employee + t.require(timeOffBalanceFieldEmployee) +} + +// SetBalance sets the Balance field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetBalance(balance *float64) { + t.Balance = balance + t.require(timeOffBalanceFieldBalance) +} + +// SetUsed sets the Used field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetUsed(used *float64) { + t.Used = used + t.require(timeOffBalanceFieldUsed) +} + +// SetPolicyType sets the PolicyType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetPolicyType(policyType *TimeOffBalancePolicyType) { + t.PolicyType = policyType + t.require(timeOffBalanceFieldPolicyType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(timeOffBalanceFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(timeOffBalanceFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimeOffBalance) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(timeOffBalanceFieldRemoteData) +} + func (t *TimeOffBalance) UnmarshalJSON(data []byte) error { type embed TimeOffBalance var unmarshaler = struct { @@ -352,7 +688,8 @@ func (t *TimeOffBalance) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TimeOffBalance) String() string { diff --git a/hris/timeoff/client.go b/hris/timeoff/client.go index 97517f4..f9edfb6 100644 --- a/hris/timeoff/client.go +++ b/hris/timeoff/client.go @@ -4,7 +4,6 @@ package timeoff import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.TimeOffListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.TimeOff], error) { +) (*core.Page[*string, *hris.TimeOff], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedTimeOffList) *internal.PageResponse[*string, *hris.TimeOff] { + readPageResponse := func(response *hris.PaginatedTimeOffList) *core.PageResponse[*string, *hris.TimeOff] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.TimeOff]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.TimeOff]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *hris.TimeOffEndpointRequest, opts ...option.RequestOption, ) (*hris.TimeOffResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/hris/v1/time-off" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.TimeOffResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `TimeOff` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *hris.TimeOffRetrieveRequest, opts ...option.RequestOption, ) (*hris.TimeOff, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/time-off/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.TimeOff - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `TimeOff` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*hris.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/time-off/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/timeoff/hris_time_off_test/hris_time_off_test.go b/hris/timeoff/hris_time_off_test/hris_time_off_test.go new file mode 100644 index 0000000..6dc4e16 --- /dev/null +++ b/hris/timeoff/hris_time_off_test/hris_time_off_test.go @@ -0,0 +1,228 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_time_off_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisTimeOffListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TimeOffListRequest{ + ApproverId: merge.String( + "approver_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + EndedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + EndedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: hris.TimeOffListRequestRemoteFieldsRequestType.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + RequestType: hris.TimeOffListRequestRequestTypeBereavement.Ptr(), + ShowEnumOrigins: hris.TimeOffListRequestShowEnumOriginsRequestType.Ptr(), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Status: hris.TimeOffListRequestStatusApproved.Ptr(), + } + _, invocationErr := client.Hris.TimeOff.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/time-off", map[string]string{"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"}, 1) +} + +func TestHrisTimeOffCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TimeOffEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &hris.TimeOffRequest{}, + } + _, invocationErr := client.Hris.TimeOff.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/time-off", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestHrisTimeOffRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TimeOffRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.TimeOffRetrieveRequestRemoteFieldsRequestType.Ptr(), + ShowEnumOrigins: hris.TimeOffRetrieveRequestShowEnumOriginsRequestType.Ptr(), + } + _, invocationErr := client.Hris.TimeOff.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/time-off/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "request_type", "show_enum_origins": "request_type"}, 1) +} + +func TestHrisTimeOffMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.TimeOff.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/time-off/meta/post", nil, 1) +} diff --git a/hris/timeoff/raw_client.go b/hris/timeoff/raw_client.go new file mode 100644 index 0000000..bca8961 --- /dev/null +++ b/hris/timeoff/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package timeoff + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *hris.TimeOffEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.TimeOffResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/time-off" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.TimeOffResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.TimeOffResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.TimeOffRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.TimeOff], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/time-off/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.TimeOff + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.TimeOff]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*hris.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/time-off/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/timeoffbalances/client.go b/hris/timeoffbalances/client.go index 8b0eeb4..ec47b3d 100644 --- a/hris/timeoffbalances/client.go +++ b/hris/timeoffbalances/client.go @@ -4,7 +4,6 @@ package timeoffbalances import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.TimeOffBalancesListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.TimeOffBalance], error) { +) (*core.Page[*string, *hris.TimeOffBalance], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedTimeOffBalanceList) *internal.PageResponse[*string, *hris.TimeOffBalance] { + readPageResponse := func(response *hris.PaginatedTimeOffBalanceList) *core.PageResponse[*string, *hris.TimeOffBalance] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.TimeOffBalance]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.TimeOffBalance]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *hris.TimeOffBalancesRetrieveRequest, opts ...option.RequestOption, ) (*hris.TimeOffBalance, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/time-off-balances/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.TimeOffBalance - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/hris/timeoffbalances/hris_time_off_balances_test/hris_time_off_balances_test.go b/hris/timeoffbalances/hris_time_off_balances_test/hris_time_off_balances_test.go new file mode 100644 index 0000000..a3a6408 --- /dev/null +++ b/hris/timeoffbalances/hris_time_off_balances_test/hris_time_off_balances_test.go @@ -0,0 +1,154 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_time_off_balances_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisTimeOffBalancesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TimeOffBalancesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PolicyType: hris.TimeOffBalancesListRequestPolicyTypeBereavement.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Hris.TimeOffBalances.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/time-off-balances", map[string]string{"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"}, 1) +} + +func TestHrisTimeOffBalancesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TimeOffBalancesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.TimeOffBalances.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/time-off-balances/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "policy_type", "show_enum_origins": "policy_type"}, 1) +} diff --git a/hris/timeoffbalances/raw_client.go b/hris/timeoffbalances/raw_client.go new file mode 100644 index 0000000..c186438 --- /dev/null +++ b/hris/timeoffbalances/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package timeoffbalances + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.TimeOffBalancesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.TimeOffBalance], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/time-off-balances/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.TimeOffBalance + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.TimeOffBalance]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/timesheet_entries.go b/hris/timesheet_entries.go index e892c01..1bb475b 100644 --- a/hris/timesheet_entries.go +++ b/hris/timesheet_entries.go @@ -6,17 +6,75 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + timesheetEntryEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + timesheetEntryEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + timesheetEntryEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type TimesheetEntryEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *TimesheetEntryRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TimesheetEntryEndpointRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + t.IsDebugMode = isDebugMode + t.require(timesheetEntryEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryEndpointRequest) SetRunAsync(runAsync *bool) { + t.RunAsync = runAsync + t.require(timesheetEntryEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryEndpointRequest) SetModel(model *TimesheetEntryRequest) { + t.Model = model + t.require(timesheetEntryEndpointRequestFieldModel) +} + +var ( + timesheetEntriesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + timesheetEntriesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + timesheetEntriesListRequestFieldCursor = big.NewInt(1 << 2) + timesheetEntriesListRequestFieldEmployeeId = big.NewInt(1 << 3) + timesheetEntriesListRequestFieldEndedAfter = big.NewInt(1 << 4) + timesheetEntriesListRequestFieldEndedBefore = big.NewInt(1 << 5) + timesheetEntriesListRequestFieldExpand = big.NewInt(1 << 6) + timesheetEntriesListRequestFieldIncludeDeletedData = big.NewInt(1 << 7) + timesheetEntriesListRequestFieldIncludeRemoteData = big.NewInt(1 << 8) + timesheetEntriesListRequestFieldIncludeShellData = big.NewInt(1 << 9) + timesheetEntriesListRequestFieldModifiedAfter = big.NewInt(1 << 10) + timesheetEntriesListRequestFieldModifiedBefore = big.NewInt(1 << 11) + timesheetEntriesListRequestFieldOrderBy = big.NewInt(1 << 12) + timesheetEntriesListRequestFieldPageSize = big.NewInt(1 << 13) + timesheetEntriesListRequestFieldRemoteId = big.NewInt(1 << 14) + timesheetEntriesListRequestFieldStartedAfter = big.NewInt(1 << 15) + timesheetEntriesListRequestFieldStartedBefore = big.NewInt(1 << 16) +) + type TimesheetEntriesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -52,8 +110,143 @@ type TimesheetEntriesListRequest struct { StartedAfter *time.Time `json:"-" url:"started_after,omitempty"` // If provided, will only return timesheet entries started before this datetime. StartedBefore *time.Time `json:"-" url:"started_before,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TimesheetEntriesListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(timesheetEntriesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(timesheetEntriesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(timesheetEntriesListRequestFieldCursor) +} + +// SetEmployeeId sets the EmployeeId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetEmployeeId(employeeId *string) { + t.EmployeeId = employeeId + t.require(timesheetEntriesListRequestFieldEmployeeId) +} + +// SetEndedAfter sets the EndedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetEndedAfter(endedAfter *time.Time) { + t.EndedAfter = endedAfter + t.require(timesheetEntriesListRequestFieldEndedAfter) +} + +// SetEndedBefore sets the EndedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetEndedBefore(endedBefore *time.Time) { + t.EndedBefore = endedBefore + t.require(timesheetEntriesListRequestFieldEndedBefore) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(timesheetEntriesListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(timesheetEntriesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(timesheetEntriesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(timesheetEntriesListRequestFieldIncludeShellData) } +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(timesheetEntriesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(timesheetEntriesListRequestFieldModifiedBefore) +} + +// SetOrderBy sets the OrderBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetOrderBy(orderBy *TimesheetEntriesListRequestOrderBy) { + t.OrderBy = orderBy + t.require(timesheetEntriesListRequestFieldOrderBy) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(timesheetEntriesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(timesheetEntriesListRequestFieldRemoteId) +} + +// SetStartedAfter sets the StartedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetStartedAfter(startedAfter *time.Time) { + t.StartedAfter = startedAfter + t.require(timesheetEntriesListRequestFieldStartedAfter) +} + +// SetStartedBefore sets the StartedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesListRequest) SetStartedBefore(startedBefore *time.Time) { + t.StartedBefore = startedBefore + t.require(timesheetEntriesListRequestFieldStartedBefore) +} + +var ( + timesheetEntriesRetrieveRequestFieldExpand = big.NewInt(1 << 0) + timesheetEntriesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + timesheetEntriesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type TimesheetEntriesRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -61,6 +254,37 @@ type TimesheetEntriesRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TimesheetEntriesRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesRetrieveRequest) SetExpand(expand []*string) { + t.Expand = expand + t.require(timesheetEntriesRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(timesheetEntriesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntriesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(timesheetEntriesRetrieveRequestFieldIncludeShellData) } type TimesheetEntriesListRequestOrderBy string @@ -85,11 +309,20 @@ func (t TimesheetEntriesListRequestOrderBy) Ptr() *TimesheetEntriesListRequestOr return &t } +var ( + paginatedTimesheetEntryListFieldNext = big.NewInt(1 << 0) + paginatedTimesheetEntryListFieldPrevious = big.NewInt(1 << 1) + paginatedTimesheetEntryListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTimesheetEntryList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*TimesheetEntry `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -119,6 +352,34 @@ func (p *PaginatedTimesheetEntryList) GetExtraProperties() map[string]interface{ return p.extraProperties } +func (p *PaginatedTimesheetEntryList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTimesheetEntryList) SetNext(next *string) { + p.Next = next + p.require(paginatedTimesheetEntryListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTimesheetEntryList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTimesheetEntryListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTimesheetEntryList) SetResults(results []*TimesheetEntry) { + p.Results = results + p.require(paginatedTimesheetEntryListFieldResults) +} + func (p *PaginatedTimesheetEntryList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTimesheetEntryList var value unmarshaler @@ -135,6 +396,17 @@ func (p *PaginatedTimesheetEntryList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTimesheetEntryList) MarshalJSON() ([]byte, error) { + type embed PaginatedTimesheetEntryList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTimesheetEntryList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -153,6 +425,20 @@ func (p *PaginatedTimesheetEntryList) String() string { // // ### Usage Example // GET and POST Timesheet Entries +var ( + timesheetEntryFieldId = big.NewInt(1 << 0) + timesheetEntryFieldRemoteId = big.NewInt(1 << 1) + timesheetEntryFieldCreatedAt = big.NewInt(1 << 2) + timesheetEntryFieldModifiedAt = big.NewInt(1 << 3) + timesheetEntryFieldEmployee = big.NewInt(1 << 4) + timesheetEntryFieldHoursWorked = big.NewInt(1 << 5) + timesheetEntryFieldStartTime = big.NewInt(1 << 6) + timesheetEntryFieldEndTime = big.NewInt(1 << 7) + timesheetEntryFieldRemoteWasDeleted = big.NewInt(1 << 8) + timesheetEntryFieldFieldMappings = big.NewInt(1 << 9) + timesheetEntryFieldRemoteData = big.NewInt(1 << 10) +) + type TimesheetEntry struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -174,6 +460,9 @@ type TimesheetEntry struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -259,6 +548,90 @@ func (t *TimesheetEntry) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TimesheetEntry) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetId(id *string) { + t.Id = id + t.require(timesheetEntryFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(timesheetEntryFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(timesheetEntryFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(timesheetEntryFieldModifiedAt) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetEmployee(employee *TimesheetEntryEmployee) { + t.Employee = employee + t.require(timesheetEntryFieldEmployee) +} + +// SetHoursWorked sets the HoursWorked field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetHoursWorked(hoursWorked *float64) { + t.HoursWorked = hoursWorked + t.require(timesheetEntryFieldHoursWorked) +} + +// SetStartTime sets the StartTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetStartTime(startTime *time.Time) { + t.StartTime = startTime + t.require(timesheetEntryFieldStartTime) +} + +// SetEndTime sets the EndTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetEndTime(endTime *time.Time) { + t.EndTime = endTime + t.require(timesheetEntryFieldEndTime) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(timesheetEntryFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(timesheetEntryFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntry) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(timesheetEntryFieldRemoteData) +} + func (t *TimesheetEntry) UnmarshalJSON(data []byte) error { type embed TimesheetEntry var unmarshaler = struct { @@ -302,7 +675,8 @@ func (t *TimesheetEntry) MarshalJSON() ([]byte, error) { StartTime: internal.NewOptionalDateTime(t.StartTime), EndTime: internal.NewOptionalDateTime(t.EndTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TimesheetEntry) String() string { @@ -386,6 +760,15 @@ func (t *TimesheetEntryEmployee) Accept(visitor TimesheetEntryEmployeeVisitor) e // // ### Usage Example // GET and POST Timesheet Entries +var ( + timesheetEntryRequestFieldEmployee = big.NewInt(1 << 0) + timesheetEntryRequestFieldHoursWorked = big.NewInt(1 << 1) + timesheetEntryRequestFieldStartTime = big.NewInt(1 << 2) + timesheetEntryRequestFieldEndTime = big.NewInt(1 << 3) + timesheetEntryRequestFieldIntegrationParams = big.NewInt(1 << 4) + timesheetEntryRequestFieldLinkedAccountParams = big.NewInt(1 << 5) +) + type TimesheetEntryRequest struct { // The employee the timesheet entry is for. Employee *TimesheetEntryRequestEmployee `json:"employee,omitempty" url:"employee,omitempty"` @@ -398,6 +781,9 @@ type TimesheetEntryRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -448,6 +834,55 @@ func (t *TimesheetEntryRequest) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TimesheetEntryRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryRequest) SetEmployee(employee *TimesheetEntryRequestEmployee) { + t.Employee = employee + t.require(timesheetEntryRequestFieldEmployee) +} + +// SetHoursWorked sets the HoursWorked field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryRequest) SetHoursWorked(hoursWorked *float64) { + t.HoursWorked = hoursWorked + t.require(timesheetEntryRequestFieldHoursWorked) +} + +// SetStartTime sets the StartTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryRequest) SetStartTime(startTime *time.Time) { + t.StartTime = startTime + t.require(timesheetEntryRequestFieldStartTime) +} + +// SetEndTime sets the EndTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryRequest) SetEndTime(endTime *time.Time) { + t.EndTime = endTime + t.require(timesheetEntryRequestFieldEndTime) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + t.IntegrationParams = integrationParams + t.require(timesheetEntryRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + t.LinkedAccountParams = linkedAccountParams + t.require(timesheetEntryRequestFieldLinkedAccountParams) +} + func (t *TimesheetEntryRequest) UnmarshalJSON(data []byte) error { type embed TimesheetEntryRequest var unmarshaler = struct { @@ -483,7 +918,8 @@ func (t *TimesheetEntryRequest) MarshalJSON() ([]byte, error) { StartTime: internal.NewOptionalDateTime(t.StartTime), EndTime: internal.NewOptionalDateTime(t.EndTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TimesheetEntryRequest) String() string { @@ -561,12 +997,22 @@ func (t *TimesheetEntryRequestEmployee) Accept(visitor TimesheetEntryRequestEmpl return fmt.Errorf("type %T does not include a non-empty union type", t) } +var ( + timesheetEntryResponseFieldModel = big.NewInt(1 << 0) + timesheetEntryResponseFieldWarnings = big.NewInt(1 << 1) + timesheetEntryResponseFieldErrors = big.NewInt(1 << 2) + timesheetEntryResponseFieldLogs = big.NewInt(1 << 3) +) + type TimesheetEntryResponse struct { Model *TimesheetEntry `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -603,6 +1049,41 @@ func (t *TimesheetEntryResponse) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TimesheetEntryResponse) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryResponse) SetModel(model *TimesheetEntry) { + t.Model = model + t.require(timesheetEntryResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryResponse) SetWarnings(warnings []*WarningValidationProblem) { + t.Warnings = warnings + t.require(timesheetEntryResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryResponse) SetErrors(errors []*ErrorValidationProblem) { + t.Errors = errors + t.require(timesheetEntryResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TimesheetEntryResponse) SetLogs(logs []*DebugModeLog) { + t.Logs = logs + t.require(timesheetEntryResponseFieldLogs) +} + func (t *TimesheetEntryResponse) UnmarshalJSON(data []byte) error { type unmarshaler TimesheetEntryResponse var value unmarshaler @@ -619,6 +1100,17 @@ func (t *TimesheetEntryResponse) UnmarshalJSON(data []byte) error { return nil } +func (t *TimesheetEntryResponse) MarshalJSON() ([]byte, error) { + type embed TimesheetEntryResponse + var marshaler = struct { + embed + }{ + embed: embed(*t), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (t *TimesheetEntryResponse) String() string { if len(t.rawJSON) > 0 { if value, err := internal.StringifyJSON(t.rawJSON); err == nil { diff --git a/hris/timesheetentries/client.go b/hris/timesheetentries/client.go index f401006..0044cda 100644 --- a/hris/timesheetentries/client.go +++ b/hris/timesheetentries/client.go @@ -4,7 +4,6 @@ package timesheetentries import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *hris.TimesheetEntriesListRequest, opts ...option.RequestOption, -) (*core.Page[*hris.TimesheetEntry], error) { +) (*core.Page[*string, *hris.TimesheetEntry], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *hris.PaginatedTimesheetEntryList) *internal.PageResponse[*string, *hris.TimesheetEntry] { + readPageResponse := func(response *hris.PaginatedTimesheetEntryList) *core.PageResponse[*string, *hris.TimesheetEntry] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *hris.TimesheetEntry]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *hris.TimesheetEntry]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *hris.TimesheetEntryEndpointRequest, opts ...option.RequestOption, ) (*hris.TimesheetEntryResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/hris/v1/timesheet-entries" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.TimesheetEntryResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `TimesheetEntry` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *hris.TimesheetEntriesRetrieveRequest, opts ...option.RequestOption, ) (*hris.TimesheetEntry, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/hris/v1/timesheet-entries/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.TimesheetEntry - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `TimesheetEntry` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*hris.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/timesheet-entries/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *hris.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/timesheetentries/hris_timesheet_entries_test/hris_timesheet_entries_test.go b/hris/timesheetentries/hris_timesheet_entries_test/hris_timesheet_entries_test.go new file mode 100644 index 0000000..7eb1802 --- /dev/null +++ b/hris/timesheetentries/hris_timesheet_entries_test/hris_timesheet_entries_test.go @@ -0,0 +1,220 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_timesheet_entries_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisTimesheetEntriesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TimesheetEntriesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + EndedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + EndedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OrderBy: hris.TimesheetEntriesListRequestOrderByStartTimeDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } + _, invocationErr := client.Hris.TimesheetEntries.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/timesheet-entries", map[string]string{"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"}, 1) +} + +func TestHrisTimesheetEntriesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TimesheetEntryEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &hris.TimesheetEntryRequest{}, + } + _, invocationErr := client.Hris.TimesheetEntries.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/timesheet-entries", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestHrisTimesheetEntriesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.TimesheetEntriesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Hris.TimesheetEntries.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/timesheet-entries/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestHrisTimesheetEntriesMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.TimesheetEntries.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/timesheet-entries/meta/post", nil, 1) +} diff --git a/hris/timesheetentries/raw_client.go b/hris/timesheetentries/raw_client.go new file mode 100644 index 0000000..7b297f7 --- /dev/null +++ b/hris/timesheetentries/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package timesheetentries + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *hris.TimesheetEntryEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.TimesheetEntryResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/timesheet-entries" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.TimesheetEntryResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.TimesheetEntryResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *hris.TimesheetEntriesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.TimesheetEntry], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/hris/v1/timesheet-entries/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.TimesheetEntry + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.TimesheetEntry]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*hris.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/timesheet-entries/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *hris.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/hris/types.go b/hris/types.go index 739f3a5..2196007 100644 --- a/hris/types.go +++ b/hris/types.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountIntegrationFieldName = big.NewInt(1 << 0) + accountIntegrationFieldAbbreviatedName = big.NewInt(1 << 1) + accountIntegrationFieldCategories = big.NewInt(1 << 2) + accountIntegrationFieldImage = big.NewInt(1 << 3) + accountIntegrationFieldSquareImage = big.NewInt(1 << 4) + accountIntegrationFieldColor = big.NewInt(1 << 5) + accountIntegrationFieldSlug = big.NewInt(1 << 6) + accountIntegrationFieldApiEndpointsToDocumentationUrls = big.NewInt(1 << 7) + accountIntegrationFieldWebhookSetupGuideUrl = big.NewInt(1 << 8) + accountIntegrationFieldCategoryBetaStatus = big.NewInt(1 << 9) +) + type AccountIntegration struct { // Company name. Name string `json:"name" url:"name"` @@ -30,6 +44,9 @@ type AccountIntegration struct { // Category or categories this integration is in beta status for. CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty" url:"category_beta_status,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -108,6 +125,83 @@ func (a *AccountIntegration) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetName(name string) { + a.Name = name + a.require(accountIntegrationFieldName) +} + +// SetAbbreviatedName sets the AbbreviatedName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetAbbreviatedName(abbreviatedName *string) { + a.AbbreviatedName = abbreviatedName + a.require(accountIntegrationFieldAbbreviatedName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetImage(image *string) { + a.Image = image + a.require(accountIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetColor(color *string) { + a.Color = color + a.require(accountIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSlug(slug *string) { + a.Slug = slug + a.require(accountIntegrationFieldSlug) +} + +// SetApiEndpointsToDocumentationUrls sets the ApiEndpointsToDocumentationUrls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetApiEndpointsToDocumentationUrls(apiEndpointsToDocumentationUrls map[string]interface{}) { + a.ApiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls + a.require(accountIntegrationFieldApiEndpointsToDocumentationUrls) +} + +// SetWebhookSetupGuideUrl sets the WebhookSetupGuideUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetWebhookSetupGuideUrl(webhookSetupGuideUrl *string) { + a.WebhookSetupGuideUrl = webhookSetupGuideUrl + a.require(accountIntegrationFieldWebhookSetupGuideUrl) +} + +// SetCategoryBetaStatus sets the CategoryBetaStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategoryBetaStatus(categoryBetaStatus map[string]interface{}) { + a.CategoryBetaStatus = categoryBetaStatus + a.require(accountIntegrationFieldCategoryBetaStatus) +} + func (a *AccountIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountIntegration var value unmarshaler @@ -124,6 +218,17 @@ func (a *AccountIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountIntegration) MarshalJSON() ([]byte, error) { + type embed AccountIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -230,6 +335,19 @@ func (c CategoryEnum) Ptr() *CategoryEnum { // // ### Usage Example // Fetch from the `LIST Companies` endpoint and filter by `ID` to show all companies. +var ( + companyFieldId = big.NewInt(1 << 0) + companyFieldRemoteId = big.NewInt(1 << 1) + companyFieldCreatedAt = big.NewInt(1 << 2) + companyFieldModifiedAt = big.NewInt(1 << 3) + companyFieldLegalName = big.NewInt(1 << 4) + companyFieldDisplayName = big.NewInt(1 << 5) + companyFieldEins = big.NewInt(1 << 6) + companyFieldRemoteWasDeleted = big.NewInt(1 << 7) + companyFieldFieldMappings = big.NewInt(1 << 8) + companyFieldRemoteData = big.NewInt(1 << 9) +) + type Company struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -249,6 +367,9 @@ type Company struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -327,6 +448,83 @@ func (c *Company) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *Company) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetId(id *string) { + c.Id = id + c.require(companyFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(companyFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(companyFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(companyFieldModifiedAt) +} + +// SetLegalName sets the LegalName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetLegalName(legalName *string) { + c.LegalName = legalName + c.require(companyFieldLegalName) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetDisplayName(displayName *string) { + c.DisplayName = displayName + c.require(companyFieldDisplayName) +} + +// SetEins sets the Eins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetEins(eins []*string) { + c.Eins = eins + c.require(companyFieldEins) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(companyFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(companyFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Company) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(companyFieldRemoteData) +} + func (c *Company) UnmarshalJSON(data []byte) error { type embed Company var unmarshaler = struct { @@ -362,7 +560,8 @@ func (c *Company) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(c.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *Company) String() string { @@ -1395,6 +1594,17 @@ func (c CountryEnum) Ptr() *CountryEnum { // // ### Usage Example // Create a `DataPassthrough` to get team hierarchies from your Rippling integration. +var ( + dataPassthroughRequestFieldMethod = big.NewInt(1 << 0) + dataPassthroughRequestFieldPath = big.NewInt(1 << 1) + dataPassthroughRequestFieldBaseUrlOverride = big.NewInt(1 << 2) + dataPassthroughRequestFieldData = big.NewInt(1 << 3) + dataPassthroughRequestFieldMultipartFormData = big.NewInt(1 << 4) + dataPassthroughRequestFieldHeaders = big.NewInt(1 << 5) + dataPassthroughRequestFieldRequestFormat = big.NewInt(1 << 6) + dataPassthroughRequestFieldNormalizeResponse = big.NewInt(1 << 7) +) + type DataPassthroughRequest struct { Method MethodEnum `json:"method" url:"method"` // The path of the request in the third party's platform. @@ -1411,6 +1621,9 @@ type DataPassthroughRequest struct { // 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`. NormalizeResponse *bool `json:"normalize_response,omitempty" url:"normalize_response,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1475,6 +1688,69 @@ func (d *DataPassthroughRequest) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DataPassthroughRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMethod(method MethodEnum) { + d.Method = method + d.require(dataPassthroughRequestFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetPath(path string) { + d.Path = path + d.require(dataPassthroughRequestFieldPath) +} + +// SetBaseUrlOverride sets the BaseUrlOverride field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetBaseUrlOverride(baseUrlOverride *string) { + d.BaseUrlOverride = baseUrlOverride + d.require(dataPassthroughRequestFieldBaseUrlOverride) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetData(data *string) { + d.Data = data + d.require(dataPassthroughRequestFieldData) +} + +// SetMultipartFormData sets the MultipartFormData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMultipartFormData(multipartFormData []*MultipartFormFieldRequest) { + d.MultipartFormData = multipartFormData + d.require(dataPassthroughRequestFieldMultipartFormData) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetHeaders(headers map[string]interface{}) { + d.Headers = headers + d.require(dataPassthroughRequestFieldHeaders) +} + +// SetRequestFormat sets the RequestFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetRequestFormat(requestFormat *RequestFormatEnum) { + d.RequestFormat = requestFormat + d.require(dataPassthroughRequestFieldRequestFormat) +} + +// SetNormalizeResponse sets the NormalizeResponse field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetNormalizeResponse(normalizeResponse *bool) { + d.NormalizeResponse = normalizeResponse + d.require(dataPassthroughRequestFieldNormalizeResponse) +} + func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { type unmarshaler DataPassthroughRequest var value unmarshaler @@ -1491,6 +1767,17 @@ func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { return nil } +func (d *DataPassthroughRequest) MarshalJSON() ([]byte, error) { + type embed DataPassthroughRequest + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DataPassthroughRequest) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -1503,11 +1790,20 @@ func (d *DataPassthroughRequest) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModeLogFieldLogId = big.NewInt(1 << 0) + debugModeLogFieldDashboardView = big.NewInt(1 << 1) + debugModeLogFieldLogSummary = big.NewInt(1 << 2) +) + type DebugModeLog struct { LogId string `json:"log_id" url:"log_id"` DashboardView string `json:"dashboard_view" url:"dashboard_view"` LogSummary *DebugModelLogSummary `json:"log_summary" url:"log_summary"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1537,6 +1833,34 @@ func (d *DebugModeLog) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModeLog) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetLogId sets the LogId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogId(logId string) { + d.LogId = logId + d.require(debugModeLogFieldLogId) +} + +// SetDashboardView sets the DashboardView field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetDashboardView(dashboardView string) { + d.DashboardView = dashboardView + d.require(debugModeLogFieldDashboardView) +} + +// SetLogSummary sets the LogSummary field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogSummary(logSummary *DebugModelLogSummary) { + d.LogSummary = logSummary + d.require(debugModeLogFieldLogSummary) +} + func (d *DebugModeLog) UnmarshalJSON(data []byte) error { type unmarshaler DebugModeLog var value unmarshaler @@ -1553,6 +1877,17 @@ func (d *DebugModeLog) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModeLog) MarshalJSON() ([]byte, error) { + type embed DebugModeLog + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModeLog) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -1565,11 +1900,20 @@ func (d *DebugModeLog) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModelLogSummaryFieldUrl = big.NewInt(1 << 0) + debugModelLogSummaryFieldMethod = big.NewInt(1 << 1) + debugModelLogSummaryFieldStatusCode = big.NewInt(1 << 2) +) + type DebugModelLogSummary struct { Url string `json:"url" url:"url"` Method string `json:"method" url:"method"` StatusCode int `json:"status_code" url:"status_code"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1599,6 +1943,34 @@ func (d *DebugModelLogSummary) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModelLogSummary) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetUrl sets the Url field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetUrl(url string) { + d.Url = url + d.require(debugModelLogSummaryFieldUrl) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetMethod(method string) { + d.Method = method + d.require(debugModelLogSummaryFieldMethod) +} + +// SetStatusCode sets the StatusCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetStatusCode(statusCode int) { + d.StatusCode = statusCode + d.require(debugModelLogSummaryFieldStatusCode) +} + func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { type unmarshaler DebugModelLogSummary var value unmarshaler @@ -1615,6 +1987,17 @@ func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModelLogSummary) MarshalJSON() ([]byte, error) { + type embed DebugModelLogSummary + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModelLogSummary) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -1633,6 +2016,45 @@ func (d *DebugModelLogSummary) String() string { // // ### Usage Example // Fetch from the `LIST Employee` endpoint and filter by `ID` to show all employees. +var ( + employeeFieldId = big.NewInt(1 << 0) + employeeFieldRemoteId = big.NewInt(1 << 1) + employeeFieldCreatedAt = big.NewInt(1 << 2) + employeeFieldModifiedAt = big.NewInt(1 << 3) + employeeFieldEmployeeNumber = big.NewInt(1 << 4) + employeeFieldCompany = big.NewInt(1 << 5) + employeeFieldFirstName = big.NewInt(1 << 6) + employeeFieldLastName = big.NewInt(1 << 7) + employeeFieldPreferredName = big.NewInt(1 << 8) + employeeFieldDisplayFullName = big.NewInt(1 << 9) + employeeFieldUsername = big.NewInt(1 << 10) + employeeFieldGroups = big.NewInt(1 << 11) + employeeFieldWorkEmail = big.NewInt(1 << 12) + employeeFieldPersonalEmail = big.NewInt(1 << 13) + employeeFieldMobilePhoneNumber = big.NewInt(1 << 14) + employeeFieldEmployments = big.NewInt(1 << 15) + employeeFieldHomeLocation = big.NewInt(1 << 16) + employeeFieldWorkLocation = big.NewInt(1 << 17) + employeeFieldManager = big.NewInt(1 << 18) + employeeFieldTeam = big.NewInt(1 << 19) + employeeFieldPayGroup = big.NewInt(1 << 20) + employeeFieldSsn = big.NewInt(1 << 21) + employeeFieldGender = big.NewInt(1 << 22) + employeeFieldEthnicity = big.NewInt(1 << 23) + employeeFieldMaritalStatus = big.NewInt(1 << 24) + employeeFieldDateOfBirth = big.NewInt(1 << 25) + employeeFieldHireDate = big.NewInt(1 << 26) + employeeFieldStartDate = big.NewInt(1 << 27) + employeeFieldRemoteCreatedAt = big.NewInt(1 << 28) + employeeFieldEmploymentStatus = big.NewInt(1 << 29) + employeeFieldTerminationDate = big.NewInt(1 << 30) + employeeFieldAvatar = big.NewInt(1 << 31) + employeeFieldCustomFields = big.NewInt(1 << 32) + employeeFieldRemoteWasDeleted = big.NewInt(1 << 33) + employeeFieldFieldMappings = big.NewInt(1 << 34) + employeeFieldRemoteData = big.NewInt(1 << 35) +) + type Employee struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -1728,6 +2150,9 @@ type Employee struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1988,6 +2413,265 @@ func (e *Employee) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *Employee) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetId(id *string) { + e.Id = id + e.require(employeeFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(employeeFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(employeeFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(employeeFieldModifiedAt) +} + +// SetEmployeeNumber sets the EmployeeNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetEmployeeNumber(employeeNumber *string) { + e.EmployeeNumber = employeeNumber + e.require(employeeFieldEmployeeNumber) +} + +// SetCompany sets the Company field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetCompany(company *EmployeeCompany) { + e.Company = company + e.require(employeeFieldCompany) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetFirstName(firstName *string) { + e.FirstName = firstName + e.require(employeeFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetLastName(lastName *string) { + e.LastName = lastName + e.require(employeeFieldLastName) +} + +// SetPreferredName sets the PreferredName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetPreferredName(preferredName *string) { + e.PreferredName = preferredName + e.require(employeeFieldPreferredName) +} + +// SetDisplayFullName sets the DisplayFullName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetDisplayFullName(displayFullName *string) { + e.DisplayFullName = displayFullName + e.require(employeeFieldDisplayFullName) +} + +// SetUsername sets the Username field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetUsername(username *string) { + e.Username = username + e.require(employeeFieldUsername) +} + +// SetGroups sets the Groups field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetGroups(groups []*EmployeeGroupsItem) { + e.Groups = groups + e.require(employeeFieldGroups) +} + +// SetWorkEmail sets the WorkEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetWorkEmail(workEmail *string) { + e.WorkEmail = workEmail + e.require(employeeFieldWorkEmail) +} + +// SetPersonalEmail sets the PersonalEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetPersonalEmail(personalEmail *string) { + e.PersonalEmail = personalEmail + e.require(employeeFieldPersonalEmail) +} + +// SetMobilePhoneNumber sets the MobilePhoneNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetMobilePhoneNumber(mobilePhoneNumber *string) { + e.MobilePhoneNumber = mobilePhoneNumber + e.require(employeeFieldMobilePhoneNumber) +} + +// SetEmployments sets the Employments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetEmployments(employments []*EmployeeEmploymentsItem) { + e.Employments = employments + e.require(employeeFieldEmployments) +} + +// SetHomeLocation sets the HomeLocation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetHomeLocation(homeLocation *EmployeeHomeLocation) { + e.HomeLocation = homeLocation + e.require(employeeFieldHomeLocation) +} + +// SetWorkLocation sets the WorkLocation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetWorkLocation(workLocation *EmployeeWorkLocation) { + e.WorkLocation = workLocation + e.require(employeeFieldWorkLocation) +} + +// SetManager sets the Manager field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetManager(manager *EmployeeManager) { + e.Manager = manager + e.require(employeeFieldManager) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetTeam(team *EmployeeTeam) { + e.Team = team + e.require(employeeFieldTeam) +} + +// SetPayGroup sets the PayGroup field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetPayGroup(payGroup *EmployeePayGroup) { + e.PayGroup = payGroup + e.require(employeeFieldPayGroup) +} + +// SetSsn sets the Ssn field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetSsn(ssn *string) { + e.Ssn = ssn + e.require(employeeFieldSsn) +} + +// SetGender sets the Gender field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetGender(gender *EmployeeGender) { + e.Gender = gender + e.require(employeeFieldGender) +} + +// SetEthnicity sets the Ethnicity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetEthnicity(ethnicity *EmployeeEthnicity) { + e.Ethnicity = ethnicity + e.require(employeeFieldEthnicity) +} + +// SetMaritalStatus sets the MaritalStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetMaritalStatus(maritalStatus *EmployeeMaritalStatus) { + e.MaritalStatus = maritalStatus + e.require(employeeFieldMaritalStatus) +} + +// SetDateOfBirth sets the DateOfBirth field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetDateOfBirth(dateOfBirth *time.Time) { + e.DateOfBirth = dateOfBirth + e.require(employeeFieldDateOfBirth) +} + +// SetHireDate sets the HireDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetHireDate(hireDate *time.Time) { + e.HireDate = hireDate + e.require(employeeFieldHireDate) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetStartDate(startDate *time.Time) { + e.StartDate = startDate + e.require(employeeFieldStartDate) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + e.RemoteCreatedAt = remoteCreatedAt + e.require(employeeFieldRemoteCreatedAt) +} + +// SetEmploymentStatus sets the EmploymentStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetEmploymentStatus(employmentStatus *EmployeeEmploymentStatus) { + e.EmploymentStatus = employmentStatus + e.require(employeeFieldEmploymentStatus) +} + +// SetTerminationDate sets the TerminationDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetTerminationDate(terminationDate *time.Time) { + e.TerminationDate = terminationDate + e.require(employeeFieldTerminationDate) +} + +// SetAvatar sets the Avatar field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetAvatar(avatar *string) { + e.Avatar = avatar + e.require(employeeFieldAvatar) +} + +// SetCustomFields sets the CustomFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetCustomFields(customFields map[string]interface{}) { + e.CustomFields = customFields + e.require(employeeFieldCustomFields) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(employeeFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetFieldMappings(fieldMappings map[string]interface{}) { + e.FieldMappings = fieldMappings + e.require(employeeFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employee) SetRemoteData(remoteData []*RemoteData) { + e.RemoteData = remoteData + e.require(employeeFieldRemoteData) +} + func (e *Employee) UnmarshalJSON(data []byte) error { type embed Employee var unmarshaler = struct { @@ -2043,7 +2727,8 @@ func (e *Employee) MarshalJSON() ([]byte, error) { RemoteCreatedAt: internal.NewOptionalDateTime(e.RemoteCreatedAt), TerminationDate: internal.NewOptionalDateTime(e.TerminationDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *Employee) String() string { @@ -2845,6 +3530,26 @@ func (e *EmployeeWorkLocation) Accept(visitor EmployeeWorkLocationVisitor) error // // ### Usage Example // Fetch from the `LIST Employments` endpoint and filter by `ID` to show all employees. +var ( + employmentFieldId = big.NewInt(1 << 0) + employmentFieldRemoteId = big.NewInt(1 << 1) + employmentFieldCreatedAt = big.NewInt(1 << 2) + employmentFieldModifiedAt = big.NewInt(1 << 3) + employmentFieldEmployee = big.NewInt(1 << 4) + employmentFieldJobTitle = big.NewInt(1 << 5) + employmentFieldPayRate = big.NewInt(1 << 6) + employmentFieldPayPeriod = big.NewInt(1 << 7) + employmentFieldPayFrequency = big.NewInt(1 << 8) + employmentFieldPayCurrency = big.NewInt(1 << 9) + employmentFieldPayGroup = big.NewInt(1 << 10) + employmentFieldFlsaStatus = big.NewInt(1 << 11) + employmentFieldEffectiveDate = big.NewInt(1 << 12) + employmentFieldEmploymentType = big.NewInt(1 << 13) + employmentFieldRemoteWasDeleted = big.NewInt(1 << 14) + employmentFieldFieldMappings = big.NewInt(1 << 15) + employmentFieldRemoteData = big.NewInt(1 << 16) +) + type Employment struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -3216,6 +3921,9 @@ type Employment struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3343,6 +4051,132 @@ func (e *Employment) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *Employment) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetId(id *string) { + e.Id = id + e.require(employmentFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetRemoteId(remoteId *string) { + e.RemoteId = remoteId + e.require(employmentFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetCreatedAt(createdAt *time.Time) { + e.CreatedAt = createdAt + e.require(employmentFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetModifiedAt(modifiedAt *time.Time) { + e.ModifiedAt = modifiedAt + e.require(employmentFieldModifiedAt) +} + +// SetEmployee sets the Employee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetEmployee(employee *EmploymentEmployee) { + e.Employee = employee + e.require(employmentFieldEmployee) +} + +// SetJobTitle sets the JobTitle field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetJobTitle(jobTitle *string) { + e.JobTitle = jobTitle + e.require(employmentFieldJobTitle) +} + +// SetPayRate sets the PayRate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetPayRate(payRate *float64) { + e.PayRate = payRate + e.require(employmentFieldPayRate) +} + +// SetPayPeriod sets the PayPeriod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetPayPeriod(payPeriod *EmploymentPayPeriod) { + e.PayPeriod = payPeriod + e.require(employmentFieldPayPeriod) +} + +// SetPayFrequency sets the PayFrequency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetPayFrequency(payFrequency *EmploymentPayFrequency) { + e.PayFrequency = payFrequency + e.require(employmentFieldPayFrequency) +} + +// SetPayCurrency sets the PayCurrency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetPayCurrency(payCurrency *EmploymentPayCurrency) { + e.PayCurrency = payCurrency + e.require(employmentFieldPayCurrency) +} + +// SetPayGroup sets the PayGroup field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetPayGroup(payGroup *EmploymentPayGroup) { + e.PayGroup = payGroup + e.require(employmentFieldPayGroup) +} + +// SetFlsaStatus sets the FlsaStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetFlsaStatus(flsaStatus *EmploymentFlsaStatus) { + e.FlsaStatus = flsaStatus + e.require(employmentFieldFlsaStatus) +} + +// SetEffectiveDate sets the EffectiveDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetEffectiveDate(effectiveDate *time.Time) { + e.EffectiveDate = effectiveDate + e.require(employmentFieldEffectiveDate) +} + +// SetEmploymentType sets the EmploymentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetEmploymentType(employmentType *EmploymentEmploymentType) { + e.EmploymentType = employmentType + e.require(employmentFieldEmploymentType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetRemoteWasDeleted(remoteWasDeleted *bool) { + e.RemoteWasDeleted = remoteWasDeleted + e.require(employmentFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetFieldMappings(fieldMappings map[string]interface{}) { + e.FieldMappings = fieldMappings + e.require(employmentFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *Employment) SetRemoteData(remoteData []*RemoteData) { + e.RemoteData = remoteData + e.require(employmentFieldRemoteData) +} + func (e *Employment) UnmarshalJSON(data []byte) error { type embed Employment var unmarshaler = struct { @@ -3382,7 +4216,8 @@ func (e *Employment) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(e.ModifiedAt), EffectiveDate: internal.NewOptionalDateTime(e.EffectiveDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) } func (e *Employment) String() string { @@ -4268,12 +5103,22 @@ func (e EncodingEnum) Ptr() *EncodingEnum { return &e } +var ( + errorValidationProblemFieldSource = big.NewInt(1 << 0) + errorValidationProblemFieldTitle = big.NewInt(1 << 1) + errorValidationProblemFieldDetail = big.NewInt(1 << 2) + errorValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type ErrorValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4310,6 +5155,41 @@ func (e *ErrorValidationProblem) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ErrorValidationProblem) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetSource(source *ValidationProblemSource) { + e.Source = source + e.require(errorValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetTitle(title string) { + e.Title = title + e.require(errorValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetDetail(detail string) { + e.Detail = detail + e.require(errorValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetProblemType(problemType string) { + e.ProblemType = problemType + e.require(errorValidationProblemFieldProblemType) +} + func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler ErrorValidationProblem var value unmarshaler @@ -4326,8 +5206,19 @@ func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { return nil } -func (e *ErrorValidationProblem) String() string { - if len(e.rawJSON) > 0 { +func (e *ErrorValidationProblem) MarshalJSON() ([]byte, error) { + type embed ErrorValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (e *ErrorValidationProblem) String() string { + if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { return value } @@ -4386,10 +5277,18 @@ func (e EthnicityEnum) Ptr() *EthnicityEnum { return &e } +var ( + fieldPermissionDeserializerRequestFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerRequestFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializerRequest struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4412,6 +5311,27 @@ func (f *FieldPermissionDeserializerRequest) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldPermissionDeserializerRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerRequestFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerRequestFieldDisabledFields) +} + func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializerRequest var value unmarshaler @@ -4428,6 +5348,17 @@ func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializerRequest) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -4514,6 +5445,20 @@ func (g GenderEnum) Ptr() *GenderEnum { // // ### Usage Example // Fetch from the `LIST Employee` endpoint and expand groups to view an employee's groups. +var ( + groupFieldId = big.NewInt(1 << 0) + groupFieldRemoteId = big.NewInt(1 << 1) + groupFieldCreatedAt = big.NewInt(1 << 2) + groupFieldModifiedAt = big.NewInt(1 << 3) + groupFieldParentGroup = big.NewInt(1 << 4) + groupFieldName = big.NewInt(1 << 5) + groupFieldType = big.NewInt(1 << 6) + groupFieldIsCommonlyUsedAsTeam = big.NewInt(1 << 7) + groupFieldRemoteWasDeleted = big.NewInt(1 << 8) + groupFieldFieldMappings = big.NewInt(1 << 9) + groupFieldRemoteData = big.NewInt(1 << 10) +) + type Group struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -4541,6 +5486,9 @@ type Group struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4626,6 +5574,90 @@ func (g *Group) GetExtraProperties() map[string]interface{} { return g.extraProperties } +func (g *Group) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetId(id *string) { + g.Id = id + g.require(groupFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetRemoteId(remoteId *string) { + g.RemoteId = remoteId + g.require(groupFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetCreatedAt(createdAt *time.Time) { + g.CreatedAt = createdAt + g.require(groupFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetModifiedAt(modifiedAt *time.Time) { + g.ModifiedAt = modifiedAt + g.require(groupFieldModifiedAt) +} + +// SetParentGroup sets the ParentGroup field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetParentGroup(parentGroup *string) { + g.ParentGroup = parentGroup + g.require(groupFieldParentGroup) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetName(name *string) { + g.Name = name + g.require(groupFieldName) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetType(type_ *GroupType) { + g.Type = type_ + g.require(groupFieldType) +} + +// SetIsCommonlyUsedAsTeam sets the IsCommonlyUsedAsTeam field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetIsCommonlyUsedAsTeam(isCommonlyUsedAsTeam *bool) { + g.IsCommonlyUsedAsTeam = isCommonlyUsedAsTeam + g.require(groupFieldIsCommonlyUsedAsTeam) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetRemoteWasDeleted(remoteWasDeleted *bool) { + g.RemoteWasDeleted = remoteWasDeleted + g.require(groupFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetFieldMappings(fieldMappings map[string]interface{}) { + g.FieldMappings = fieldMappings + g.require(groupFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *Group) SetRemoteData(remoteData []*RemoteData) { + g.RemoteData = remoteData + g.require(groupFieldRemoteData) +} + func (g *Group) UnmarshalJSON(data []byte) error { type embed Group var unmarshaler = struct { @@ -4661,7 +5693,8 @@ func (g *Group) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(g.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(g.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, g.explicitFields) + return json.Marshal(explicitMarshaler) } func (g *Group) String() string { @@ -4781,11 +5814,20 @@ func (g GroupTypeEnum) Ptr() *GroupTypeEnum { return &g } +var ( + individualCommonModelScopeDeserializerRequestFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerRequestFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerRequestFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializerRequest struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4815,6 +5857,34 @@ func (i *IndividualCommonModelScopeDeserializerRequest) GetExtraProperties() map return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializerRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerRequestFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializerRequest) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializerRequest) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializerRequest var value unmarshaler @@ -4831,6 +5901,17 @@ func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byt return nil } +func (i *IndividualCommonModelScopeDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializerRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -4883,10 +5964,18 @@ func (l LastSyncResultEnum) Ptr() *LastSyncResultEnum { return &l } +var ( + linkedAccountStatusFieldLinkedAccountStatus = big.NewInt(1 << 0) + linkedAccountStatusFieldCanMakeRequest = big.NewInt(1 << 1) +) + type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status" url:"linked_account_status"` CanMakeRequest bool `json:"can_make_request" url:"can_make_request"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4909,6 +5998,27 @@ func (l *LinkedAccountStatus) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkedAccountStatus) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkedAccountStatus sets the LinkedAccountStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetLinkedAccountStatus(linkedAccountStatus string) { + l.LinkedAccountStatus = linkedAccountStatus + l.require(linkedAccountStatusFieldLinkedAccountStatus) +} + +// SetCanMakeRequest sets the CanMakeRequest field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetCanMakeRequest(canMakeRequest bool) { + l.CanMakeRequest = canMakeRequest + l.require(linkedAccountStatusFieldCanMakeRequest) +} + func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { type unmarshaler LinkedAccountStatus var value unmarshaler @@ -4925,6 +6035,17 @@ func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkedAccountStatus) MarshalJSON() ([]byte, error) { + type embed LinkedAccountStatus + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkedAccountStatus) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { @@ -4943,6 +6064,25 @@ func (l *LinkedAccountStatus) String() string { // // ### Usage Example // Fetch from the `LIST Locations` endpoint and filter by `ID` to show all office locations. +var ( + locationFieldId = big.NewInt(1 << 0) + locationFieldRemoteId = big.NewInt(1 << 1) + locationFieldCreatedAt = big.NewInt(1 << 2) + locationFieldModifiedAt = big.NewInt(1 << 3) + locationFieldName = big.NewInt(1 << 4) + locationFieldPhoneNumber = big.NewInt(1 << 5) + locationFieldStreet1 = big.NewInt(1 << 6) + locationFieldStreet2 = big.NewInt(1 << 7) + locationFieldCity = big.NewInt(1 << 8) + locationFieldState = big.NewInt(1 << 9) + locationFieldZipCode = big.NewInt(1 << 10) + locationFieldCountry = big.NewInt(1 << 11) + locationFieldLocationType = big.NewInt(1 << 12) + locationFieldRemoteWasDeleted = big.NewInt(1 << 13) + locationFieldFieldMappings = big.NewInt(1 << 14) + locationFieldRemoteData = big.NewInt(1 << 15) +) + type Location struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -5227,6 +6367,9 @@ type Location struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5347,6 +6490,125 @@ func (l *Location) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *Location) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetId(id *string) { + l.Id = id + l.require(locationFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetRemoteId(remoteId *string) { + l.RemoteId = remoteId + l.require(locationFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetCreatedAt(createdAt *time.Time) { + l.CreatedAt = createdAt + l.require(locationFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetModifiedAt(modifiedAt *time.Time) { + l.ModifiedAt = modifiedAt + l.require(locationFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetName(name *string) { + l.Name = name + l.require(locationFieldName) +} + +// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetPhoneNumber(phoneNumber *string) { + l.PhoneNumber = phoneNumber + l.require(locationFieldPhoneNumber) +} + +// SetStreet1 sets the Street1 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetStreet1(street1 *string) { + l.Street1 = street1 + l.require(locationFieldStreet1) +} + +// SetStreet2 sets the Street2 field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetStreet2(street2 *string) { + l.Street2 = street2 + l.require(locationFieldStreet2) +} + +// SetCity sets the City field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetCity(city *string) { + l.City = city + l.require(locationFieldCity) +} + +// SetState sets the State field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetState(state *string) { + l.State = state + l.require(locationFieldState) +} + +// SetZipCode sets the ZipCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetZipCode(zipCode *string) { + l.ZipCode = zipCode + l.require(locationFieldZipCode) +} + +// SetCountry sets the Country field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetCountry(country *LocationCountry) { + l.Country = country + l.require(locationFieldCountry) +} + +// SetLocationType sets the LocationType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetLocationType(locationType *LocationLocationType) { + l.LocationType = locationType + l.require(locationFieldLocationType) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetRemoteWasDeleted(remoteWasDeleted *bool) { + l.RemoteWasDeleted = remoteWasDeleted + l.require(locationFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetFieldMappings(fieldMappings map[string]interface{}) { + l.FieldMappings = fieldMappings + l.require(locationFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *Location) SetRemoteData(remoteData []*RemoteData) { + l.RemoteData = remoteData + l.require(locationFieldRemoteData) +} + func (l *Location) UnmarshalJSON(data []byte) error { type embed Location var unmarshaler = struct { @@ -5382,7 +6644,8 @@ func (l *Location) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(l.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(l.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) } func (l *Location) String() string { @@ -5836,6 +7099,14 @@ func (m MaritalStatusEnum) Ptr() *MaritalStatusEnum { return &m } +var ( + metaResponseFieldRequestSchema = big.NewInt(1 << 0) + metaResponseFieldRemoteFieldClasses = big.NewInt(1 << 1) + metaResponseFieldStatus = big.NewInt(1 << 2) + metaResponseFieldHasConditionalParams = big.NewInt(1 << 3) + metaResponseFieldHasRequiredLinkedAccountParams = big.NewInt(1 << 4) +) + type MetaResponse struct { RequestSchema map[string]interface{} `json:"request_schema" url:"request_schema"` RemoteFieldClasses map[string]interface{} `json:"remote_field_classes,omitempty" url:"remote_field_classes,omitempty"` @@ -5843,6 +7114,9 @@ type MetaResponse struct { HasConditionalParams bool `json:"has_conditional_params" url:"has_conditional_params"` HasRequiredLinkedAccountParams bool `json:"has_required_linked_account_params" url:"has_required_linked_account_params"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5886,6 +7160,48 @@ func (m *MetaResponse) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *MetaResponse) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetRequestSchema sets the RequestSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRequestSchema(requestSchema map[string]interface{}) { + m.RequestSchema = requestSchema + m.require(metaResponseFieldRequestSchema) +} + +// SetRemoteFieldClasses sets the RemoteFieldClasses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRemoteFieldClasses(remoteFieldClasses map[string]interface{}) { + m.RemoteFieldClasses = remoteFieldClasses + m.require(metaResponseFieldRemoteFieldClasses) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetStatus(status *LinkedAccountStatus) { + m.Status = status + m.require(metaResponseFieldStatus) +} + +// SetHasConditionalParams sets the HasConditionalParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasConditionalParams(hasConditionalParams bool) { + m.HasConditionalParams = hasConditionalParams + m.require(metaResponseFieldHasConditionalParams) +} + +// SetHasRequiredLinkedAccountParams sets the HasRequiredLinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasRequiredLinkedAccountParams(hasRequiredLinkedAccountParams bool) { + m.HasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams + m.require(metaResponseFieldHasRequiredLinkedAccountParams) +} + func (m *MetaResponse) UnmarshalJSON(data []byte) error { type unmarshaler MetaResponse var value unmarshaler @@ -5902,6 +7218,17 @@ func (m *MetaResponse) UnmarshalJSON(data []byte) error { return nil } +func (m *MetaResponse) MarshalJSON() ([]byte, error) { + type embed MetaResponse + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MetaResponse) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -5964,12 +7291,22 @@ func (m MethodEnum) Ptr() *MethodEnum { // // ### Usage Example // View what operations are supported for the `Candidate` endpoint. +var ( + modelOperationFieldModelName = big.NewInt(1 << 0) + modelOperationFieldAvailableOperations = big.NewInt(1 << 1) + modelOperationFieldRequiredPostParameters = big.NewInt(1 << 2) + modelOperationFieldSupportedFields = big.NewInt(1 << 3) +) + type ModelOperation struct { ModelName string `json:"model_name" url:"model_name"` AvailableOperations []string `json:"available_operations" url:"available_operations"` RequiredPostParameters []string `json:"required_post_parameters" url:"required_post_parameters"` SupportedFields []string `json:"supported_fields" url:"supported_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6006,6 +7343,41 @@ func (m *ModelOperation) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *ModelOperation) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetModelName(modelName string) { + m.ModelName = modelName + m.require(modelOperationFieldModelName) +} + +// SetAvailableOperations sets the AvailableOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetAvailableOperations(availableOperations []string) { + m.AvailableOperations = availableOperations + m.require(modelOperationFieldAvailableOperations) +} + +// SetRequiredPostParameters sets the RequiredPostParameters field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetRequiredPostParameters(requiredPostParameters []string) { + m.RequiredPostParameters = requiredPostParameters + m.require(modelOperationFieldRequiredPostParameters) +} + +// SetSupportedFields sets the SupportedFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetSupportedFields(supportedFields []string) { + m.SupportedFields = supportedFields + m.require(modelOperationFieldSupportedFields) +} + func (m *ModelOperation) UnmarshalJSON(data []byte) error { type unmarshaler ModelOperation var value unmarshaler @@ -6022,6 +7394,17 @@ func (m *ModelOperation) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelOperation) MarshalJSON() ([]byte, error) { + type embed ModelOperation + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelOperation) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -6034,9 +7417,16 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +var ( + modelPermissionDeserializerRequestFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializerRequest struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6052,6 +7442,20 @@ func (m *ModelPermissionDeserializerRequest) GetExtraProperties() map[string]int return m.extraProperties } +func (m *ModelPermissionDeserializerRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializerRequest) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerRequestFieldIsEnabled) +} + func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializerRequest var value unmarshaler @@ -6068,6 +7472,17 @@ func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializerRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -6086,6 +7501,14 @@ func (m *ModelPermissionDeserializerRequest) String() string { // // ### Usage Example // Create a `MultipartFormField` to define a multipart form entry. +var ( + multipartFormFieldRequestFieldName = big.NewInt(1 << 0) + multipartFormFieldRequestFieldData = big.NewInt(1 << 1) + multipartFormFieldRequestFieldEncoding = big.NewInt(1 << 2) + multipartFormFieldRequestFieldFileName = big.NewInt(1 << 3) + multipartFormFieldRequestFieldContentType = big.NewInt(1 << 4) +) + type MultipartFormFieldRequest struct { // The name of the form field Name string `json:"name" url:"name"` @@ -6102,6 +7525,9 @@ type MultipartFormFieldRequest struct { // The MIME type of the file, if the field is for a file. ContentType *string `json:"content_type,omitempty" url:"content_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -6145,6 +7571,48 @@ func (m *MultipartFormFieldRequest) GetExtraProperties() map[string]interface{} return m.extraProperties } +func (m *MultipartFormFieldRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetName(name string) { + m.Name = name + m.require(multipartFormFieldRequestFieldName) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetData(data string) { + m.Data = data + m.require(multipartFormFieldRequestFieldData) +} + +// SetEncoding sets the Encoding field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetEncoding(encoding *EncodingEnum) { + m.Encoding = encoding + m.require(multipartFormFieldRequestFieldEncoding) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetFileName(fileName *string) { + m.FileName = fileName + m.require(multipartFormFieldRequestFieldFileName) +} + +// SetContentType sets the ContentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetContentType(contentType *string) { + m.ContentType = contentType + m.require(multipartFormFieldRequestFieldContentType) +} + func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { type unmarshaler MultipartFormFieldRequest var value unmarshaler @@ -6161,6 +7629,17 @@ func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *MultipartFormFieldRequest) MarshalJSON() ([]byte, error) { + type embed MultipartFormFieldRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MultipartFormFieldRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -7471,6 +8950,17 @@ func (p PayFrequencyEnum) Ptr() *PayFrequencyEnum { // // ### Usage Example // Fetch from the `LIST PayGroup` endpoint and filter by `ID` to show all pay group information. +var ( + payGroupFieldId = big.NewInt(1 << 0) + payGroupFieldRemoteId = big.NewInt(1 << 1) + payGroupFieldCreatedAt = big.NewInt(1 << 2) + payGroupFieldModifiedAt = big.NewInt(1 << 3) + payGroupFieldPayGroupName = big.NewInt(1 << 4) + payGroupFieldRemoteWasDeleted = big.NewInt(1 << 5) + payGroupFieldFieldMappings = big.NewInt(1 << 6) + payGroupFieldRemoteData = big.NewInt(1 << 7) +) + type PayGroup struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -7486,6 +8976,9 @@ type PayGroup struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7550,6 +9043,69 @@ func (p *PayGroup) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PayGroup) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroup) SetId(id *string) { + p.Id = id + p.require(payGroupFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroup) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(payGroupFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroup) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(payGroupFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroup) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(payGroupFieldModifiedAt) +} + +// SetPayGroupName sets the PayGroupName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroup) SetPayGroupName(payGroupName *string) { + p.PayGroupName = payGroupName + p.require(payGroupFieldPayGroupName) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroup) SetRemoteWasDeleted(remoteWasDeleted *bool) { + p.RemoteWasDeleted = remoteWasDeleted + p.require(payGroupFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroup) SetFieldMappings(fieldMappings map[string]interface{}) { + p.FieldMappings = fieldMappings + p.require(payGroupFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayGroup) SetRemoteData(remoteData []*RemoteData) { + p.RemoteData = remoteData + p.require(payGroupFieldRemoteData) +} + func (p *PayGroup) UnmarshalJSON(data []byte) error { type embed PayGroup var unmarshaler = struct { @@ -7585,7 +9141,8 @@ func (p *PayGroup) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(p.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PayGroup) String() string { @@ -7658,6 +9215,21 @@ func (p PayPeriodEnum) Ptr() *PayPeriodEnum { // // ### Usage Example // Fetch from the `LIST PayrollRuns` endpoint and filter by `ID` to show all payroll runs. +var ( + payrollRunFieldId = big.NewInt(1 << 0) + payrollRunFieldRemoteId = big.NewInt(1 << 1) + payrollRunFieldCreatedAt = big.NewInt(1 << 2) + payrollRunFieldModifiedAt = big.NewInt(1 << 3) + payrollRunFieldRunState = big.NewInt(1 << 4) + payrollRunFieldRunType = big.NewInt(1 << 5) + payrollRunFieldStartDate = big.NewInt(1 << 6) + payrollRunFieldEndDate = big.NewInt(1 << 7) + payrollRunFieldCheckDate = big.NewInt(1 << 8) + payrollRunFieldRemoteWasDeleted = big.NewInt(1 << 9) + payrollRunFieldFieldMappings = big.NewInt(1 << 10) + payrollRunFieldRemoteData = big.NewInt(1 << 11) +) + type PayrollRun struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -7693,6 +9265,9 @@ type PayrollRun struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -7785,6 +9360,97 @@ func (p *PayrollRun) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PayrollRun) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetId(id *string) { + p.Id = id + p.require(payrollRunFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(payrollRunFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(payrollRunFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(payrollRunFieldModifiedAt) +} + +// SetRunState sets the RunState field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetRunState(runState *PayrollRunRunState) { + p.RunState = runState + p.require(payrollRunFieldRunState) +} + +// SetRunType sets the RunType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetRunType(runType *PayrollRunRunType) { + p.RunType = runType + p.require(payrollRunFieldRunType) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetStartDate(startDate *time.Time) { + p.StartDate = startDate + p.require(payrollRunFieldStartDate) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetEndDate(endDate *time.Time) { + p.EndDate = endDate + p.require(payrollRunFieldEndDate) +} + +// SetCheckDate sets the CheckDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetCheckDate(checkDate *time.Time) { + p.CheckDate = checkDate + p.require(payrollRunFieldCheckDate) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetRemoteWasDeleted(remoteWasDeleted *bool) { + p.RemoteWasDeleted = remoteWasDeleted + p.require(payrollRunFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetFieldMappings(fieldMappings map[string]interface{}) { + p.FieldMappings = fieldMappings + p.require(payrollRunFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PayrollRun) SetRemoteData(remoteData []*RemoteData) { + p.RemoteData = remoteData + p.require(payrollRunFieldRemoteData) +} + func (p *PayrollRun) UnmarshalJSON(data []byte) error { type embed PayrollRun var unmarshaler = struct { @@ -7832,7 +9498,8 @@ func (p *PayrollRun) MarshalJSON() ([]byte, error) { EndDate: internal.NewOptionalDateTime(p.EndDate), CheckDate: internal.NewOptionalDateTime(p.CheckDate), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PayrollRun) String() string { @@ -7991,11 +9658,19 @@ func (p *PayrollRunRunType) Accept(visitor PayrollRunRunTypeVisitor) error { // // ### Usage Example // TODO +var ( + remoteDataFieldPath = big.NewInt(1 << 0) + remoteDataFieldData = big.NewInt(1 << 1) +) + type RemoteData struct { // The third-party API path that is being called. Path string `json:"path" url:"path"` Data interface{} `json:"data,omitempty" url:"data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8018,6 +9693,27 @@ func (r *RemoteData) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteData) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetPath(path string) { + r.Path = path + r.require(remoteDataFieldPath) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetData(data interface{}) { + r.Data = data + r.require(remoteDataFieldData) +} + func (r *RemoteData) UnmarshalJSON(data []byte) error { type unmarshaler RemoteData var value unmarshaler @@ -8034,6 +9730,17 @@ func (r *RemoteData) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteData) MarshalJSON() ([]byte, error) { + type embed RemoteData + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteData) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -8052,10 +9759,18 @@ func (r *RemoteData) String() string { // // ### Usage Example // Post a `GenerateRemoteKey` to receive a new `RemoteKey`. +var ( + remoteKeyFieldName = big.NewInt(1 << 0) + remoteKeyFieldKey = big.NewInt(1 << 1) +) + type RemoteKey struct { Name string `json:"name" url:"name"` Key string `json:"key" url:"key"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8078,6 +9793,27 @@ func (r *RemoteKey) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteKey) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetName(name string) { + r.Name = name + r.require(remoteKeyFieldName) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetKey(key string) { + r.Key = key + r.require(remoteKeyFieldKey) +} + func (r *RemoteKey) UnmarshalJSON(data []byte) error { type unmarshaler RemoteKey var value unmarshaler @@ -8094,6 +9830,17 @@ func (r *RemoteKey) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteKey) MarshalJSON() ([]byte, error) { + type embed RemoteKey + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteKey) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -8112,6 +9859,16 @@ func (r *RemoteKey) String() string { // // ### Usage Example // View the `RemoteResponse` returned from your `DataPassthrough`. +var ( + remoteResponseFieldMethod = big.NewInt(1 << 0) + remoteResponseFieldPath = big.NewInt(1 << 1) + remoteResponseFieldStatus = big.NewInt(1 << 2) + remoteResponseFieldResponse = big.NewInt(1 << 3) + remoteResponseFieldResponseHeaders = big.NewInt(1 << 4) + remoteResponseFieldResponseType = big.NewInt(1 << 5) + remoteResponseFieldHeaders = big.NewInt(1 << 6) +) + type RemoteResponse struct { Method string `json:"method" url:"method"` Path string `json:"path" url:"path"` @@ -8121,6 +9878,9 @@ type RemoteResponse struct { ResponseType *RemoteResponseResponseType `json:"response_type,omitempty" url:"response_type,omitempty"` Headers map[string]interface{} `json:"headers,omitempty" url:"headers,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8178,6 +9938,62 @@ func (r *RemoteResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetMethod(method string) { + r.Method = method + r.require(remoteResponseFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetPath(path string) { + r.Path = path + r.require(remoteResponseFieldPath) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetStatus(status int) { + r.Status = status + r.require(remoteResponseFieldStatus) +} + +// SetResponse sets the Response field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponse(response interface{}) { + r.Response = response + r.require(remoteResponseFieldResponse) +} + +// SetResponseHeaders sets the ResponseHeaders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseHeaders(responseHeaders map[string]interface{}) { + r.ResponseHeaders = responseHeaders + r.require(remoteResponseFieldResponseHeaders) +} + +// SetResponseType sets the ResponseType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseType(responseType *RemoteResponseResponseType) { + r.ResponseType = responseType + r.require(remoteResponseFieldResponseType) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetHeaders(headers map[string]interface{}) { + r.Headers = headers + r.require(remoteResponseFieldHeaders) +} + func (r *RemoteResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteResponse var value unmarshaler @@ -8194,6 +10010,17 @@ func (r *RemoteResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteResponse) MarshalJSON() ([]byte, error) { + type embed RemoteResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -8462,6 +10289,18 @@ func (s StatusFd5Enum) Ptr() *StatusFd5Enum { // // ### Usage Example // View the `SyncStatus` for an account to see how recently its models were synced. +var ( + syncStatusFieldModelName = big.NewInt(1 << 0) + syncStatusFieldModelId = big.NewInt(1 << 1) + syncStatusFieldLastSyncStart = big.NewInt(1 << 2) + syncStatusFieldNextSyncStart = big.NewInt(1 << 3) + syncStatusFieldLastSyncResult = big.NewInt(1 << 4) + syncStatusFieldLastSyncFinished = big.NewInt(1 << 5) + syncStatusFieldStatus = big.NewInt(1 << 6) + syncStatusFieldIsInitialSync = big.NewInt(1 << 7) + syncStatusFieldSelectiveSyncConfigurationsUsage = big.NewInt(1 << 8) +) + type SyncStatus struct { ModelName string `json:"model_name" url:"model_name"` ModelId string `json:"model_id" url:"model_id"` @@ -8473,6 +10312,9 @@ type SyncStatus struct { IsInitialSync bool `json:"is_initial_sync" url:"is_initial_sync"` SelectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum `json:"selective_sync_configurations_usage,omitempty" url:"selective_sync_configurations_usage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8544,6 +10386,76 @@ func (s *SyncStatus) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *SyncStatus) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelName(modelName string) { + s.ModelName = modelName + s.require(syncStatusFieldModelName) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelId(modelId string) { + s.ModelId = modelId + s.require(syncStatusFieldModelId) +} + +// SetLastSyncStart sets the LastSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncStart(lastSyncStart *time.Time) { + s.LastSyncStart = lastSyncStart + s.require(syncStatusFieldLastSyncStart) +} + +// SetNextSyncStart sets the NextSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetNextSyncStart(nextSyncStart *time.Time) { + s.NextSyncStart = nextSyncStart + s.require(syncStatusFieldNextSyncStart) +} + +// SetLastSyncResult sets the LastSyncResult field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncResult(lastSyncResult *SyncStatusLastSyncResult) { + s.LastSyncResult = lastSyncResult + s.require(syncStatusFieldLastSyncResult) +} + +// SetLastSyncFinished sets the LastSyncFinished field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncFinished(lastSyncFinished *time.Time) { + s.LastSyncFinished = lastSyncFinished + s.require(syncStatusFieldLastSyncFinished) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetStatus(status *SyncStatusStatus) { + s.Status = status + s.require(syncStatusFieldStatus) +} + +// SetIsInitialSync sets the IsInitialSync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetIsInitialSync(isInitialSync bool) { + s.IsInitialSync = isInitialSync + s.require(syncStatusFieldIsInitialSync) +} + +// SetSelectiveSyncConfigurationsUsage sets the SelectiveSyncConfigurationsUsage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetSelectiveSyncConfigurationsUsage(selectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum) { + s.SelectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage + s.require(syncStatusFieldSelectiveSyncConfigurationsUsage) +} + func (s *SyncStatus) UnmarshalJSON(data []byte) error { type embed SyncStatus var unmarshaler = struct { @@ -8583,7 +10495,8 @@ func (s *SyncStatus) MarshalJSON() ([]byte, error) { NextSyncStart: internal.NewOptionalDateTime(s.NextSyncStart), LastSyncFinished: internal.NewOptionalDateTime(s.LastSyncFinished), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *SyncStatus) String() string { @@ -8728,6 +10641,18 @@ func (s *SyncStatusStatus) Accept(visitor SyncStatusStatusVisitor) error { // // ### 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. +var ( + teamFieldId = big.NewInt(1 << 0) + teamFieldRemoteId = big.NewInt(1 << 1) + teamFieldCreatedAt = big.NewInt(1 << 2) + teamFieldModifiedAt = big.NewInt(1 << 3) + teamFieldName = big.NewInt(1 << 4) + teamFieldParentTeam = big.NewInt(1 << 5) + teamFieldRemoteWasDeleted = big.NewInt(1 << 6) + teamFieldFieldMappings = big.NewInt(1 << 7) + teamFieldRemoteData = big.NewInt(1 << 8) +) + type Team struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -8745,6 +10670,9 @@ type Team struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8816,6 +10744,76 @@ func (t *Team) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *Team) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetId(id *string) { + t.Id = id + t.require(teamFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(teamFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(teamFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(teamFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetName(name *string) { + t.Name = name + t.require(teamFieldName) +} + +// SetParentTeam sets the ParentTeam field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetParentTeam(parentTeam *TeamParentTeam) { + t.ParentTeam = parentTeam + t.require(teamFieldParentTeam) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(teamFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(teamFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(teamFieldRemoteData) +} + func (t *Team) UnmarshalJSON(data []byte) error { type embed Team var unmarshaler = struct { @@ -8851,7 +10849,8 @@ func (t *Team) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *Team) String() string { @@ -8929,9 +10928,16 @@ func (t *TeamParentTeam) Accept(visitor TeamParentTeamVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", t) } +var ( + validationProblemSourceFieldPointer = big.NewInt(1 << 0) +) + type ValidationProblemSource struct { Pointer string `json:"pointer" url:"pointer"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -8947,6 +10953,20 @@ func (v *ValidationProblemSource) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *ValidationProblemSource) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetPointer sets the Pointer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *ValidationProblemSource) SetPointer(pointer string) { + v.Pointer = pointer + v.require(validationProblemSourceFieldPointer) +} + func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { type unmarshaler ValidationProblemSource var value unmarshaler @@ -8963,6 +10983,17 @@ func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { return nil } +func (v *ValidationProblemSource) MarshalJSON() ([]byte, error) { + type embed ValidationProblemSource + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (v *ValidationProblemSource) String() string { if len(v.rawJSON) > 0 { if value, err := internal.StringifyJSON(v.rawJSON); err == nil { @@ -8975,12 +11006,22 @@ func (v *ValidationProblemSource) String() string { return fmt.Sprintf("%#v", v) } +var ( + warningValidationProblemFieldSource = big.NewInt(1 << 0) + warningValidationProblemFieldTitle = big.NewInt(1 << 1) + warningValidationProblemFieldDetail = big.NewInt(1 << 2) + warningValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type WarningValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -9017,6 +11058,41 @@ func (w *WarningValidationProblem) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WarningValidationProblem) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetSource(source *ValidationProblemSource) { + w.Source = source + w.require(warningValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetTitle(title string) { + w.Title = title + w.require(warningValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetDetail(detail string) { + w.Detail = detail + w.require(warningValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetProblemType(problemType string) { + w.ProblemType = problemType + w.require(warningValidationProblemFieldProblemType) +} + func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler WarningValidationProblem var value unmarshaler @@ -9033,6 +11109,17 @@ func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (w *WarningValidationProblem) MarshalJSON() ([]byte, error) { + type embed WarningValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WarningValidationProblem) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/hris/webhook_receivers.go b/hris/webhook_receivers.go index 357d0d3..f771690 100644 --- a/hris/webhook_receivers.go +++ b/hris/webhook_receivers.go @@ -6,19 +6,66 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + webhookReceiverRequestFieldEvent = big.NewInt(1 << 0) + webhookReceiverRequestFieldIsActive = big.NewInt(1 << 1) + webhookReceiverRequestFieldKey = big.NewInt(1 << 2) ) type WebhookReceiverRequest struct { Event string `json:"event" url:"-"` IsActive bool `json:"is_active" url:"-"` Key *string `json:"key,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (w *WebhookReceiverRequest) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverRequestFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverRequestFieldIsActive) } +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverRequestFieldKey) +} + +var ( + webhookReceiverFieldEvent = big.NewInt(1 << 0) + webhookReceiverFieldIsActive = big.NewInt(1 << 1) + webhookReceiverFieldKey = big.NewInt(1 << 2) +) + type WebhookReceiver struct { Event string `json:"event" url:"event"` IsActive bool `json:"is_active" url:"is_active"` Key *string `json:"key,omitempty" url:"key,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +95,34 @@ func (w *WebhookReceiver) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WebhookReceiver) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverFieldIsActive) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverFieldKey) +} + func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { type unmarshaler WebhookReceiver var value unmarshaler @@ -64,6 +139,17 @@ func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { return nil } +func (w *WebhookReceiver) MarshalJSON() ([]byte, error) { + type embed WebhookReceiver + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WebhookReceiver) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/hris/webhookreceivers/client.go b/hris/webhookreceivers/client.go index 848bc83..8f04637 100644 --- a/hris/webhookreceivers/client.go +++ b/hris/webhookreceivers/client.go @@ -8,26 +8,27 @@ import ( hris "github.com/merge-api/merge-go-client/v2/hris" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) List( ctx context.Context, opts ...option.RequestOption, ) ([]*hris.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*hris.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.List( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Creates a `WebhookReceiver` object with the given values. @@ -73,35 +53,13 @@ func (c *Client) Create( request *hris.WebhookReceiverRequest, opts ...option.RequestOption, ) (*hris.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/hris/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *hris.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/hris/webhookreceivers/hris_webhook_receivers_test/hris_webhook_receivers_test.go b/hris/webhookreceivers/hris_webhook_receivers_test/hris_webhook_receivers_test.go new file mode 100644 index 0000000..88d7e3c --- /dev/null +++ b/hris/webhookreceivers/hris_webhook_receivers_test/hris_webhook_receivers_test.go @@ -0,0 +1,103 @@ +// Code generated by Fern. DO NOT EDIT. + +package hris_webhook_receivers_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + hris "github.com/merge-api/merge-go-client/v2/hris" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestHrisWebhookReceiversListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Hris.WebhookReceivers.List( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/hris/v1/webhook-receivers", nil, 1) +} + +func TestHrisWebhookReceiversCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &hris.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } + _, invocationErr := client.Hris.WebhookReceivers.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/hris/v1/webhook-receivers", nil, 1) +} diff --git a/hris/webhookreceivers/raw_client.go b/hris/webhookreceivers/raw_client.go new file mode 100644 index 0000000..ea96dfc --- /dev/null +++ b/hris/webhookreceivers/raw_client.go @@ -0,0 +1,112 @@ +// Code generated by Fern. DO NOT EDIT. + +package webhookreceivers + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + hris "github.com/merge-api/merge-go-client/v2/hris" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*hris.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*hris.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*hris.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *hris.WebhookReceiverRequest, + opts ...option.RequestOption, +) (*core.Response[*hris.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/hris/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *hris.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*hris.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/integration/cursor_pagination_test.go b/integration/cursor_pagination_test.go new file mode 100644 index 0000000..4629f6c --- /dev/null +++ b/integration/cursor_pagination_test.go @@ -0,0 +1,193 @@ +package integration + +import ( + "context" + "os" + "testing" + + "github.com/merge-api/merge-go-client/v2/client" + "github.com/merge-api/merge-go-client/v2/filestorage" + "github.com/merge-api/merge-go-client/v2/option" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestCursorPaginationWithFileStorageFolders(t *testing.T) { + apiKey := os.Getenv("MERGE_API_KEY_FILESTORAGE") + accountToken := os.Getenv("MERGE_ACCOUNT_TOKEN_FILESTORAGE") + + if apiKey == "" || accountToken == "" { + t.Fatal("MERGE_API_KEY_FILESTORAGE and MERGE_ACCOUNT_TOKEN_FILESTORAGE environment variables must be set") + } + + mergeClient := client.NewClient( + option.WithApiKey(apiKey), + option.WithAccountToken(&accountToken), + ) + + // Test basic folder listing with pagination + response, err := mergeClient.FileStorage.Folders.List( + context.TODO(), + &filestorage.FoldersListRequest{}, + ) + + require.NoError(t, err, "Folders list should not return an error") + assert.NotNil(t, response, "Folders list response should not be null") + + // Test that we can access results + assert.NotNil(t, response.Results, "Results list should not be null") + + // Test cursor pagination metadata access + if response.RawResponse.Next != nil { + assert.NotEmpty(t, *response.RawResponse.Next, "Cursor token should not be empty when present") + } + + // Test that we have some data structure even if empty + assert.NotNil(t, response.Results, "Results should always be accessible") +} + +func TestStatelessPaginationWithCursor(t *testing.T) { + apiKey := os.Getenv("MERGE_API_KEY_FILESTORAGE") + accountToken := os.Getenv("MERGE_ACCOUNT_TOKEN_FILESTORAGE") + + if apiKey == "" || accountToken == "" { + t.Fatal("MERGE_API_KEY_FILESTORAGE and MERGE_ACCOUNT_TOKEN_FILESTORAGE environment variables must be set") + } + + mergeClient := client.NewClient( + option.WithApiKey(apiKey), + option.WithAccountToken(&accountToken), + ) + + // Simulate frontend flow: get first page + firstPageResponse, err := mergeClient.FileStorage.Folders.List( + context.TODO(), + &filestorage.FoldersListRequest{}, + ) + + require.NoError(t, err, "First page request should not return an error") + require.NotNil(t, firstPageResponse, "First page response should not be null") + + // If there's a next cursor, test stateless pagination by actually using it + if firstPageResponse.RawResponse.Next != nil && *firstPageResponse.RawResponse.Next != "" { + nextCursor := *firstPageResponse.RawResponse.Next + assert.NotEmpty(t, nextCursor, "Next cursor should not be empty") + + // Frontend sends cursor back to backend for next page + secondPageRequest := &filestorage.FoldersListRequest{ + Cursor: &nextCursor, + } + + // Backend fetches second page using the cursor + secondPageResponse, err := mergeClient.FileStorage.Folders.List( + context.TODO(), + secondPageRequest, + ) + + require.NoError(t, err, "Second page request should not return an error") + assert.NotNil(t, secondPageResponse, "Second page should not be null") + + // Verify we got a valid response with results + assert.NotNil(t, secondPageResponse.Results, "Second page should have results") + } else { + t.Skip("No pagination available in current dataset - skipping cursor pagination test") + } +} + +func TestPaginationMetadataAccess(t *testing.T) { + apiKey := os.Getenv("MERGE_API_KEY_FILESTORAGE") + accountToken := os.Getenv("MERGE_ACCOUNT_TOKEN_FILESTORAGE") + + if apiKey == "" || accountToken == "" { + t.Fatal("MERGE_API_KEY_FILESTORAGE and MERGE_ACCOUNT_TOKEN_FILESTORAGE environment variables must be set") + } + + mergeClient := client.NewClient( + option.WithApiKey(apiKey), + option.WithAccountToken(&accountToken), + ) + + response, err := mergeClient.FileStorage.Folders.List( + context.TODO(), + &filestorage.FoldersListRequest{}, + ) + + require.NoError(t, err, "Request should not return an error") + require.NotNil(t, response, "Response should not be null") + + // Test access to pagination metadata + // These fields may be nil if no pagination is needed + if response.RawResponse.Next != nil { + assert.NotNil(t, response.RawResponse.Next, "Next cursor should not be null if present") + } + + // At minimum, results should be accessible + assert.NotNil(t, response.Results, "Results should always be accessible") +} + +func TestIterationOverPaginatedResults(t *testing.T) { + apiKey := os.Getenv("MERGE_API_KEY_FILESTORAGE") + accountToken := os.Getenv("MERGE_ACCOUNT_TOKEN_FILESTORAGE") + + if apiKey == "" || accountToken == "" { + t.Fatal("MERGE_API_KEY_FILESTORAGE and MERGE_ACCOUNT_TOKEN_FILESTORAGE environment variables must be set") + } + + mergeClient := client.NewClient( + option.WithApiKey(apiKey), + option.WithAccountToken(&accountToken), + ) + + response, err := mergeClient.FileStorage.Folders.List( + context.TODO(), + &filestorage.FoldersListRequest{}, + ) + + require.NoError(t, err, "Request should not return an error") + require.NotNil(t, response, "Response should not be null") + + // Test iteration over paginated results + itemCount := 0 + + for _, folder := range response.Results { + assert.NotNil(t, folder, "Each folder should not be null") + itemCount++ + + // Limit test to prevent excessive API calls + if itemCount >= 10 { + break + } + } + + assert.GreaterOrEqual(t, itemCount, 0, "Should have processed at least 0 items") +} + +func TestPaginationWithPageSize(t *testing.T) { + apiKey := os.Getenv("MERGE_API_KEY_FILESTORAGE") + accountToken := os.Getenv("MERGE_ACCOUNT_TOKEN_FILESTORAGE") + + if apiKey == "" || accountToken == "" { + t.Fatal("MERGE_API_KEY_FILESTORAGE and MERGE_ACCOUNT_TOKEN_FILESTORAGE environment variables must be set") + } + + mergeClient := client.NewClient( + option.WithApiKey(apiKey), + option.WithAccountToken(&accountToken), + ) + + pageSize := 5 + response, err := mergeClient.FileStorage.Folders.List( + context.TODO(), + &filestorage.FoldersListRequest{ + PageSize: &pageSize, + }, + ) + + require.NoError(t, err, "Request should not return an error") + require.NotNil(t, response, "Response should not be null") + + // Verify that page size constraint is respected (if there are enough items) + if len(response.Results) > 0 { + assert.LessOrEqual(t, len(response.Results), pageSize, "Result count should not exceed page size") + } +} \ No newline at end of file diff --git a/internal/caller.go b/internal/caller.go index eeab804..6ce6d81 100644 --- a/internal/caller.go +++ b/internal/caller.go @@ -64,67 +64,14 @@ type CallParams struct { ErrorDecoder ErrorDecoder } -// Call issues an API call according to the given call parameters. -func (c *Caller) Call(ctx context.Context, params *CallParams) error { - resp, err := c.CallRaw( - ctx, - &CallRawParams{ - URL: params.URL, - Method: params.Method, - MaxAttempts: params.MaxAttempts, - Headers: params.Headers, - BodyProperties: params.BodyProperties, - QueryParameters: params.QueryParameters, - Client: params.Client, - Request: params.Request, - ErrorDecoder: params.ErrorDecoder, - }, - ) - if err != nil { - return err - } - - // Close the response body after we're done. - defer resp.Body.Close() - - if params.Response != nil { - if writer, ok := params.Response.(io.Writer); ok { - _, err = io.Copy(writer, resp.Body) - } else { - err = json.NewDecoder(resp.Body).Decode(params.Response) - } - if err != nil { - if err == io.EOF { - if params.ResponseIsOptional { - // The response is optional, so we should ignore the - // io.EOF error - return nil - } - return fmt.Errorf("expected a %T response, but the server responded with nothing", params.Response) - } - return err - } - } - - return nil -} - -// CallRawParams represents the parameters used to issue an API call. -type CallRawParams struct { - URL string - Method string - MaxAttempts uint - Headers http.Header - BodyProperties map[string]interface{} - QueryParameters url.Values - Client core.HTTPClient - Request interface{} - ErrorDecoder ErrorDecoder +// CallResponse is a parsed HTTP response from an API call. +type CallResponse struct { + StatusCode int + Header http.Header } -// CallRaw issues an API call according to the given call parameters and returns the raw HTTP response. -// The caller is responsible for closing the response body. -func (c *Caller) CallRaw(ctx context.Context, params *CallRawParams) (*http.Response, error) { +// Call issues an API call according to the given call parameters. +func (c *Caller) Call(ctx context.Context, params *CallParams) (*CallResponse, error) { url := buildURL(params.URL, params.QueryParameters) req, err := newRequest( ctx, @@ -145,6 +92,7 @@ func (c *Caller) CallRaw(ctx context.Context, params *CallRawParams) (*http.Resp client := c.client if params.Client != nil { + // Use the HTTP client scoped to the request. client = params.Client } @@ -163,19 +111,46 @@ func (c *Caller) CallRaw(ctx context.Context, params *CallRawParams) (*http.Resp return nil, err } + // Close the response body after we're done. + defer resp.Body.Close() + // Check if the call was cancelled before we return the error // associated with the call and/or unmarshal the response data. if err := ctx.Err(); err != nil { - defer resp.Body.Close() return nil, err } if resp.StatusCode < 200 || resp.StatusCode >= 300 { - defer resp.Body.Close() return nil, decodeError(resp, params.ErrorDecoder) } - return resp, nil + // Mutate the response parameter in-place. + if params.Response != nil { + if writer, ok := params.Response.(io.Writer); ok { + _, err = io.Copy(writer, resp.Body) + } else { + err = json.NewDecoder(resp.Body).Decode(params.Response) + } + if err != nil { + if err == io.EOF { + if params.ResponseIsOptional { + // The response is optional, so we should ignore the + // io.EOF error + return &CallResponse{ + StatusCode: resp.StatusCode, + Header: resp.Header, + }, nil + } + return nil, fmt.Errorf("expected a %T response, but the server responded with nothing", params.Response) + } + return nil, err + } + } + + return &CallResponse{ + StatusCode: resp.StatusCode, + Header: resp.Header, + }, nil } // buildURL constructs the final URL by appending the given query parameters (if any). @@ -250,7 +225,7 @@ func decodeError(response *http.Response, errorDecoder ErrorDecoder) error { // This endpoint has custom errors, so we'll // attempt to unmarshal the error into a structured // type based on the status code. - return errorDecoder(response.StatusCode, response.Body) + return errorDecoder(response.StatusCode, response.Header, response.Body) } // This endpoint doesn't have any custom error // types, so we just read the body as-is, and @@ -263,9 +238,9 @@ func decodeError(response *http.Response, errorDecoder ErrorDecoder) error { // The error didn't have a response body, // so all we can do is return an error // with the status code. - return core.NewAPIError(response.StatusCode, nil) + return core.NewAPIError(response.StatusCode, response.Header, nil) } - return core.NewAPIError(response.StatusCode, errors.New(string(bytes))) + return core.NewAPIError(response.StatusCode, response.Header, errors.New(string(bytes))) } // isNil is used to determine if the request value is equal to nil (i.e. an interface diff --git a/internal/caller_test.go b/internal/caller_test.go index 51ab005..2b8ea09 100644 --- a/internal/caller_test.go +++ b/internal/caller_test.go @@ -18,8 +18,8 @@ import ( "github.com/stretchr/testify/require" ) -// TestCase represents a single test case. -type TestCase struct { +// InternalTestCase represents a single test case. +type InternalTestCase struct { description string // Server-side assertions. @@ -28,47 +28,47 @@ type TestCase struct { giveResponseIsOptional bool giveHeader http.Header giveErrorDecoder ErrorDecoder - giveRequest *Request + giveRequest *InternalTestRequest giveQueryParams url.Values giveBodyProperties map[string]interface{} // Client-side assertions. - wantResponse *Response + wantResponse *InternalTestResponse wantHeaders http.Header wantError error } -// Request a simple request body. -type Request struct { +// InternalTestRequest a simple request body. +type InternalTestRequest struct { Id string `json:"id"` } -// Response a simple response body. -type Response struct { +// InternalTestResponse a simple response body. +type InternalTestResponse struct { Id string `json:"id"` ExtraBodyProperties map[string]interface{} `json:"extraBodyProperties,omitempty"` QueryParameters url.Values `json:"queryParameters,omitempty"` } -// NotFoundError represents a 404. -type NotFoundError struct { +// InternalTestNotFoundError represents a 404. +type InternalTestNotFoundError struct { *core.APIError Message string `json:"message"` } func TestCall(t *testing.T) { - tests := []*TestCase{ + tests := []*InternalTestCase{ { description: "GET success", giveMethod: http.MethodGet, giveHeader: http.Header{ "X-API-Status": []string{"success"}, }, - giveRequest: &Request{ + giveRequest: &InternalTestRequest{ Id: "123", }, - wantResponse: &Response{ + wantResponse: &InternalTestResponse{ Id: "123", }, }, @@ -79,10 +79,10 @@ func TestCall(t *testing.T) { giveHeader: http.Header{ "X-API-Status": []string{"success"}, }, - giveRequest: &Request{ + giveRequest: &InternalTestRequest{ Id: "123", }, - wantResponse: &Response{ + wantResponse: &InternalTestResponse{ Id: "123", QueryParameters: url.Values{ "limit": []string{"1"}, @@ -95,13 +95,14 @@ func TestCall(t *testing.T) { giveHeader: http.Header{ "X-API-Status": []string{"fail"}, }, - giveRequest: &Request{ + giveRequest: &InternalTestRequest{ Id: strconv.Itoa(http.StatusNotFound), }, giveErrorDecoder: newTestErrorDecoder(t), - wantError: &NotFoundError{ + wantError: &InternalTestNotFoundError{ APIError: core.NewAPIError( http.StatusNotFound, + http.Header{}, errors.New(`{"message":"ID \"404\" not found"}`), ), }, @@ -115,6 +116,7 @@ func TestCall(t *testing.T) { giveRequest: nil, wantError: core.NewAPIError( http.StatusBadRequest, + http.Header{}, errors.New("invalid request"), ), }, @@ -124,7 +126,7 @@ func TestCall(t *testing.T) { giveHeader: http.Header{ "X-API-Status": []string{"success"}, }, - giveRequest: &Request{ + giveRequest: &InternalTestRequest{ Id: "123", }, giveResponseIsOptional: true, @@ -135,11 +137,12 @@ func TestCall(t *testing.T) { giveHeader: http.Header{ "X-API-Status": []string{"fail"}, }, - giveRequest: &Request{ + giveRequest: &InternalTestRequest{ Id: strconv.Itoa(http.StatusInternalServerError), }, wantError: core.NewAPIError( http.StatusInternalServerError, + http.Header{}, errors.New("failed to process request"), ), }, @@ -149,11 +152,11 @@ func TestCall(t *testing.T) { giveHeader: http.Header{ "X-API-Status": []string{"success"}, }, - giveRequest: new(Request), + giveRequest: new(InternalTestRequest), giveBodyProperties: map[string]interface{}{ "key": "value", }, - wantResponse: &Response{ + wantResponse: &InternalTestResponse{ ExtraBodyProperties: map[string]interface{}{ "key": "value", }, @@ -168,10 +171,10 @@ func TestCall(t *testing.T) { giveQueryParams: url.Values{ "extra": []string{"true"}, }, - giveRequest: &Request{ + giveRequest: &InternalTestRequest{ Id: "123", }, - wantResponse: &Response{ + wantResponse: &InternalTestResponse{ Id: "123", QueryParameters: url.Values{ "extra": []string{"true"}, @@ -185,13 +188,13 @@ func TestCall(t *testing.T) { giveHeader: http.Header{ "X-API-Status": []string{"success"}, }, - giveRequest: &Request{ + giveRequest: &InternalTestRequest{ Id: "123", }, giveQueryParams: url.Values{ "extra": []string{"true"}, }, - wantResponse: &Response{ + wantResponse: &InternalTestResponse{ Id: "123", QueryParameters: url.Values{ "limit": []string{"1"}, @@ -211,8 +214,8 @@ func TestCall(t *testing.T) { Client: client, }, ) - var response *Response - err := caller.Call( + var response *InternalTestResponse + _, err := caller.Call( context.Background(), &CallParams{ URL: server.URL + test.givePathSuffix, @@ -236,67 +239,6 @@ func TestCall(t *testing.T) { } } -func TestCallRaw(t *testing.T) { - tests := []*TestCase{ - { - description: "HEAD success", - giveMethod: http.MethodHead, - giveHeader: http.Header{ - "X-API-Status": []string{"success"}, - }, - wantHeaders: http.Header{ - "Content-Length": []string{"250"}, - "Date": []string{"1970-01-01"}, - }, - }, - } - for _, test := range tests { - t.Run(test.description, func(t *testing.T) { - server := httptest.NewServer( - http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, test.giveMethod, r.Method) - for header, value := range test.giveHeader { - assert.Equal(t, value, r.Header.Values(header)) - } - for header, values := range test.wantHeaders { - for _, value := range values { - w.Header().Add(header, value) - } - } - w.WriteHeader(http.StatusOK) - }, - ), - ) - defer server.Close() - - caller := NewCaller( - &CallerParams{ - Client: server.Client(), - }, - ) - response, err := caller.CallRaw( - context.Background(), - &CallRawParams{ - URL: server.URL + test.givePathSuffix, - Method: test.giveMethod, - Headers: test.giveHeader, - BodyProperties: test.giveBodyProperties, - QueryParameters: test.giveQueryParams, - Request: test.giveRequest, - ErrorDecoder: test.giveErrorDecoder, - }, - ) - if test.wantError != nil { - assert.EqualError(t, err, test.wantError.Error()) - return - } - require.NoError(t, err) - assert.Equal(t, test.wantHeaders, response.Header) - }) - } -} - func TestMergeHeaders(t *testing.T) { t.Run("both empty", func(t *testing.T) { merged := MergeHeaders(make(http.Header), make(http.Header)) @@ -361,7 +303,7 @@ func TestMergeHeaders(t *testing.T) { // newTestServer returns a new *httptest.Server configured with the // given test parameters. -func newTestServer(t *testing.T, tc *TestCase) *httptest.Server { +func newTestServer(t *testing.T, tc *InternalTestCase) *httptest.Server { return httptest.NewServer( http.HandlerFunc( func(w http.ResponseWriter, r *http.Request) { @@ -371,7 +313,7 @@ func newTestServer(t *testing.T, tc *TestCase) *httptest.Server { assert.Equal(t, value, r.Header.Values(header)) } - request := new(Request) + request := new(InternalTestRequest) bytes, err := io.ReadAll(r.Body) if tc.giveRequest == nil { @@ -386,7 +328,7 @@ func newTestServer(t *testing.T, tc *TestCase) *httptest.Server { switch request.Id { case strconv.Itoa(http.StatusNotFound): - notFoundError := &NotFoundError{ + notFoundError := &InternalTestNotFoundError{ APIError: &core.APIError{ StatusCode: http.StatusNotFound, }, @@ -416,7 +358,7 @@ func newTestServer(t *testing.T, tc *TestCase) *httptest.Server { require.NoError(t, json.Unmarshal(bytes, &extraBodyProperties)) delete(extraBodyProperties, "id") - response := &Response{ + response := &InternalTestResponse{ Id: request.Id, ExtraBodyProperties: extraBodyProperties, QueryParameters: r.URL.Query(), @@ -432,17 +374,17 @@ func newTestServer(t *testing.T, tc *TestCase) *httptest.Server { } // newTestErrorDecoder returns an error decoder suitable for tests. -func newTestErrorDecoder(t *testing.T) func(int, io.Reader) error { - return func(statusCode int, body io.Reader) error { +func newTestErrorDecoder(t *testing.T) func(int, http.Header, io.Reader) error { + return func(statusCode int, header http.Header, body io.Reader) error { raw, err := io.ReadAll(body) require.NoError(t, err) var ( - apiError = core.NewAPIError(statusCode, errors.New(string(raw))) + apiError = core.NewAPIError(statusCode, header, errors.New(string(raw))) decoder = json.NewDecoder(bytes.NewReader(raw)) ) if statusCode == http.StatusNotFound { - value := new(NotFoundError) + value := new(InternalTestNotFoundError) value.APIError = apiError require.NoError(t, decoder.Decode(value)) diff --git a/internal/error_decoder.go b/internal/error_decoder.go index 83ccb6a..d04ec0d 100644 --- a/internal/error_decoder.go +++ b/internal/error_decoder.go @@ -6,29 +6,48 @@ import ( "errors" "fmt" "io" + "net/http" "github.com/merge-api/merge-go-client/v2/core" ) -// ErrorDecoder decodes *http.Response errors and returns a -// typed API error (e.g. *core.APIError). -type ErrorDecoder func(statusCode int, body io.Reader) error - // ErrorCodes maps HTTP status codes to error constructors. type ErrorCodes map[int]func(*core.APIError) error +// ErrorDecoder decodes *http.Response errors and returns a +// typed API error (e.g. *core.APIError). +type ErrorDecoder func(statusCode int, header http.Header, body io.Reader) error + // NewErrorDecoder returns a new ErrorDecoder backed by the given error codes. -func NewErrorDecoder(errorCodes ErrorCodes) ErrorDecoder { - return func(statusCode int, body io.Reader) error { +// errorCodesOverrides is optional and will be merged with the default error codes, +// with overrides taking precedence. +func NewErrorDecoder(errorCodes ErrorCodes, errorCodesOverrides ...ErrorCodes) ErrorDecoder { + // Merge default error codes with overrides + mergedErrorCodes := make(ErrorCodes) + + // Start with default error codes + for statusCode, errorFunc := range errorCodes { + mergedErrorCodes[statusCode] = errorFunc + } + + // Apply overrides if provided + if len(errorCodesOverrides) > 0 && errorCodesOverrides[0] != nil { + for statusCode, errorFunc := range errorCodesOverrides[0] { + mergedErrorCodes[statusCode] = errorFunc + } + } + + return func(statusCode int, header http.Header, body io.Reader) error { raw, err := io.ReadAll(body) if err != nil { return fmt.Errorf("failed to read error from response body: %w", err) } apiError := core.NewAPIError( statusCode, + header, errors.New(string(raw)), ) - newErrorFunc, ok := errorCodes[statusCode] + newErrorFunc, ok := mergedErrorCodes[statusCode] if !ok { // This status code isn't recognized, so we return // the API error as-is. diff --git a/internal/error_decoder_test.go b/internal/error_decoder_test.go index 31840a5..77f966d 100644 --- a/internal/error_decoder_test.go +++ b/internal/error_decoder_test.go @@ -14,42 +14,46 @@ func TestErrorDecoder(t *testing.T) { decoder := NewErrorDecoder( ErrorCodes{ http.StatusNotFound: func(apiError *core.APIError) error { - return &NotFoundError{APIError: apiError} + return &InternalTestNotFoundError{APIError: apiError} }, }) tests := []struct { description string giveStatusCode int + giveHeader http.Header giveBody string wantError error }{ { description: "unrecognized status code", giveStatusCode: http.StatusInternalServerError, + giveHeader: http.Header{}, giveBody: "Internal Server Error", - wantError: core.NewAPIError(http.StatusInternalServerError, errors.New("Internal Server Error")), + wantError: core.NewAPIError(http.StatusInternalServerError, http.Header{}, errors.New("Internal Server Error")), }, { description: "not found with valid JSON", giveStatusCode: http.StatusNotFound, + giveHeader: http.Header{}, giveBody: `{"message": "Resource not found"}`, - wantError: &NotFoundError{ - APIError: core.NewAPIError(http.StatusNotFound, errors.New(`{"message": "Resource not found"}`)), + wantError: &InternalTestNotFoundError{ + APIError: core.NewAPIError(http.StatusNotFound, http.Header{}, errors.New(`{"message": "Resource not found"}`)), Message: "Resource not found", }, }, { description: "not found with invalid JSON", giveStatusCode: http.StatusNotFound, + giveHeader: http.Header{}, giveBody: `Resource not found`, - wantError: core.NewAPIError(http.StatusNotFound, errors.New("Resource not found")), + wantError: core.NewAPIError(http.StatusNotFound, http.Header{}, errors.New("Resource not found")), }, } for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { - assert.Equal(t, tt.wantError, decoder(tt.giveStatusCode, bytes.NewReader([]byte(tt.giveBody)))) + assert.Equal(t, tt.wantError, decoder(tt.giveStatusCode, tt.giveHeader, bytes.NewReader([]byte(tt.giveBody)))) }) } } diff --git a/internal/explicit_fields.go b/internal/explicit_fields.go new file mode 100644 index 0000000..4bdf34f --- /dev/null +++ b/internal/explicit_fields.go @@ -0,0 +1,116 @@ +package internal + +import ( + "math/big" + "reflect" + "strings" +) + +// HandleExplicitFields processes a struct to remove `omitempty` from +// fields that have been explicitly set (as indicated by their corresponding bit in explicitFields). +// Note that `marshaler` should be an embedded struct to avoid infinite recursion. +// Returns an interface{} that can be passed to json.Marshal. +func HandleExplicitFields(marshaler interface{}, explicitFields *big.Int) interface{} { + val := reflect.ValueOf(marshaler) + typ := reflect.TypeOf(marshaler) + + // Handle pointer types + if val.Kind() == reflect.Ptr { + if val.IsNil() { + return nil + } + val = val.Elem() + typ = typ.Elem() + } + + // Only handle struct types + if val.Kind() != reflect.Struct { + return marshaler + } + + // Handle embedded struct pattern + var sourceVal reflect.Value + var sourceType reflect.Type + + // Check if this is an embedded struct pattern + if typ.NumField() == 1 && typ.Field(0).Anonymous { + // This is likely an embedded struct, get the embedded value + embeddedField := val.Field(0) + sourceVal = embeddedField + sourceType = embeddedField.Type() + } else { + // Regular struct + sourceVal = val + sourceType = typ + } + + // If no explicit fields set, use standard marshaling + if explicitFields == nil || explicitFields.Sign() == 0 { + return marshaler + } + + // Create a new struct type with modified tags + fields := make([]reflect.StructField, 0, sourceType.NumField()) + + for i := 0; i < sourceType.NumField(); i++ { + field := sourceType.Field(i) + + // Skip unexported fields and the explicitFields field itself + if !field.IsExported() || field.Name == "explicitFields" { + continue + } + + // Check if this field has been explicitly set + fieldBit := big.NewInt(1) + fieldBit.Lsh(fieldBit, uint(i)) + if big.NewInt(0).And(explicitFields, fieldBit).Sign() != 0 { + // Remove omitempty from the json tag + tag := field.Tag.Get("json") + if tag != "" && tag != "-" { + // Parse the json tag, remove omitempty from options + parts := strings.Split(tag, ",") + if len(parts) > 1 { + var newParts []string + newParts = append(newParts, parts[0]) // Keep the field name + for _, part := range parts[1:] { + if strings.TrimSpace(part) != "omitempty" { + newParts = append(newParts, part) + } + } + tag = strings.Join(newParts, ",") + } + + // Reconstruct the struct tag + newTag := `json:"` + tag + `"` + if urlTag := field.Tag.Get("url"); urlTag != "" { + newTag += ` url:"` + urlTag + `"` + } + + field.Tag = reflect.StructTag(newTag) + } + } + + fields = append(fields, field) + } + + // Create new struct type with modified tags + newType := reflect.StructOf(fields) + newVal := reflect.New(newType).Elem() + + // Copy field values from original struct to new struct + fieldIndex := 0 + for i := 0; i < sourceType.NumField(); i++ { + originalField := sourceType.Field(i) + + // Skip unexported fields and the explicitFields field itself + if !originalField.IsExported() || originalField.Name == "explicitFields" { + continue + } + + originalValue := sourceVal.Field(i) + newVal.Field(fieldIndex).Set(originalValue) + fieldIndex++ + } + + return newVal.Interface() +} diff --git a/internal/explicit_fields_test.go b/internal/explicit_fields_test.go new file mode 100644 index 0000000..9fccda7 --- /dev/null +++ b/internal/explicit_fields_test.go @@ -0,0 +1,496 @@ +package internal + +import ( + "encoding/json" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +type testExplicitFieldsStruct struct { + Name *string `json:"name,omitempty"` + Code *string `json:"code,omitempty"` + Count *int `json:"count,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Tags []string `json:"tags,omitempty"` + unexported string `json:"-"` + explicitFields *big.Int `json:"-"` +} + +var ( + testFieldName = big.NewInt(1 << 0) + testFieldCode = big.NewInt(1 << 1) + testFieldCount = big.NewInt(1 << 2) + testFieldEnabled = big.NewInt(1 << 3) + testFieldTags = big.NewInt(1 << 4) +) + +func (t *testExplicitFieldsStruct) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +func (t *testExplicitFieldsStruct) SetName(name *string) { + t.Name = name + t.require(testFieldName) +} + +func (t *testExplicitFieldsStruct) SetCode(code *string) { + t.Code = code + t.require(testFieldCode) +} + +func (t *testExplicitFieldsStruct) SetCount(count *int) { + t.Count = count + t.require(testFieldCount) +} + +func (t *testExplicitFieldsStruct) SetEnabled(enabled *bool) { + t.Enabled = enabled + t.require(testFieldEnabled) +} + +func (t *testExplicitFieldsStruct) SetTags(tags []string) { + t.Tags = tags + t.require(testFieldTags) +} + +func (t *testExplicitFieldsStruct) MarshalJSON() ([]byte, error) { + type embed testExplicitFieldsStruct + var marshaler = struct { + embed + }{ + embed: embed(*t), + } + return json.Marshal(HandleExplicitFields(marshaler, t.explicitFields)) +} + +type testStructWithoutExplicitFields struct { + Name *string `json:"name,omitempty"` + Code *string `json:"code,omitempty"` +} + +func TestHandleExplicitFields(t *testing.T) { + tests := []struct { + desc string + giveInput interface{} + wantBytes []byte + wantError string + }{ + { + desc: "nil input", + giveInput: nil, + wantBytes: []byte(`null`), + }, + { + desc: "non-struct input", + giveInput: "string", + wantBytes: []byte(`"string"`), + }, + { + desc: "slice input", + giveInput: []string{"a", "b"}, + wantBytes: []byte(`["a","b"]`), + }, + { + desc: "map input", + giveInput: map[string]interface{}{"key": "value"}, + wantBytes: []byte(`{"key":"value"}`), + }, + { + desc: "struct without explicitFields field", + giveInput: &testStructWithoutExplicitFields{ + Name: stringPtr("test"), + Code: nil, + }, + wantBytes: []byte(`{"name":"test"}`), + }, + { + desc: "struct with no explicit fields set", + giveInput: &testExplicitFieldsStruct{ + Name: stringPtr("test"), + Code: nil, + }, + wantBytes: []byte(`{"name":"test"}`), + }, + { + desc: "struct with explicit nil field", + giveInput: func() *testExplicitFieldsStruct { + s := &testExplicitFieldsStruct{ + Name: stringPtr("test"), + } + s.SetCode(nil) + return s + }(), + wantBytes: []byte(`{"name":"test","code":null}`), + }, + { + desc: "struct with explicit non-nil field", + giveInput: func() *testExplicitFieldsStruct { + s := &testExplicitFieldsStruct{} + s.SetName(stringPtr("explicit")) + s.SetCode(stringPtr("also-explicit")) + return s + }(), + wantBytes: []byte(`{"name":"explicit","code":"also-explicit"}`), + }, + { + desc: "struct with mixed explicit and implicit fields", + giveInput: func() *testExplicitFieldsStruct { + s := &testExplicitFieldsStruct{ + Name: stringPtr("implicit"), + Count: intPtr(42), + } + s.SetCode(nil) // explicit nil + return s + }(), + wantBytes: []byte(`{"name":"implicit","code":null,"count":42}`), + }, + { + desc: "struct with multiple explicit nil fields", + giveInput: func() *testExplicitFieldsStruct { + s := &testExplicitFieldsStruct{ + Name: stringPtr("test"), + } + s.SetCode(nil) + s.SetCount(nil) + return s + }(), + wantBytes: []byte(`{"name":"test","code":null,"count":null}`), + }, + { + desc: "struct with slice field", + giveInput: func() *testExplicitFieldsStruct { + s := &testExplicitFieldsStruct{ + Tags: []string{"tag1", "tag2"}, + } + s.SetTags(nil) // explicit nil slice + return s + }(), + wantBytes: []byte(`{"tags":null}`), + }, + { + desc: "struct with boolean field", + giveInput: func() *testExplicitFieldsStruct { + s := &testExplicitFieldsStruct{} + s.SetEnabled(boolPtr(false)) // explicit false + return s + }(), + wantBytes: []byte(`{"enabled":false}`), + }, + { + desc: "struct with all fields explicit", + giveInput: func() *testExplicitFieldsStruct { + s := &testExplicitFieldsStruct{} + s.SetName(stringPtr("test")) + s.SetCode(nil) + s.SetCount(intPtr(0)) + s.SetEnabled(boolPtr(false)) + s.SetTags([]string{}) + return s + }(), + wantBytes: []byte(`{"name":"test","code":null,"count":0,"enabled":false,"tags":[]}`), + }, + } + + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + var explicitFields *big.Int + if s, ok := tt.giveInput.(*testExplicitFieldsStruct); ok { + explicitFields = s.explicitFields + } + bytes, err := json.Marshal(HandleExplicitFields(tt.giveInput, explicitFields)) + if tt.wantError != "" { + require.EqualError(t, err, tt.wantError) + assert.Nil(t, tt.wantBytes) + return + } + require.NoError(t, err) + assert.JSONEq(t, string(tt.wantBytes), string(bytes)) + + // Verify it's valid JSON + var value interface{} + require.NoError(t, json.Unmarshal(bytes, &value)) + }) + } +} + +func TestHandleExplicitFieldsCustomMarshaler(t *testing.T) { + t.Run("custom marshaler with explicit fields", func(t *testing.T) { + s := &testExplicitFieldsStruct{} + s.SetName(nil) + s.SetCode(stringPtr("test-code")) + + bytes, err := s.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, `{"name":null,"code":"test-code"}`, string(bytes)) + }) + + t.Run("custom marshaler with no explicit fields", func(t *testing.T) { + s := &testExplicitFieldsStruct{ + Name: stringPtr("implicit"), + Code: stringPtr("also-implicit"), + } + + bytes, err := s.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, `{"name":"implicit","code":"also-implicit"}`, string(bytes)) + }) +} + +func TestHandleExplicitFieldsPointerHandling(t *testing.T) { + t.Run("nil pointer", func(t *testing.T) { + var s *testExplicitFieldsStruct + bytes, err := json.Marshal(HandleExplicitFields(s, nil)) + require.NoError(t, err) + assert.Equal(t, []byte(`null`), bytes) + }) + + t.Run("pointer to struct", func(t *testing.T) { + s := &testExplicitFieldsStruct{} + s.SetName(nil) + + bytes, err := json.Marshal(HandleExplicitFields(s, s.explicitFields)) + require.NoError(t, err) + assert.JSONEq(t, `{"name":null}`, string(bytes)) + }) +} + +func TestHandleExplicitFieldsEmbeddedStruct(t *testing.T) { + t.Run("embedded struct with explicit fields", func(t *testing.T) { + // Create a struct similar to what MarshalJSON creates + s := &testExplicitFieldsStruct{} + s.SetName(nil) + s.SetCode(stringPtr("test-code")) + + type embed testExplicitFieldsStruct + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + + bytes, err := json.Marshal(HandleExplicitFields(marshaler, s.explicitFields)) + require.NoError(t, err) + // Should include both explicit fields (name as null, code as "test-code") + assert.JSONEq(t, `{"name":null,"code":"test-code"}`, string(bytes)) + }) + + t.Run("embedded struct with no explicit fields", func(t *testing.T) { + s := &testExplicitFieldsStruct{ + Name: stringPtr("implicit"), + Code: stringPtr("also-implicit"), + } + + type embed testExplicitFieldsStruct + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + + bytes, err := json.Marshal(HandleExplicitFields(marshaler, s.explicitFields)) + require.NoError(t, err) + // Should only include non-nil fields (omitempty behavior) + assert.JSONEq(t, `{"name":"implicit","code":"also-implicit"}`, string(bytes)) + }) + + t.Run("embedded struct with mixed fields", func(t *testing.T) { + s := &testExplicitFieldsStruct{ + Count: intPtr(42), // implicit field + } + s.SetName(nil) // explicit nil + s.SetCode(stringPtr("explicit")) // explicit value + + type embed testExplicitFieldsStruct + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + + bytes, err := json.Marshal(HandleExplicitFields(marshaler, s.explicitFields)) + require.NoError(t, err) + // Should include explicit null, explicit value, and implicit value + assert.JSONEq(t, `{"name":null,"code":"explicit","count":42}`, string(bytes)) + }) +} + +func TestHandleExplicitFieldsTagHandling(t *testing.T) { + type testStructWithComplexTags struct { + Field1 *string `json:"field1,omitempty" url:"field1,omitempty"` + Field2 *string `json:"field2,omitempty,string" url:"field2"` + Field3 *string `json:"-"` + Field4 *string `json:"field4"` + explicitFields *big.Int `json:"-"` + } + + s := &testStructWithComplexTags{ + Field1: stringPtr("test1"), + Field4: stringPtr("test4"), + explicitFields: big.NewInt(1), // Only first field is explicit + } + + bytes, err := json.Marshal(HandleExplicitFields(s, s.explicitFields)) + require.NoError(t, err) + + // Field1 should have omitempty removed, Field2 should keep omitempty, Field4 should be included + assert.JSONEq(t, `{"field1":"test1","field4":"test4"}`, string(bytes)) +} + +// Test types for nested struct explicit fields testing +type testNestedStruct struct { + NestedName *string `json:"nested_name,omitempty"` + NestedCode *string `json:"nested_code,omitempty"` + explicitFields *big.Int `json:"-"` +} + +type testParentStruct struct { + ParentName *string `json:"parent_name,omitempty"` + Nested *testNestedStruct `json:"nested,omitempty"` + explicitFields *big.Int `json:"-"` +} + +var ( + nestedFieldName = big.NewInt(1 << 0) + nestedFieldCode = big.NewInt(1 << 1) +) + +var ( + parentFieldName = big.NewInt(1 << 0) + parentFieldNested = big.NewInt(1 << 1) +) + +func (n *testNestedStruct) require(field *big.Int) { + if n.explicitFields == nil { + n.explicitFields = big.NewInt(0) + } + n.explicitFields.Or(n.explicitFields, field) +} + +func (n *testNestedStruct) SetNestedName(name *string) { + n.NestedName = name + n.require(nestedFieldName) +} + +func (n *testNestedStruct) SetNestedCode(code *string) { + n.NestedCode = code + n.require(nestedFieldCode) +} + +func (n *testNestedStruct) MarshalJSON() ([]byte, error) { + type embed testNestedStruct + var marshaler = struct { + embed + }{ + embed: embed(*n), + } + return json.Marshal(HandleExplicitFields(marshaler, n.explicitFields)) +} + +func (p *testParentStruct) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +func (p *testParentStruct) SetParentName(name *string) { + p.ParentName = name + p.require(parentFieldName) +} + +func (p *testParentStruct) SetNested(nested *testNestedStruct) { + p.Nested = nested + p.require(parentFieldNested) +} + +func (p *testParentStruct) MarshalJSON() ([]byte, error) { + type embed testParentStruct + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + return json.Marshal(HandleExplicitFields(marshaler, p.explicitFields)) +} + +func TestHandleExplicitFieldsNestedStruct(t *testing.T) { + tests := []struct { + desc string + setupFunc func() *testParentStruct + wantBytes []byte + }{ + { + desc: "nested struct with explicit nil in nested object", + setupFunc: func() *testParentStruct { + nested := &testNestedStruct{ + NestedName: stringPtr("implicit-nested"), + } + nested.SetNestedCode(nil) // explicit nil + + return &testParentStruct{ + ParentName: stringPtr("implicit-parent"), + Nested: nested, + } + }, + wantBytes: []byte(`{"parent_name":"implicit-parent","nested":{"nested_name":"implicit-nested","nested_code":null}}`), + }, + { + desc: "parent with explicit nil nested struct", + setupFunc: func() *testParentStruct { + parent := &testParentStruct{ + ParentName: stringPtr("implicit-parent"), + } + parent.SetNested(nil) // explicit nil nested struct + return parent + }, + wantBytes: []byte(`{"parent_name":"implicit-parent","nested":null}`), + }, + { + desc: "all explicit fields in nested structure", + setupFunc: func() *testParentStruct { + nested := &testNestedStruct{} + nested.SetNestedName(stringPtr("explicit-nested")) + nested.SetNestedCode(nil) // explicit nil + + parent := &testParentStruct{} + parent.SetParentName(nil) // explicit nil + parent.SetNested(nested) // explicit nested struct + + return parent + }, + wantBytes: []byte(`{"parent_name":null,"nested":{"nested_name":"explicit-nested","nested_code":null}}`), + }, + } + + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + parent := tt.setupFunc() + bytes, err := parent.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, string(tt.wantBytes), string(bytes)) + + // Verify it's valid JSON + var value interface{} + require.NoError(t, json.Unmarshal(bytes, &value)) + }) + } +} + +// Helper functions +func stringPtr(s string) *string { + return &s +} + +func intPtr(i int) *int { + return &i +} + +func boolPtr(b bool) *bool { + return &b +} diff --git a/internal/http.go b/internal/http.go index 768968b..7786375 100644 --- a/internal/http.go +++ b/internal/http.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" "net/url" + "reflect" ) // HTTPClient is an interface for a subset of the *http.Client. @@ -23,15 +24,37 @@ func ResolveBaseURL(values ...string) string { } // EncodeURL encodes the given arguments into the URL, escaping -// values as needed. +// values as needed. Pointer arguments are dereferenced before processing. func EncodeURL(urlFormat string, args ...interface{}) string { escapedArgs := make([]interface{}, 0, len(args)) for _, arg := range args { - escapedArgs = append(escapedArgs, url.PathEscape(fmt.Sprintf("%v", arg))) + // Dereference the argument if it's a pointer + value := dereferenceArg(arg) + escapedArgs = append(escapedArgs, url.PathEscape(fmt.Sprintf("%v", value))) } return fmt.Sprintf(urlFormat, escapedArgs...) } +// dereferenceArg dereferences a pointer argument if necessary, returning the underlying value. +// If the argument is not a pointer or is nil, it returns the argument as-is. +func dereferenceArg(arg interface{}) interface{} { + if arg == nil { + return arg + } + + v := reflect.ValueOf(arg) + + // Keep dereferencing until we get to a non-pointer value or hit nil + for v.Kind() == reflect.Ptr { + if v.IsNil() { + return nil + } + v = v.Elem() + } + + return v.Interface() +} + // MergeHeaders merges the given headers together, where the right // takes precedence over the left. func MergeHeaders(left, right http.Header) http.Header { diff --git a/internal/pager.go b/internal/pager.go index 4c9423b..d3b429e 100644 --- a/internal/pager.go +++ b/internal/pager.go @@ -27,30 +27,15 @@ type Pager[ readPageResponse PageResponseFunc[Cursor, Response, Results] } -// PageRequest represents the information required to identify a single page. -type PageRequest[Cursor comparable] struct { - Cursor Cursor - - // Holds the value of the response type (populated by the *Caller). - Response any -} - -// PageResponse represents the information associated with a single page. -type PageResponse[Cursor comparable, Result any] struct { - Results []Result - Next Cursor - Done bool -} - // PageRequestFunc prepares the *CallParams from the given page request. -type PageRequestFunc[Cursor comparable] func(request *PageRequest[Cursor]) *CallParams +type PageRequestFunc[Cursor comparable] func(request *core.PageRequest[Cursor]) *CallParams // PageResponseFunc extracts the next page information from the response. type PageResponseFunc[ Cursor comparable, Response any, Results any, -] func(Response) *PageResponse[Cursor, Results] +] func(Response) *core.PageResponse[Cursor, Results] // NewCursorPager constructs a new Pager that fetches pages from a paginated endpoint. func NewCursorPager[Cursor comparable, Response any, Results any]( @@ -85,24 +70,25 @@ func (p *Pager[ Cursor, Response, Results, -]) GetPage(ctx context.Context, cursor Cursor) (*core.Page[Results], error) { +]) GetPage(ctx context.Context, cursor Cursor) (*core.Page[Cursor, Results], error) { var response Response - pageRequest := &PageRequest[Cursor]{ + pageRequest := &core.PageRequest[Cursor]{ Cursor: cursor, Response: &response, } callParams := p.prepareCall(pageRequest) - if err := p.caller.Call(ctx, callParams); err != nil { + if _, err := p.caller.Call(ctx, callParams); err != nil { return nil, err } pageResponse := p.readPageResponse(response) if p.mode == PagerModeOffset { - return &core.Page[Results]{ - Results: pageResponse.Results, - NextPageFunc: func(ctx context.Context) (*core.Page[Results], error) { + return &core.Page[Cursor, Results]{ + Results: pageResponse.Results, + RawResponse: *pageResponse, + NextPageFunc: func(ctx context.Context) (*core.Page[Cursor, Results], error) { page, err := p.GetPage(ctx, pageResponse.Next) if err != nil { return nil, err @@ -115,9 +101,10 @@ func (p *Pager[ }, nil } - return &core.Page[Results]{ - Results: pageResponse.Results, - NextPageFunc: func(ctx context.Context) (*core.Page[Results], error) { + return &core.Page[Cursor, Results]{ + Results: pageResponse.Results, + RawResponse: *pageResponse, + NextPageFunc: func(ctx context.Context) (*core.Page[Cursor, Results], error) { if pageResponse.Done { return nil, core.ErrNoPages } diff --git a/internal/pager_test.go b/internal/pager_test.go index 5476da8..dc6dcb3 100644 --- a/internal/pager_test.go +++ b/internal/pager_test.go @@ -9,6 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/merge-api/merge-go-client/v2/core" ) type TestPageResponse struct { @@ -110,7 +112,7 @@ func TestPager(t *testing.T) { ) pager := NewCursorPager( caller, - func(request *PageRequest[*string]) *CallParams { + func(request *core.PageRequest[*string]) *CallParams { url := server.URL if request.Cursor != nil { url += "?cursor=" + *request.Cursor @@ -121,7 +123,7 @@ func TestPager(t *testing.T) { Response: request.Response, } }, - func(response *TestPageResponse) *PageResponse[*string, *TestPageItem] { + func(response *TestPageResponse) *core.PageResponse[*string, *TestPageItem] { var items []*TestPageItem for _, item := range response.Items { itemCopy := item @@ -131,7 +133,7 @@ func TestPager(t *testing.T) { if response.Next != "" { next = &response.Next } - return &PageResponse[*string, *TestPageItem]{ + return &core.PageResponse[*string, *TestPageItem]{ Results: items, Next: next, Done: response.Next == "", diff --git a/internal/query_test.go b/internal/query_test.go index 75f66f8..e7740a5 100644 --- a/internal/query_test.go +++ b/internal/query_test.go @@ -236,4 +236,4 @@ func TestQueryValues(t *testing.T) { require.NoError(t, err) assert.Equal(t, "metadata%5Binner%5D=one&metadata%5Binner%5D=two&metadata%5Binner%5D=three", values.Encode()) }) -} +} \ No newline at end of file diff --git a/internal/retrier.go b/internal/retrier.go index 3418f00..4efae1b 100644 --- a/internal/retrier.go +++ b/internal/retrier.go @@ -4,13 +4,14 @@ import ( "crypto/rand" "math/big" "net/http" + "strconv" "time" ) const ( defaultRetryAttempts = 2 - minRetryDelay = 500 * time.Millisecond - maxRetryDelay = 5000 * time.Millisecond + minRetryDelay = 1000 * time.Millisecond + maxRetryDelay = 60000 * time.Millisecond ) // RetryOption adapts the behavior the *Retrier. @@ -105,7 +106,7 @@ func (r *Retrier) run( if r.shouldRetry(response) { defer response.Body.Close() - delay, err := r.retryDelay(retryAttempt) + delay, err := r.retryDelay(response, retryAttempt) if err != nil { return nil, err } @@ -133,31 +134,95 @@ func (r *Retrier) shouldRetry(response *http.Response) bool { response.StatusCode >= http.StatusInternalServerError } -// retryDelay calculates the delay time in milliseconds based on the retry attempt. -func (r *Retrier) retryDelay(retryAttempt uint) (time.Duration, error) { - // Apply exponential backoff. - delay := minRetryDelay + minRetryDelay*time.Duration(retryAttempt*retryAttempt) +// retryDelay calculates the delay time based on response headers, +// falling back to exponential backoff if no headers are present. +func (r *Retrier) retryDelay(response *http.Response, retryAttempt uint) (time.Duration, error) { + // Check for Retry-After header first (RFC 7231), applying no jitter + if retryAfter := response.Header.Get("Retry-After"); retryAfter != "" { + // Parse as number of seconds... + if seconds, err := strconv.Atoi(retryAfter); err == nil { + delay := time.Duration(seconds) * time.Second + if delay > 0 { + if delay > maxRetryDelay { + delay = maxRetryDelay + } + return delay, nil + } + } + + // ...or as an HTTP date; both are valid + if retryTime, err := time.Parse(time.RFC1123, retryAfter); err == nil { + delay := time.Until(retryTime) + if delay > 0 { + if delay > maxRetryDelay { + delay = maxRetryDelay + } + return delay, nil + } + } + } + + // Then check for industry-standard X-RateLimit-Reset header, applying positive jitter + if rateLimitReset := response.Header.Get("X-RateLimit-Reset"); rateLimitReset != "" { + if resetTimestamp, err := strconv.ParseInt(rateLimitReset, 10, 64); err == nil { + // Assume Unix timestamp in seconds + resetTime := time.Unix(resetTimestamp, 0) + delay := time.Until(resetTime) + if delay > 0 { + if delay > maxRetryDelay { + delay = maxRetryDelay + } + return r.addPositiveJitter(delay) + } + } + } + + // Fall back to exponential backoff + return r.exponentialBackoff(retryAttempt) +} - // Do not allow the number to exceed maxRetryDelay. +// exponentialBackoff calculates the delay time based on the retry attempt +// and applies symmetric jitter (±10% around the delay). +func (r *Retrier) exponentialBackoff(retryAttempt uint) (time.Duration, error) { + if retryAttempt > 63 { // 2^63+ would overflow uint64 + retryAttempt = 63 + } + + delay := minRetryDelay << retryAttempt if delay > maxRetryDelay { delay = maxRetryDelay } - // Apply some jitter by randomizing the value in the range of 75%-100%. - max := big.NewInt(int64(delay / 4)) - jitter, err := rand.Int(rand.Reader, max) + return r.addSymmetricJitter(delay) +} + +// addJitterWithRange applies jitter to the given delay. +// minPercent and maxPercent define the jitter range (e.g., 100, 120 for +0% to +20%). +func (r *Retrier) addJitterWithRange(delay time.Duration, minPercent, maxPercent int) (time.Duration, error) { + jitterRange := big.NewInt(int64(delay * time.Duration(maxPercent-minPercent) / 100)) + jitter, err := rand.Int(rand.Reader, jitterRange) if err != nil { return 0, err } - delay -= time.Duration(jitter.Int64()) - - // Never sleep less than the base sleep seconds. - if delay < minRetryDelay { - delay = minRetryDelay + jitteredDelay := delay + time.Duration(jitter.Int64()) + delay*time.Duration(minPercent-100)/100 + if jitteredDelay < minRetryDelay { + jitteredDelay = minRetryDelay } + if jitteredDelay > maxRetryDelay { + jitteredDelay = maxRetryDelay + } + return jitteredDelay, nil +} + +// addPositiveJitter applies positive jitter to the given delay (100%-120% range). +func (r *Retrier) addPositiveJitter(delay time.Duration) (time.Duration, error) { + return r.addJitterWithRange(delay, 100, 120) +} - return delay, nil +// addSymmetricJitter applies symmetric jitter to the given delay (90%-110% range). +func (r *Retrier) addSymmetricJitter(delay time.Duration) (time.Duration, error) { + return r.addJitterWithRange(delay, 90, 110) } type retryOptions struct { diff --git a/internal/retrier_test.go b/internal/retrier_test.go index 87613f0..cba9d06 100644 --- a/internal/retrier_test.go +++ b/internal/retrier_test.go @@ -3,6 +3,7 @@ package internal import ( "context" "encoding/json" + "fmt" "io" "net/http" "net/http/httptest" @@ -19,9 +20,9 @@ type RetryTestCase struct { giveAttempts uint giveStatusCodes []int - giveResponse *Response + giveResponse *InternalTestResponse - wantResponse *Response + wantResponse *InternalTestResponse wantError *core.APIError } @@ -35,10 +36,10 @@ func TestRetrier(t *testing.T) { http.StatusServiceUnavailable, http.StatusOK, }, - giveResponse: &Response{ + giveResponse: &InternalTestResponse{ Id: "1", }, - wantResponse: &Response{ + wantResponse: &InternalTestResponse{ Id: "1", }, }, @@ -106,13 +107,13 @@ func TestRetrier(t *testing.T) { }, ) - var response *Response - err := caller.Call( + var response *InternalTestResponse + _, err := caller.Call( context.Background(), &CallParams{ URL: server.URL, Method: http.MethodGet, - Request: &Request{}, + Request: &InternalTestRequest{}, Response: &response, MaxAttempts: test.giveAttempts, ResponseIsOptional: true, @@ -147,8 +148,8 @@ func newTestRetryServer(t *testing.T, tc *RetryTestCase) *httptest.Server { // Ensure that the duration between retries increases exponentially, // and that it is within the minimum and maximum retry delay values. actualDuration := timestamps[index].Sub(timestamps[index-1]) - expectedDurationMin := expectedRetryDurations[index-1] * 75 / 100 - expectedDurationMax := expectedRetryDurations[index-1] * 125 / 100 + expectedDurationMin := expectedRetryDurations[index-1] * 50 / 100 + expectedDurationMax := expectedRetryDurations[index-1] * 150 / 100 assert.True( t, actualDuration >= expectedDurationMin && actualDuration <= expectedDurationMax, @@ -175,13 +176,14 @@ func newTestRetryServer(t *testing.T, tc *RetryTestCase) *httptest.Server { ) } - request := new(Request) + request := new(InternalTestRequest) bytes, err := io.ReadAll(r.Body) require.NoError(t, err) require.NoError(t, json.Unmarshal(bytes, request)) require.LessOrEqual(t, index, len(tc.giveStatusCodes)) statusCode := tc.giveStatusCodes[index] + w.WriteHeader(statusCode) if tc.giveResponse != nil && statusCode == http.StatusOK { @@ -200,12 +202,99 @@ func newTestRetryServer(t *testing.T, tc *RetryTestCase) *httptest.Server { // expectedRetryDurations holds an array of calculated retry durations, // where the index of the array should correspond to the retry attempt. // -// Values are calculated based off of `minRetryDelay + minRetryDelay*i*i`, with -// a max and min value of 5000ms and 500ms respectively. +// Values are calculated based off of `minRetryDelay * 2^i`. var expectedRetryDurations = []time.Duration{ - 500 * time.Millisecond, - 1000 * time.Millisecond, - 2500 * time.Millisecond, - 5000 * time.Millisecond, - 5000 * time.Millisecond, + 1000 * time.Millisecond, // 500ms * 2^1 = 1000ms + 2000 * time.Millisecond, // 500ms * 2^2 = 2000ms + 4000 * time.Millisecond, // 500ms * 2^3 = 4000ms + 8000 * time.Millisecond, // 500ms * 2^4 = 8000ms +} + +func TestRetryDelayTiming(t *testing.T) { + tests := []struct { + name string + headerName string + headerValueFunc func() string + expectedMinMs int64 + expectedMaxMs int64 + }{ + { + name: "retry-after with seconds value", + headerName: "retry-after", + headerValueFunc: func() string { + return "1" + }, + expectedMinMs: 500, + expectedMaxMs: 1500, + }, + { + name: "retry-after with HTTP date", + headerName: "retry-after", + headerValueFunc: func() string { + return time.Now().Add(3 * time.Second).Format(time.RFC1123) + }, + expectedMinMs: 1500, + expectedMaxMs: 4500, + }, + { + name: "x-ratelimit-reset with future timestamp", + headerName: "x-ratelimit-reset", + headerValueFunc: func() string { + return fmt.Sprintf("%d", time.Now().Add(3*time.Second).Unix()) + }, + expectedMinMs: 1500, + expectedMaxMs: 4500, + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + var timestamps []time.Time + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + timestamps = append(timestamps, time.Now()) + if len(timestamps) == 1 { + // First request - return retryable error with header + w.Header().Set(tt.headerName, tt.headerValueFunc()) + w.WriteHeader(http.StatusTooManyRequests) + } else { + // Second request - return success + w.WriteHeader(http.StatusOK) + response := &InternalTestResponse{Id: "success"} + bytes, _ := json.Marshal(response) + w.Write(bytes) + } + })) + defer server.Close() + + caller := NewCaller(&CallerParams{ + Client: server.Client(), + }) + + var response *InternalTestResponse + _, err := caller.Call( + context.Background(), + &CallParams{ + URL: server.URL, + Method: http.MethodGet, + Request: &InternalTestRequest{}, + Response: &response, + MaxAttempts: 2, + ResponseIsOptional: true, + }, + ) + + require.NoError(t, err) + require.Len(t, timestamps, 2, "Expected exactly 2 requests") + + actualDelayMs := timestamps[1].Sub(timestamps[0]).Milliseconds() + + assert.GreaterOrEqual(t, actualDelayMs, tt.expectedMinMs, + "Actual delay %dms should be >= expected min %dms", actualDelayMs, tt.expectedMinMs) + assert.LessOrEqual(t, actualDelayMs, tt.expectedMaxMs, + "Actual delay %dms should be <= expected max %dms", actualDelayMs, tt.expectedMaxMs) + }) + } } diff --git a/reference.md b/reference.md new file mode 100644 index 0000000..2bc3af3 --- /dev/null +++ b/reference.md @@ -0,0 +1,50048 @@ +# Reference +## Ats AccountDetails +
client.Ats.AccountDetails.Retrieve() -> *ats.AccountDetails +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details for a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.AccountDetails.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ats AccountToken +
client.Ats.AccountToken.Retrieve(PublicToken) -> *ats.AccountToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the account token for the end user with the provided public token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**publicToken:** `string` + +
+
+
+
+ + +
+
+
+ +## Ats Activities +
client.Ats.Activities.List() -> *ats.PaginatedActivityList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Activity` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ActivitiesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: ats.ActivitiesListRequestRemoteFieldsActivityType.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: ats.ActivitiesListRequestShowEnumOriginsActivityType.Ptr(), + UserId: merge.String( + "user_id", + ), + } +client.Ats.Activities.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*ats.ActivitiesListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*ats.ActivitiesListRequestShowEnumOrigins` — A comma separated list 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) + +
+
+ +
+
+ +**userId:** `*string` — If provided, will only return activities done by this user. + +
+
+
+
+ + +
+
+
+ +
client.Ats.Activities.Create(request) -> *ats.ActivityResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Activity` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ActivityEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.ActivityRequest{}, + RemoteUserId: "remote_user_id", + } +client.Ats.Activities.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ats.ActivityRequest` + +
+
+ +
+
+ +**remoteUserId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Activities.Retrieve(Id) -> *ats.Activity +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Activity` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ActivitiesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: ats.ActivitiesRetrieveRequestRemoteFieldsActivityType.Ptr(), + ShowEnumOrigins: ats.ActivitiesRetrieveRequestShowEnumOriginsActivityType.Ptr(), + } +client.Ats.Activities.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*ats.ActivitiesRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*ats.ActivitiesRetrieveRequestShowEnumOrigins` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Activities.MetaPostRetrieve() -> *ats.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Activity` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.Activities.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ats Applications +
client.Ats.Applications.List() -> *ats.PaginatedApplicationList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Application` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ApplicationsListRequest{ + CandidateId: merge.String( + "candidate_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreditedToId: merge.String( + "credited_to_id", + ), + CurrentStageId: merge.String( + "current_stage_id", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + JobId: merge.String( + "job_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RejectReasonId: merge.String( + "reject_reason_id", + ), + RemoteId: merge.String( + "remote_id", + ), + Source: merge.String( + "source", + ), + } +client.Ats.Applications.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**candidateId:** `*string` — If provided, will only return applications for this candidate. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**creditedToId:** `*string` — If provided, will only return applications credited to this user. + +
+
+ +
+
+ +**currentStageId:** `*string` — If provided, will only return applications at this interview stage. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ats.ApplicationsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**jobId:** `*string` — If provided, will only return applications for this job. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**rejectReasonId:** `*string` — If provided, will only return applications with this reject reason. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**source:** `*string` — If provided, will only return applications with this source. + +
+
+
+
+ + +
+
+
+ +
client.Ats.Applications.Create(request) -> *ats.ApplicationResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ApplicationEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.ApplicationRequest{}, + RemoteUserId: "remote_user_id", + } +client.Ats.Applications.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ats.ApplicationRequest` + +
+
+ +
+
+ +**remoteUserId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Applications.Retrieve(Id) -> *ats.Application +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Application` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ApplicationsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Applications.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*ats.ApplicationsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Ats.Applications.ChangeStageCreate(Id, request) -> *ats.ApplicationResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates the `current_stage` field of an `Application` object +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.UpdateApplicationStageRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + } +client.Ats.Applications.ChangeStageCreate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**jobInterviewStage:** `*string` — The interview stage to move the application to. + +
+
+ +
+
+ +**remoteUserId:** `*string` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Applications.MetaPostRetrieve() -> *ats.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Application` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ApplicationsMetaPostRetrieveRequest{ + ApplicationRemoteTemplateId: merge.String( + "application_remote_template_id", + ), + } +client.Ats.Applications.MetaPostRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**applicationRemoteTemplateId:** `*string` — The template ID associated with the nested application in the request. + +
+
+
+
+ + +
+
+
+ +## Ats AsyncPassthrough +
client.Ats.AsyncPassthrough.Create(request) -> *ats.AsyncPassthroughReciept +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Asynchronously pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.DataPassthroughRequest{ + Method: ats.MethodEnumGet, + Path: "/scooters", + } +client.Ats.AsyncPassthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*ats.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ats.AsyncPassthrough.Retrieve(AsyncPassthroughReceiptId) -> *ats.AsyncPassthroughRetrieveResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves data from earlier async-passthrough POST request +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**asyncPassthroughReceiptId:** `string` + +
+
+
+
+ + +
+
+
+ +## Ats Attachments +
client.Ats.Attachments.List() -> *ats.PaginatedAttachmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Attachment` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.AttachmentsListRequest{ + CandidateId: merge.String( + "candidate_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.Attachments.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**candidateId:** `*string` — If provided, will only return attachments for this candidate. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Attachments.Create(request) -> *ats.AttachmentResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Attachment` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.AttachmentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.AttachmentRequest{}, + RemoteUserId: "remote_user_id", + } +client.Ats.Attachments.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ats.AttachmentRequest` + +
+
+ +
+
+ +**remoteUserId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Attachments.Retrieve(Id) -> *ats.Attachment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Attachment` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.AttachmentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Attachments.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Attachments.MetaPostRetrieve() -> *ats.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Attachment` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.Attachments.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ats AuditTrail +
client.Ats.AuditTrail.List() -> *ats.PaginatedAuditLogEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of audit trail events. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } +client.Ats.AuditTrail.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include audit trail events that occurred before this time + +
+
+ +
+
+ +**eventType:** `*string` — 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` + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include audit trail events that occurred after this time + +
+
+ +
+
+ +**userEmail:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +## Ats AvailableActions +
client.Ats.AvailableActions.Retrieve() -> *ats.AvailableActions +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of models and actions available for an account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.AvailableActions.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ats Candidates +
client.Ats.Candidates.List() -> *ats.PaginatedCandidateList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Candidate` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.CandidatesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddresses: merge.String( + "email_addresses", + ), + FirstName: merge.String( + "first_name", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + LastName: merge.String( + "last_name", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Tags: merge.String( + "tags", + ), + } +client.Ats.Candidates.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**emailAddresses:** `*string` — If provided, will only return candidates with these email addresses; multiple addresses can be separated by commas. + +
+
+ +
+
+ +**expand:** `*ats.CandidatesListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**firstName:** `*string` — If provided, will only return candidates with this first name. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**lastName:** `*string` — If provided, will only return candidates with this last name. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**tags:** `*string` — If provided, will only return candidates with these tags; multiple tags can be separated by commas. + +
+
+
+
+ + +
+
+
+ +
client.Ats.Candidates.Create(request) -> *ats.CandidateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Candidate` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.CandidateEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.CandidateRequest{}, + RemoteUserId: "remote_user_id", + } +client.Ats.Candidates.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ats.CandidateRequest` + +
+
+ +
+
+ +**remoteUserId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Candidates.Retrieve(Id) -> *ats.Candidate +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Candidate` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.CandidatesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Candidates.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*ats.CandidatesRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Ats.Candidates.PartialUpdate(Id, request) -> *ats.CandidateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a `Candidate` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.PatchedCandidateEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.PatchedCandidateRequest{}, + RemoteUserId: "remote_user_id", + } +client.Ats.Candidates.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ats.PatchedCandidateRequest` + +
+
+ +
+
+ +**remoteUserId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Candidates.IgnoreCreate(ModelId, request) -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.IgnoreCommonModelRequest{ + Reason: &ats.IgnoreCommonModelRequestReason{ + ReasonEnum: ats.ReasonEnumGeneralCustomerRequest, + }, + } +client.Ats.Candidates.IgnoreCreate( + context.TODO(), + "model_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**modelId:** `string` + +
+
+ +
+
+ +**request:** `*ats.IgnoreCommonModelRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Candidates.MetaPatchRetrieve(Id) -> *ats.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Candidate` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.Candidates.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Candidates.MetaPostRetrieve() -> *ats.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Candidate` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.Candidates.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ats Scopes +
client.Ats.Scopes.DefaultScopesRetrieve() -> *ats.CommonModelScopeApi +
+
+ +#### 📝 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). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Ats.Scopes.LinkedAccountScopesRetrieve() -> *ats.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Ats.Scopes.LinkedAccountScopesCreate(request) -> *ats.CommonModelScopeApi +
+
+ +#### 📝 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) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*ats.IndividualCommonModelScopeDeserializerRequest{ + &ats.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*ats.ModelPermissionDeserializerRequest{ + "READ": &ats.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &ats.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &ats.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &ats.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*ats.ModelPermissionDeserializerRequest{ + "WRITE": &ats.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } +client.Ats.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `[]*ats.IndividualCommonModelScopeDeserializerRequest` — The common models you want to update the scopes for + +
+
+
+
+ + +
+
+
+ +## Ats DeleteAccount +
client.Ats.DeleteAccount.Delete() -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.DeleteAccount.Delete( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ats Departments +
client.Ats.Departments.List() -> *ats.PaginatedDepartmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Department` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.DepartmentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.Departments.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ats.Departments.Retrieve(Id) -> *ats.Department +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Department` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.DepartmentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Departments.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ats Eeocs +
client.Ats.Eeocs.List() -> *ats.PaginatedEeocList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `EEOC` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.EeocsListRequest{ + CandidateId: merge.String( + "candidate_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: ats.EeocsListRequestRemoteFieldsDisabilityStatus.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: ats.EeocsListRequestShowEnumOriginsDisabilityStatus.Ptr(), + } +client.Ats.Eeocs.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**candidateId:** `*string` — If provided, will only return EEOC info for this candidate. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*ats.EeocsListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*ats.EeocsListRequestShowEnumOrigins` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Eeocs.Retrieve(Id) -> *ats.Eeoc +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `EEOC` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.EeocsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: ats.EeocsRetrieveRequestRemoteFieldsDisabilityStatus.Ptr(), + ShowEnumOrigins: ats.EeocsRetrieveRequestShowEnumOriginsDisabilityStatus.Ptr(), + } +client.Ats.Eeocs.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*ats.EeocsRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*ats.EeocsRetrieveRequestShowEnumOrigins` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +## Ats FieldMapping +
client.Ats.FieldMapping.FieldMappingsRetrieve() -> *ats.FieldMappingApiInstanceResponse +
+
+ +#### 📝 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/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } +client.Ats.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+
+
+ + +
+
+
+ +
client.Ats.FieldMapping.FieldMappingsCreate(request) -> *ats.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } +client.Ats.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+ +
+
+ +**targetFieldName:** `string` — The name of the target field you want this remote field to map to. + +
+
+ +
+
+ +**targetFieldDescription:** `string` — The description of the target field you want this remote field to map to. + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `string` — The path of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**commonModelName:** `string` — The name of the Common Model that the remote field corresponds to in a given category. + +
+
+
+
+ + +
+
+
+ +
client.Ats.FieldMapping.FieldMappingsDestroy(FieldMappingId) -> *ats.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ats.FieldMapping.FieldMappingsPartialUpdate(FieldMappingId, request) -> *ats.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.PatchedEditFieldMappingRequest{} +client.Ats.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `*string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `*string` — The path of the remote endpoint where the remote field is coming from. + +
+
+
+
+ + +
+
+
+ +
client.Ats.FieldMapping.RemoteFieldsRetrieve() -> *ats.RemoteFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } +client.Ats.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `*string` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + +
+
+ +
+
+ +**includeExampleValues:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +
client.Ats.FieldMapping.TargetFieldsRetrieve() -> *ats.ExternalTargetFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ats GenerateKey +
client.Ats.GenerateKey.Create(request) -> *ats.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } +client.Ats.GenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Ats Interviews +
client.Ats.Interviews.List() -> *ats.PaginatedScheduledInterviewList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `ScheduledInterview` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.InterviewsListRequest{ + ApplicationId: merge.String( + "application_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + JobId: merge.String( + "job_id", + ), + JobInterviewStageId: merge.String( + "job_interview_stage_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OrganizerId: merge.String( + "organizer_id", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.Interviews.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**applicationId:** `*string` — If provided, will only return interviews for this application. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ats.InterviewsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**jobId:** `*string` — If provided, wll only return interviews organized for this job. + +
+
+ +
+
+ +**jobInterviewStageId:** `*string` — If provided, will only return interviews at this stage. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**organizerId:** `*string` — If provided, will only return interviews organized by this user. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Interviews.Create(request) -> *ats.ScheduledInterviewResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `ScheduledInterview` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ScheduledInterviewEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ats.ScheduledInterviewRequest{}, + RemoteUserId: "remote_user_id", + } +client.Ats.Interviews.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ats.ScheduledInterviewRequest` + +
+
+ +
+
+ +**remoteUserId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Interviews.Retrieve(Id) -> *ats.ScheduledInterview +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `ScheduledInterview` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.InterviewsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Interviews.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*ats.InterviewsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Interviews.MetaPostRetrieve() -> *ats.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `ScheduledInterview` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.Interviews.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ats Issues +
client.Ats.Issues.List() -> *ats.PaginatedIssueList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets all issues for Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: ats.IssuesListRequestStatusOngoing.Ptr(), + } +client.Ats.Issues.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountToken:** `*string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include issues whose most recent action occurred before this time + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` + +
+
+ +
+
+ +**firstIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose first incident time was after this datetime. + +
+
+ +
+
+ +**firstIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose first incident time was before this datetime. + +
+
+ +
+
+ +**includeMuted:** `*string` — If true, will include muted issues + +
+
+ +
+
+ +**integrationName:** `*string` + +
+
+ +
+
+ +**lastIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose last incident time was after this datetime. + +
+
+ +
+
+ +**lastIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose last incident time was before this datetime. + +
+
+ +
+
+ +**linkedAccountId:** `*string` — If provided, will only include issues pertaining to the linked account passed in. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include issues whose most recent action occurred after this time + +
+
+ +
+
+ +**status:** `*ats.IssuesListRequestStatus` + +Status of the issue. Options: ('ONGOING', 'RESOLVED') + +* `ONGOING` - ONGOING +* `RESOLVED` - RESOLVED + +
+
+
+
+ + +
+
+
+ +
client.Ats.Issues.Retrieve(Id) -> *ats.Issue +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific issue. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.Issues.Retrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +## Ats JobInterviewStages +
client.Ats.JobInterviewStages.List() -> *ats.PaginatedJobInterviewStageList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `JobInterviewStage` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.JobInterviewStagesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + JobId: merge.String( + "job_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.JobInterviewStages.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**jobId:** `*string` — If provided, will only return interview stages for this job. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ats.JobInterviewStages.Retrieve(Id) -> *ats.JobInterviewStage +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `JobInterviewStage` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.JobInterviewStagesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.JobInterviewStages.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ats JobPostings +
client.Ats.JobPostings.List() -> *ats.PaginatedJobPostingList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `JobPosting` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.JobPostingsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: ats.JobPostingsListRequestStatusClosed.Ptr(), + } +client.Ats.JobPostings.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**status:** `*ats.JobPostingsListRequestStatus` + +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 + +
+
+
+
+ + +
+
+
+ +
client.Ats.JobPostings.Retrieve(Id) -> *ats.JobPosting +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `JobPosting` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.JobPostingsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.JobPostings.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ats Jobs +
client.Ats.Jobs.List() -> *ats.PaginatedJobList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Job` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.JobsListRequest{ + Code: merge.String( + "code", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Offices: merge.String( + "offices", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: ats.JobsListRequestStatusArchived.Ptr(), + } +client.Ats.Jobs.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**code:** `*string` — If provided, will only return jobs with this code. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ats.JobsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**offices:** `*string` — If provided, will only return jobs for this office; multiple offices can be separated by commas. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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:** `*ats.JobsListRequestStatus` + +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 + +
+
+
+
+ + +
+
+
+ +
client.Ats.Jobs.Retrieve(Id) -> *ats.Job +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Job` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.JobsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Jobs.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*ats.JobsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Jobs.ScreeningQuestionsList(JobId) -> *ats.PaginatedScreeningQuestionList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `ScreeningQuestion` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.JobsScreeningQuestionsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Ats.Jobs.ScreeningQuestionsList( + context.TODO(), + "job_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**jobId:** `string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ats.JobsScreeningQuestionsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Ats LinkToken +
client.Ats.LinkToken.Create(request) -> *ats.LinkToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a link token to be used when linking a new end user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []ats.CategoriesEnum{ + ats.CategoriesEnumHris, + ats.CategoriesEnumAts, + }, + } +client.Ats.LinkToken.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**endUserEmailAddress:** `string` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + +
+
+ +
+
+ +**endUserOrganizationName:** `string` — Your end user's organization. + +
+
+ +
+
+ +**endUserOriginId:** `string` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + +
+
+ +
+
+ +**categories:** `[]*ats.CategoriesEnum` — The integration categories to show in Merge Link. + +
+
+ +
+
+ +**integration:** `*string` — 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/. + +
+
+ +
+
+ +**linkExpiryMins:** `*int` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + +
+
+ +
+
+ +**shouldCreateMagicLinkUrl:** `*bool` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**hideAdminMagicLink:** `*bool` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**commonModels:** `[]*ats.CommonModelScopesBodyRequest` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + +
+
+ +
+
+ +**categoryCommonModelScopes:** `map[string][]*ats.IndividualCommonModelScopeDeserializerRequest` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + +
+
+ +
+
+ +**language:** `*ats.EndUserDetailsRequestLanguage` + +The following subset of IETF language tags can be used to configure localization. + +* `en` - en +* `de` - de + +
+
+ +
+
+ +**areSyncsDisabled:** `*bool` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. + +
+
+ +
+
+ +**integrationSpecificConfig:** `map[string]any` — A JSON object containing integration-specific configuration options. + +
+
+
+
+ + +
+
+
+ +## Ats LinkedAccounts +
client.Ats.LinkedAccounts.List() -> *ats.PaginatedAccountDetailsAndActionsList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List linked accounts for your organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.LinkedAccountsListRequest{ + Category: ats.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } +client.Ats.LinkedAccounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**category:** `*ats.LinkedAccountsListRequestCategory` + +Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` + +* `hris` - hris +* `ats` - ats +* `accounting` - accounting +* `ticketing` - ticketing +* `crm` - crm +* `mktg` - mktg +* `filestorage` - filestorage + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endUserEmailAddress:** `*string` — If provided, will only return linked accounts associated with the given email address. + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` — If provided, will only return linked accounts associated with the given organization name. + +
+
+ +
+
+ +**endUserOriginId:** `*string` — If provided, will only return linked accounts associated with the given origin ID. + +
+
+ +
+
+ +**endUserOriginIds:** `*string` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + +
+
+ +
+
+ +**id:** `*string` + +
+
+ +
+
+ +**ids:** `*string` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + +
+
+ +
+
+ +**includeDuplicates:** `*bool` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + +
+
+ +
+
+ +**integrationName:** `*string` — If provided, will only return linked accounts associated with the given integration name. + +
+
+ +
+
+ +**isTestAccount:** `*string` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**status:** `*string` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + +
+
+
+
+ + +
+
+
+ +## Ats Offers +
client.Ats.Offers.List() -> *ats.PaginatedOfferList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Offer` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.OffersListRequest{ + ApplicationId: merge.String( + "application_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatorId: merge.String( + "creator_id", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.Offers.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**applicationId:** `*string` — If provided, will only return offers for this application. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**creatorId:** `*string` — If provided, will only return offers created by this user. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ats.OffersListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Offers.Retrieve(Id) -> *ats.Offer +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Offer` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.OffersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Offers.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*ats.OffersRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +## Ats Offices +
client.Ats.Offices.List() -> *ats.PaginatedOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Office` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.OfficesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.Offices.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ats.Offices.Retrieve(Id) -> *ats.Office +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Office` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.OfficesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Offices.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ats Passthrough +
client.Ats.Passthrough.Create(request) -> *ats.RemoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.DataPassthroughRequest{ + Method: ats.MethodEnumGet, + Path: "/scooters", + } +client.Ats.Passthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*ats.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +## Ats RegenerateKey +
client.Ats.RegenerateKey.Create(request) -> *ats.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } +client.Ats.RegenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Ats RejectReasons +
client.Ats.RejectReasons.List() -> *ats.PaginatedRejectReasonList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RejectReason` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.RejectReasonsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.RejectReasons.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ats.RejectReasons.Retrieve(Id) -> *ats.RejectReason +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `RejectReason` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.RejectReasonsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.RejectReasons.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ats Scorecards +
client.Ats.Scorecards.List() -> *ats.PaginatedScorecardList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Scorecard` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ScorecardsListRequest{ + ApplicationId: merge.String( + "application_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + InterviewId: merge.String( + "interview_id", + ), + InterviewerId: merge.String( + "interviewer_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.Scorecards.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**applicationId:** `*string` — If provided, will only return scorecards for this application. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ats.ScorecardsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**interviewId:** `*string` — If provided, will only return scorecards for this interview. + +
+
+ +
+
+ +**interviewerId:** `*string` — If provided, will only return scorecards for this interviewer. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Scorecards.Retrieve(Id) -> *ats.Scorecard +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Scorecard` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.ScorecardsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Scorecards.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*ats.ScorecardsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +## Ats SyncStatus +
client.Ats.SyncStatus.List() -> *ats.PaginatedSyncStatusList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } +client.Ats.SyncStatus.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Ats ForceResync +
client.Ats.ForceResync.SyncStatusResyncCreate() -> []*ats.SyncStatus +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ats Tags +
client.Ats.Tags.List() -> *ats.PaginatedTagList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Tag` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.TagsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.Tags.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +## Ats Users +
client.Ats.Users.List() -> *ats.PaginatedRemoteUserList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteUser` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.UsersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + Email: merge.String( + "email", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ats.Users.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**email:** `*string` — If provided, will only return remote users with the given email address + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ats.Users.Retrieve(Id) -> *ats.RemoteUser +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `RemoteUser` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.UsersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ats.Users.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +## Ats WebhookReceivers +
client.Ats.WebhookReceivers.List() -> []*ats.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `WebhookReceiver` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ats.WebhookReceivers.List( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Ats.WebhookReceivers.Create(request) -> *ats.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `WebhookReceiver` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ats.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } +client.Ats.WebhookReceivers.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**event:** `string` + +
+
+ +
+
+ +**isActive:** `bool` + +
+
+ +
+
+ +**key:** `*string` + +
+
+
+
+ + +
+
+
+ +## Accounting AccountDetails +
client.Accounting.AccountDetails.Retrieve() -> *accounting.AccountDetails +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details for a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.AccountDetails.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting AccountToken +
client.Accounting.AccountToken.Retrieve(PublicToken) -> *accounting.AccountToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the account token for the end user with the provided public token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**publicToken:** `string` + +
+
+
+
+ + +
+
+
+ +## Accounting AccountingPeriods +
client.Accounting.AccountingPeriods.List() -> *accounting.PaginatedAccountingPeriodList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `AccountingPeriod` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AccountingPeriodsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.AccountingPeriods.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.AccountingPeriods.Retrieve(Id) -> *accounting.AccountingPeriod +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `AccountingPeriod` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AccountingPeriodsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.AccountingPeriods.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting Accounts +
client.Accounting.Accounts.List() -> *accounting.PaginatedAccountList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Account` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AccountsListRequest{ + AccountType: merge.String( + "account_type", + ), + Classification: accounting.AccountsListRequestClassificationEmpty.Ptr(), + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: accounting.AccountsListRequestRemoteFieldsClassification.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: accounting.AccountsListRequestShowEnumOriginsClassification.Ptr(), + Status: accounting.AccountsListRequestStatusEmpty.Ptr(), + } +client.Accounting.Accounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountType:** `*string` — If provided, will only return accounts with the passed in enum. + +
+
+ +
+
+ +**classification:** `*accounting.AccountsListRequestClassification` — If provided, will only return accounts with this classification. + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return accounts for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return Accounts with this name. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*accounting.AccountsListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*accounting.AccountsListRequestShowEnumOrigins` — A comma separated list 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:** `*accounting.AccountsListRequestStatus` — If provided, will only return accounts with this status. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Accounts.Create(request) -> *accounting.AccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Account` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AccountEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.AccountRequest{}, + } +client.Accounting.Accounts.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.AccountRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Accounts.Retrieve(Id) -> *accounting.Account +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Account` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AccountsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: accounting.AccountsRetrieveRequestRemoteFieldsClassification.Ptr(), + ShowEnumOrigins: accounting.AccountsRetrieveRequestShowEnumOriginsClassification.Ptr(), + } +client.Accounting.Accounts.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*accounting.AccountsRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*accounting.AccountsRetrieveRequestShowEnumOrigins` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Accounts.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Account` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Accounts.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting Addresses +
client.Accounting.Addresses.Retrieve(Id) -> *accounting.Address +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Address` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AddressesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Addresses.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +## Accounting AsyncPassthrough +
client.Accounting.AsyncPassthrough.Create(request) -> *accounting.AsyncPassthroughReciept +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Asynchronously pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.DataPassthroughRequest{ + Method: accounting.MethodEnumGet, + Path: "/scooters", + } +client.Accounting.AsyncPassthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*accounting.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.AsyncPassthrough.Retrieve(AsyncPassthroughReceiptId) -> *accounting.AsyncPassthroughRetrieveResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves data from earlier async-passthrough POST request +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**asyncPassthroughReceiptId:** `string` + +
+
+
+
+ + +
+
+
+ +## Accounting AsyncTasks +
client.Accounting.AsyncTasks.Retrieve(Id) -> *accounting.AsyncPostTask +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `AsyncPostTask` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.AsyncTasks.Retrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +## Accounting Attachments +
client.Accounting.Attachments.List() -> *accounting.PaginatedAccountingAttachmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `AccountingAttachment` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AttachmentsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.Attachments.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return accounting attachments for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Attachments.Create(request) -> *accounting.AccountingAttachmentResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `AccountingAttachment` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AccountingAttachmentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.AccountingAttachmentRequest{}, + } +client.Accounting.Attachments.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.AccountingAttachmentRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Attachments.Retrieve(Id) -> *accounting.AccountingAttachment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `AccountingAttachment` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AttachmentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Attachments.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Attachments.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `AccountingAttachment` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Attachments.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting AuditTrail +
client.Accounting.AuditTrail.List() -> *accounting.PaginatedAuditLogEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of audit trail events. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } +client.Accounting.AuditTrail.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include audit trail events that occurred before this time + +
+
+ +
+
+ +**eventType:** `*string` — 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` + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include audit trail events that occurred after this time + +
+
+ +
+
+ +**userEmail:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +## Accounting AvailableActions +
client.Accounting.AvailableActions.Retrieve() -> *accounting.AvailableActions +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of models and actions available for an account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.AvailableActions.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting BalanceSheets +
client.Accounting.BalanceSheets.List() -> *accounting.PaginatedBalanceSheetList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `BalanceSheet` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.BalanceSheetsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.BalanceSheets.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return balance sheets for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.BalanceSheets.Retrieve(Id) -> *accounting.BalanceSheet +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `BalanceSheet` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.BalanceSheetsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.BalanceSheets.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting BankFeedAccounts +
client.Accounting.BankFeedAccounts.List() -> *accounting.PaginatedBankFeedAccountList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `BankFeedAccount` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.BankFeedAccountsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.BankFeedAccounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.BankFeedAccounts.Create(request) -> *accounting.BankFeedAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `BankFeedAccount` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.BankFeedAccountEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.BankFeedAccountRequest{}, + } +client.Accounting.BankFeedAccounts.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.BankFeedAccountRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.BankFeedAccounts.Retrieve(Id) -> *accounting.BankFeedAccount +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `BankFeedAccount` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.BankFeedAccountsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.BankFeedAccounts.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Accounting.BankFeedAccounts.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `BankFeedAccount` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.BankFeedAccounts.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting BankFeedTransactions +
client.Accounting.BankFeedTransactions.List() -> *accounting.PaginatedBankFeedTransactionList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `BankFeedTransaction` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.BankFeedTransactionsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsProcessed: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.BankFeedTransactions.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isProcessed:** `*bool` — If provided, will only return bank feed transactions with this is_processed value + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.BankFeedTransactions.Create(request) -> *accounting.BankFeedTransactionResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `BankFeedTransaction` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.BankFeedTransactionEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.BankFeedTransactionRequestRequest{}, + } +client.Accounting.BankFeedTransactions.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.BankFeedTransactionRequestRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.BankFeedTransactions.Retrieve(Id) -> *accounting.BankFeedTransaction +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `BankFeedTransaction` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.BankFeedTransactionsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.BankFeedTransactions.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Accounting.BankFeedTransactions.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `BankFeedTransaction` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.BankFeedTransactions.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting CashFlowStatements +
client.Accounting.CashFlowStatements.List() -> *accounting.PaginatedCashFlowStatementList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `CashFlowStatement` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.CashFlowStatementsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.CashFlowStatements.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return cash flow statements for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.CashFlowStatements.Retrieve(Id) -> *accounting.CashFlowStatement +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `CashFlowStatement` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.CashFlowStatementsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.CashFlowStatements.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting CompanyInfo +
client.Accounting.CompanyInfo.List() -> *accounting.PaginatedCompanyInfoList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `CompanyInfo` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.CompanyInfoListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.CompanyInfo.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.CompanyInfoListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.CompanyInfo.Retrieve(Id) -> *accounting.CompanyInfo +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `CompanyInfo` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.CompanyInfoRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.CompanyInfo.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.CompanyInfoRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting Contacts +
client.Accounting.Contacts.List() -> *accounting.PaginatedContactList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Contact` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ContactsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddress: merge.String( + "email_address", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCustomer: merge.String( + "is_customer", + ), + IsSupplier: merge.String( + "is_supplier", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: accounting.ContactsListRequestStatusEmpty.Ptr(), + } +client.Accounting.Contacts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return contacts for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**emailAddress:** `*string` — If provided, will only return Contacts that match this email. + +
+
+ +
+
+ +**expand:** `*accounting.ContactsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCustomer:** `*string` — If provided, will only return Contacts that are denoted as customers. + +
+
+ +
+
+ +**isSupplier:** `*string` — If provided, will only return Contacts that are denoted as suppliers. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return Contacts that match this name. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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:** `*accounting.ContactsListRequestStatus` — If provided, will only return Contacts that match this status. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Contacts.Create(request) -> *accounting.ContactResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Contact` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ContactEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.ContactRequest{}, + } +client.Accounting.Contacts.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.ContactRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Contacts.Retrieve(Id) -> *accounting.Contact +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Contact` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ContactsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Contacts.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.ContactsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Contacts.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Contact` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Contacts.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Accounting.Contacts.RemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ContactsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.Contacts.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Accounting CreditNotes +
client.Accounting.CreditNotes.List() -> *accounting.PaginatedCreditNoteList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `CreditNote` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.CreditNotesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: accounting.CreditNotesListRequestRemoteFieldsStatus.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: accounting.CreditNotesListRequestShowEnumOriginsStatus.Ptr(), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Accounting.CreditNotes.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return credit notes for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.CreditNotesListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*accounting.CreditNotesListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*accounting.CreditNotesListRequestShowEnumOrigins` — A comma separated list 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) + +
+
+ +
+
+ +**transactionDateAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**transactionDateBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.CreditNotes.Create(request) -> *accounting.CreditNoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `CreditNote` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.CreditNoteEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.CreditNoteRequest{}, + } +client.Accounting.CreditNotes.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.CreditNoteRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.CreditNotes.Retrieve(Id) -> *accounting.CreditNote +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `CreditNote` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.CreditNotesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: accounting.CreditNotesRetrieveRequestRemoteFieldsStatus.Ptr(), + ShowEnumOrigins: accounting.CreditNotesRetrieveRequestShowEnumOriginsStatus.Ptr(), + } +client.Accounting.CreditNotes.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.CreditNotesRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*accounting.CreditNotesRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*accounting.CreditNotesRetrieveRequestShowEnumOrigins` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Accounting.CreditNotes.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CreditNote` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.CreditNotes.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting Scopes +
client.Accounting.Scopes.DefaultScopesRetrieve() -> *accounting.CommonModelScopeApi +
+
+ +#### 📝 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). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Accounting.Scopes.LinkedAccountScopesRetrieve() -> *accounting.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Accounting.Scopes.LinkedAccountScopesCreate(request) -> *accounting.CommonModelScopeApi +
+
+ +#### 📝 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) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*accounting.IndividualCommonModelScopeDeserializerRequest{ + &accounting.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*accounting.ModelPermissionDeserializerRequest{ + "READ": &accounting.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &accounting.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &accounting.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &accounting.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*accounting.ModelPermissionDeserializerRequest{ + "WRITE": &accounting.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } +client.Accounting.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `[]*accounting.IndividualCommonModelScopeDeserializerRequest` — The common models you want to update the scopes for + +
+
+
+
+ + +
+
+
+ +## Accounting DeleteAccount +
client.Accounting.DeleteAccount.Delete() -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.DeleteAccount.Delete( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting Employees +
client.Accounting.Employees.List() -> *accounting.PaginatedEmployeeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Employee` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.EmployeesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.Employees.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Employees.Retrieve(Id) -> *accounting.Employee +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Employee` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.EmployeesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Employees.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting Expenses +
client.Accounting.Expenses.List() -> *accounting.PaginatedExpenseList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Expense` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ExpensesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Accounting.Expenses.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return expenses for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.ExpensesListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**transactionDateAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**transactionDateBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Expenses.Create(request) -> *accounting.ExpenseResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Expense` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ExpenseEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.ExpenseRequest{}, + } +client.Accounting.Expenses.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.ExpenseRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Expenses.Retrieve(Id) -> *accounting.Expense +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Expense` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ExpensesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Expenses.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.ExpensesRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Expenses.LinesRemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ExpensesLinesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.Expenses.LinesRemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Expenses.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Expense` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Expenses.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Accounting.Expenses.RemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ExpensesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.Expenses.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Accounting FieldMapping +
client.Accounting.FieldMapping.FieldMappingsRetrieve() -> *accounting.FieldMappingApiInstanceResponse +
+
+ +#### 📝 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/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } +client.Accounting.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.FieldMapping.FieldMappingsCreate(request) -> *accounting.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } +client.Accounting.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+ +
+
+ +**targetFieldName:** `string` — The name of the target field you want this remote field to map to. + +
+
+ +
+
+ +**targetFieldDescription:** `string` — The description of the target field you want this remote field to map to. + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `string` — The path of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**commonModelName:** `string` — The name of the Common Model that the remote field corresponds to in a given category. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.FieldMapping.FieldMappingsDestroy(FieldMappingId) -> *accounting.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.FieldMapping.FieldMappingsPartialUpdate(FieldMappingId, request) -> *accounting.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PatchedEditFieldMappingRequest{} +client.Accounting.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `*string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `*string` — The path of the remote endpoint where the remote field is coming from. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.FieldMapping.RemoteFieldsRetrieve() -> *accounting.RemoteFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } +client.Accounting.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `*string` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + +
+
+ +
+
+ +**includeExampleValues:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.FieldMapping.TargetFieldsRetrieve() -> *accounting.ExternalTargetFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting GeneralLedgerTransactions +
client.Accounting.GeneralLedgerTransactions.List() -> *accounting.PaginatedGeneralLedgerTransactionList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `GeneralLedgerTransaction` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.GeneralLedgerTransactionsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PostedDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PostedDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.GeneralLedgerTransactions.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return general ledger transactions for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.GeneralLedgerTransactionsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**postedDateAfter:** `*time.Time` — If provided, will only return objects posted after this datetime. + +
+
+ +
+
+ +**postedDateBefore:** `*time.Time` — If provided, will only return objects posted before this datetime. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.GeneralLedgerTransactions.Retrieve(Id) -> *accounting.GeneralLedgerTransaction +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `GeneralLedgerTransaction` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.GeneralLedgerTransactionsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.GeneralLedgerTransactions.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.GeneralLedgerTransactionsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting GenerateKey +
client.Accounting.GenerateKey.Create(request) -> *accounting.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } +client.Accounting.GenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Accounting IncomeStatements +
client.Accounting.IncomeStatements.List() -> *accounting.PaginatedIncomeStatementList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `IncomeStatement` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.IncomeStatementsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.IncomeStatements.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return income statements for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.IncomeStatements.Retrieve(Id) -> *accounting.IncomeStatement +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `IncomeStatement` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.IncomeStatementsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.IncomeStatements.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting Invoices +
client.Accounting.Invoices.List() -> *accounting.PaginatedInvoiceList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Invoice` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.InvoicesListRequest{ + CompanyId: merge.String( + "company_id", + ), + ContactId: merge.String( + "contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IssueDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IssueDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Number: merge.String( + "number", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: accounting.InvoicesListRequestStatusDraft.Ptr(), + Type: accounting.InvoicesListRequestTypeAccountsPayable.Ptr(), + } +client.Accounting.Invoices.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return invoices for this company. + +
+
+ +
+
+ +**contactId:** `*string` — If provided, will only return invoices for this contact. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.InvoicesListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**issueDateAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**issueDateBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**number:** `*string` — If provided, will only return Invoices with this number. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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:** `*accounting.InvoicesListRequestStatus` + +If provided, will only return Invoices with this status. + +* `PAID` - PAID +* `DRAFT` - DRAFT +* `SUBMITTED` - SUBMITTED +* `PARTIALLY_PAID` - PARTIALLY_PAID +* `OPEN` - OPEN +* `VOID` - VOID + +
+
+ +
+
+ +**type_:** `*accounting.InvoicesListRequestType` + +If provided, will only return Invoices with this type. + +* `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE +* `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Invoices.Create(request) -> *accounting.InvoiceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +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). + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.InvoiceEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.InvoiceRequest{}, + } +client.Accounting.Invoices.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.InvoiceRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Invoices.Retrieve(Id) -> *accounting.Invoice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Invoice` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.InvoicesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Invoices.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.InvoicesRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Invoices.PartialUpdate(Id, request) -> *accounting.InvoiceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an `Invoice` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PatchedInvoiceEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.InvoiceRequest{}, + } +client.Accounting.Invoices.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.InvoiceRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Invoices.LineItemsRemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.InvoicesLineItemsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.Invoices.LineItemsRemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Invoices.MetaPatchRetrieve(Id) -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Invoice` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Invoices.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Invoices.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Invoice` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Invoices.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Accounting.Invoices.RemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.InvoicesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.Invoices.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Accounting Issues +
client.Accounting.Issues.List() -> *accounting.PaginatedIssueList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets all issues for Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: accounting.IssuesListRequestStatusOngoing.Ptr(), + } +client.Accounting.Issues.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountToken:** `*string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include issues whose most recent action occurred before this time + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` + +
+
+ +
+
+ +**firstIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose first incident time was after this datetime. + +
+
+ +
+
+ +**firstIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose first incident time was before this datetime. + +
+
+ +
+
+ +**includeMuted:** `*string` — If true, will include muted issues + +
+
+ +
+
+ +**integrationName:** `*string` + +
+
+ +
+
+ +**lastIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose last incident time was after this datetime. + +
+
+ +
+
+ +**lastIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose last incident time was before this datetime. + +
+
+ +
+
+ +**linkedAccountId:** `*string` — If provided, will only include issues pertaining to the linked account passed in. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include issues whose most recent action occurred after this time + +
+
+ +
+
+ +**status:** `*accounting.IssuesListRequestStatus` + +Status of the issue. Options: ('ONGOING', 'RESOLVED') + +* `ONGOING` - ONGOING +* `RESOLVED` - RESOLVED + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Issues.Retrieve(Id) -> *accounting.Issue +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific issue. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Issues.Retrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +## Accounting Items +
client.Accounting.Items.List() -> *accounting.PaginatedItemList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Item` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ItemsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.Items.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return items for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.ItemsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Items.Create(request) -> *accounting.ItemResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Item` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ItemEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.ItemRequestRequest{}, + } +client.Accounting.Items.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.ItemRequestRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Items.Retrieve(Id) -> *accounting.Item +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Item` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ItemsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Items.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.ItemsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Items.PartialUpdate(Id, request) -> *accounting.ItemResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an `Item` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PatchedItemEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.PatchedItemRequestRequest{}, + } +client.Accounting.Items.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.PatchedItemRequestRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Items.MetaPatchRetrieve(Id) -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Item` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Items.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Items.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Item` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Items.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting JournalEntries +
client.Accounting.JournalEntries.List() -> *accounting.PaginatedJournalEntryList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `JournalEntry` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.JournalEntriesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Accounting.JournalEntries.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return journal entries for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.JournalEntriesListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**transactionDateAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**transactionDateBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.JournalEntries.Create(request) -> *accounting.JournalEntryResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `JournalEntry` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.JournalEntryEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.JournalEntryRequest{}, + } +client.Accounting.JournalEntries.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.JournalEntryRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.JournalEntries.Retrieve(Id) -> *accounting.JournalEntry +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `JournalEntry` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.JournalEntriesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.JournalEntries.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.JournalEntriesRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Accounting.JournalEntries.LinesRemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.JournalEntriesLinesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.JournalEntries.LinesRemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.JournalEntries.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `JournalEntry` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.JournalEntries.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Accounting.JournalEntries.RemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.JournalEntriesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.JournalEntries.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Accounting LinkToken +
client.Accounting.LinkToken.Create(request) -> *accounting.LinkToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a link token to be used when linking a new end user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []accounting.CategoriesEnum{ + accounting.CategoriesEnumHris, + accounting.CategoriesEnumAts, + }, + } +client.Accounting.LinkToken.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**endUserEmailAddress:** `string` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + +
+
+ +
+
+ +**endUserOrganizationName:** `string` — Your end user's organization. + +
+
+ +
+
+ +**endUserOriginId:** `string` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + +
+
+ +
+
+ +**categories:** `[]*accounting.CategoriesEnum` — The integration categories to show in Merge Link. + +
+
+ +
+
+ +**integration:** `*string` — 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/. + +
+
+ +
+
+ +**linkExpiryMins:** `*int` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + +
+
+ +
+
+ +**shouldCreateMagicLinkUrl:** `*bool` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**hideAdminMagicLink:** `*bool` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**commonModels:** `[]*accounting.CommonModelScopesBodyRequest` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + +
+
+ +
+
+ +**categoryCommonModelScopes:** `map[string][]*accounting.IndividualCommonModelScopeDeserializerRequest` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + +
+
+ +
+
+ +**language:** `*accounting.EndUserDetailsRequestLanguage` + +The following subset of IETF language tags can be used to configure localization. + +* `en` - en +* `de` - de + +
+
+ +
+
+ +**areSyncsDisabled:** `*bool` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. + +
+
+ +
+
+ +**integrationSpecificConfig:** `map[string]any` — A JSON object containing integration-specific configuration options. + +
+
+
+
+ + +
+
+
+ +## Accounting LinkedAccounts +
client.Accounting.LinkedAccounts.List() -> *accounting.PaginatedAccountDetailsAndActionsList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List linked accounts for your organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.LinkedAccountsListRequest{ + Category: accounting.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } +client.Accounting.LinkedAccounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**category:** `*accounting.LinkedAccountsListRequestCategory` + +Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` + +* `hris` - hris +* `ats` - ats +* `accounting` - accounting +* `ticketing` - ticketing +* `crm` - crm +* `mktg` - mktg +* `filestorage` - filestorage + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endUserEmailAddress:** `*string` — If provided, will only return linked accounts associated with the given email address. + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` — If provided, will only return linked accounts associated with the given organization name. + +
+
+ +
+
+ +**endUserOriginId:** `*string` — If provided, will only return linked accounts associated with the given origin ID. + +
+
+ +
+
+ +**endUserOriginIds:** `*string` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + +
+
+ +
+
+ +**id:** `*string` + +
+
+ +
+
+ +**ids:** `*string` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + +
+
+ +
+
+ +**includeDuplicates:** `*bool` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + +
+
+ +
+
+ +**integrationName:** `*string` — If provided, will only return linked accounts associated with the given integration name. + +
+
+ +
+
+ +**isTestAccount:** `*string` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**status:** `*string` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + +
+
+
+
+ + +
+
+
+ +## Accounting Passthrough +
client.Accounting.Passthrough.Create(request) -> *accounting.RemoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.DataPassthroughRequest{ + Method: accounting.MethodEnumGet, + Path: "/scooters", + } +client.Accounting.Passthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*accounting.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +## Accounting PaymentMethods +
client.Accounting.PaymentMethods.List() -> *accounting.PaginatedPaymentMethodList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `PaymentMethod` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PaymentMethodsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.PaymentMethods.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.PaymentMethods.Retrieve(Id) -> *accounting.PaymentMethod +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `PaymentMethod` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PaymentMethodsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.PaymentMethods.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting PaymentTerms +
client.Accounting.PaymentTerms.List() -> *accounting.PaginatedPaymentTermList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `PaymentTerm` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PaymentTermsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.PaymentTerms.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.PaymentTerms.Retrieve(Id) -> *accounting.PaymentTerm +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `PaymentTerm` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PaymentTermsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.PaymentTerms.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting Payments +
client.Accounting.Payments.List() -> *accounting.PaginatedPaymentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Payment` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PaymentsListRequest{ + AccountId: merge.String( + "account_id", + ), + CompanyId: merge.String( + "company_id", + ), + ContactId: merge.String( + "contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Accounting.Payments.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountId:** `*string` — If provided, will only return payments for this account. + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return payments for this company. + +
+
+ +
+
+ +**contactId:** `*string` — If provided, will only return payments for this contact. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.PaymentsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**transactionDateAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**transactionDateBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Payments.Create(request) -> *accounting.PaymentResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Payment` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PaymentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.PaymentRequest{}, + } +client.Accounting.Payments.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.PaymentRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Payments.Retrieve(Id) -> *accounting.Payment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Payment` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PaymentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Payments.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.PaymentsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Payments.PartialUpdate(Id, request) -> *accounting.PaymentResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a `Payment` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PatchedPaymentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.PatchedPaymentRequest{}, + } +client.Accounting.Payments.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.PatchedPaymentRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Payments.LineItemsRemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PaymentsLineItemsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.Payments.LineItemsRemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Payments.MetaPatchRetrieve(Id) -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Payment` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Payments.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Payments.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Payment` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.Payments.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Accounting.Payments.RemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PaymentsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.Payments.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Accounting PhoneNumbers +
client.Accounting.PhoneNumbers.Retrieve(Id) -> *accounting.AccountingPhoneNumber +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `AccountingPhoneNumber` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PhoneNumbersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.PhoneNumbers.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting Projects +
client.Accounting.Projects.List() -> *accounting.PaginatedProjectList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Project` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ProjectsListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.Projects.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.ProjectsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Projects.Retrieve(Id) -> *accounting.Project +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Project` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.ProjectsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Projects.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.ProjectsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting PurchaseOrders +
client.Accounting.PurchaseOrders.List() -> *accounting.PaginatedPurchaseOrderList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `PurchaseOrder` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PurchaseOrdersListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IssueDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IssueDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.PurchaseOrders.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return purchase orders for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.PurchaseOrdersListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**issueDateAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**issueDateBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Accounting.PurchaseOrders.Create(request) -> *accounting.PurchaseOrderResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `PurchaseOrder` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PurchaseOrderEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.PurchaseOrderRequest{}, + } +client.Accounting.PurchaseOrders.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.PurchaseOrderRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.PurchaseOrders.Retrieve(Id) -> *accounting.PurchaseOrder +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `PurchaseOrder` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PurchaseOrdersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.PurchaseOrders.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.PurchaseOrdersRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Accounting.PurchaseOrders.LineItemsRemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PurchaseOrdersLineItemsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.PurchaseOrders.LineItemsRemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.PurchaseOrders.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `PurchaseOrder` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.PurchaseOrders.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Accounting.PurchaseOrders.RemoteFieldClassesList() -> *accounting.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.PurchaseOrdersRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.PurchaseOrders.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Accounting RegenerateKey +
client.Accounting.RegenerateKey.Create(request) -> *accounting.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } +client.Accounting.RegenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Accounting SyncStatus +
client.Accounting.SyncStatus.List() -> *accounting.PaginatedSyncStatusList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } +client.Accounting.SyncStatus.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Accounting ForceResync +
client.Accounting.ForceResync.SyncStatusResyncCreate() -> []*accounting.SyncStatus +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting TaxRates +
client.Accounting.TaxRates.List() -> *accounting.PaginatedTaxRateList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `TaxRate` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.TaxRatesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Accounting.TaxRates.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return tax rates for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return TaxRates with this name. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.TaxRates.Retrieve(Id) -> *accounting.TaxRate +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `TaxRate` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.TaxRatesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.TaxRates.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting TrackingCategories +
client.Accounting.TrackingCategories.List() -> *accounting.PaginatedTrackingCategoryList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `TrackingCategory` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.TrackingCategoriesListRequest{ + CategoryType: accounting.TrackingCategoriesListRequestCategoryTypeEmpty.Ptr(), + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Status: accounting.TrackingCategoriesListRequestStatusEmpty.Ptr(), + } +client.Accounting.TrackingCategories.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**categoryType:** `*accounting.TrackingCategoriesListRequestCategoryType` — If provided, will only return tracking categories with this type. + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return tracking categories for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return tracking categories with this name. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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:** `*accounting.TrackingCategoriesListRequestStatus` — If provided, will only return tracking categories with this status. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.TrackingCategories.Retrieve(Id) -> *accounting.TrackingCategory +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `TrackingCategory` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.TrackingCategoriesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.TrackingCategories.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +## Accounting Transactions +
client.Accounting.Transactions.List() -> *accounting.PaginatedTransactionList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Transaction` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.TransactionsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Accounting.Transactions.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return accounting transactions for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.TransactionsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**transactionDateAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**transactionDateBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.Transactions.Retrieve(Id) -> *accounting.Transaction +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Transaction` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.TransactionsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.Transactions.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.TransactionsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Accounting VendorCredits +
client.Accounting.VendorCredits.List() -> *accounting.PaginatedVendorCreditList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `VendorCredit` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.VendorCreditsListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + TransactionDateAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TransactionDateBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Accounting.VendorCredits.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return vendor credits for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*accounting.VendorCreditsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**transactionDateAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**transactionDateBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Accounting.VendorCredits.Create(request) -> *accounting.VendorCreditResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `VendorCredit` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.VendorCreditEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &accounting.VendorCreditRequest{}, + } +client.Accounting.VendorCredits.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*accounting.VendorCreditRequest` + +
+
+
+
+ + +
+
+
+ +
client.Accounting.VendorCredits.Retrieve(Id) -> *accounting.VendorCredit +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `VendorCredit` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.VendorCreditsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Accounting.VendorCredits.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*accounting.VendorCreditsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Accounting.VendorCredits.MetaPostRetrieve() -> *accounting.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `VendorCredit` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.VendorCredits.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Accounting WebhookReceivers +
client.Accounting.WebhookReceivers.List() -> []*accounting.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `WebhookReceiver` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Accounting.WebhookReceivers.List( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Accounting.WebhookReceivers.Create(request) -> *accounting.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `WebhookReceiver` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &accounting.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } +client.Accounting.WebhookReceivers.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**event:** `string` + +
+
+ +
+
+ +**isActive:** `bool` + +
+
+ +
+
+ +**key:** `*string` + +
+
+
+
+ + +
+
+
+ +## Crm AccountDetails +
client.Crm.AccountDetails.Retrieve() -> *crm.AccountDetails +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details for a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.AccountDetails.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Crm AccountToken +
client.Crm.AccountToken.Retrieve(PublicToken) -> *crm.AccountToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the account token for the end user with the provided public token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**publicToken:** `string` + +
+
+
+
+ + +
+
+
+ +## Crm Accounts +
client.Crm.Accounts.List() -> *crm.PaginatedAccountList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Account` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.AccountsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + OwnerId: merge.String( + "owner_id", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.Accounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return accounts with this name. + +
+
+ +
+
+ +**ownerId:** `*string` — If provided, will only return accounts with this owner. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.Create(request) -> *crm.CrmAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Account` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CrmAccountEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.AccountRequest{}, + } +client.Crm.Accounts.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.AccountRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.Retrieve(Id) -> *crm.Account +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Account` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.AccountsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.Accounts.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.PartialUpdate(Id, request) -> *crm.CrmAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an `Account` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.PatchedCrmAccountEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedAccountRequest{}, + } +client.Crm.Accounts.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.PatchedAccountRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.MetaPatchRetrieve(Id) -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMAccount` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Accounts.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.MetaPostRetrieve() -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMAccount` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Accounts.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.AccountsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.Accounts.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm AsyncPassthrough +
client.Crm.AsyncPassthrough.Create(request) -> *crm.AsyncPassthroughReciept +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Asynchronously pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.DataPassthroughRequest{ + Method: crm.MethodEnumGet, + Path: "/scooters", + } +client.Crm.AsyncPassthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*crm.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.AsyncPassthrough.Retrieve(AsyncPassthroughReceiptId) -> *crm.AsyncPassthroughRetrieveResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves data from earlier async-passthrough POST request +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**asyncPassthroughReceiptId:** `string` + +
+
+
+
+ + +
+
+
+ +## Crm AuditTrail +
client.Crm.AuditTrail.List() -> *crm.PaginatedAuditLogEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of audit trail events. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } +client.Crm.AuditTrail.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include audit trail events that occurred before this time + +
+
+ +
+
+ +**eventType:** `*string` — 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` + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include audit trail events that occurred after this time + +
+
+ +
+
+ +**userEmail:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +## Crm AvailableActions +
client.Crm.AvailableActions.Retrieve() -> *crm.AvailableActions +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of models and actions available for an account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.AvailableActions.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Crm Contacts +
client.Crm.Contacts.List() -> *crm.PaginatedContactList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Contact` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.ContactsListRequest{ + AccountId: merge.String( + "account_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddresses: merge.String( + "email_addresses", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PhoneNumbers: merge.String( + "phone_numbers", + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.Contacts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountId:** `*string` — If provided, will only return contacts with this account. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**emailAddresses:** `*string` — If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas. + +
+
+ +
+
+ +**expand:** `*crm.ContactsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**phoneNumbers:** `*string` — If provided, will only return contacts matching the phone numbers; multiple phone numbers can be separated by commas. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.Create(request) -> *crm.CrmContactResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Contact` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CrmContactEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.ContactRequest{}, + } +client.Crm.Contacts.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.ContactRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.Retrieve(Id) -> *crm.Contact +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Contact` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.ContactsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.Contacts.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*crm.ContactsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.PartialUpdate(Id, request) -> *crm.CrmContactResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a `Contact` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.PatchedCrmContactEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedContactRequest{}, + } +client.Crm.Contacts.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.PatchedContactRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.IgnoreCreate(ModelId, request) -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.IgnoreCommonModelRequest{ + Reason: &crm.IgnoreCommonModelRequestReason{ + ReasonEnum: crm.ReasonEnumGeneralCustomerRequest, + }, + } +client.Crm.Contacts.IgnoreCreate( + context.TODO(), + "model_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**modelId:** `string` + +
+
+ +
+
+ +**request:** `*crm.IgnoreCommonModelRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.MetaPatchRetrieve(Id) -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMContact` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Contacts.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.MetaPostRetrieve() -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMContact` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Contacts.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.ContactsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.Contacts.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm CustomObjectClasses +
client.Crm.CustomObjectClasses.List() -> *crm.PaginatedCustomObjectClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `CustomObjectClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CustomObjectClassesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.CustomObjectClasses.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjectClasses.Retrieve(Id) -> *crm.CustomObjectClass +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `CustomObjectClass` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CustomObjectClassesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.CustomObjectClasses.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Crm AssociationTypes +
client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesList(CustomObjectClassId) -> *crm.PaginatedAssociationTypeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `AssociationType` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CustomObjectClassesAssociationTypesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesList( + context.TODO(), + "custom_object_class_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesCreate(CustomObjectClassId, request) -> *crm.CrmAssociationTypeResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `AssociationType` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CrmAssociationTypeEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.AssociationTypeRequestRequest{ + SourceObjectClass: &crm.ObjectClassDescriptionRequest{ + Id: "id", + OriginType: crm.OriginTypeEnumCustomObject, + }, + TargetObjectClasses: []*crm.ObjectClassDescriptionRequest{ + &crm.ObjectClassDescriptionRequest{ + Id: "id", + OriginType: crm.OriginTypeEnumCustomObject, + }, + }, + RemoteKeyName: "remote_key_name", + }, + } +client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesCreate( + context.TODO(), + "custom_object_class_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.AssociationTypeRequestRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesRetrieve(CustomObjectClassId, Id) -> *crm.AssociationType +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `AssociationType` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CustomObjectClassesAssociationTypesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesRetrieve( + context.TODO(), + "custom_object_class_id", + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesMetaPostRetrieve(CustomObjectClassId) -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMAssociationType` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesMetaPostRetrieve( + context.TODO(), + "custom_object_class_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+
+
+ + +
+
+
+ +## Crm CustomObjects +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsList(CustomObjectClassId) -> *crm.PaginatedCustomObjectList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `CustomObject` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CustomObjectClassesCustomObjectsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.CustomObjects.CustomObjectClassesCustomObjectsList( + context.TODO(), + "custom_object_class_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsCreate(CustomObjectClassId, request) -> *crm.CrmCustomObjectResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `CustomObject` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CrmCustomObjectEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.CustomObjectRequest{ + Fields: map[string]any{ + "test_field": "hello", + }, + }, + } +client.Crm.CustomObjects.CustomObjectClassesCustomObjectsCreate( + context.TODO(), + "custom_object_class_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.CustomObjectRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRetrieve(CustomObjectClassId, Id) -> *crm.CustomObject +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `CustomObject` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CustomObjectClassesCustomObjectsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRetrieve( + context.TODO(), + "custom_object_class_id", + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsMetaPostRetrieve(CustomObjectClassId) -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMCustomObject` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.CustomObjects.CustomObjectClassesCustomObjectsMetaPostRetrieve( + context.TODO(), + "custom_object_class_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm Associations +
client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsList(CustomObjectClassId, ObjectId) -> *crm.PaginatedAssociationList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Association` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CustomObjectClassesCustomObjectsAssociationsListRequest{ + AssociationTypeId: merge.String( + "association_type_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsList( + context.TODO(), + "custom_object_class_id", + "object_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**objectId:** `string` + +
+
+ +
+
+ +**associationTypeId:** `*string` — If provided, will only return opportunities with this association_type. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsUpdate(SourceClassId, SourceObjectId, TargetClassId, TargetObjectId, AssociationTypeId) -> *crm.Association +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an Association between `source_object_id` and `target_object_id` of type `association_type_id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CustomObjectClassesCustomObjectsAssociationsUpdateRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + } +client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsUpdate( + context.TODO(), + "source_class_id", + "source_object_id", + "target_class_id", + "target_object_id", + "association_type_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**sourceClassId:** `string` + +
+
+ +
+
+ +**sourceObjectId:** `string` + +
+
+ +
+
+ +**targetClassId:** `string` + +
+
+ +
+
+ +**targetObjectId:** `string` + +
+
+ +
+
+ +**associationTypeId:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+
+
+ + +
+
+
+ +## Crm Scopes +
client.Crm.Scopes.DefaultScopesRetrieve() -> *crm.CommonModelScopeApi +
+
+ +#### 📝 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). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Scopes.LinkedAccountScopesRetrieve() -> *crm.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Scopes.LinkedAccountScopesCreate(request) -> *crm.CommonModelScopeApi +
+
+ +#### 📝 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) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*crm.IndividualCommonModelScopeDeserializerRequest{ + &crm.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*crm.ModelPermissionDeserializerRequest{ + "READ": &crm.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &crm.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &crm.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &crm.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*crm.ModelPermissionDeserializerRequest{ + "WRITE": &crm.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } +client.Crm.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `[]*crm.IndividualCommonModelScopeDeserializerRequest` — The common models you want to update the scopes for + +
+
+
+
+ + +
+
+
+ +## Crm DeleteAccount +
client.Crm.DeleteAccount.Delete() -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.DeleteAccount.Delete( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Crm EngagementTypes +
client.Crm.EngagementTypes.List() -> *crm.PaginatedEngagementTypeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `EngagementType` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.EngagementTypesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.EngagementTypes.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.EngagementTypes.Retrieve(Id) -> *crm.EngagementType +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `EngagementType` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.EngagementTypesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.EngagementTypes.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.EngagementTypes.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.EngagementTypesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.EngagementTypes.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm Engagements +
client.Crm.Engagements.List() -> *crm.PaginatedEngagementList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Engagement` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.EngagementsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Crm.Engagements.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*crm.EngagementsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**startedAfter:** `*time.Time` — If provided, will only return engagements started after this datetime. + +
+
+ +
+
+ +**startedBefore:** `*time.Time` — If provided, will only return engagements started before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.Create(request) -> *crm.EngagementResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Engagement` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.EngagementEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.EngagementRequest{}, + } +client.Crm.Engagements.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.EngagementRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.Retrieve(Id) -> *crm.Engagement +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Engagement` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.EngagementsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.Engagements.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*crm.EngagementsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.PartialUpdate(Id, request) -> *crm.EngagementResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an `Engagement` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.PatchedEngagementEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedEngagementRequest{}, + } +client.Crm.Engagements.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.PatchedEngagementRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.MetaPatchRetrieve(Id) -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Engagement` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Engagements.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.MetaPostRetrieve() -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Engagement` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Engagements.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.EngagementsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.Engagements.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm FieldMapping +
client.Crm.FieldMapping.FieldMappingsRetrieve() -> *crm.FieldMappingApiInstanceResponse +
+
+ +#### 📝 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/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } +client.Crm.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+
+
+ + +
+
+
+ +
client.Crm.FieldMapping.FieldMappingsCreate(request) -> *crm.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } +client.Crm.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+ +
+
+ +**targetFieldName:** `string` — The name of the target field you want this remote field to map to. + +
+
+ +
+
+ +**targetFieldDescription:** `string` — The description of the target field you want this remote field to map to. + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `string` — The path of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**commonModelName:** `string` — The name of the Common Model that the remote field corresponds to in a given category. + +
+
+
+
+ + +
+
+
+ +
client.Crm.FieldMapping.FieldMappingsDestroy(FieldMappingId) -> *crm.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.FieldMapping.FieldMappingsPartialUpdate(FieldMappingId, request) -> *crm.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.PatchedEditFieldMappingRequest{} +client.Crm.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `*string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `*string` — The path of the remote endpoint where the remote field is coming from. + +
+
+
+
+ + +
+
+
+ +
client.Crm.FieldMapping.RemoteFieldsRetrieve() -> *crm.RemoteFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } +client.Crm.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `*string` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + +
+
+ +
+
+ +**includeExampleValues:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +
client.Crm.FieldMapping.TargetFieldsRetrieve() -> *crm.ExternalTargetFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Crm GenerateKey +
client.Crm.GenerateKey.Create(request) -> *crm.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } +client.Crm.GenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Crm Issues +
client.Crm.Issues.List() -> *crm.PaginatedIssueList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets all issues for Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: crm.IssuesListRequestStatusOngoing.Ptr(), + } +client.Crm.Issues.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountToken:** `*string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include issues whose most recent action occurred before this time + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` + +
+
+ +
+
+ +**firstIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose first incident time was after this datetime. + +
+
+ +
+
+ +**firstIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose first incident time was before this datetime. + +
+
+ +
+
+ +**includeMuted:** `*string` — If true, will include muted issues + +
+
+ +
+
+ +**integrationName:** `*string` + +
+
+ +
+
+ +**lastIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose last incident time was after this datetime. + +
+
+ +
+
+ +**lastIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose last incident time was before this datetime. + +
+
+ +
+
+ +**linkedAccountId:** `*string` — If provided, will only include issues pertaining to the linked account passed in. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include issues whose most recent action occurred after this time + +
+
+ +
+
+ +**status:** `*crm.IssuesListRequestStatus` + +Status of the issue. Options: ('ONGOING', 'RESOLVED') + +* `ONGOING` - ONGOING +* `RESOLVED` - RESOLVED + +
+
+
+
+ + +
+
+
+ +
client.Crm.Issues.Retrieve(Id) -> *crm.Issue +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific issue. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Issues.Retrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +## Crm Leads +
client.Crm.Leads.List() -> *crm.PaginatedLeadList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Lead` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.LeadsListRequest{ + ConvertedAccountId: merge.String( + "converted_account_id", + ), + ConvertedContactId: merge.String( + "converted_contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddresses: merge.String( + "email_addresses", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OwnerId: merge.String( + "owner_id", + ), + PageSize: merge.Int( + 1, + ), + PhoneNumbers: merge.String( + "phone_numbers", + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.Leads.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**convertedAccountId:** `*string` — If provided, will only return leads with this account. + +
+
+ +
+
+ +**convertedContactId:** `*string` — If provided, will only return leads with this contact. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**emailAddresses:** `*string` — If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas. + +
+
+ +
+
+ +**expand:** `*crm.LeadsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**ownerId:** `*string` — If provided, will only return leads with this owner. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**phoneNumbers:** `*string` — If provided, will only return contacts matching the phone numbers; multiple phone numbers can be separated by commas. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.Leads.Create(request) -> *crm.LeadResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Lead` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.LeadEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.LeadRequest{}, + } +client.Crm.Leads.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.LeadRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Leads.Retrieve(Id) -> *crm.Lead +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Lead` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.LeadsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.Leads.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*crm.LeadsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.Leads.MetaPostRetrieve() -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Lead` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Leads.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Leads.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.LeadsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.Leads.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm LinkToken +
client.Crm.LinkToken.Create(request) -> *crm.LinkToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a link token to be used when linking a new end user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []crm.CategoriesEnum{ + crm.CategoriesEnumHris, + crm.CategoriesEnumAts, + }, + } +client.Crm.LinkToken.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**endUserEmailAddress:** `string` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + +
+
+ +
+
+ +**endUserOrganizationName:** `string` — Your end user's organization. + +
+
+ +
+
+ +**endUserOriginId:** `string` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + +
+
+ +
+
+ +**categories:** `[]*crm.CategoriesEnum` — The integration categories to show in Merge Link. + +
+
+ +
+
+ +**integration:** `*string` — 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/. + +
+
+ +
+
+ +**linkExpiryMins:** `*int` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + +
+
+ +
+
+ +**shouldCreateMagicLinkUrl:** `*bool` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**hideAdminMagicLink:** `*bool` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**commonModels:** `[]*crm.CommonModelScopesBodyRequest` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + +
+
+ +
+
+ +**categoryCommonModelScopes:** `map[string][]*crm.IndividualCommonModelScopeDeserializerRequest` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + +
+
+ +
+
+ +**language:** `*crm.EndUserDetailsRequestLanguage` + +The following subset of IETF language tags can be used to configure localization. + +* `en` - en +* `de` - de + +
+
+ +
+
+ +**areSyncsDisabled:** `*bool` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. + +
+
+ +
+
+ +**integrationSpecificConfig:** `map[string]any` — A JSON object containing integration-specific configuration options. + +
+
+
+
+ + +
+
+
+ +## Crm LinkedAccounts +
client.Crm.LinkedAccounts.List() -> *crm.PaginatedAccountDetailsAndActionsList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List linked accounts for your organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.LinkedAccountsListRequest{ + Category: crm.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } +client.Crm.LinkedAccounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**category:** `*crm.LinkedAccountsListRequestCategory` + +Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` + +* `hris` - hris +* `ats` - ats +* `accounting` - accounting +* `ticketing` - ticketing +* `crm` - crm +* `mktg` - mktg +* `filestorage` - filestorage + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endUserEmailAddress:** `*string` — If provided, will only return linked accounts associated with the given email address. + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` — If provided, will only return linked accounts associated with the given organization name. + +
+
+ +
+
+ +**endUserOriginId:** `*string` — If provided, will only return linked accounts associated with the given origin ID. + +
+
+ +
+
+ +**endUserOriginIds:** `*string` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + +
+
+ +
+
+ +**id:** `*string` + +
+
+ +
+
+ +**ids:** `*string` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + +
+
+ +
+
+ +**includeDuplicates:** `*bool` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + +
+
+ +
+
+ +**integrationName:** `*string` — If provided, will only return linked accounts associated with the given integration name. + +
+
+ +
+
+ +**isTestAccount:** `*string` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**status:** `*string` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + +
+
+
+
+ + +
+
+
+ +## Crm Notes +
client.Crm.Notes.List() -> *crm.PaginatedNoteList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Note` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.NotesListRequest{ + AccountId: merge.String( + "account_id", + ), + ContactId: merge.String( + "contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OpportunityId: merge.String( + "opportunity_id", + ), + OwnerId: merge.String( + "owner_id", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.Notes.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountId:** `*string` — If provided, will only return notes with this account. + +
+
+ +
+
+ +**contactId:** `*string` — If provided, will only return notes with this contact. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*crm.NotesListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**opportunityId:** `*string` — If provided, will only return notes with this opportunity. + +
+
+ +
+
+ +**ownerId:** `*string` — If provided, will only return notes with this owner. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.Notes.Create(request) -> *crm.NoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Note` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.NoteEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.NoteRequest{}, + } +client.Crm.Notes.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.NoteRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Notes.Retrieve(Id) -> *crm.Note +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Note` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.NotesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.Notes.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*crm.NotesRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.Notes.MetaPostRetrieve() -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Note` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Notes.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Notes.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.NotesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.Notes.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm Opportunities +
client.Crm.Opportunities.List() -> *crm.PaginatedOpportunityList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Opportunity` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.OpportunitiesListRequest{ + AccountId: merge.String( + "account_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OwnerId: merge.String( + "owner_id", + ), + PageSize: merge.Int( + 1, + ), + RemoteCreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteId: merge.String( + "remote_id", + ), + StageId: merge.String( + "stage_id", + ), + Status: crm.OpportunitiesListRequestStatusLost.Ptr(), + } +client.Crm.Opportunities.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountId:** `*string` — If provided, will only return opportunities with this account. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*crm.OpportunitiesListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**ownerId:** `*string` — If provided, will only return opportunities with this owner. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteCreatedAfter:** `*time.Time` — If provided, will only return opportunities created in the third party platform after this datetime. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+ +
+
+ +**stageId:** `*string` — If provided, will only return opportunities with this stage. + +
+
+ +
+
+ +**status:** `*crm.OpportunitiesListRequestStatus` + +If provided, will only return opportunities with this status. Options: ('OPEN', 'WON', 'LOST') + +* `OPEN` - OPEN +* `WON` - WON +* `LOST` - LOST + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.Create(request) -> *crm.OpportunityResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Opportunity` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.OpportunityEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.OpportunityRequest{}, + } +client.Crm.Opportunities.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.OpportunityRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.Retrieve(Id) -> *crm.Opportunity +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Opportunity` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.OpportunitiesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.Opportunities.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*crm.OpportunitiesRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.PartialUpdate(Id, request) -> *crm.OpportunityResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an `Opportunity` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.PatchedOpportunityEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedOpportunityRequest{}, + } +client.Crm.Opportunities.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.PatchedOpportunityRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.MetaPatchRetrieve(Id) -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Opportunity` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Opportunities.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.MetaPostRetrieve() -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Opportunity` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Opportunities.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.OpportunitiesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.Opportunities.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm Passthrough +
client.Crm.Passthrough.Create(request) -> *crm.RemoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.DataPassthroughRequest{ + Method: crm.MethodEnumGet, + Path: "/scooters", + } +client.Crm.Passthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*crm.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +## Crm RegenerateKey +
client.Crm.RegenerateKey.Create(request) -> *crm.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } +client.Crm.RegenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Crm Stages +
client.Crm.Stages.List() -> *crm.PaginatedStageList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Stage` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.StagesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.Stages.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.Stages.Retrieve(Id) -> *crm.Stage +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Stage` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.StagesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.Stages.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.Stages.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.StagesRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.Stages.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm SyncStatus +
client.Crm.SyncStatus.List() -> *crm.PaginatedSyncStatusList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.SyncStatus.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm ForceResync +
client.Crm.ForceResync.SyncStatusResyncCreate() -> []*crm.SyncStatus +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Crm Tasks +
client.Crm.Tasks.List() -> *crm.PaginatedTaskList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Task` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.TasksListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.Tasks.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*crm.TasksListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.Create(request) -> *crm.TaskResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Task` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.TaskEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.TaskRequest{}, + } +client.Crm.Tasks.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.TaskRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.Retrieve(Id) -> *crm.Task +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Task` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.TasksRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.Tasks.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*crm.TasksRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.PartialUpdate(Id, request) -> *crm.TaskResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a `Task` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.PatchedTaskEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &crm.PatchedTaskRequest{}, + } +client.Crm.Tasks.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*crm.PatchedTaskRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.MetaPatchRetrieve(Id) -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Task` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Tasks.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.MetaPostRetrieve() -> *crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Task` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.Tasks.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.TasksRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.Tasks.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm Users +
client.Crm.Users.List() -> *crm.PaginatedUserList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `User` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.UsersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + Email: merge.String( + "email", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Crm.Users.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**email:** `*string` — If provided, will only return users with this email. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Crm.Users.Retrieve(Id) -> *crm.User +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `User` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.UsersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Crm.Users.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Crm.Users.IgnoreCreate(ModelId, request) -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.IgnoreCommonModelRequest{ + Reason: &crm.IgnoreCommonModelRequestReason{ + ReasonEnum: crm.ReasonEnumGeneralCustomerRequest, + }, + } +client.Crm.Users.IgnoreCreate( + context.TODO(), + "model_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**modelId:** `string` + +
+
+ +
+
+ +**request:** `*crm.IgnoreCommonModelRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Users.RemoteFieldClassesList() -> *crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.UsersRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Crm.Users.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Crm WebhookReceivers +
client.Crm.WebhookReceivers.List() -> []*crm.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `WebhookReceiver` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Crm.WebhookReceivers.List( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.WebhookReceivers.Create(request) -> *crm.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `WebhookReceiver` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &crm.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } +client.Crm.WebhookReceivers.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**event:** `string` + +
+
+ +
+
+ +**isActive:** `bool` + +
+
+ +
+
+ +**key:** `*string` + +
+
+
+
+ + +
+
+
+ +## FileStorage AccountDetails +
client.FileStorage.AccountDetails.Retrieve() -> *filestorage.AccountDetails +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details for a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.AccountDetails.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## FileStorage AccountToken +
client.FileStorage.AccountToken.Retrieve(PublicToken) -> *filestorage.AccountToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the account token for the end user with the provided public token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**publicToken:** `string` + +
+
+
+
+ + +
+
+
+ +## FileStorage AsyncPassthrough +
client.FileStorage.AsyncPassthrough.Create(request) -> *filestorage.AsyncPassthroughReciept +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Asynchronously pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.DataPassthroughRequest{ + Method: filestorage.MethodEnumGet, + Path: "/scooters", + } +client.FileStorage.AsyncPassthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*filestorage.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.AsyncPassthrough.Retrieve(AsyncPassthroughReceiptId) -> *filestorage.AsyncPassthroughRetrieveResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves data from earlier async-passthrough POST request +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**asyncPassthroughReceiptId:** `string` + +
+
+
+
+ + +
+
+
+ +## FileStorage AuditTrail +
client.FileStorage.AuditTrail.List() -> *filestorage.PaginatedAuditLogEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of audit trail events. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } +client.FileStorage.AuditTrail.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include audit trail events that occurred before this time + +
+
+ +
+
+ +**eventType:** `*string` — 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` + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include audit trail events that occurred after this time + +
+
+ +
+
+ +**userEmail:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +## FileStorage AvailableActions +
client.FileStorage.AvailableActions.Retrieve() -> *filestorage.AvailableActions +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of models and actions available for an account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.AvailableActions.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## FileStorage Scopes +
client.FileStorage.Scopes.DefaultScopesRetrieve() -> *filestorage.CommonModelScopeApi +
+
+ +#### 📝 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). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Scopes.LinkedAccountScopesRetrieve() -> *filestorage.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Scopes.LinkedAccountScopesCreate(request) -> *filestorage.CommonModelScopeApi +
+
+ +#### 📝 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) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*filestorage.IndividualCommonModelScopeDeserializerRequest{ + &filestorage.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*filestorage.ModelPermissionDeserializerRequest{ + "READ": &filestorage.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &filestorage.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &filestorage.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &filestorage.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*filestorage.ModelPermissionDeserializerRequest{ + "WRITE": &filestorage.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } +client.FileStorage.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `[]*filestorage.IndividualCommonModelScopeDeserializerRequest` — The common models you want to update the scopes for + +
+
+
+
+ + +
+
+
+ +## FileStorage DeleteAccount +
client.FileStorage.DeleteAccount.Delete() -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.DeleteAccount.Delete( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## FileStorage Drives +
client.FileStorage.Drives.List() -> *filestorage.PaginatedDriveList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Drive` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.DrivesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.FileStorage.Drives.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return drives with this name. This performs an exact match. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Drives.Retrieve(Id) -> *filestorage.Drive +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Drive` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.DrivesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.FileStorage.Drives.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## FileStorage FieldMapping +
client.FileStorage.FieldMapping.FieldMappingsRetrieve() -> *filestorage.FieldMappingApiInstanceResponse +
+
+ +#### 📝 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/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } +client.FileStorage.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.FieldMapping.FieldMappingsCreate(request) -> *filestorage.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } +client.FileStorage.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+ +
+
+ +**targetFieldName:** `string` — The name of the target field you want this remote field to map to. + +
+
+ +
+
+ +**targetFieldDescription:** `string` — The description of the target field you want this remote field to map to. + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `string` — The path of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**commonModelName:** `string` — The name of the Common Model that the remote field corresponds to in a given category. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.FieldMapping.FieldMappingsDestroy(FieldMappingId) -> *filestorage.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.FieldMapping.FieldMappingsPartialUpdate(FieldMappingId, request) -> *filestorage.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.PatchedEditFieldMappingRequest{} +client.FileStorage.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `*string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `*string` — The path of the remote endpoint where the remote field is coming from. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.FieldMapping.RemoteFieldsRetrieve() -> *filestorage.RemoteFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } +client.FileStorage.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `*string` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + +
+
+ +
+
+ +**includeExampleValues:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.FieldMapping.TargetFieldsRetrieve() -> *filestorage.ExternalTargetFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## FileStorage Files +
client.FileStorage.Files.List() -> *filestorage.PaginatedFileList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `File` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.FilesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + DriveId: merge.String( + "drive_id", + ), + FolderId: merge.String( + "folder_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + MimeType: merge.String( + "mime_type", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + OrderBy: filestorage.FilesListRequestOrderByCreatedAtDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.FileStorage.Files.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**driveId:** `*string` — Specifying a drive id returns only the files in that drive. Specifying null returns only the files outside the top-level drive. + +
+
+ +
+
+ +**expand:** `*filestorage.FilesListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**folderId:** `*string` — Specifying a folder id returns only the files in that folder. Specifying null returns only the files in root directory. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**mimeType:** `*string` — If provided, will only return files with these mime_types. Multiple values can be separated by commas. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return files with this name. This performs an exact match. + +
+
+ +
+
+ +**orderBy:** `*filestorage.FilesListRequestOrderBy` — Overrides the default ordering for this endpoint. Possible values include: created_at, -created_at, modified_at, -modified_at. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Files.Create(request) -> *filestorage.FileStorageFileResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `File` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.FileStorageFileEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &filestorage.FileRequest{}, + } +client.FileStorage.Files.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*filestorage.FileRequest` + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Files.Retrieve(Id) -> *filestorage.File +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `File` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.FilesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.FileStorage.Files.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*filestorage.FilesRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Files.DownloadRequestMetaRetrieve(Id) -> *filestorage.DownloadRequestMeta +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.FilesDownloadRequestMetaRetrieveRequest{ + MimeType: merge.String( + "mime_type", + ), + } +client.FileStorage.Files.DownloadRequestMetaRetrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**mimeType:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Files.DownloadRequestMetaList() -> *filestorage.PaginatedDownloadRequestMetaList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.FilesDownloadRequestMetaListRequest{ + CreatedAfter: merge.String( + "created_after", + ), + CreatedBefore: merge.String( + "created_before", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + MimeTypes: merge.String( + "mime_types", + ), + ModifiedAfter: merge.String( + "modified_after", + ), + ModifiedBefore: merge.String( + "modified_before", + ), + OrderBy: filestorage.FilesDownloadRequestMetaListRequestOrderByCreatedAtDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + } +client.FileStorage.Files.DownloadRequestMetaList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*string` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*string` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**mimeTypes:** `*string` — 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. + +
+
+ +
+
+ +**modifiedAfter:** `*string` — If provided, will only return objects modified after this datetime. + +
+
+ +
+
+ +**modifiedBefore:** `*string` — If provided, will only return objects modified before this datetime. + +
+
+ +
+
+ +**orderBy:** `*filestorage.FilesDownloadRequestMetaListRequestOrderBy` — Overrides the default ordering for this endpoint. Possible values include: created_at, -created_at, modified_at, -modified_at. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Files.MetaPostRetrieve() -> *filestorage.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `FileStorageFile` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.Files.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## FileStorage Folders +
client.FileStorage.Folders.List() -> *filestorage.PaginatedFolderList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Folder` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.FoldersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + DriveId: merge.String( + "drive_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + ParentFolderId: merge.String( + "parent_folder_id", + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.FileStorage.Folders.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**driveId:** `*string` — If provided, will only return folders in this drive. + +
+
+ +
+
+ +**expand:** `*filestorage.FoldersListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return folders with this name. This performs an exact match. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**parentFolderId:** `*string` — If provided, will only return folders in this parent folder. If null, will return folders in root directory. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Folders.Create(request) -> *filestorage.FileStorageFolderResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Folder` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.FileStorageFolderEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &filestorage.FolderRequest{}, + } +client.FileStorage.Folders.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*filestorage.FolderRequest` + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Folders.Retrieve(Id) -> *filestorage.Folder +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Folder` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.FoldersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.FileStorage.Folders.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*filestorage.FoldersRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Folders.MetaPostRetrieve() -> *filestorage.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `FileStorageFolder` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.Folders.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## FileStorage GenerateKey +
client.FileStorage.GenerateKey.Create(request) -> *filestorage.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } +client.FileStorage.GenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## FileStorage Groups +
client.FileStorage.Groups.List() -> *filestorage.PaginatedGroupList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Group` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.GroupsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.FileStorage.Groups.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*filestorage.GroupsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Groups.Retrieve(Id) -> *filestorage.Group +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Group` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.GroupsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.FileStorage.Groups.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*filestorage.GroupsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## FileStorage Issues +
client.FileStorage.Issues.List() -> *filestorage.PaginatedIssueList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets all issues for Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: filestorage.IssuesListRequestStatusOngoing.Ptr(), + } +client.FileStorage.Issues.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountToken:** `*string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include issues whose most recent action occurred before this time + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` + +
+
+ +
+
+ +**firstIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose first incident time was after this datetime. + +
+
+ +
+
+ +**firstIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose first incident time was before this datetime. + +
+
+ +
+
+ +**includeMuted:** `*string` — If true, will include muted issues + +
+
+ +
+
+ +**integrationName:** `*string` + +
+
+ +
+
+ +**lastIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose last incident time was after this datetime. + +
+
+ +
+
+ +**lastIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose last incident time was before this datetime. + +
+
+ +
+
+ +**linkedAccountId:** `*string` — If provided, will only include issues pertaining to the linked account passed in. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include issues whose most recent action occurred after this time + +
+
+ +
+
+ +**status:** `*filestorage.IssuesListRequestStatus` + +Status of the issue. Options: ('ONGOING', 'RESOLVED') + +* `ONGOING` - ONGOING +* `RESOLVED` - RESOLVED + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Issues.Retrieve(Id) -> *filestorage.Issue +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific issue. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.Issues.Retrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +## FileStorage LinkToken +
client.FileStorage.LinkToken.Create(request) -> *filestorage.LinkToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a link token to be used when linking a new end user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []filestorage.CategoriesEnum{ + filestorage.CategoriesEnumHris, + filestorage.CategoriesEnumAts, + }, + } +client.FileStorage.LinkToken.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**endUserEmailAddress:** `string` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + +
+
+ +
+
+ +**endUserOrganizationName:** `string` — Your end user's organization. + +
+
+ +
+
+ +**endUserOriginId:** `string` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + +
+
+ +
+
+ +**categories:** `[]*filestorage.CategoriesEnum` — The integration categories to show in Merge Link. + +
+
+ +
+
+ +**integration:** `*string` — 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/. + +
+
+ +
+
+ +**linkExpiryMins:** `*int` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + +
+
+ +
+
+ +**shouldCreateMagicLinkUrl:** `*bool` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**hideAdminMagicLink:** `*bool` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**commonModels:** `[]*filestorage.CommonModelScopesBodyRequest` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + +
+
+ +
+
+ +**categoryCommonModelScopes:** `map[string][]*filestorage.IndividualCommonModelScopeDeserializerRequest` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + +
+
+ +
+
+ +**language:** `*filestorage.EndUserDetailsRequestLanguage` + +The following subset of IETF language tags can be used to configure localization. + +* `en` - en +* `de` - de + +
+
+ +
+
+ +**areSyncsDisabled:** `*bool` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. + +
+
+ +
+
+ +**integrationSpecificConfig:** `map[string]any` — A JSON object containing integration-specific configuration options. + +
+
+
+
+ + +
+
+
+ +## FileStorage LinkedAccounts +
client.FileStorage.LinkedAccounts.List() -> *filestorage.PaginatedAccountDetailsAndActionsList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List linked accounts for your organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.LinkedAccountsListRequest{ + Category: filestorage.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } +client.FileStorage.LinkedAccounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**category:** `*filestorage.LinkedAccountsListRequestCategory` + +Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` + +* `hris` - hris +* `ats` - ats +* `accounting` - accounting +* `ticketing` - ticketing +* `crm` - crm +* `mktg` - mktg +* `filestorage` - filestorage + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endUserEmailAddress:** `*string` — If provided, will only return linked accounts associated with the given email address. + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` — If provided, will only return linked accounts associated with the given organization name. + +
+
+ +
+
+ +**endUserOriginId:** `*string` — If provided, will only return linked accounts associated with the given origin ID. + +
+
+ +
+
+ +**endUserOriginIds:** `*string` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + +
+
+ +
+
+ +**id:** `*string` + +
+
+ +
+
+ +**ids:** `*string` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + +
+
+ +
+
+ +**includeDuplicates:** `*bool` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + +
+
+ +
+
+ +**integrationName:** `*string` — If provided, will only return linked accounts associated with the given integration name. + +
+
+ +
+
+ +**isTestAccount:** `*string` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**status:** `*string` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + +
+
+
+
+ + +
+
+
+ +## FileStorage Passthrough +
client.FileStorage.Passthrough.Create(request) -> *filestorage.RemoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.DataPassthroughRequest{ + Method: filestorage.MethodEnumGet, + Path: "/scooters", + } +client.FileStorage.Passthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*filestorage.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +## FileStorage RegenerateKey +
client.FileStorage.RegenerateKey.Create(request) -> *filestorage.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } +client.FileStorage.RegenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## FileStorage SyncStatus +
client.FileStorage.SyncStatus.List() -> *filestorage.PaginatedSyncStatusList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } +client.FileStorage.SyncStatus.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## FileStorage ForceResync +
client.FileStorage.ForceResync.SyncStatusResyncCreate() -> []*filestorage.SyncStatus +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## FileStorage Users +
client.FileStorage.Users.List() -> *filestorage.PaginatedUserList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `User` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.UsersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsMe: merge.String( + "is_me", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.FileStorage.Users.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isMe:** `*string` — If provided, will only return the user object for requestor. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.FileStorage.Users.Retrieve(Id) -> *filestorage.User +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `User` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.UsersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.FileStorage.Users.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## FileStorage WebhookReceivers +
client.FileStorage.WebhookReceivers.List() -> []*filestorage.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `WebhookReceiver` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.FileStorage.WebhookReceivers.List( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.FileStorage.WebhookReceivers.Create(request) -> *filestorage.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `WebhookReceiver` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &filestorage.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } +client.FileStorage.WebhookReceivers.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**event:** `string` + +
+
+ +
+
+ +**isActive:** `bool` + +
+
+ +
+
+ +**key:** `*string` + +
+
+
+
+ + +
+
+
+ +## Hris AccountDetails +
client.Hris.AccountDetails.Retrieve() -> *hris.AccountDetails +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details for a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.AccountDetails.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Hris AccountToken +
client.Hris.AccountToken.Retrieve(PublicToken) -> *hris.AccountToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the account token for the end user with the provided public token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**publicToken:** `string` + +
+
+
+
+ + +
+
+
+ +## Hris AsyncPassthrough +
client.Hris.AsyncPassthrough.Create(request) -> *hris.AsyncPassthroughReciept +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Asynchronously pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.DataPassthroughRequest{ + Method: hris.MethodEnumGet, + Path: "/scooters", + } +client.Hris.AsyncPassthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*hris.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +
client.Hris.AsyncPassthrough.Retrieve(AsyncPassthroughReceiptId) -> *hris.AsyncPassthroughRetrieveResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves data from earlier async-passthrough POST request +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**asyncPassthroughReceiptId:** `string` + +
+
+
+
+ + +
+
+
+ +## Hris AuditTrail +
client.Hris.AuditTrail.List() -> *hris.PaginatedAuditLogEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of audit trail events. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } +client.Hris.AuditTrail.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include audit trail events that occurred before this time + +
+
+ +
+
+ +**eventType:** `*string` — 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` + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include audit trail events that occurred after this time + +
+
+ +
+
+ +**userEmail:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +## Hris AvailableActions +
client.Hris.AvailableActions.Retrieve() -> *hris.AvailableActions +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of models and actions available for an account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.AvailableActions.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Hris BankInfo +
client.Hris.BankInfo.List() -> *hris.PaginatedBankInfoList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `BankInfo` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.BankInfoListRequest{ + AccountType: hris.BankInfoListRequestAccountTypeChecking.Ptr(), + BankName: merge.String( + "bank_name", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OrderBy: hris.BankInfoListRequestOrderByRemoteCreatedAtDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Hris.BankInfo.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountType:** `*hris.BankInfoListRequestAccountType` + +If provided, will only return BankInfo's with this account type. Options: ('SAVINGS', 'CHECKING') + +* `SAVINGS` - SAVINGS +* `CHECKING` - CHECKING + +
+
+ +
+
+ +**bankName:** `*string` — If provided, will only return BankInfo's with this bank name. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**employeeId:** `*string` — If provided, will only return bank accounts for this employee. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**orderBy:** `*hris.BankInfoListRequestOrderBy` — Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Hris.BankInfo.Retrieve(Id) -> *hris.BankInfo +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `BankInfo` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.BankInfoRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.BankInfo.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +## Hris Benefits +
client.Hris.Benefits.List() -> *hris.PaginatedBenefitList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Benefit` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.BenefitsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Hris.Benefits.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**employeeId:** `*string` — If provided, will return the benefits associated with the employee. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Hris.Benefits.Retrieve(Id) -> *hris.Benefit +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Benefit` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.BenefitsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.Benefits.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Hris Companies +
client.Hris.Companies.List() -> *hris.PaginatedCompanyList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Company` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.CompaniesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Hris.Companies.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Hris.Companies.Retrieve(Id) -> *hris.Company +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Company` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.CompaniesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.Companies.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Hris Scopes +
client.Hris.Scopes.DefaultScopesRetrieve() -> *hris.CommonModelScopeApi +
+
+ +#### 📝 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). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Hris.Scopes.LinkedAccountScopesRetrieve() -> *hris.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Hris.Scopes.LinkedAccountScopesCreate(request) -> *hris.CommonModelScopeApi +
+
+ +#### 📝 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) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*hris.IndividualCommonModelScopeDeserializerRequest{ + &hris.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*hris.ModelPermissionDeserializerRequest{ + "READ": &hris.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &hris.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &hris.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &hris.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*hris.ModelPermissionDeserializerRequest{ + "WRITE": &hris.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } +client.Hris.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `[]*hris.IndividualCommonModelScopeDeserializerRequest` — The common models you want to update the scopes for + +
+
+
+
+ + +
+
+
+ +## Hris DeleteAccount +
client.Hris.DeleteAccount.Delete() -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.DeleteAccount.Delete( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Hris Dependents +
client.Hris.Dependents.List() -> *hris.PaginatedDependentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Dependent` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.DependentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeSensitiveFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Hris.Dependents.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeSensitiveFields:** `*bool` — Whether to include sensitive fields (such as social security numbers) in the response. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Hris.Dependents.Retrieve(Id) -> *hris.Dependent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Dependent` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.DependentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeSensitiveFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.Dependents.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeSensitiveFields:** `*bool` — Whether to include sensitive fields (such as social security numbers) in the response. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Hris EmployeePayrollRuns +
client.Hris.EmployeePayrollRuns.List() -> *hris.PaginatedEmployeePayrollRunList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `EmployeePayrollRun` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EmployeePayrollRunsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + EndedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + EndedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PayrollRunId: merge.String( + "payroll_run_id", + ), + RemoteId: merge.String( + "remote_id", + ), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Hris.EmployeePayrollRuns.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**employeeId:** `*string` — If provided, will only return employee payroll runs for this employee. + +
+
+ +
+
+ +**endedAfter:** `*time.Time` — If provided, will only return employee payroll runs ended after this datetime. + +
+
+ +
+
+ +**endedBefore:** `*time.Time` — If provided, will only return employee payroll runs ended before this datetime. + +
+
+ +
+
+ +**expand:** `*hris.EmployeePayrollRunsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**payrollRunId:** `*string` — If provided, will only return employee payroll runs for this employee. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**startedAfter:** `*time.Time` — If provided, will only return employee payroll runs started after this datetime. + +
+
+ +
+
+ +**startedBefore:** `*time.Time` — If provided, will only return employee payroll runs started before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Hris.EmployeePayrollRuns.Retrieve(Id) -> *hris.EmployeePayrollRun +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `EmployeePayrollRun` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EmployeePayrollRunsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.EmployeePayrollRuns.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*hris.EmployeePayrollRunsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Hris Employees +
client.Hris.Employees.List() -> *hris.PaginatedEmployeeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Employee` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EmployeesListRequest{ + CompanyId: merge.String( + "company_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + DisplayFullName: merge.String( + "display_full_name", + ), + EmploymentStatus: hris.EmployeesListRequestEmploymentStatusActive.Ptr(), + EmploymentType: merge.String( + "employment_type", + ), + FirstName: merge.String( + "first_name", + ), + Groups: merge.String( + "groups", + ), + HomeLocationId: merge.String( + "home_location_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeSensitiveFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + JobTitle: merge.String( + "job_title", + ), + LastName: merge.String( + "last_name", + ), + ManagerId: merge.String( + "manager_id", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PayGroupId: merge.String( + "pay_group_id", + ), + PersonalEmail: merge.String( + "personal_email", + ), + RemoteFields: hris.EmployeesListRequestRemoteFieldsEmploymentStatus.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: hris.EmployeesListRequestShowEnumOriginsEmploymentStatus.Ptr(), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TeamId: merge.String( + "team_id", + ), + TerminatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + TerminatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + WorkEmail: merge.String( + "work_email", + ), + WorkLocationId: merge.String( + "work_location_id", + ), + } +client.Hris.Employees.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `*string` — If provided, will only return employees for this company. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**displayFullName:** `*string` — If provided, will only return employees with this display name. + +
+
+ +
+
+ +**employmentStatus:** `*hris.EmployeesListRequestEmploymentStatus` + +If provided, will only return employees with this employment status. + +* `ACTIVE` - ACTIVE +* `PENDING` - PENDING +* `INACTIVE` - INACTIVE + +
+
+ +
+
+ +**employmentType:** `*string` — If provided, will only return employees that have an employment of the specified employment_type. + +
+
+ +
+
+ +**expand:** `*hris.EmployeesListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**firstName:** `*string` — If provided, will only return employees with this first name. + +
+
+ +
+
+ +**groups:** `*string` — If provided, will only return employees matching the group ids; multiple groups can be separated by commas. + +
+
+ +
+
+ +**homeLocationId:** `*string` — If provided, will only return employees for this home location. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeSensitiveFields:** `*bool` — Whether to include sensitive fields (such as social security numbers) in the response. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**jobTitle:** `*string` — If provided, will only return employees that have an employment of the specified job_title. + +
+
+ +
+
+ +**lastName:** `*string` — If provided, will only return employees with this last name. + +
+
+ +
+
+ +**managerId:** `*string` — If provided, will only return employees for this manager. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**payGroupId:** `*string` — If provided, will only return employees for this pay group + +
+
+ +
+
+ +**personalEmail:** `*string` — If provided, will only return Employees with this personal email + +
+
+ +
+
+ +**remoteFields:** `*hris.EmployeesListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.EmployeesListRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+ +
+
+ +**startedAfter:** `*time.Time` — If provided, will only return employees that started after this datetime. + +
+
+ +
+
+ +**startedBefore:** `*time.Time` — If provided, will only return employees that started before this datetime. + +
+
+ +
+
+ +**teamId:** `*string` — If provided, will only return employees for this team. + +
+
+ +
+
+ +**terminatedAfter:** `*time.Time` — If provided, will only return employees that were terminated after this datetime. + +
+
+ +
+
+ +**terminatedBefore:** `*time.Time` — If provided, will only return employees that were terminated before this datetime. + +
+
+ +
+
+ +**workEmail:** `*string` — If provided, will only return Employees with this work email + +
+
+ +
+
+ +**workLocationId:** `*string` — If provided, will only return employees for this location. + +
+
+
+
+ + +
+
+
+ +
client.Hris.Employees.Create(request) -> *hris.EmployeeResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Employee` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EmployeeEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &hris.EmployeeRequest{}, + } +client.Hris.Employees.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*hris.EmployeeRequest` + +
+
+
+
+ + +
+
+
+ +
client.Hris.Employees.Retrieve(Id) -> *hris.Employee +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Employee` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EmployeesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeSensitiveFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.EmployeesRetrieveRequestRemoteFieldsEmploymentStatus.Ptr(), + ShowEnumOrigins: hris.EmployeesRetrieveRequestShowEnumOriginsEmploymentStatus.Ptr(), + } +client.Hris.Employees.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*hris.EmployeesRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeSensitiveFields:** `*bool` — Whether to include sensitive fields (such as social security numbers) in the response. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*hris.EmployeesRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.EmployeesRetrieveRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +
client.Hris.Employees.IgnoreCreate(ModelId, request) -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.IgnoreCommonModelRequest{ + Reason: &hris.IgnoreCommonModelRequestReason{ + ReasonEnum: hris.ReasonEnumGeneralCustomerRequest, + }, + } +client.Hris.Employees.IgnoreCreate( + context.TODO(), + "model_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**modelId:** `string` + +
+
+ +
+
+ +**request:** `*hris.IgnoreCommonModelRequest` + +
+
+
+
+ + +
+
+
+ +
client.Hris.Employees.MetaPostRetrieve() -> *hris.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Employee` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.Employees.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Hris EmployerBenefits +
client.Hris.EmployerBenefits.List() -> *hris.PaginatedEmployerBenefitList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `EmployerBenefit` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EmployerBenefitsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Hris.EmployerBenefits.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Hris.EmployerBenefits.Retrieve(Id) -> *hris.EmployerBenefit +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `EmployerBenefit` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EmployerBenefitsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.EmployerBenefits.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Hris Employments +
client.Hris.Employments.List() -> *hris.PaginatedEmploymentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Employment` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EmploymentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OrderBy: hris.EmploymentsListRequestOrderByEffectiveDateDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + RemoteFields: hris.EmploymentsListRequestRemoteFieldsEmploymentType.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: hris.EmploymentsListRequestShowEnumOriginsEmploymentType.Ptr(), + } +client.Hris.Employments.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**employeeId:** `*string` — If provided, will only return employments for this employee. + +
+
+ +
+
+ +**expand:** `*hris.EmploymentsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**orderBy:** `*hris.EmploymentsListRequestOrderBy` — Overrides the default ordering for this endpoint. Possible values include: effective_date, -effective_date. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*hris.EmploymentsListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.EmploymentsListRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +
client.Hris.Employments.Retrieve(Id) -> *hris.Employment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Employment` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EmploymentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.EmploymentsRetrieveRequestRemoteFieldsEmploymentType.Ptr(), + ShowEnumOrigins: hris.EmploymentsRetrieveRequestShowEnumOriginsEmploymentType.Ptr(), + } +client.Hris.Employments.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*hris.EmploymentsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*hris.EmploymentsRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.EmploymentsRetrieveRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +## Hris FieldMapping +
client.Hris.FieldMapping.FieldMappingsRetrieve() -> *hris.FieldMappingApiInstanceResponse +
+
+ +#### 📝 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/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } +client.Hris.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+
+
+ + +
+
+
+ +
client.Hris.FieldMapping.FieldMappingsCreate(request) -> *hris.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } +client.Hris.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+ +
+
+ +**targetFieldName:** `string` — The name of the target field you want this remote field to map to. + +
+
+ +
+
+ +**targetFieldDescription:** `string` — The description of the target field you want this remote field to map to. + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `string` — The path of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**commonModelName:** `string` — The name of the Common Model that the remote field corresponds to in a given category. + +
+
+
+
+ + +
+
+
+ +
client.Hris.FieldMapping.FieldMappingsDestroy(FieldMappingId) -> *hris.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Hris.FieldMapping.FieldMappingsPartialUpdate(FieldMappingId, request) -> *hris.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.PatchedEditFieldMappingRequest{} +client.Hris.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `*string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `*string` — The path of the remote endpoint where the remote field is coming from. + +
+
+
+
+ + +
+
+
+ +
client.Hris.FieldMapping.RemoteFieldsRetrieve() -> *hris.RemoteFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } +client.Hris.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `*string` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + +
+
+ +
+
+ +**includeExampleValues:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +
client.Hris.FieldMapping.TargetFieldsRetrieve() -> *hris.ExternalTargetFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Hris GenerateKey +
client.Hris.GenerateKey.Create(request) -> *hris.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } +client.Hris.GenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Hris Groups +
client.Hris.Groups.List() -> *hris.PaginatedGroupList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Group` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.GroupsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonlyUsedAsTeam: merge.String( + "is_commonly_used_as_team", + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Names: merge.String( + "names", + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Types: merge.String( + "types", + ), + } +client.Hris.Groups.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonlyUsedAsTeam:** `*string` — 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. + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**names:** `*string` — If provided, will only return groups with these names. Multiple values can be separated by commas. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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:** `*string` — If provided, will only return groups of these types. Multiple values can be separated by commas. + +
+
+
+
+ + +
+
+
+ +
client.Hris.Groups.Retrieve(Id) -> *hris.Group +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Group` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.GroupsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.Groups.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +## Hris Issues +
client.Hris.Issues.List() -> *hris.PaginatedIssueList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets all issues for Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: hris.IssuesListRequestStatusOngoing.Ptr(), + } +client.Hris.Issues.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountToken:** `*string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include issues whose most recent action occurred before this time + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` + +
+
+ +
+
+ +**firstIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose first incident time was after this datetime. + +
+
+ +
+
+ +**firstIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose first incident time was before this datetime. + +
+
+ +
+
+ +**includeMuted:** `*string` — If true, will include muted issues + +
+
+ +
+
+ +**integrationName:** `*string` + +
+
+ +
+
+ +**lastIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose last incident time was after this datetime. + +
+
+ +
+
+ +**lastIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose last incident time was before this datetime. + +
+
+ +
+
+ +**linkedAccountId:** `*string` — If provided, will only include issues pertaining to the linked account passed in. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include issues whose most recent action occurred after this time + +
+
+ +
+
+ +**status:** `*hris.IssuesListRequestStatus` + +Status of the issue. Options: ('ONGOING', 'RESOLVED') + +* `ONGOING` - ONGOING +* `RESOLVED` - RESOLVED + +
+
+
+
+ + +
+
+
+ +
client.Hris.Issues.Retrieve(Id) -> *hris.Issue +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific issue. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.Issues.Retrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +## Hris LinkToken +
client.Hris.LinkToken.Create(request) -> *hris.LinkToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a link token to be used when linking a new end user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []hris.CategoriesEnum{ + hris.CategoriesEnumHris, + hris.CategoriesEnumAts, + }, + } +client.Hris.LinkToken.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**endUserEmailAddress:** `string` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + +
+
+ +
+
+ +**endUserOrganizationName:** `string` — Your end user's organization. + +
+
+ +
+
+ +**endUserOriginId:** `string` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + +
+
+ +
+
+ +**categories:** `[]*hris.CategoriesEnum` — The integration categories to show in Merge Link. + +
+
+ +
+
+ +**integration:** `*string` — 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/. + +
+
+ +
+
+ +**linkExpiryMins:** `*int` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + +
+
+ +
+
+ +**shouldCreateMagicLinkUrl:** `*bool` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**hideAdminMagicLink:** `*bool` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**commonModels:** `[]*hris.CommonModelScopesBodyRequest` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + +
+
+ +
+
+ +**categoryCommonModelScopes:** `map[string][]*hris.IndividualCommonModelScopeDeserializerRequest` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + +
+
+ +
+
+ +**language:** `*hris.EndUserDetailsRequestLanguage` + +The following subset of IETF language tags can be used to configure localization. + +* `en` - en +* `de` - de + +
+
+ +
+
+ +**areSyncsDisabled:** `*bool` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. + +
+
+ +
+
+ +**integrationSpecificConfig:** `map[string]any` — A JSON object containing integration-specific configuration options. + +
+
+
+
+ + +
+
+
+ +## Hris LinkedAccounts +
client.Hris.LinkedAccounts.List() -> *hris.PaginatedAccountDetailsAndActionsList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List linked accounts for your organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.LinkedAccountsListRequest{ + Category: hris.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } +client.Hris.LinkedAccounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**category:** `*hris.LinkedAccountsListRequestCategory` + +Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` + +* `hris` - hris +* `ats` - ats +* `accounting` - accounting +* `ticketing` - ticketing +* `crm` - crm +* `mktg` - mktg +* `filestorage` - filestorage + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endUserEmailAddress:** `*string` — If provided, will only return linked accounts associated with the given email address. + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` — If provided, will only return linked accounts associated with the given organization name. + +
+
+ +
+
+ +**endUserOriginId:** `*string` — If provided, will only return linked accounts associated with the given origin ID. + +
+
+ +
+
+ +**endUserOriginIds:** `*string` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + +
+
+ +
+
+ +**id:** `*string` + +
+
+ +
+
+ +**ids:** `*string` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + +
+
+ +
+
+ +**includeDuplicates:** `*bool` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + +
+
+ +
+
+ +**integrationName:** `*string` — If provided, will only return linked accounts associated with the given integration name. + +
+
+ +
+
+ +**isTestAccount:** `*string` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**status:** `*string` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + +
+
+
+
+ + +
+
+
+ +## Hris Locations +
client.Hris.Locations.List() -> *hris.PaginatedLocationList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Location` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.LocationsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + LocationType: hris.LocationsListRequestLocationTypeHome.Ptr(), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: hris.LocationsListRequestRemoteFieldsCountry.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + ShowEnumOrigins: hris.LocationsListRequestShowEnumOriginsCountry.Ptr(), + } +client.Hris.Locations.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**locationType:** `*hris.LocationsListRequestLocationType` + +If provided, will only return locations with this location_type + +* `HOME` - HOME +* `WORK` - WORK + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*hris.LocationsListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.LocationsListRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +
client.Hris.Locations.Retrieve(Id) -> *hris.Location +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Location` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.LocationsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.LocationsRetrieveRequestRemoteFieldsCountry.Ptr(), + ShowEnumOrigins: hris.LocationsRetrieveRequestShowEnumOriginsCountry.Ptr(), + } +client.Hris.Locations.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*hris.LocationsRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.LocationsRetrieveRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +## Hris Passthrough +
client.Hris.Passthrough.Create(request) -> *hris.RemoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.DataPassthroughRequest{ + Method: hris.MethodEnumGet, + Path: "/scooters", + } +client.Hris.Passthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*hris.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +## Hris PayGroups +
client.Hris.PayGroups.List() -> *hris.PaginatedPayGroupList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `PayGroup` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.PayGroupsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Hris.PayGroups.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Hris.PayGroups.Retrieve(Id) -> *hris.PayGroup +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `PayGroup` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.PayGroupsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.PayGroups.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Hris PayrollRuns +
client.Hris.PayrollRuns.List() -> *hris.PaginatedPayrollRunList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `PayrollRun` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.PayrollRunsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + EndedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: hris.PayrollRunsListRequestRemoteFieldsRunState.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + RunType: hris.PayrollRunsListRequestRunTypeCorrection.Ptr(), + ShowEnumOrigins: hris.PayrollRunsListRequestShowEnumOriginsRunState.Ptr(), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Hris.PayrollRuns.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endedAfter:** `*time.Time` — If provided, will only return payroll runs ended after this datetime. + +
+
+ +
+
+ +**endedBefore:** `*time.Time` — If provided, will only return payroll runs ended before this datetime. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*hris.PayrollRunsListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**runType:** `*hris.PayrollRunsListRequestRunType` + +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 + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.PayrollRunsListRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+ +
+
+ +**startedAfter:** `*time.Time` — If provided, will only return payroll runs started after this datetime. + +
+
+ +
+
+ +**startedBefore:** `*time.Time` — If provided, will only return payroll runs started before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Hris.PayrollRuns.Retrieve(Id) -> *hris.PayrollRun +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `PayrollRun` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.PayrollRunsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.PayrollRunsRetrieveRequestRemoteFieldsRunState.Ptr(), + ShowEnumOrigins: hris.PayrollRunsRetrieveRequestShowEnumOriginsRunState.Ptr(), + } +client.Hris.PayrollRuns.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*hris.PayrollRunsRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.PayrollRunsRetrieveRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +## Hris RegenerateKey +
client.Hris.RegenerateKey.Create(request) -> *hris.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } +client.Hris.RegenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Hris SyncStatus +
client.Hris.SyncStatus.List() -> *hris.PaginatedSyncStatusList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } +client.Hris.SyncStatus.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Hris ForceResync +
client.Hris.ForceResync.SyncStatusResyncCreate() -> []*hris.SyncStatus +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Hris Teams +
client.Hris.Teams.List() -> *hris.PaginatedTeamList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Team` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TeamsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + ParentTeamId: merge.String( + "parent_team_id", + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Hris.Teams.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**parentTeamId:** `*string` — If provided, will only return teams with this parent team. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Hris.Teams.Retrieve(Id) -> *hris.Team +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Team` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TeamsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.Teams.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Hris TimeOff +
client.Hris.TimeOff.List() -> *hris.PaginatedTimeOffList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `TimeOff` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TimeOffListRequest{ + ApproverId: merge.String( + "approver_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + EndedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + EndedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteFields: hris.TimeOffListRequestRemoteFieldsRequestType.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + RequestType: hris.TimeOffListRequestRequestTypeBereavement.Ptr(), + ShowEnumOrigins: hris.TimeOffListRequestShowEnumOriginsRequestType.Ptr(), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Status: hris.TimeOffListRequestStatusApproved.Ptr(), + } +client.Hris.TimeOff.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**approverId:** `*string` — If provided, will only return time off for this approver. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**employeeId:** `*string` — If provided, will only return time off for this employee. + +
+
+ +
+
+ +**endedAfter:** `*time.Time` — If provided, will only return employees that ended after this datetime. + +
+
+ +
+
+ +**endedBefore:** `*time.Time` — If provided, will only return time-offs that ended before this datetime. + +
+
+ +
+
+ +**expand:** `*hris.TimeOffListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteFields:** `*hris.TimeOffListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**requestType:** `*hris.TimeOffListRequestRequestType` + +If provided, will only return TimeOff with this request type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') + +* `VACATION` - VACATION +* `SICK` - SICK +* `PERSONAL` - PERSONAL +* `JURY_DUTY` - JURY_DUTY +* `VOLUNTEER` - VOLUNTEER +* `BEREAVEMENT` - BEREAVEMENT + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.TimeOffListRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+ +
+
+ +**startedAfter:** `*time.Time` — If provided, will only return time-offs that started after this datetime. + +
+
+ +
+
+ +**startedBefore:** `*time.Time` — If provided, will only return time-offs that started before this datetime. + +
+
+ +
+
+ +**status:** `*hris.TimeOffListRequestStatus` + +If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED') + +* `REQUESTED` - REQUESTED +* `APPROVED` - APPROVED +* `DECLINED` - DECLINED +* `CANCELLED` - CANCELLED +* `DELETED` - DELETED + +
+
+
+
+ + +
+
+
+ +
client.Hris.TimeOff.Create(request) -> *hris.TimeOffResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `TimeOff` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TimeOffEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &hris.TimeOffRequest{}, + } +client.Hris.TimeOff.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*hris.TimeOffRequest` + +
+
+
+
+ + +
+
+
+ +
client.Hris.TimeOff.Retrieve(Id) -> *hris.TimeOff +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `TimeOff` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TimeOffRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: hris.TimeOffRetrieveRequestRemoteFieldsRequestType.Ptr(), + ShowEnumOrigins: hris.TimeOffRetrieveRequestShowEnumOriginsRequestType.Ptr(), + } +client.Hris.TimeOff.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*hris.TimeOffRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*hris.TimeOffRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*hris.TimeOffRetrieveRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +
client.Hris.TimeOff.MetaPostRetrieve() -> *hris.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `TimeOff` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.TimeOff.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Hris TimeOffBalances +
client.Hris.TimeOffBalances.List() -> *hris.PaginatedTimeOffBalanceList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `TimeOffBalance` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TimeOffBalancesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + PolicyType: hris.TimeOffBalancesListRequestPolicyTypeBereavement.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + } +client.Hris.TimeOffBalances.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**employeeId:** `*string` — If provided, will only return time off balances for this employee. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**policyType:** `*hris.TimeOffBalancesListRequestPolicyType` + +If provided, will only return TimeOffBalance with this policy type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') + +* `VACATION` - VACATION +* `SICK` - SICK +* `PERSONAL` - PERSONAL +* `JURY_DUTY` - JURY_DUTY +* `VOLUNTEER` - VOLUNTEER +* `BEREAVEMENT` - BEREAVEMENT + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Hris.TimeOffBalances.Retrieve(Id) -> *hris.TimeOffBalance +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `TimeOffBalance` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TimeOffBalancesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.TimeOffBalances.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +## Hris TimesheetEntries +
client.Hris.TimesheetEntries.List() -> *hris.PaginatedTimesheetEntryList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `TimesheetEntry` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TimesheetEntriesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmployeeId: merge.String( + "employee_id", + ), + EndedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + EndedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + OrderBy: hris.TimesheetEntriesListRequestOrderByStartTimeDescending.Ptr(), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + StartedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + StartedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + } +client.Hris.TimesheetEntries.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**employeeId:** `*string` — If provided, will only return timesheet entries for this employee. + +
+
+ +
+
+ +**endedAfter:** `*time.Time` — If provided, will only return timesheet entries ended after this datetime. + +
+
+ +
+
+ +**endedBefore:** `*time.Time` — If provided, will only return timesheet entries ended before this datetime. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**orderBy:** `*hris.TimesheetEntriesListRequestOrderBy` — Overrides the default ordering for this endpoint. Possible values include: start_time, -start_time. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**startedAfter:** `*time.Time` — If provided, will only return timesheet entries started after this datetime. + +
+
+ +
+
+ +**startedBefore:** `*time.Time` — If provided, will only return timesheet entries started before this datetime. + +
+
+
+
+ + +
+
+
+ +
client.Hris.TimesheetEntries.Create(request) -> *hris.TimesheetEntryResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `TimesheetEntry` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TimesheetEntryEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &hris.TimesheetEntryRequest{}, + } +client.Hris.TimesheetEntries.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*hris.TimesheetEntryRequest` + +
+
+
+
+ + +
+
+
+ +
client.Hris.TimesheetEntries.Retrieve(Id) -> *hris.TimesheetEntry +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `TimesheetEntry` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.TimesheetEntriesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Hris.TimesheetEntries.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Hris.TimesheetEntries.MetaPostRetrieve() -> *hris.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `TimesheetEntry` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.TimesheetEntries.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Hris WebhookReceivers +
client.Hris.WebhookReceivers.List() -> []*hris.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `WebhookReceiver` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Hris.WebhookReceivers.List( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Hris.WebhookReceivers.Create(request) -> *hris.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `WebhookReceiver` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &hris.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } +client.Hris.WebhookReceivers.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**event:** `string` + +
+
+ +
+
+ +**isActive:** `bool` + +
+
+ +
+
+ +**key:** `*string` + +
+
+
+
+ + +
+
+
+ +## Ticketing AccountDetails +
client.Ticketing.AccountDetails.Retrieve() -> *ticketing.AccountDetails +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details for a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.AccountDetails.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ticketing AccountToken +
client.Ticketing.AccountToken.Retrieve(PublicToken) -> *ticketing.AccountToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the account token for the end user with the provided public token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**publicToken:** `string` + +
+
+
+
+ + +
+
+
+ +## Ticketing Accounts +
client.Ticketing.Accounts.List() -> *ticketing.PaginatedAccountList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Account` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.AccountsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ticketing.Accounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Accounts.Retrieve(Id) -> *ticketing.Account +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Account` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.AccountsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Accounts.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ticketing AsyncPassthrough +
client.Ticketing.AsyncPassthrough.Create(request) -> *ticketing.AsyncPassthroughReciept +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Asynchronously pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.DataPassthroughRequest{ + Method: ticketing.MethodEnumGet, + Path: "/scooters", + } +client.Ticketing.AsyncPassthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*ticketing.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.AsyncPassthrough.Retrieve(AsyncPassthroughReceiptId) -> *ticketing.AsyncPassthroughRetrieveResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves data from earlier async-passthrough POST request +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**asyncPassthroughReceiptId:** `string` + +
+
+
+
+ + +
+
+
+ +## Ticketing Attachments +
client.Ticketing.Attachments.List() -> *ticketing.PaginatedAttachmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Attachment` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.AttachmentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteCreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteId: merge.String( + "remote_id", + ), + TicketId: merge.String( + "ticket_id", + ), + } +client.Ticketing.Attachments.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteCreatedAfter:** `*time.Time` — If provided, will only return attachments created in the third party platform after this datetime. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**ticketId:** `*string` — If provided, will only return comments for this ticket. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Attachments.Create(request) -> *ticketing.TicketingAttachmentResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Attachment` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TicketingAttachmentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.AttachmentRequest{}, + } +client.Ticketing.Attachments.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ticketing.AttachmentRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Attachments.Retrieve(Id) -> *ticketing.Attachment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Attachment` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.AttachmentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Attachments.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Attachments.MetaPostRetrieve() -> *ticketing.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `TicketingAttachment` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.Attachments.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ticketing AuditTrail +
client.Ticketing.AuditTrail.List() -> *ticketing.PaginatedAuditLogEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of audit trail events. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } +client.Ticketing.AuditTrail.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include audit trail events that occurred before this time + +
+
+ +
+
+ +**eventType:** `*string` — 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` + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include audit trail events that occurred after this time + +
+
+ +
+
+ +**userEmail:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +## Ticketing AvailableActions +
client.Ticketing.AvailableActions.Retrieve() -> *ticketing.AvailableActions +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of models and actions available for an account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.AvailableActions.Retrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ticketing Collections +
client.Ticketing.Collections.List() -> *ticketing.PaginatedCollectionList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Collection` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.CollectionsListRequest{ + CollectionType: ticketing.CollectionsListRequestCollectionTypeEmpty.Ptr(), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + ParentCollectionId: merge.String( + "parent_collection_id", + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ticketing.Collections.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionType:** `*ticketing.CollectionsListRequestCollectionType` — If provided, will only return collections of the given type. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return collections with this name. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**parentCollectionId:** `*string` — If provided, will only return collections whose parent collection matches the given id. + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Collections.ViewersList(CollectionId) -> *ticketing.PaginatedViewerList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Viewer` objects that point to a User id or Team id that is either an assignee or viewer on a `Collection` with the given id. [Learn more.](https://help.merge.dev/en/articles/10333658-ticketing-access-control-list-acls) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.CollectionsViewersListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Ticketing.Collections.ViewersList( + context.TODO(), + "collection_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionId:** `string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ticketing.CollectionsViewersListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Collections.Retrieve(Id) -> *ticketing.Collection +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Collection` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.CollectionsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Collections.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*string` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*string` — A comma separated list 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) + +
+
+
+
+ + +
+
+
+ +## Ticketing Comments +
client.Ticketing.Comments.List() -> *ticketing.PaginatedCommentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Comment` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.CommentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteCreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteId: merge.String( + "remote_id", + ), + TicketId: merge.String( + "ticket_id", + ), + } +client.Ticketing.Comments.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ticketing.CommentsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteCreatedAfter:** `*time.Time` — If provided, will only return Comments created in the third party platform after this datetime. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**ticketId:** `*string` — If provided, will only return comments for this ticket. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Comments.Create(request) -> *ticketing.CommentResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Comment` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.CommentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.CommentRequest{}, + } +client.Ticketing.Comments.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ticketing.CommentRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Comments.Retrieve(Id) -> *ticketing.Comment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Comment` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.CommentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Comments.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*ticketing.CommentsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Comments.MetaPostRetrieve() -> *ticketing.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Comment` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.Comments.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ticketing Contacts +
client.Ticketing.Contacts.List() -> *ticketing.PaginatedContactList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Contact` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.ContactsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddress: merge.String( + "email_address", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ticketing.Contacts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**emailAddress:** `*string` — If provided, will only return Contacts that match this email. + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Contacts.Create(request) -> *ticketing.TicketingContactResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Contact` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TicketingContactEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.ContactRequest{}, + } +client.Ticketing.Contacts.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ticketing.ContactRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Contacts.Retrieve(Id) -> *ticketing.Contact +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Contact` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.ContactsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Contacts.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*string` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Contacts.MetaPostRetrieve() -> *ticketing.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `TicketingContact` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.Contacts.MetaPostRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ticketing Scopes +
client.Ticketing.Scopes.DefaultScopesRetrieve() -> *ticketing.CommonModelScopeApi +
+
+ +#### 📝 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). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Scopes.LinkedAccountScopesRetrieve() -> *ticketing.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Scopes.LinkedAccountScopesCreate(request) -> *ticketing.CommonModelScopeApi +
+
+ +#### 📝 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) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*ticketing.IndividualCommonModelScopeDeserializerRequest{ + &ticketing.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*ticketing.ModelPermissionDeserializerRequest{ + "READ": &ticketing.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &ticketing.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &ticketing.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &ticketing.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*ticketing.ModelPermissionDeserializerRequest{ + "WRITE": &ticketing.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } +client.Ticketing.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `[]*ticketing.IndividualCommonModelScopeDeserializerRequest` — The common models you want to update the scopes for + +
+
+
+
+ + +
+
+
+ +## Ticketing DeleteAccount +
client.Ticketing.DeleteAccount.Delete() -> error +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.DeleteAccount.Delete( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ticketing FieldMapping +
client.Ticketing.FieldMapping.FieldMappingsRetrieve() -> *ticketing.FieldMappingApiInstanceResponse +
+
+ +#### 📝 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/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } +client.Ticketing.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.FieldMapping.FieldMappingsCreate(request) -> *ticketing.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } +client.Ticketing.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**excludeRemoteFieldMetadata:** `*bool` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+ +
+
+ +**targetFieldName:** `string` — The name of the target field you want this remote field to map to. + +
+
+ +
+
+ +**targetFieldDescription:** `string` — The description of the target field you want this remote field to map to. + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `string` — The path of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**commonModelName:** `string` — The name of the Common Model that the remote field corresponds to in a given category. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.FieldMapping.FieldMappingsDestroy(FieldMappingId) -> *ticketing.FieldMappingInstanceResponse +
+
+ +#### 📝 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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.FieldMapping.FieldMappingsPartialUpdate(FieldMappingId, request) -> *ticketing.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.PatchedEditFieldMappingRequest{} +client.Ticketing.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+ +
+
+ +**remoteFieldTraversalPath:** `[]any` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remoteMethod:** `*string` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remoteUrlPath:** `*string` — The path of the remote endpoint where the remote field is coming from. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.FieldMapping.RemoteFieldsRetrieve() -> *ticketing.RemoteFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } +client.Ticketing.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**commonModels:** `*string` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + +
+
+ +
+
+ +**includeExampleValues:** `*string` — 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. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.FieldMapping.TargetFieldsRetrieve() -> *ticketing.ExternalTargetFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ticketing GenerateKey +
client.Ticketing.GenerateKey.Create(request) -> *ticketing.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } +client.Ticketing.GenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Ticketing Issues +
client.Ticketing.Issues.List() -> *ticketing.PaginatedIssueList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets all issues for Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: ticketing.IssuesListRequestStatusOngoing.Ptr(), + } +client.Ticketing.Issues.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountToken:** `*string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endDate:** `*string` — If included, will only include issues whose most recent action occurred before this time + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` + +
+
+ +
+
+ +**firstIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose first incident time was after this datetime. + +
+
+ +
+
+ +**firstIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose first incident time was before this datetime. + +
+
+ +
+
+ +**includeMuted:** `*string` — If true, will include muted issues + +
+
+ +
+
+ +**integrationName:** `*string` + +
+
+ +
+
+ +**lastIncidentTimeAfter:** `*time.Time` — If provided, will only return issues whose last incident time was after this datetime. + +
+
+ +
+
+ +**lastIncidentTimeBefore:** `*time.Time` — If provided, will only return issues whose last incident time was before this datetime. + +
+
+ +
+
+ +**linkedAccountId:** `*string` — If provided, will only include issues pertaining to the linked account passed in. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**startDate:** `*string` — If included, will only include issues whose most recent action occurred after this time + +
+
+ +
+
+ +**status:** `*ticketing.IssuesListRequestStatus` + +Status of the issue. Options: ('ONGOING', 'RESOLVED') + +* `ONGOING` - ONGOING +* `RESOLVED` - RESOLVED + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Issues.Retrieve(Id) -> *ticketing.Issue +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific issue. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.Issues.Retrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +## Ticketing LinkToken +
client.Ticketing.LinkToken.Create(request) -> *ticketing.LinkToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a link token to be used when linking a new end user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []ticketing.CategoriesEnum{ + ticketing.CategoriesEnumHris, + ticketing.CategoriesEnumAts, + }, + } +client.Ticketing.LinkToken.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**endUserEmailAddress:** `string` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + +
+
+ +
+
+ +**endUserOrganizationName:** `string` — Your end user's organization. + +
+
+ +
+
+ +**endUserOriginId:** `string` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + +
+
+ +
+
+ +**categories:** `[]*ticketing.CategoriesEnum` — The integration categories to show in Merge Link. + +
+
+ +
+
+ +**integration:** `*string` — 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/. + +
+
+ +
+
+ +**linkExpiryMins:** `*int` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + +
+
+ +
+
+ +**shouldCreateMagicLinkUrl:** `*bool` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**hideAdminMagicLink:** `*bool` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**commonModels:** `[]*ticketing.CommonModelScopesBodyRequest` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + +
+
+ +
+
+ +**categoryCommonModelScopes:** `map[string][]*ticketing.IndividualCommonModelScopeDeserializerRequest` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + +
+
+ +
+
+ +**language:** `*ticketing.EndUserDetailsRequestLanguage` + +The following subset of IETF language tags can be used to configure localization. + +* `en` - en +* `de` - de + +
+
+ +
+
+ +**areSyncsDisabled:** `*bool` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. + +
+
+ +
+
+ +**integrationSpecificConfig:** `map[string]any` — A JSON object containing integration-specific configuration options. + +
+
+
+
+ + +
+
+
+ +## Ticketing LinkedAccounts +
client.Ticketing.LinkedAccounts.List() -> *ticketing.PaginatedAccountDetailsAndActionsList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List linked accounts for your organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.LinkedAccountsListRequest{ + Category: ticketing.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } +client.Ticketing.LinkedAccounts.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**category:** `*ticketing.LinkedAccountsListRequestCategory` + +Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` + +* `hris` - hris +* `ats` - ats +* `accounting` - accounting +* `ticketing` - ticketing +* `crm` - crm +* `mktg` - mktg +* `filestorage` - filestorage + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**endUserEmailAddress:** `*string` — If provided, will only return linked accounts associated with the given email address. + +
+
+ +
+
+ +**endUserOrganizationName:** `*string` — If provided, will only return linked accounts associated with the given organization name. + +
+
+ +
+
+ +**endUserOriginId:** `*string` — If provided, will only return linked accounts associated with the given origin ID. + +
+
+ +
+
+ +**endUserOriginIds:** `*string` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + +
+
+ +
+
+ +**id:** `*string` + +
+
+ +
+
+ +**ids:** `*string` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + +
+
+ +
+
+ +**includeDuplicates:** `*bool` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + +
+
+ +
+
+ +**integrationName:** `*string` — If provided, will only return linked accounts associated with the given integration name. + +
+
+ +
+
+ +**isTestAccount:** `*string` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**status:** `*string` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + +
+
+
+
+ + +
+
+
+ +## Ticketing Passthrough +
client.Ticketing.Passthrough.Create(request) -> *ticketing.RemoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.DataPassthroughRequest{ + Method: ticketing.MethodEnumGet, + Path: "/scooters", + } +client.Ticketing.Passthrough.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `*ticketing.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +## Ticketing Projects +
client.Ticketing.Projects.List() -> *ticketing.PaginatedProjectList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Project` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.ProjectsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ticketing.Projects.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Projects.Retrieve(Id) -> *ticketing.Project +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Project` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.ProjectsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Projects.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Projects.UsersList(ParentId) -> *ticketing.PaginatedUserList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `User` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.ProjectsUsersListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Ticketing.Projects.UsersList( + context.TODO(), + "parent_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**parentId:** `string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ticketing.ProjectsUsersListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Ticketing RegenerateKey +
client.Ticketing.RegenerateKey.Create(request) -> *ticketing.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } +client.Ticketing.RegenerateKey.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` — The name of the remote key + +
+
+
+
+ + +
+
+
+ +## Ticketing Roles +
client.Ticketing.Roles.List() -> *ticketing.PaginatedRoleList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Role` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.RolesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ticketing.Roles.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Roles.Retrieve(Id) -> *ticketing.Role +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Role` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.RolesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Roles.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ticketing SyncStatus +
client.Ticketing.SyncStatus.List() -> *ticketing.PaginatedSyncStatusList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } +client.Ticketing.SyncStatus.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Ticketing ForceResync +
client.Ticketing.ForceResync.SyncStatusResyncCreate() -> []*ticketing.SyncStatus +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +## Ticketing Tags +
client.Ticketing.Tags.List() -> *ticketing.PaginatedTagList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Tag` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TagsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ticketing.Tags.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Tags.Retrieve(Id) -> *ticketing.Tag +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Tag` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TagsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Tags.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ticketing Teams +
client.Ticketing.Teams.List() -> *ticketing.PaginatedTeamList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Team` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TeamsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } +client.Ticketing.Teams.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Teams.Retrieve(Id) -> *ticketing.Team +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Team` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TeamsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Teams.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ticketing Tickets +
client.Ticketing.Tickets.List() -> *ticketing.PaginatedTicketList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Ticket` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TicketsListRequest{ + AccountId: merge.String( + "account_id", + ), + AssigneeIds: merge.String( + "assignee_ids", + ), + CollectionIds: merge.String( + "collection_ids", + ), + CompletedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CompletedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ContactId: merge.String( + "contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatorId: merge.String( + "creator_id", + ), + CreatorIds: merge.String( + "creator_ids", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + DueAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + DueBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + ParentTicketId: merge.String( + "parent_ticket_id", + ), + Priority: ticketing.TicketsListRequestPriorityHigh.Ptr(), + RemoteCreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteCreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteFields: ticketing.TicketsListRequestRemoteFieldsPriority.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + RemoteUpdatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteUpdatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ShowEnumOrigins: ticketing.TicketsListRequestShowEnumOriginsPriority.Ptr(), + Status: ticketing.TicketsListRequestStatusEmpty.Ptr(), + Tags: merge.String( + "tags", + ), + TicketType: merge.String( + "ticket_type", + ), + TicketUrl: merge.String( + "ticket_url", + ), + } +client.Ticketing.Tickets.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**accountId:** `*string` — If provided, will only return tickets for this account. + +
+
+ +
+
+ +**assigneeIds:** `*string` — If provided, will only return tickets assigned to the assignee_ids; multiple assignee_ids can be separated by commas. + +
+
+ +
+
+ +**collectionIds:** `*string` — If provided, will only return tickets assigned to the collection_ids; multiple collection_ids can be separated by commas. + +
+
+ +
+
+ +**completedAfter:** `*time.Time` — If provided, will only return tickets completed after this datetime. + +
+
+ +
+
+ +**completedBefore:** `*time.Time` — If provided, will only return tickets completed before this datetime. + +
+
+ +
+
+ +**contactId:** `*string` — If provided, will only return tickets for this contact. + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**creatorId:** `*string` — If provided, will only return tickets created by this creator_id. + +
+
+ +
+
+ +**creatorIds:** `*string` — If provided, will only return tickets created by the creator_ids; multiple creator_ids can be separated by commas. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**dueAfter:** `*time.Time` — If provided, will only return tickets due after this datetime. + +
+
+ +
+
+ +**dueBefore:** `*time.Time` — If provided, will only return tickets due before this datetime. + +
+
+ +
+
+ +**expand:** `*ticketing.TicketsListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**name:** `*string` — If provided, will only return tickets with this name. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**parentTicketId:** `*string` — If provided, will only return sub tickets of the parent_ticket_id. + +
+
+ +
+
+ +**priority:** `*ticketing.TicketsListRequestPriority` + +If provided, will only return tickets of this priority. + +* `URGENT` - URGENT +* `HIGH` - HIGH +* `NORMAL` - NORMAL +* `LOW` - LOW + +
+
+ +
+
+ +**remoteCreatedAfter:** `*time.Time` — If provided, will only return tickets created in the third party platform after this datetime. + +
+
+ +
+
+ +**remoteCreatedBefore:** `*time.Time` — If provided, will only return tickets created in the third party platform before this datetime. + +
+
+ +
+
+ +**remoteFields:** `*ticketing.TicketsListRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**remoteUpdatedAfter:** `*time.Time` — If provided, will only return tickets updated in the third party platform after this datetime. + +
+
+ +
+
+ +**remoteUpdatedBefore:** `*time.Time` — If provided, will only return tickets updated in the third party platform before this datetime. + +
+
+ +
+
+ +**showEnumOrigins:** `*ticketing.TicketsListRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+ +
+
+ +**status:** `*ticketing.TicketsListRequestStatus` — If provided, will only return tickets of this status. + +
+
+ +
+
+ +**tags:** `*string` — If provided, will only return tickets matching the tags; multiple tags can be separated by commas. + +
+
+ +
+
+ +**ticketType:** `*string` — If provided, will only return tickets of this type. + +
+
+ +
+
+ +**ticketUrl:** `*string` — If provided, will only return tickets where the URL matches or contains the substring + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Tickets.Create(request) -> *ticketing.TicketResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Ticket` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TicketEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.TicketRequest{}, + } +client.Ticketing.Tickets.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ticketing.TicketRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Tickets.Retrieve(Id) -> *ticketing.Ticket +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Ticket` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TicketsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: ticketing.TicketsRetrieveRequestRemoteFieldsPriority.Ptr(), + ShowEnumOrigins: ticketing.TicketsRetrieveRequestShowEnumOriginsPriority.Ptr(), + } +client.Ticketing.Tickets.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*ticketing.TicketsRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeRemoteFields:** `*bool` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**remoteFields:** `*ticketing.TicketsRetrieveRequestRemoteFields` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**showEnumOrigins:** `*ticketing.TicketsRetrieveRequestShowEnumOrigins` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Tickets.PartialUpdate(Id, request) -> *ticketing.TicketResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a `Ticket` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.PatchedTicketEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.PatchedTicketRequest{}, + } +client.Ticketing.Tickets.PartialUpdate( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**isDebugMode:** `*bool` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**runAsync:** `*bool` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**model:** `*ticketing.PatchedTicketRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Tickets.ViewersList(TicketId) -> *ticketing.PaginatedViewerList +
+
+ +#### 📝 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) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TicketsViewersListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Ticketing.Tickets.ViewersList( + context.TODO(), + "ticket_id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**ticketId:** `string` + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `*ticketing.TicketsViewersListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Tickets.MetaPatchRetrieve(Id) -> *ticketing.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Ticket` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.Tickets.MetaPatchRetrieve( + context.TODO(), + "id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Tickets.MetaPostRetrieve() -> *ticketing.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Ticket` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TicketsMetaPostRetrieveRequest{ + CollectionId: merge.String( + "collection_id", + ), + TicketType: merge.String( + "ticket_type", + ), + } +client.Ticketing.Tickets.MetaPostRetrieve( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionId:** `*string` — If provided, will only return tickets for this collection. + +
+
+ +
+
+ +**ticketType:** `*string` — If provided, will only return tickets for this ticket type. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Tickets.RemoteFieldClassesList() -> *ticketing.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.TicketsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + Ids: merge.String( + "ids", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } +client.Ticketing.Tickets.RemoteFieldClassesList( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**ids:** `*string` — If provided, will only return remote field classes with the `ids` in this list + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**isCommonModelField:** `*bool` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**isCustom:** `*bool` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+
+
+ + +
+
+
+ +## Ticketing Users +
client.Ticketing.Users.List() -> *ticketing.PaginatedUserList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `User` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.UsersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddress: merge.String( + "email_address", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Team: merge.String( + "team", + ), + } +client.Ticketing.Users.List( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**createdAfter:** `*time.Time` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**createdBefore:** `*time.Time` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `*string` — The pagination cursor value. + +
+
+ +
+
+ +**emailAddress:** `*string` — If provided, will only return users with emails equal to this value (case insensitive). + +
+
+ +
+
+ +**expand:** `*ticketing.UsersListRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeDeletedData:** `*bool` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modifiedAfter:** `*time.Time` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modifiedBefore:** `*time.Time` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**pageSize:** `*int` — Number of results to return per page. + +
+
+ +
+
+ +**remoteId:** `*string` — The API provider's ID for the given object. + +
+
+ +
+
+ +**team:** `*string` — If provided, will only return users matching in this team. + +
+
+
+
+ + +
+
+
+ +
client.Ticketing.Users.Retrieve(Id) -> *ticketing.User +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `User` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.UsersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } +client.Ticketing.Users.Retrieve( + context.TODO(), + "id", + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**expand:** `*ticketing.UsersRetrieveRequestExpandItem` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**includeRemoteData:** `*bool` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**includeShellData:** `*bool` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+
+
+ + +
+
+
+ +## Ticketing WebhookReceivers +
client.Ticketing.WebhookReceivers.List() -> []*ticketing.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `WebhookReceiver` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Ticketing.WebhookReceivers.List( + context.TODO(), + ) +} +``` +
+
+
+
+ + +
+
+
+ +
client.Ticketing.WebhookReceivers.Create(request) -> *ticketing.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `WebhookReceiver` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &ticketing.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } +client.Ticketing.WebhookReceivers.Create( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**event:** `string` + +
+
+ +
+
+ +**isActive:** `bool` + +
+
+ +
+
+ +**key:** `*string` + +
+
+
+
+ + +
+
+
diff --git a/ticketing/account_details.go b/ticketing/account_details.go index f29b9eb..b45fa8b 100644 --- a/ticketing/account_details.go +++ b/ticketing/account_details.go @@ -6,9 +6,25 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountDetailsFieldId = big.NewInt(1 << 0) + accountDetailsFieldIntegration = big.NewInt(1 << 1) + accountDetailsFieldIntegrationSlug = big.NewInt(1 << 2) + accountDetailsFieldCategory = big.NewInt(1 << 3) + accountDetailsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsFieldStatus = big.NewInt(1 << 7) + accountDetailsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsFieldAccountType = big.NewInt(1 << 10) + accountDetailsFieldCompletedAt = big.NewInt(1 << 11) +) + type AccountDetails struct { Id *string `json:"id,omitempty" url:"id,omitempty"` Integration *string `json:"integration,omitempty" url:"integration,omitempty"` @@ -25,6 +41,9 @@ type AccountDetails struct { // The time at which account completes the linking flow. CompletedAt *time.Time `json:"completed_at,omitempty" url:"completed_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -117,6 +136,97 @@ func (a *AccountDetails) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetails) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetId(id *string) { + a.Id = id + a.require(accountDetailsFieldId) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegration(integration *string) { + a.Integration = integration + a.require(accountDetailsFieldIntegration) +} + +// SetIntegrationSlug sets the IntegrationSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIntegrationSlug(integrationSlug *string) { + a.IntegrationSlug = integrationSlug + a.require(accountDetailsFieldIntegrationSlug) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCategory(category *AccountDetailsCategory) { + a.Category = category + a.require(accountDetailsFieldCategory) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserOrganizationName(endUserOrganizationName *string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetEndUserEmailAddress(endUserEmailAddress *string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsFieldEndUserEmailAddress) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetStatus(status *string) { + a.Status = status + a.require(accountDetailsFieldStatus) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetWebhookListenerUrl(webhookListenerUrl *string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsFieldIsDuplicate) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetAccountType(accountType *string) { + a.AccountType = accountType + a.require(accountDetailsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetails) SetCompletedAt(completedAt *time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsFieldCompletedAt) +} + func (a *AccountDetails) UnmarshalJSON(data []byte) error { type embed AccountDetails var unmarshaler = struct { @@ -148,7 +258,8 @@ func (a *AccountDetails) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewOptionalDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetails) String() string { diff --git a/ticketing/account_token.go b/ticketing/account_token.go index 0072ce8..ce05118 100644 --- a/ticketing/account_token.go +++ b/ticketing/account_token.go @@ -6,6 +6,13 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + accountTokenFieldAccountToken = big.NewInt(1 << 0) + accountTokenFieldIntegration = big.NewInt(1 << 1) + accountTokenFieldId = big.NewInt(1 << 2) ) type AccountToken struct { @@ -13,6 +20,9 @@ type AccountToken struct { Integration *AccountIntegration `json:"integration" url:"integration"` Id string `json:"id" url:"id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -42,6 +52,34 @@ func (a *AccountToken) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountToken) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetAccountToken(accountToken string) { + a.AccountToken = accountToken + a.require(accountTokenFieldAccountToken) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(accountTokenFieldIntegration) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountToken) SetId(id string) { + a.Id = id + a.require(accountTokenFieldId) +} + func (a *AccountToken) UnmarshalJSON(data []byte) error { type unmarshaler AccountToken var value unmarshaler @@ -58,6 +96,17 @@ func (a *AccountToken) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountToken) MarshalJSON() ([]byte, error) { + type embed AccountToken + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountToken) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/ticketing/accountdetails/client.go b/ticketing/accountdetails/client.go index 54dcd9c..f60f44d 100644 --- a/ticketing/accountdetails/client.go +++ b/ticketing/accountdetails/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*ticketing.AccountDetails, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/account-details" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.AccountDetails - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/accountdetails/raw_client.go b/ticketing/accountdetails/raw_client.go new file mode 100644 index 0000000..dd30c99 --- /dev/null +++ b/ticketing/accountdetails/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package accountdetails + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ticketing.AccountDetails], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/account-details" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.AccountDetails + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.AccountDetails]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/accountdetails/ticketing_account_details_test/ticketing_account_details_test.go b/ticketing/accountdetails/ticketing_account_details_test/ticketing_account_details_test.go new file mode 100644 index 0000000..9cea3c4 --- /dev/null +++ b/ticketing/accountdetails/ticketing_account_details_test/ticketing_account_details_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_account_details_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingAccountDetailsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.AccountDetails.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/account-details", nil, 1) +} diff --git a/ticketing/accounts.go b/ticketing/accounts.go index 11004bb..bfe7552 100644 --- a/ticketing/accounts.go +++ b/ticketing/accounts.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + accountsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + accountsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + accountsListRequestFieldCursor = big.NewInt(1 << 2) + accountsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + accountsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + accountsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + accountsListRequestFieldModifiedAfter = big.NewInt(1 << 6) + accountsListRequestFieldModifiedBefore = big.NewInt(1 << 7) + accountsListRequestFieldPageSize = big.NewInt(1 << 8) + accountsListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type AccountsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,20 +44,138 @@ type AccountsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AccountsListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCreatedAfter(createdAfter *time.Time) { + a.CreatedAfter = createdAfter + a.require(accountsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCreatedBefore(createdBefore *time.Time) { + a.CreatedBefore = createdBefore + a.require(accountsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(accountsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(accountsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(accountsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(accountsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + a.ModifiedAfter = modifiedAfter + a.require(accountsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + a.ModifiedBefore = modifiedBefore + a.require(accountsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(accountsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsListRequest) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(accountsListRequestFieldRemoteId) } +var ( + accountsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + accountsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type AccountsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (a *AccountsRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(accountsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(accountsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedAccountListFieldNext = big.NewInt(1 << 0) + paginatedAccountListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Account `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -73,6 +205,34 @@ func (p *PaginatedAccountList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedAccountList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountList) SetResults(results []*Account) { + p.Results = results + p.require(paginatedAccountListFieldResults) +} + func (p *PaginatedAccountList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountList var value unmarshaler @@ -89,6 +249,17 @@ func (p *PaginatedAccountList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAccountList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ticketing/accounts/client.go b/ticketing/accounts/client.go index 57903a5..a0281c9 100644 --- a/ticketing/accounts/client.go +++ b/ticketing/accounts/client.go @@ -4,7 +4,6 @@ package accounts import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.AccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Account], error) { +) (*core.Page[*string, *ticketing.Account], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedAccountList) *internal.PageResponse[*string, *ticketing.Account] { + readPageResponse := func(response *ticketing.PaginatedAccountList) *core.PageResponse[*string, *ticketing.Account] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Account]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Account]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ticketing.AccountsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Account, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/accounts/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Account - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ticketing/accounts/raw_client.go b/ticketing/accounts/raw_client.go new file mode 100644 index 0000000..e2cf11c --- /dev/null +++ b/ticketing/accounts/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounts + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.AccountsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Account], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/accounts/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Account + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Account]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/accounts/ticketing_accounts_test/ticketing_accounts_test.go b/ticketing/accounts/ticketing_accounts_test/ticketing_accounts_test.go new file mode 100644 index 0000000..8947781 --- /dev/null +++ b/ticketing/accounts/ticketing_accounts_test/ticketing_accounts_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.AccountsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ticketing.Accounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/accounts", map[string]string{"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"}, 1) +} + +func TestTicketingAccountsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.AccountsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Accounts.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/accounts/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ticketing/accounttoken/client.go b/ticketing/accounttoken/client.go index 96fc287..f7f6a4b 100644 --- a/ticketing/accounttoken/client.go +++ b/ticketing/accounttoken/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,36 +38,13 @@ func (c *Client) Retrieve( publicToken string, opts ...option.RequestOption, ) (*ticketing.AccountToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/account-token/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, publicToken, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.AccountToken - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/accounttoken/raw_client.go b/ticketing/accounttoken/raw_client.go new file mode 100644 index 0000000..f65ad97 --- /dev/null +++ b/ticketing/accounttoken/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package accounttoken + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + publicToken string, + opts ...option.RequestOption, +) (*core.Response[*ticketing.AccountToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/account-token/%v", + publicToken, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.AccountToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.AccountToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/accounttoken/ticketing_account_token_test/ticketing_account_token_test.go b/ticketing/accounttoken/ticketing_account_token_test/ticketing_account_token_test.go new file mode 100644 index 0000000..535db9f --- /dev/null +++ b/ticketing/accounttoken/ticketing_account_token_test/ticketing_account_token_test.go @@ -0,0 +1,80 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_account_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingAccountTokenRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.AccountToken.Retrieve( + context.TODO(), + "public_token", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/account-token/public_token", nil, 1) +} diff --git a/ticketing/async_passthrough.go b/ticketing/async_passthrough.go index f6e2681..87300a9 100644 --- a/ticketing/async_passthrough.go +++ b/ticketing/async_passthrough.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) type AsyncPassthroughRetrieveResponse struct { @@ -70,9 +71,16 @@ func (a *AsyncPassthroughRetrieveResponse) Accept(visitor AsyncPassthroughRetrie return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + asyncPassthroughRecieptFieldAsyncPassthroughReceiptId = big.NewInt(1 << 0) +) + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id" url:"async_passthrough_receipt_id"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -88,6 +96,20 @@ func (a *AsyncPassthroughReciept) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AsyncPassthroughReciept) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetAsyncPassthroughReceiptId sets the AsyncPassthroughReceiptId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AsyncPassthroughReciept) SetAsyncPassthroughReceiptId(asyncPassthroughReceiptId string) { + a.AsyncPassthroughReceiptId = asyncPassthroughReceiptId + a.require(asyncPassthroughRecieptFieldAsyncPassthroughReceiptId) +} + func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { type unmarshaler AsyncPassthroughReciept var value unmarshaler @@ -104,6 +126,17 @@ func (a *AsyncPassthroughReciept) UnmarshalJSON(data []byte) error { return nil } +func (a *AsyncPassthroughReciept) MarshalJSON() ([]byte, error) { + type embed AsyncPassthroughReciept + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AsyncPassthroughReciept) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/ticketing/asyncpassthrough/client.go b/ticketing/asyncpassthrough/client.go index c36db1d..d8ab5ad 100644 --- a/ticketing/asyncpassthrough/client.go +++ b/ticketing/asyncpassthrough/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,37 +38,15 @@ func (c *Client) Create( request *ticketing.DataPassthroughRequest, opts ...option.RequestOption, ) (*ticketing.AsyncPassthroughReciept, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/async-passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.AsyncPassthroughReciept - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Retrieves data from earlier async-passthrough POST request @@ -76,36 +55,13 @@ func (c *Client) Retrieve( asyncPassthroughReceiptId string, opts ...option.RequestOption, ) (*ticketing.AsyncPassthroughRetrieveResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/async-passthrough/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, asyncPassthroughReceiptId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.AsyncPassthroughRetrieveResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/asyncpassthrough/raw_client.go b/ticketing/asyncpassthrough/raw_client.go new file mode 100644 index 0000000..b61ecf4 --- /dev/null +++ b/ticketing/asyncpassthrough/raw_client.go @@ -0,0 +1,115 @@ +// Code generated by Fern. DO NOT EDIT. + +package asyncpassthrough + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.AsyncPassthroughReciept], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/async-passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.AsyncPassthroughReciept + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.AsyncPassthroughReciept]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + asyncPassthroughReceiptId string, + opts ...option.RequestOption, +) (*core.Response[*ticketing.AsyncPassthroughRetrieveResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/async-passthrough/%v", + asyncPassthroughReceiptId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.AsyncPassthroughRetrieveResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.AsyncPassthroughRetrieveResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/asyncpassthrough/ticketing_async_passthrough_test/ticketing_async_passthrough_test.go b/ticketing/asyncpassthrough/ticketing_async_passthrough_test/ticketing_async_passthrough_test.go new file mode 100644 index 0000000..9ddfa52 --- /dev/null +++ b/ticketing/asyncpassthrough/ticketing_async_passthrough_test/ticketing_async_passthrough_test.go @@ -0,0 +1,104 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_async_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingAsyncPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.DataPassthroughRequest{ + Method: ticketing.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Ticketing.AsyncPassthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/async-passthrough", nil, 1) +} + +func TestTicketingAsyncPassthroughRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.AsyncPassthrough.Retrieve( + context.TODO(), + "async_passthrough_receipt_id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/async-passthrough/async_passthrough_receipt_id", nil, 1) +} diff --git a/ticketing/attachments.go b/ticketing/attachments.go index 87c599e..7656034 100644 --- a/ticketing/attachments.go +++ b/ticketing/attachments.go @@ -6,24 +6,107 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + ticketingAttachmentEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + ticketingAttachmentEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + ticketingAttachmentEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type TicketingAttachmentEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *AttachmentRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TicketingAttachmentEndpointRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingAttachmentEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + t.IsDebugMode = isDebugMode + t.require(ticketingAttachmentEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingAttachmentEndpointRequest) SetRunAsync(runAsync *bool) { + t.RunAsync = runAsync + t.require(ticketingAttachmentEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingAttachmentEndpointRequest) SetModel(model *AttachmentRequest) { + t.Model = model + t.require(ticketingAttachmentEndpointRequestFieldModel) +} + +var ( + attachmentsDownloadRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 0) + attachmentsDownloadRetrieveRequestFieldMimeType = big.NewInt(1 << 1) +) + type AttachmentsDownloadRetrieveRequest struct { // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // 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. MimeType *string `json:"-" url:"mime_type,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (a *AttachmentsDownloadRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsDownloadRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(attachmentsDownloadRetrieveRequestFieldIncludeShellData) +} + +// SetMimeType sets the MimeType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsDownloadRetrieveRequest) SetMimeType(mimeType *string) { + a.MimeType = mimeType + a.require(attachmentsDownloadRetrieveRequestFieldMimeType) +} + +var ( + attachmentsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + attachmentsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + attachmentsListRequestFieldCursor = big.NewInt(1 << 2) + attachmentsListRequestFieldExpand = big.NewInt(1 << 3) + attachmentsListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + attachmentsListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + attachmentsListRequestFieldIncludeShellData = big.NewInt(1 << 6) + attachmentsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + attachmentsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + attachmentsListRequestFieldPageSize = big.NewInt(1 << 9) + attachmentsListRequestFieldRemoteCreatedAfter = big.NewInt(1 << 10) + attachmentsListRequestFieldRemoteId = big.NewInt(1 << 11) + attachmentsListRequestFieldTicketId = big.NewInt(1 << 12) +) + type AttachmentsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -51,8 +134,115 @@ type AttachmentsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // If provided, will only return comments for this ticket. TicketId *string `json:"-" url:"ticket_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AttachmentsListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) } +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCreatedAfter(createdAfter *time.Time) { + a.CreatedAfter = createdAfter + a.require(attachmentsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCreatedBefore(createdBefore *time.Time) { + a.CreatedBefore = createdBefore + a.require(attachmentsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(attachmentsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(attachmentsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + a.IncludeDeletedData = includeDeletedData + a.require(attachmentsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(attachmentsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(attachmentsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + a.ModifiedAfter = modifiedAfter + a.require(attachmentsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + a.ModifiedBefore = modifiedBefore + a.require(attachmentsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(attachmentsListRequestFieldPageSize) +} + +// SetRemoteCreatedAfter sets the RemoteCreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetRemoteCreatedAfter(remoteCreatedAfter *time.Time) { + a.RemoteCreatedAfter = remoteCreatedAfter + a.require(attachmentsListRequestFieldRemoteCreatedAfter) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(attachmentsListRequestFieldRemoteId) +} + +// SetTicketId sets the TicketId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsListRequest) SetTicketId(ticketId *string) { + a.TicketId = ticketId + a.require(attachmentsListRequestFieldTicketId) +} + +var ( + attachmentsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + attachmentsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + attachmentsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type AttachmentsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -60,6 +250,37 @@ type AttachmentsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AttachmentsRetrieveRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetExpand(expand []*string) { + a.Expand = expand + a.require(attachmentsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + a.IncludeRemoteData = includeRemoteData + a.require(attachmentsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + a.IncludeShellData = includeShellData + a.require(attachmentsRetrieveRequestFieldIncludeShellData) } // # The Attachment Object @@ -68,6 +289,16 @@ type AttachmentsRetrieveRequest struct { // // ### Usage Example // TODO +var ( + attachmentRequestFieldFileName = big.NewInt(1 << 0) + attachmentRequestFieldTicket = big.NewInt(1 << 1) + attachmentRequestFieldFileUrl = big.NewInt(1 << 2) + attachmentRequestFieldContentType = big.NewInt(1 << 3) + attachmentRequestFieldUploadedBy = big.NewInt(1 << 4) + attachmentRequestFieldIntegrationParams = big.NewInt(1 << 5) + attachmentRequestFieldLinkedAccountParams = big.NewInt(1 << 6) +) + type AttachmentRequest struct { // The attachment's name. It is required to include the file extension in the attachment's name. FileName *string `json:"file_name,omitempty" url:"file_name,omitempty"` @@ -82,6 +313,9 @@ type AttachmentRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -139,6 +373,62 @@ func (a *AttachmentRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AttachmentRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetFileName(fileName *string) { + a.FileName = fileName + a.require(attachmentRequestFieldFileName) +} + +// SetTicket sets the Ticket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetTicket(ticket *AttachmentRequestTicket) { + a.Ticket = ticket + a.require(attachmentRequestFieldTicket) +} + +// SetFileUrl sets the FileUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetFileUrl(fileUrl *string) { + a.FileUrl = fileUrl + a.require(attachmentRequestFieldFileUrl) +} + +// SetContentType sets the ContentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetContentType(contentType *string) { + a.ContentType = contentType + a.require(attachmentRequestFieldContentType) +} + +// SetUploadedBy sets the UploadedBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetUploadedBy(uploadedBy *string) { + a.UploadedBy = uploadedBy + a.require(attachmentRequestFieldUploadedBy) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + a.IntegrationParams = integrationParams + a.require(attachmentRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AttachmentRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + a.LinkedAccountParams = linkedAccountParams + a.require(attachmentRequestFieldLinkedAccountParams) +} + func (a *AttachmentRequest) UnmarshalJSON(data []byte) error { type unmarshaler AttachmentRequest var value unmarshaler @@ -155,6 +445,17 @@ func (a *AttachmentRequest) UnmarshalJSON(data []byte) error { return nil } +func (a *AttachmentRequest) MarshalJSON() ([]byte, error) { + type embed AttachmentRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AttachmentRequest) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -230,11 +531,20 @@ func (a *AttachmentRequestTicket) Accept(visitor AttachmentRequestTicketVisitor) return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + paginatedAttachmentListFieldNext = big.NewInt(1 << 0) + paginatedAttachmentListFieldPrevious = big.NewInt(1 << 1) + paginatedAttachmentListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAttachmentList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Attachment `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -264,6 +574,34 @@ func (p *PaginatedAttachmentList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedAttachmentList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAttachmentList) SetNext(next *string) { + p.Next = next + p.require(paginatedAttachmentListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAttachmentList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAttachmentListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAttachmentList) SetResults(results []*Attachment) { + p.Results = results + p.require(paginatedAttachmentListFieldResults) +} + func (p *PaginatedAttachmentList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAttachmentList var value unmarshaler @@ -280,6 +618,17 @@ func (p *PaginatedAttachmentList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAttachmentList) MarshalJSON() ([]byte, error) { + type embed PaginatedAttachmentList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAttachmentList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -292,12 +641,22 @@ func (p *PaginatedAttachmentList) String() string { return fmt.Sprintf("%#v", p) } +var ( + ticketingAttachmentResponseFieldModel = big.NewInt(1 << 0) + ticketingAttachmentResponseFieldWarnings = big.NewInt(1 << 1) + ticketingAttachmentResponseFieldErrors = big.NewInt(1 << 2) + ticketingAttachmentResponseFieldLogs = big.NewInt(1 << 3) +) + type TicketingAttachmentResponse struct { Model *Attachment `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -334,6 +693,41 @@ func (t *TicketingAttachmentResponse) GetExtraProperties() map[string]interface{ return t.extraProperties } +func (t *TicketingAttachmentResponse) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingAttachmentResponse) SetModel(model *Attachment) { + t.Model = model + t.require(ticketingAttachmentResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingAttachmentResponse) SetWarnings(warnings []*WarningValidationProblem) { + t.Warnings = warnings + t.require(ticketingAttachmentResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingAttachmentResponse) SetErrors(errors []*ErrorValidationProblem) { + t.Errors = errors + t.require(ticketingAttachmentResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingAttachmentResponse) SetLogs(logs []*DebugModeLog) { + t.Logs = logs + t.require(ticketingAttachmentResponseFieldLogs) +} + func (t *TicketingAttachmentResponse) UnmarshalJSON(data []byte) error { type unmarshaler TicketingAttachmentResponse var value unmarshaler @@ -350,6 +744,17 @@ func (t *TicketingAttachmentResponse) UnmarshalJSON(data []byte) error { return nil } +func (t *TicketingAttachmentResponse) MarshalJSON() ([]byte, error) { + type embed TicketingAttachmentResponse + var marshaler = struct { + embed + }{ + embed: embed(*t), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (t *TicketingAttachmentResponse) String() string { if len(t.rawJSON) > 0 { if value, err := internal.StringifyJSON(t.rawJSON); err == nil { diff --git a/ticketing/attachments/client.go b/ticketing/attachments/client.go index d33b926..dba7263 100644 --- a/ticketing/attachments/client.go +++ b/ticketing/attachments/client.go @@ -3,9 +3,7 @@ package attachments import ( - bytes "bytes" context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -15,22 +13,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -39,7 +39,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.AttachmentsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Attachment], error) { +) (*core.Page[*string, *ticketing.Attachment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -52,13 +52,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -75,11 +74,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedAttachmentList) *internal.PageResponse[*string, *ticketing.Attachment] { + readPageResponse := func(response *ticketing.PaginatedAttachmentList) *core.PageResponse[*string, *ticketing.Attachment] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Attachment]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Attachment]{ Next: next, Results: results, Done: next == zeroValue, @@ -99,44 +98,15 @@ func (c *Client) Create( request *ticketing.TicketingAttachmentEndpointRequest, opts ...option.RequestOption, ) (*ticketing.TicketingAttachmentResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ticketing/v1/attachments" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.TicketingAttachmentResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns an `Attachment` object with the given `id`. @@ -146,45 +116,16 @@ func (c *Client) Retrieve( request *ticketing.AttachmentsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Attachment, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/attachments/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Attachment - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns the `File` content with the given `id` as a stream of bytes. @@ -194,45 +135,16 @@ func (c *Client) DownloadRetrieve( request *ticketing.AttachmentsDownloadRetrieveRequest, opts ...option.RequestOption, ) (io.Reader, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/attachments/%v/download", + response, err := c.WithRawResponse.DownloadRetrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - response := bytes.NewBuffer(nil) - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `TicketingAttachment` POSTs. @@ -240,33 +152,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ticketing.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/attachments/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/attachments/raw_client.go b/ticketing/attachments/raw_client.go new file mode 100644 index 0000000..09eee2f --- /dev/null +++ b/ticketing/attachments/raw_client.go @@ -0,0 +1,223 @@ +// Code generated by Fern. DO NOT EDIT. + +package attachments + +import ( + bytes "bytes" + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + io "io" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.TicketingAttachmentEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.TicketingAttachmentResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/attachments" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.TicketingAttachmentResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.TicketingAttachmentResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.AttachmentsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Attachment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/attachments/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Attachment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Attachment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) DownloadRetrieve( + ctx context.Context, + id string, + request *ticketing.AttachmentsDownloadRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[io.Reader], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/attachments/%v/download", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + response := bytes.NewBuffer(nil) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[io.Reader]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ticketing.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/attachments/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/attachments/ticketing_attachments_test/ticketing_attachments_test.go b/ticketing/attachments/ticketing_attachments_test/ticketing_attachments_test.go new file mode 100644 index 0000000..6a88668 --- /dev/null +++ b/ticketing/attachments/ticketing_attachments_test/ticketing_attachments_test.go @@ -0,0 +1,204 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_attachments_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingAttachmentsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.AttachmentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteCreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteId: merge.String( + "remote_id", + ), + TicketId: merge.String( + "ticket_id", + ), + } + _, invocationErr := client.Ticketing.Attachments.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/attachments", map[string]string{"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"}, 1) +} + +func TestTicketingAttachmentsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TicketingAttachmentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.AttachmentRequest{}, + } + _, invocationErr := client.Ticketing.Attachments.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/attachments", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestTicketingAttachmentsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.AttachmentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Attachments.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/attachments/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestTicketingAttachmentsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.Attachments.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/attachments/meta/post", nil, 1) +} diff --git a/ticketing/audit_trail.go b/ticketing/audit_trail.go index af42f13..1095174 100644 --- a/ticketing/audit_trail.go +++ b/ticketing/audit_trail.go @@ -6,9 +6,19 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + auditTrailListRequestFieldCursor = big.NewInt(1 << 0) + auditTrailListRequestFieldEndDate = big.NewInt(1 << 1) + auditTrailListRequestFieldEventType = big.NewInt(1 << 2) + auditTrailListRequestFieldPageSize = big.NewInt(1 << 3) + auditTrailListRequestFieldStartDate = big.NewInt(1 << 4) + auditTrailListRequestFieldUserEmail = big.NewInt(1 << 5) +) + type AuditTrailListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -22,8 +32,71 @@ type AuditTrailListRequest struct { StartDate *string `json:"-" url:"start_date,omitempty"` // 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. UserEmail *string `json:"-" url:"user_email,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (a *AuditTrailListRequest) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetCursor(cursor *string) { + a.Cursor = cursor + a.require(auditTrailListRequestFieldCursor) } +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEndDate(endDate *string) { + a.EndDate = endDate + a.require(auditTrailListRequestFieldEndDate) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetEventType(eventType *string) { + a.EventType = eventType + a.require(auditTrailListRequestFieldEventType) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetPageSize(pageSize *int) { + a.PageSize = pageSize + a.require(auditTrailListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetStartDate(startDate *string) { + a.StartDate = startDate + a.require(auditTrailListRequestFieldStartDate) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditTrailListRequest) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditTrailListRequestFieldUserEmail) +} + +var ( + auditLogEventFieldId = big.NewInt(1 << 0) + auditLogEventFieldUserName = big.NewInt(1 << 1) + auditLogEventFieldUserEmail = big.NewInt(1 << 2) + auditLogEventFieldRole = big.NewInt(1 << 3) + auditLogEventFieldIpAddress = big.NewInt(1 << 4) + auditLogEventFieldEventType = big.NewInt(1 << 5) + auditLogEventFieldEventDescription = big.NewInt(1 << 6) + auditLogEventFieldCreatedAt = big.NewInt(1 << 7) +) + type AuditLogEvent struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The User's full name at the time of this Event occurring. @@ -89,6 +162,9 @@ type AuditLogEvent struct { EventDescription string `json:"event_description" url:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -153,6 +229,69 @@ func (a *AuditLogEvent) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AuditLogEvent) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetId(id *string) { + a.Id = id + a.require(auditLogEventFieldId) +} + +// SetUserName sets the UserName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserName(userName *string) { + a.UserName = userName + a.require(auditLogEventFieldUserName) +} + +// SetUserEmail sets the UserEmail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetUserEmail(userEmail *string) { + a.UserEmail = userEmail + a.require(auditLogEventFieldUserEmail) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetRole(role *AuditLogEventRole) { + a.Role = role + a.require(auditLogEventFieldRole) +} + +// SetIpAddress sets the IpAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetIpAddress(ipAddress string) { + a.IpAddress = ipAddress + a.require(auditLogEventFieldIpAddress) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventType(eventType *AuditLogEventEventType) { + a.EventType = eventType + a.require(auditLogEventFieldEventType) +} + +// SetEventDescription sets the EventDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetEventDescription(eventDescription string) { + a.EventDescription = eventDescription + a.require(auditLogEventFieldEventDescription) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AuditLogEvent) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(auditLogEventFieldCreatedAt) +} + func (a *AuditLogEvent) UnmarshalJSON(data []byte) error { type embed AuditLogEvent var unmarshaler = struct { @@ -184,7 +323,8 @@ func (a *AuditLogEvent) MarshalJSON() ([]byte, error) { embed: embed(*a), CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AuditLogEvent) String() string { @@ -564,11 +704,20 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +var ( + paginatedAuditLogEventListFieldNext = big.NewInt(1 << 0) + paginatedAuditLogEventListFieldPrevious = big.NewInt(1 << 1) + paginatedAuditLogEventListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAuditLogEventList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AuditLogEvent `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -598,6 +747,34 @@ func (p *PaginatedAuditLogEventList) GetExtraProperties() map[string]interface{} return p.extraProperties } +func (p *PaginatedAuditLogEventList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetNext(next *string) { + p.Next = next + p.require(paginatedAuditLogEventListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAuditLogEventListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAuditLogEventList) SetResults(results []*AuditLogEvent) { + p.Results = results + p.require(paginatedAuditLogEventListFieldResults) +} + func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAuditLogEventList var value unmarshaler @@ -614,6 +791,17 @@ func (p *PaginatedAuditLogEventList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedAuditLogEventList) MarshalJSON() ([]byte, error) { + type embed PaginatedAuditLogEventList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAuditLogEventList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ticketing/audittrail/client.go b/ticketing/audittrail/client.go index 118a7c4..65c206a 100644 --- a/ticketing/audittrail/client.go +++ b/ticketing/audittrail/client.go @@ -4,7 +4,6 @@ package audittrail import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.AuditTrailListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.AuditLogEvent], error) { +) (*core.Page[*string, *ticketing.AuditLogEvent], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedAuditLogEventList) *internal.PageResponse[*string, *ticketing.AuditLogEvent] { + readPageResponse := func(response *ticketing.PaginatedAuditLogEventList) *core.PageResponse[*string, *ticketing.AuditLogEvent] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.AuditLogEvent]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.AuditLogEvent]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ticketing/audittrail/raw_client.go b/ticketing/audittrail/raw_client.go new file mode 100644 index 0000000..cce0cac --- /dev/null +++ b/ticketing/audittrail/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package audittrail + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/ticketing/audittrail/ticketing_audit_trail_test/ticketing_audit_trail_test.go b/ticketing/audittrail/ticketing_audit_trail_test/ticketing_audit_trail_test.go new file mode 100644 index 0000000..d6484d5 --- /dev/null +++ b/ticketing/audittrail/ticketing_audit_trail_test/ticketing_audit_trail_test.go @@ -0,0 +1,102 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_audit_trail_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingAuditTrailListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.AuditTrailListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EventType: merge.String( + "event_type", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + UserEmail: merge.String( + "user_email", + ), + } + _, invocationErr := client.Ticketing.AuditTrail.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/audit-trail", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "end_date": "end_date", "event_type": "event_type", "page_size": "1", "start_date": "start_date", "user_email": "user_email"}, 1) +} diff --git a/ticketing/available_actions.go b/ticketing/available_actions.go index 70d6d39..f778c5d 100644 --- a/ticketing/available_actions.go +++ b/ticketing/available_actions.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" ) // # The AvailableActions Object @@ -14,11 +15,20 @@ import ( // // ### Usage Example // Fetch all the actions available for the `Zenefits` integration. +var ( + availableActionsFieldIntegration = big.NewInt(1 << 0) + availableActionsFieldPassthroughAvailable = big.NewInt(1 << 1) + availableActionsFieldAvailableModelOperations = big.NewInt(1 << 2) +) + type AvailableActions struct { Integration *AccountIntegration `json:"integration" url:"integration"` PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +58,34 @@ func (a *AvailableActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AvailableActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetIntegration(integration *AccountIntegration) { + a.Integration = integration + a.require(availableActionsFieldIntegration) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(availableActionsFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AvailableActions) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(availableActionsFieldAvailableModelOperations) +} + func (a *AvailableActions) UnmarshalJSON(data []byte) error { type unmarshaler AvailableActions var value unmarshaler @@ -64,6 +102,17 @@ func (a *AvailableActions) UnmarshalJSON(data []byte) error { return nil } +func (a *AvailableActions) MarshalJSON() ([]byte, error) { + type embed AvailableActions + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AvailableActions) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { diff --git a/ticketing/availableactions/client.go b/ticketing/availableactions/client.go index de835b7..e288dcc 100644 --- a/ticketing/availableactions/client.go +++ b/ticketing/availableactions/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) Retrieve( ctx context.Context, opts ...option.RequestOption, ) (*ticketing.AvailableActions, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/available-actions" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.AvailableActions - if err := c.caller.Call( + response, err := c.WithRawResponse.Retrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/availableactions/raw_client.go b/ticketing/availableactions/raw_client.go new file mode 100644 index 0000000..658989e --- /dev/null +++ b/ticketing/availableactions/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package availableactions + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ticketing.AvailableActions], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/available-actions" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.AvailableActions + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.AvailableActions]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/availableactions/ticketing_available_actions_test/ticketing_available_actions_test.go b/ticketing/availableactions/ticketing_available_actions_test/ticketing_available_actions_test.go new file mode 100644 index 0000000..ddfb9ec --- /dev/null +++ b/ticketing/availableactions/ticketing_available_actions_test/ticketing_available_actions_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_available_actions_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingAvailableActionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.AvailableActions.Retrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/available-actions", nil, 1) +} diff --git a/ticketing/client/client.go b/ticketing/client/client.go index b37257f..dc32827 100644 --- a/ticketing/client/client.go +++ b/ticketing/client/client.go @@ -5,7 +5,6 @@ package client import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" - option "github.com/merge-api/merge-go-client/v2/option" accountdetails "github.com/merge-api/merge-go-client/v2/ticketing/accountdetails" accounts "github.com/merge-api/merge-go-client/v2/ticketing/accounts" accounttoken "github.com/merge-api/merge-go-client/v2/ticketing/accounttoken" @@ -34,14 +33,9 @@ import ( tickets "github.com/merge-api/merge-go-client/v2/ticketing/tickets" users "github.com/merge-api/merge-go-client/v2/ticketing/users" webhookreceivers "github.com/merge-api/merge-go-client/v2/ticketing/webhookreceivers" - http "net/http" ) type Client struct { - baseURL string - caller *internal.Caller - header http.Header - AccountDetails *accountdetails.Client AccountToken *accounttoken.Client Accounts *accounts.Client @@ -70,46 +64,49 @@ type Client struct { Tickets *tickets.Client Users *users.Client WebhookReceivers *webhookreceivers.Client + + options *core.RequestOptions + baseURL string + caller *internal.Caller } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + AccountDetails: accountdetails.NewClient(options), + AccountToken: accounttoken.NewClient(options), + Accounts: accounts.NewClient(options), + AsyncPassthrough: asyncpassthrough.NewClient(options), + Attachments: attachments.NewClient(options), + AuditTrail: audittrail.NewClient(options), + AvailableActions: availableactions.NewClient(options), + Collections: collections.NewClient(options), + Comments: comments.NewClient(options), + Contacts: contacts.NewClient(options), + Scopes: scopes.NewClient(options), + DeleteAccount: deleteaccount.NewClient(options), + FieldMapping: fieldmapping.NewClient(options), + GenerateKey: generatekey.NewClient(options), + Issues: issues.NewClient(options), + LinkToken: linktoken.NewClient(options), + LinkedAccounts: linkedaccounts.NewClient(options), + Passthrough: passthrough.NewClient(options), + Projects: projects.NewClient(options), + RegenerateKey: regeneratekey.NewClient(options), + Roles: roles.NewClient(options), + SyncStatus: syncstatus.NewClient(options), + ForceResync: forceresync.NewClient(options), + Tags: tags.NewClient(options), + Teams: teams.NewClient(options), + Tickets: tickets.NewClient(options), + Users: users.NewClient(options), + WebhookReceivers: webhookreceivers.NewClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), - AccountDetails: accountdetails.NewClient(opts...), - AccountToken: accounttoken.NewClient(opts...), - Accounts: accounts.NewClient(opts...), - AsyncPassthrough: asyncpassthrough.NewClient(opts...), - Attachments: attachments.NewClient(opts...), - AuditTrail: audittrail.NewClient(opts...), - AvailableActions: availableactions.NewClient(opts...), - Collections: collections.NewClient(opts...), - Comments: comments.NewClient(opts...), - Contacts: contacts.NewClient(opts...), - Scopes: scopes.NewClient(opts...), - DeleteAccount: deleteaccount.NewClient(opts...), - FieldMapping: fieldmapping.NewClient(opts...), - GenerateKey: generatekey.NewClient(opts...), - Issues: issues.NewClient(opts...), - LinkToken: linktoken.NewClient(opts...), - LinkedAccounts: linkedaccounts.NewClient(opts...), - Passthrough: passthrough.NewClient(opts...), - Projects: projects.NewClient(opts...), - RegenerateKey: regeneratekey.NewClient(opts...), - Roles: roles.NewClient(opts...), - SyncStatus: syncstatus.NewClient(opts...), - ForceResync: forceresync.NewClient(opts...), - Tags: tags.NewClient(opts...), - Teams: teams.NewClient(opts...), - Tickets: tickets.NewClient(opts...), - Users: users.NewClient(opts...), - WebhookReceivers: webhookreceivers.NewClient(opts...), } } diff --git a/ticketing/collections.go b/ticketing/collections.go index 9852046..9900236 100644 --- a/ticketing/collections.go +++ b/ticketing/collections.go @@ -6,12 +6,32 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + collectionsListRequestFieldCollectionType = big.NewInt(1 << 0) + collectionsListRequestFieldCreatedAfter = big.NewInt(1 << 1) + collectionsListRequestFieldCreatedBefore = big.NewInt(1 << 2) + collectionsListRequestFieldCursor = big.NewInt(1 << 3) + collectionsListRequestFieldExpand = big.NewInt(1 << 4) + collectionsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + collectionsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + collectionsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + collectionsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + collectionsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + collectionsListRequestFieldName = big.NewInt(1 << 10) + collectionsListRequestFieldPageSize = big.NewInt(1 << 11) + collectionsListRequestFieldParentCollectionId = big.NewInt(1 << 12) + collectionsListRequestFieldRemoteFields = big.NewInt(1 << 13) + collectionsListRequestFieldRemoteId = big.NewInt(1 << 14) + collectionsListRequestFieldShowEnumOrigins = big.NewInt(1 << 15) +) + type CollectionsListRequest struct { // If provided, will only return collections of the given type. - CollectionType *string `json:"-" url:"collection_type,omitempty"` + CollectionType *CollectionsListRequestCollectionType `json:"-" url:"collection_type,omitempty"` // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` // If provided, will only return objects created before this datetime. @@ -30,6 +50,8 @@ type CollectionsListRequest struct { ModifiedAfter *time.Time `json:"-" url:"modified_after,omitempty"` // If provided, only objects synced by Merge before this date time will be returned. ModifiedBefore *time.Time `json:"-" url:"modified_before,omitempty"` + // If provided, will only return collections with this name. + Name *string `json:"-" url:"name,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` // If provided, will only return collections whose parent collection matches the given id. @@ -40,8 +62,138 @@ type CollectionsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CollectionsListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCollectionType sets the CollectionType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetCollectionType(collectionType *CollectionsListRequestCollectionType) { + c.CollectionType = collectionType + c.require(collectionsListRequestFieldCollectionType) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(collectionsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(collectionsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(collectionsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(collectionsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(collectionsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(collectionsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(collectionsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(collectionsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(collectionsListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetName(name *string) { + c.Name = name + c.require(collectionsListRequestFieldName) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(collectionsListRequestFieldPageSize) +} + +// SetParentCollectionId sets the ParentCollectionId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetParentCollectionId(parentCollectionId *string) { + c.ParentCollectionId = parentCollectionId + c.require(collectionsListRequestFieldParentCollectionId) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetRemoteFields(remoteFields *string) { + c.RemoteFields = remoteFields + c.require(collectionsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(collectionsListRequestFieldRemoteId) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsListRequest) SetShowEnumOrigins(showEnumOrigins *string) { + c.ShowEnumOrigins = showEnumOrigins + c.require(collectionsListRequestFieldShowEnumOrigins) } +var ( + collectionsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + collectionsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + collectionsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) + collectionsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 3) + collectionsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 4) +) + type CollectionsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -53,6 +205,76 @@ type CollectionsRetrieveRequest struct { RemoteFields *string `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *string `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CollectionsRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsRetrieveRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(collectionsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(collectionsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(collectionsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsRetrieveRequest) SetRemoteFields(remoteFields *string) { + c.RemoteFields = remoteFields + c.require(collectionsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *string) { + c.ShowEnumOrigins = showEnumOrigins + c.require(collectionsRetrieveRequestFieldShowEnumOrigins) +} + +type CollectionsListRequestCollectionType string + +const ( + CollectionsListRequestCollectionTypeEmpty CollectionsListRequestCollectionType = "" + CollectionsListRequestCollectionTypeList CollectionsListRequestCollectionType = "LIST" + CollectionsListRequestCollectionTypeProject CollectionsListRequestCollectionType = "PROJECT" +) + +func NewCollectionsListRequestCollectionTypeFromString(s string) (CollectionsListRequestCollectionType, error) { + switch s { + case "": + return CollectionsListRequestCollectionTypeEmpty, nil + case "LIST": + return CollectionsListRequestCollectionTypeList, nil + case "PROJECT": + return CollectionsListRequestCollectionTypeProject, nil + } + var t CollectionsListRequestCollectionType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CollectionsListRequestCollectionType) Ptr() *CollectionsListRequestCollectionType { + return &c } type CollectionsViewersListRequestExpandItem string @@ -77,11 +299,20 @@ func (c CollectionsViewersListRequestExpandItem) Ptr() *CollectionsViewersListRe return &c } +var ( + paginatedCollectionListFieldNext = big.NewInt(1 << 0) + paginatedCollectionListFieldPrevious = big.NewInt(1 << 1) + paginatedCollectionListFieldResults = big.NewInt(1 << 2) +) + type PaginatedCollectionList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Collection `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -111,6 +342,34 @@ func (p *PaginatedCollectionList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedCollectionList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCollectionList) SetNext(next *string) { + p.Next = next + p.require(paginatedCollectionListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCollectionList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedCollectionListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCollectionList) SetResults(results []*Collection) { + p.Results = results + p.require(paginatedCollectionListFieldResults) +} + func (p *PaginatedCollectionList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedCollectionList var value unmarshaler @@ -127,6 +386,17 @@ func (p *PaginatedCollectionList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedCollectionList) MarshalJSON() ([]byte, error) { + type embed PaginatedCollectionList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedCollectionList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -139,6 +409,15 @@ func (p *PaginatedCollectionList) String() string { return fmt.Sprintf("%#v", p) } +var ( + collectionsViewersListRequestFieldCursor = big.NewInt(1 << 0) + collectionsViewersListRequestFieldExpand = big.NewInt(1 << 1) + collectionsViewersListRequestFieldIncludeDeletedData = big.NewInt(1 << 2) + collectionsViewersListRequestFieldIncludeRemoteData = big.NewInt(1 << 3) + collectionsViewersListRequestFieldIncludeShellData = big.NewInt(1 << 4) + collectionsViewersListRequestFieldPageSize = big.NewInt(1 << 5) +) + type CollectionsViewersListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -152,4 +431,56 @@ type CollectionsViewersListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CollectionsViewersListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsViewersListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(collectionsViewersListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsViewersListRequest) SetExpand(expand []*CollectionsViewersListRequestExpandItem) { + c.Expand = expand + c.require(collectionsViewersListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsViewersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(collectionsViewersListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsViewersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(collectionsViewersListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsViewersListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(collectionsViewersListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CollectionsViewersListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(collectionsViewersListRequestFieldPageSize) } diff --git a/ticketing/collections/client.go b/ticketing/collections/client.go index e9bdcbd..ba76d96 100644 --- a/ticketing/collections/client.go +++ b/ticketing/collections/client.go @@ -4,7 +4,6 @@ package collections import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.CollectionsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Collection], error) { +) (*core.Page[*string, *ticketing.Collection], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedCollectionList) *internal.PageResponse[*string, *ticketing.Collection] { + readPageResponse := func(response *ticketing.PaginatedCollectionList) *core.PageResponse[*string, *ticketing.Collection] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Collection]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Collection]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,7 +97,7 @@ func (c *Client) ViewersList( collectionId string, request *ticketing.CollectionsViewersListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Viewer], error) { +) (*core.Page[*string, *ticketing.Viewer], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -113,13 +113,12 @@ func (c *Client) ViewersList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -136,11 +135,11 @@ func (c *Client) ViewersList( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedViewerList) *internal.PageResponse[*string, *ticketing.Viewer] { + readPageResponse := func(response *ticketing.PaginatedViewerList) *core.PageResponse[*string, *ticketing.Viewer] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Viewer]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Viewer]{ Next: next, Results: results, Done: next == zeroValue, @@ -161,43 +160,14 @@ func (c *Client) Retrieve( request *ticketing.CollectionsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Collection, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/collections/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Collection - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ticketing/collections/raw_client.go b/ticketing/collections/raw_client.go new file mode 100644 index 0000000..0ea445b --- /dev/null +++ b/ticketing/collections/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package collections + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.CollectionsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Collection], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/collections/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Collection + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Collection]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/collections/ticketing_collections_test/ticketing_collections_test.go b/ticketing/collections/ticketing_collections_test/ticketing_collections_test.go new file mode 100644 index 0000000..c449864 --- /dev/null +++ b/ticketing/collections/ticketing_collections_test/ticketing_collections_test.go @@ -0,0 +1,194 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_collections_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingCollectionsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.CollectionsListRequest{ + CollectionType: ticketing.CollectionsListRequestCollectionTypeEmpty.Ptr(), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + ParentCollectionId: merge.String( + "parent_collection_id", + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ticketing.Collections.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/collections", map[string]string{"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"}, 1) +} + +func TestTicketingCollectionsViewersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.CollectionsViewersListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Ticketing.Collections.ViewersList( + context.TODO(), + "collection_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/collections/collection_id/viewers", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} + +func TestTicketingCollectionsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.CollectionsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Collections.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/collections/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true", "remote_fields": "collection_type", "show_enum_origins": "collection_type"}, 1) +} diff --git a/ticketing/comments.go b/ticketing/comments.go index 5a141de..38e792b 100644 --- a/ticketing/comments.go +++ b/ticketing/comments.go @@ -6,17 +6,71 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + commentEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + commentEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + commentEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type CommentEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *CommentRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CommentEndpointRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + c.IsDebugMode = isDebugMode + c.require(commentEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentEndpointRequest) SetRunAsync(runAsync *bool) { + c.RunAsync = runAsync + c.require(commentEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentEndpointRequest) SetModel(model *CommentRequest) { + c.Model = model + c.require(commentEndpointRequestFieldModel) +} + +var ( + commentsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + commentsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + commentsListRequestFieldCursor = big.NewInt(1 << 2) + commentsListRequestFieldExpand = big.NewInt(1 << 3) + commentsListRequestFieldIncludeDeletedData = big.NewInt(1 << 4) + commentsListRequestFieldIncludeRemoteData = big.NewInt(1 << 5) + commentsListRequestFieldIncludeShellData = big.NewInt(1 << 6) + commentsListRequestFieldModifiedAfter = big.NewInt(1 << 7) + commentsListRequestFieldModifiedBefore = big.NewInt(1 << 8) + commentsListRequestFieldPageSize = big.NewInt(1 << 9) + commentsListRequestFieldRemoteCreatedAfter = big.NewInt(1 << 10) + commentsListRequestFieldRemoteId = big.NewInt(1 << 11) + commentsListRequestFieldTicketId = big.NewInt(1 << 12) +) + type CommentsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -44,8 +98,115 @@ type CommentsListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // If provided, will only return comments for this ticket. TicketId *string `json:"-" url:"ticket_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CommentsListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(commentsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(commentsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(commentsListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetExpand(expand []*CommentsListRequestExpandItem) { + c.Expand = expand + c.require(commentsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(commentsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(commentsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(commentsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(commentsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(commentsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(commentsListRequestFieldPageSize) +} + +// SetRemoteCreatedAfter sets the RemoteCreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetRemoteCreatedAfter(remoteCreatedAfter *time.Time) { + c.RemoteCreatedAfter = remoteCreatedAfter + c.require(commentsListRequestFieldRemoteCreatedAfter) } +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(commentsListRequestFieldRemoteId) +} + +// SetTicketId sets the TicketId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsListRequest) SetTicketId(ticketId *string) { + c.TicketId = ticketId + c.require(commentsListRequestFieldTicketId) +} + +var ( + commentsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + commentsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + commentsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type CommentsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*CommentsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -53,6 +214,37 @@ type CommentsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CommentsRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsRetrieveRequest) SetExpand(expand []*CommentsRetrieveRequestExpandItem) { + c.Expand = expand + c.require(commentsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(commentsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(commentsRetrieveRequestFieldIncludeShellData) } type CommentsListRequestExpandItem string @@ -111,6 +303,23 @@ func (c CommentsRetrieveRequestExpandItem) Ptr() *CommentsRetrieveRequestExpandI // // ### Usage Example // TODO +var ( + commentFieldId = big.NewInt(1 << 0) + commentFieldRemoteId = big.NewInt(1 << 1) + commentFieldCreatedAt = big.NewInt(1 << 2) + commentFieldModifiedAt = big.NewInt(1 << 3) + commentFieldUser = big.NewInt(1 << 4) + commentFieldContact = big.NewInt(1 << 5) + commentFieldBody = big.NewInt(1 << 6) + commentFieldHtmlBody = big.NewInt(1 << 7) + commentFieldTicket = big.NewInt(1 << 8) + commentFieldIsPrivate = big.NewInt(1 << 9) + commentFieldRemoteCreatedAt = big.NewInt(1 << 10) + commentFieldRemoteWasDeleted = big.NewInt(1 << 11) + commentFieldFieldMappings = big.NewInt(1 << 12) + commentFieldRemoteData = big.NewInt(1 << 13) +) + type Comment struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -138,6 +347,9 @@ type Comment struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -244,6 +456,111 @@ func (c *Comment) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *Comment) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetId(id *string) { + c.Id = id + c.require(commentFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(commentFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(commentFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(commentFieldModifiedAt) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetUser(user *CommentUser) { + c.User = user + c.require(commentFieldUser) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetContact(contact *CommentContact) { + c.Contact = contact + c.require(commentFieldContact) +} + +// SetBody sets the Body field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetBody(body *string) { + c.Body = body + c.require(commentFieldBody) +} + +// SetHtmlBody sets the HtmlBody field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetHtmlBody(htmlBody *string) { + c.HtmlBody = htmlBody + c.require(commentFieldHtmlBody) +} + +// SetTicket sets the Ticket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetTicket(ticket *CommentTicket) { + c.Ticket = ticket + c.require(commentFieldTicket) +} + +// SetIsPrivate sets the IsPrivate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetIsPrivate(isPrivate *bool) { + c.IsPrivate = isPrivate + c.require(commentFieldIsPrivate) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + c.RemoteCreatedAt = remoteCreatedAt + c.require(commentFieldRemoteCreatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(commentFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(commentFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Comment) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(commentFieldRemoteData) +} + func (c *Comment) UnmarshalJSON(data []byte) error { type embed Comment var unmarshaler = struct { @@ -283,7 +600,8 @@ func (c *Comment) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), RemoteCreatedAt: internal.NewOptionalDateTime(c.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *Comment) String() string { @@ -367,6 +685,17 @@ func (c *CommentContact) Accept(visitor CommentContactVisitor) error { // // ### Usage Example // TODO +var ( + commentRequestFieldUser = big.NewInt(1 << 0) + commentRequestFieldContact = big.NewInt(1 << 1) + commentRequestFieldBody = big.NewInt(1 << 2) + commentRequestFieldHtmlBody = big.NewInt(1 << 3) + commentRequestFieldTicket = big.NewInt(1 << 4) + commentRequestFieldIsPrivate = big.NewInt(1 << 5) + commentRequestFieldIntegrationParams = big.NewInt(1 << 6) + commentRequestFieldLinkedAccountParams = big.NewInt(1 << 7) +) + type CommentRequest struct { // 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. User *CommentRequestUser `json:"user,omitempty" url:"user,omitempty"` @@ -383,6 +712,9 @@ type CommentRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -447,6 +779,69 @@ func (c *CommentRequest) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CommentRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentRequest) SetUser(user *CommentRequestUser) { + c.User = user + c.require(commentRequestFieldUser) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentRequest) SetContact(contact *CommentRequestContact) { + c.Contact = contact + c.require(commentRequestFieldContact) +} + +// SetBody sets the Body field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentRequest) SetBody(body *string) { + c.Body = body + c.require(commentRequestFieldBody) +} + +// SetHtmlBody sets the HtmlBody field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentRequest) SetHtmlBody(htmlBody *string) { + c.HtmlBody = htmlBody + c.require(commentRequestFieldHtmlBody) +} + +// SetTicket sets the Ticket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentRequest) SetTicket(ticket *CommentRequestTicket) { + c.Ticket = ticket + c.require(commentRequestFieldTicket) +} + +// SetIsPrivate sets the IsPrivate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentRequest) SetIsPrivate(isPrivate *bool) { + c.IsPrivate = isPrivate + c.require(commentRequestFieldIsPrivate) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + c.IntegrationParams = integrationParams + c.require(commentRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + c.LinkedAccountParams = linkedAccountParams + c.require(commentRequestFieldLinkedAccountParams) +} + func (c *CommentRequest) UnmarshalJSON(data []byte) error { type unmarshaler CommentRequest var value unmarshaler @@ -463,6 +858,17 @@ func (c *CommentRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *CommentRequest) MarshalJSON() ([]byte, error) { + type embed CommentRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommentRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -664,12 +1070,22 @@ func (c *CommentRequestUser) Accept(visitor CommentRequestUserVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", c) } +var ( + commentResponseFieldModel = big.NewInt(1 << 0) + commentResponseFieldWarnings = big.NewInt(1 << 1) + commentResponseFieldErrors = big.NewInt(1 << 2) + commentResponseFieldLogs = big.NewInt(1 << 3) +) + type CommentResponse struct { Model *Comment `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -706,6 +1122,41 @@ func (c *CommentResponse) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CommentResponse) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentResponse) SetModel(model *Comment) { + c.Model = model + c.require(commentResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentResponse) SetWarnings(warnings []*WarningValidationProblem) { + c.Warnings = warnings + c.require(commentResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentResponse) SetErrors(errors []*ErrorValidationProblem) { + c.Errors = errors + c.require(commentResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommentResponse) SetLogs(logs []*DebugModeLog) { + c.Logs = logs + c.require(commentResponseFieldLogs) +} + func (c *CommentResponse) UnmarshalJSON(data []byte) error { type unmarshaler CommentResponse var value unmarshaler @@ -722,6 +1173,17 @@ func (c *CommentResponse) UnmarshalJSON(data []byte) error { return nil } +func (c *CommentResponse) MarshalJSON() ([]byte, error) { + type embed CommentResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommentResponse) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -860,11 +1322,20 @@ func (c *CommentUser) Accept(visitor CommentUserVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", c) } +var ( + paginatedCommentListFieldNext = big.NewInt(1 << 0) + paginatedCommentListFieldPrevious = big.NewInt(1 << 1) + paginatedCommentListFieldResults = big.NewInt(1 << 2) +) + type PaginatedCommentList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Comment `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -894,6 +1365,34 @@ func (p *PaginatedCommentList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedCommentList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCommentList) SetNext(next *string) { + p.Next = next + p.require(paginatedCommentListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCommentList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedCommentListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedCommentList) SetResults(results []*Comment) { + p.Results = results + p.require(paginatedCommentListFieldResults) +} + func (p *PaginatedCommentList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedCommentList var value unmarshaler @@ -910,6 +1409,17 @@ func (p *PaginatedCommentList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedCommentList) MarshalJSON() ([]byte, error) { + type embed PaginatedCommentList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedCommentList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ticketing/comments/client.go b/ticketing/comments/client.go index e39a288..584a4ac 100644 --- a/ticketing/comments/client.go +++ b/ticketing/comments/client.go @@ -4,7 +4,6 @@ package comments import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.CommentsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Comment], error) { +) (*core.Page[*string, *ticketing.Comment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedCommentList) *internal.PageResponse[*string, *ticketing.Comment] { + readPageResponse := func(response *ticketing.PaginatedCommentList) *core.PageResponse[*string, *ticketing.Comment] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Comment]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Comment]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *ticketing.CommentEndpointRequest, opts ...option.RequestOption, ) (*ticketing.CommentResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ticketing/v1/comments" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.CommentResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Comment` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *ticketing.CommentsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Comment, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/comments/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Comment - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `Comment` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ticketing.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/comments/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/comments/raw_client.go b/ticketing/comments/raw_client.go new file mode 100644 index 0000000..023afd1 --- /dev/null +++ b/ticketing/comments/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package comments + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.CommentEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.CommentResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/comments" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.CommentResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.CommentResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.CommentsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Comment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/comments/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Comment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Comment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ticketing.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/comments/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/comments/ticketing_comments_test/ticketing_comments_test.go b/ticketing/comments/ticketing_comments_test/ticketing_comments_test.go new file mode 100644 index 0000000..d2837ef --- /dev/null +++ b/ticketing/comments/ticketing_comments_test/ticketing_comments_test.go @@ -0,0 +1,204 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_comments_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingCommentsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.CommentsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteCreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteId: merge.String( + "remote_id", + ), + TicketId: merge.String( + "ticket_id", + ), + } + _, invocationErr := client.Ticketing.Comments.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/comments", map[string]string{"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"}, 1) +} + +func TestTicketingCommentsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.CommentEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.CommentRequest{}, + } + _, invocationErr := client.Ticketing.Comments.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/comments", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestTicketingCommentsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.CommentsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Comments.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/comments/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestTicketingCommentsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.Comments.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/comments/meta/post", nil, 1) +} diff --git a/ticketing/contacts.go b/ticketing/contacts.go index 7e7e27c..eecc2fd 100644 --- a/ticketing/contacts.go +++ b/ticketing/contacts.go @@ -6,17 +6,70 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + ticketingContactEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + ticketingContactEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + ticketingContactEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type TicketingContactEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *ContactRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TicketingContactEndpointRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingContactEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + t.IsDebugMode = isDebugMode + t.require(ticketingContactEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingContactEndpointRequest) SetRunAsync(runAsync *bool) { + t.RunAsync = runAsync + t.require(ticketingContactEndpointRequestFieldRunAsync) } +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingContactEndpointRequest) SetModel(model *ContactRequest) { + t.Model = model + t.require(ticketingContactEndpointRequestFieldModel) +} + +var ( + contactsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + contactsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + contactsListRequestFieldCursor = big.NewInt(1 << 2) + contactsListRequestFieldEmailAddress = big.NewInt(1 << 3) + contactsListRequestFieldExpand = big.NewInt(1 << 4) + contactsListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + contactsListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + contactsListRequestFieldIncludeShellData = big.NewInt(1 << 7) + contactsListRequestFieldModifiedAfter = big.NewInt(1 << 8) + contactsListRequestFieldModifiedBefore = big.NewInt(1 << 9) + contactsListRequestFieldPageSize = big.NewInt(1 << 10) + contactsListRequestFieldRemoteId = big.NewInt(1 << 11) +) + type ContactsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -24,6 +77,8 @@ type ContactsListRequest struct { CreatedBefore *time.Time `json:"-" url:"created_before,omitempty"` // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` + // If provided, will only return Contacts that match this email. + EmailAddress *string `json:"-" url:"email_address,omitempty"` // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). @@ -40,8 +95,108 @@ type ContactsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ContactsListRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCreatedAfter(createdAfter *time.Time) { + c.CreatedAfter = createdAfter + c.require(contactsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCreatedBefore(createdBefore *time.Time) { + c.CreatedBefore = createdBefore + c.require(contactsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetCursor(cursor *string) { + c.Cursor = cursor + c.require(contactsListRequestFieldCursor) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetEmailAddress(emailAddress *string) { + c.EmailAddress = emailAddress + c.require(contactsListRequestFieldEmailAddress) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(contactsListRequestFieldExpand) } +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + c.IncludeDeletedData = includeDeletedData + c.require(contactsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(contactsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(contactsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + c.ModifiedAfter = modifiedAfter + c.require(contactsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + c.ModifiedBefore = modifiedBefore + c.require(contactsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetPageSize(pageSize *int) { + c.PageSize = pageSize + c.require(contactsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsListRequest) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(contactsListRequestFieldRemoteId) +} + +var ( + contactsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + contactsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + contactsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type ContactsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*string `json:"-" url:"expand,omitempty"` @@ -49,6 +204,37 @@ type ContactsRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ContactsRetrieveRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetExpand(expand []*string) { + c.Expand = expand + c.require(contactsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + c.IncludeRemoteData = includeRemoteData + c.require(contactsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + c.IncludeShellData = includeShellData + c.require(contactsRetrieveRequestFieldIncludeShellData) } // # The Contact Object @@ -57,6 +243,16 @@ type ContactsRetrieveRequest struct { // // ### Usage Example // TODO +var ( + contactRequestFieldName = big.NewInt(1 << 0) + contactRequestFieldEmailAddress = big.NewInt(1 << 1) + contactRequestFieldPhoneNumber = big.NewInt(1 << 2) + contactRequestFieldDetails = big.NewInt(1 << 3) + contactRequestFieldAccount = big.NewInt(1 << 4) + contactRequestFieldIntegrationParams = big.NewInt(1 << 5) + contactRequestFieldLinkedAccountParams = big.NewInt(1 << 6) +) + type ContactRequest struct { // The contact's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -71,6 +267,9 @@ type ContactRequest struct { IntegrationParams map[string]interface{} `json:"integration_params,omitempty" url:"integration_params,omitempty"` LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -128,6 +327,62 @@ func (c *ContactRequest) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *ContactRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetName(name *string) { + c.Name = name + c.require(contactRequestFieldName) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetEmailAddress(emailAddress *string) { + c.EmailAddress = emailAddress + c.require(contactRequestFieldEmailAddress) +} + +// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetPhoneNumber(phoneNumber *string) { + c.PhoneNumber = phoneNumber + c.require(contactRequestFieldPhoneNumber) +} + +// SetDetails sets the Details field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetDetails(details *string) { + c.Details = details + c.require(contactRequestFieldDetails) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetAccount(account *ContactRequestAccount) { + c.Account = account + c.require(contactRequestFieldAccount) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + c.IntegrationParams = integrationParams + c.require(contactRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ContactRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + c.LinkedAccountParams = linkedAccountParams + c.require(contactRequestFieldLinkedAccountParams) +} + func (c *ContactRequest) UnmarshalJSON(data []byte) error { type unmarshaler ContactRequest var value unmarshaler @@ -144,6 +399,17 @@ func (c *ContactRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *ContactRequest) MarshalJSON() ([]byte, error) { + type embed ContactRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *ContactRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -219,11 +485,20 @@ func (c *ContactRequestAccount) Accept(visitor ContactRequestAccountVisitor) err return fmt.Errorf("type %T does not include a non-empty union type", c) } +var ( + paginatedContactListFieldNext = big.NewInt(1 << 0) + paginatedContactListFieldPrevious = big.NewInt(1 << 1) + paginatedContactListFieldResults = big.NewInt(1 << 2) +) + type PaginatedContactList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Contact `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -253,6 +528,34 @@ func (p *PaginatedContactList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedContactList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedContactList) SetNext(next *string) { + p.Next = next + p.require(paginatedContactListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedContactList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedContactListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedContactList) SetResults(results []*Contact) { + p.Results = results + p.require(paginatedContactListFieldResults) +} + func (p *PaginatedContactList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedContactList var value unmarshaler @@ -269,6 +572,17 @@ func (p *PaginatedContactList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedContactList) MarshalJSON() ([]byte, error) { + type embed PaginatedContactList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedContactList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -281,12 +595,22 @@ func (p *PaginatedContactList) String() string { return fmt.Sprintf("%#v", p) } +var ( + ticketingContactResponseFieldModel = big.NewInt(1 << 0) + ticketingContactResponseFieldWarnings = big.NewInt(1 << 1) + ticketingContactResponseFieldErrors = big.NewInt(1 << 2) + ticketingContactResponseFieldLogs = big.NewInt(1 << 3) +) + type TicketingContactResponse struct { Model *Contact `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -323,6 +647,41 @@ func (t *TicketingContactResponse) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TicketingContactResponse) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingContactResponse) SetModel(model *Contact) { + t.Model = model + t.require(ticketingContactResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingContactResponse) SetWarnings(warnings []*WarningValidationProblem) { + t.Warnings = warnings + t.require(ticketingContactResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingContactResponse) SetErrors(errors []*ErrorValidationProblem) { + t.Errors = errors + t.require(ticketingContactResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketingContactResponse) SetLogs(logs []*DebugModeLog) { + t.Logs = logs + t.require(ticketingContactResponseFieldLogs) +} + func (t *TicketingContactResponse) UnmarshalJSON(data []byte) error { type unmarshaler TicketingContactResponse var value unmarshaler @@ -339,6 +698,17 @@ func (t *TicketingContactResponse) UnmarshalJSON(data []byte) error { return nil } +func (t *TicketingContactResponse) MarshalJSON() ([]byte, error) { + type embed TicketingContactResponse + var marshaler = struct { + embed + }{ + embed: embed(*t), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (t *TicketingContactResponse) String() string { if len(t.rawJSON) > 0 { if value, err := internal.StringifyJSON(t.rawJSON); err == nil { diff --git a/ticketing/contacts/client.go b/ticketing/contacts/client.go index ff5da87..d92ce1a 100644 --- a/ticketing/contacts/client.go +++ b/ticketing/contacts/client.go @@ -4,7 +4,6 @@ package contacts import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.ContactsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Contact], error) { +) (*core.Page[*string, *ticketing.Contact], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedContactList) *internal.PageResponse[*string, *ticketing.Contact] { + readPageResponse := func(response *ticketing.PaginatedContactList) *core.PageResponse[*string, *ticketing.Contact] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Contact]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Contact]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *ticketing.TicketingContactEndpointRequest, opts ...option.RequestOption, ) (*ticketing.TicketingContactResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ticketing/v1/contacts" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.TicketingContactResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Contact` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *ticketing.ContactsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Contact, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/contacts/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Contact - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns metadata for `TicketingContact` POSTs. @@ -190,33 +132,12 @@ func (c *Client) MetaPostRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ticketing.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/contacts/meta/post" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.MetaResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.MetaPostRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/contacts/raw_client.go b/ticketing/contacts/raw_client.go new file mode 100644 index 0000000..f5fad0d --- /dev/null +++ b/ticketing/contacts/raw_client.go @@ -0,0 +1,170 @@ +// Code generated by Fern. DO NOT EDIT. + +package contacts + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.TicketingContactEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.TicketingContactResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/contacts" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.TicketingContactResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.TicketingContactResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.ContactsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Contact], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/contacts/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Contact + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Contact]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ticketing.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/contacts/meta/post" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/contacts/ticketing_contacts_test/ticketing_contacts_test.go b/ticketing/contacts/ticketing_contacts_test/ticketing_contacts_test.go new file mode 100644 index 0000000..c02f1eb --- /dev/null +++ b/ticketing/contacts/ticketing_contacts_test/ticketing_contacts_test.go @@ -0,0 +1,199 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_contacts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingContactsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.ContactsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddress: merge.String( + "email_address", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ticketing.Contacts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/contacts", map[string]string{"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"}, 1) +} + +func TestTicketingContactsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TicketingContactEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.ContactRequest{}, + } + _, invocationErr := client.Ticketing.Contacts.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/contacts", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestTicketingContactsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.ContactsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Contacts.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/contacts/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestTicketingContactsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.Contacts.MetaPostRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/contacts/meta/post", nil, 1) +} diff --git a/ticketing/deleteaccount/client.go b/ticketing/deleteaccount/client.go index c6e2d2c..9f2d80e 100644 --- a/ticketing/deleteaccount/client.go +++ b/ticketing/deleteaccount/client.go @@ -7,26 +7,27 @@ import ( core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -35,30 +36,11 @@ func (c *Client) Delete( ctx context.Context, opts ...option.RequestOption, ) error { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/delete-account" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - if err := c.caller.Call( + _, err := c.WithRawResponse.Delete( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - }, - ); err != nil { + opts..., + ) + if err != nil { return err } return nil diff --git a/ticketing/deleteaccount/raw_client.go b/ticketing/deleteaccount/raw_client.go new file mode 100644 index 0000000..1bc2c2a --- /dev/null +++ b/ticketing/deleteaccount/raw_client.go @@ -0,0 +1,67 @@ +// Code generated by Fern. DO NOT EDIT. + +package deleteaccount + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Delete( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[any], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/delete-account" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[any]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: nil, + }, nil +} diff --git a/ticketing/deleteaccount/ticketing_delete_account_test/ticketing_delete_account_test.go b/ticketing/deleteaccount/ticketing_delete_account_test/ticketing_delete_account_test.go new file mode 100644 index 0000000..96d5679 --- /dev/null +++ b/ticketing/deleteaccount/ticketing_delete_account_test/ticketing_delete_account_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_delete_account_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingDeleteAccountDeleteWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + invocationErr := client.Ticketing.DeleteAccount.Delete( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/delete-account", nil, 1) +} diff --git a/ticketing/field_mapping.go b/ticketing/field_mapping.go index b0300a8..7672556 100644 --- a/ticketing/field_mapping.go +++ b/ticketing/field_mapping.go @@ -6,6 +6,17 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + createFieldMappingRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) + createFieldMappingRequestFieldTargetFieldName = big.NewInt(1 << 1) + createFieldMappingRequestFieldTargetFieldDescription = big.NewInt(1 << 2) + createFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 3) + createFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 4) + createFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 5) + createFieldMappingRequestFieldCommonModelName = big.NewInt(1 << 6) ) type CreateFieldMappingRequest struct { @@ -23,8 +34,73 @@ type CreateFieldMappingRequest struct { RemoteUrlPath string `json:"remote_url_path" url:"-"` // The name of the Common Model that the remote field corresponds to in a given category. CommonModelName string `json:"common_model_name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreateFieldMappingRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + c.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + c.require(createFieldMappingRequestFieldExcludeRemoteFieldMetadata) +} + +// SetTargetFieldName sets the TargetFieldName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldName(targetFieldName string) { + c.TargetFieldName = targetFieldName + c.require(createFieldMappingRequestFieldTargetFieldName) } +// SetTargetFieldDescription sets the TargetFieldDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetTargetFieldDescription(targetFieldDescription string) { + c.TargetFieldDescription = targetFieldDescription + c.require(createFieldMappingRequestFieldTargetFieldDescription) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + c.RemoteFieldTraversalPath = remoteFieldTraversalPath + c.require(createFieldMappingRequestFieldRemoteFieldTraversalPath) +} + +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteMethod(remoteMethod string) { + c.RemoteMethod = remoteMethod + c.require(createFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath string) { + c.RemoteUrlPath = remoteUrlPath + c.require(createFieldMappingRequestFieldRemoteUrlPath) +} + +// SetCommonModelName sets the CommonModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateFieldMappingRequest) SetCommonModelName(commonModelName string) { + c.CommonModelName = commonModelName + c.require(createFieldMappingRequestFieldCommonModelName) +} + +var ( + patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath = big.NewInt(1 << 0) + patchedEditFieldMappingRequestFieldRemoteMethod = big.NewInt(1 << 1) + patchedEditFieldMappingRequestFieldRemoteUrlPath = big.NewInt(1 << 2) +) + type PatchedEditFieldMappingRequest struct { // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty" url:"-"` @@ -32,20 +108,110 @@ type PatchedEditFieldMappingRequest struct { RemoteMethod *string `json:"remote_method,omitempty" url:"-"` // The path of the remote endpoint where the remote field is coming from. RemoteUrlPath *string `json:"remote_url_path,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedEditFieldMappingRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetRemoteFieldTraversalPath sets the RemoteFieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteFieldTraversalPath(remoteFieldTraversalPath []interface{}) { + p.RemoteFieldTraversalPath = remoteFieldTraversalPath + p.require(patchedEditFieldMappingRequestFieldRemoteFieldTraversalPath) } +// SetRemoteMethod sets the RemoteMethod field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteMethod(remoteMethod *string) { + p.RemoteMethod = remoteMethod + p.require(patchedEditFieldMappingRequestFieldRemoteMethod) +} + +// SetRemoteUrlPath sets the RemoteUrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedEditFieldMappingRequest) SetRemoteUrlPath(remoteUrlPath *string) { + p.RemoteUrlPath = remoteUrlPath + p.require(patchedEditFieldMappingRequestFieldRemoteUrlPath) +} + +var ( + fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata = big.NewInt(1 << 0) +) + type FieldMappingsRetrieveRequest struct { // 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. ExcludeRemoteFieldMetadata *bool `json:"-" url:"exclude_remote_field_metadata,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (f *FieldMappingsRetrieveRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetExcludeRemoteFieldMetadata sets the ExcludeRemoteFieldMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingsRetrieveRequest) SetExcludeRemoteFieldMetadata(excludeRemoteFieldMetadata *bool) { + f.ExcludeRemoteFieldMetadata = excludeRemoteFieldMetadata + f.require(fieldMappingsRetrieveRequestFieldExcludeRemoteFieldMetadata) } +var ( + remoteFieldsRetrieveRequestFieldCommonModels = big.NewInt(1 << 0) + remoteFieldsRetrieveRequestFieldIncludeExampleValues = big.NewInt(1 << 1) +) + type RemoteFieldsRetrieveRequest struct { // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. CommonModels *string `json:"-" url:"common_models,omitempty"` // 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. IncludeExampleValues *string `json:"-" url:"include_example_values,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (r *RemoteFieldsRetrieveRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetCommonModels(commonModels *string) { + r.CommonModels = commonModels + r.require(remoteFieldsRetrieveRequestFieldCommonModels) +} + +// SetIncludeExampleValues sets the IncludeExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldsRetrieveRequest) SetIncludeExampleValues(includeExampleValues *string) { + r.IncludeExampleValues = includeExampleValues + r.require(remoteFieldsRetrieveRequestFieldIncludeExampleValues) +} + +var ( + advancedMetadataFieldId = big.NewInt(1 << 0) + advancedMetadataFieldDisplayName = big.NewInt(1 << 1) + advancedMetadataFieldDescription = big.NewInt(1 << 2) + advancedMetadataFieldIsRequired = big.NewInt(1 << 3) + advancedMetadataFieldIsCustom = big.NewInt(1 << 4) + advancedMetadataFieldFieldChoices = big.NewInt(1 << 5) +) + type AdvancedMetadata struct { Id string `json:"id" url:"id"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` @@ -54,6 +220,9 @@ type AdvancedMetadata struct { IsCustom *bool `json:"is_custom,omitempty" url:"is_custom,omitempty"` FieldChoices []interface{} `json:"field_choices,omitempty" url:"field_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -104,6 +273,55 @@ func (a *AdvancedMetadata) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AdvancedMetadata) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetId(id string) { + a.Id = id + a.require(advancedMetadataFieldId) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDisplayName(displayName *string) { + a.DisplayName = displayName + a.require(advancedMetadataFieldDisplayName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetDescription(description *string) { + a.Description = description + a.require(advancedMetadataFieldDescription) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsRequired(isRequired *bool) { + a.IsRequired = isRequired + a.require(advancedMetadataFieldIsRequired) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetIsCustom(isCustom *bool) { + a.IsCustom = isCustom + a.require(advancedMetadataFieldIsCustom) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AdvancedMetadata) SetFieldChoices(fieldChoices []interface{}) { + a.FieldChoices = fieldChoices + a.require(advancedMetadataFieldFieldChoices) +} + func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { type unmarshaler AdvancedMetadata var value unmarshaler @@ -120,6 +338,17 @@ func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { return nil } +func (a *AdvancedMetadata) MarshalJSON() ([]byte, error) { + type embed AdvancedMetadata + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AdvancedMetadata) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -132,11 +361,20 @@ func (a *AdvancedMetadata) String() string { return fmt.Sprintf("%#v", a) } +var ( + externalTargetFieldApiFieldName = big.NewInt(1 << 0) + externalTargetFieldApiFieldDescription = big.NewInt(1 << 1) + externalTargetFieldApiFieldIsMapped = big.NewInt(1 << 2) +) + type ExternalTargetFieldApi struct { Name *string `json:"name,omitempty" url:"name,omitempty"` Description *string `json:"description,omitempty" url:"description,omitempty"` IsMapped *string `json:"is_mapped,omitempty" url:"is_mapped,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -166,6 +404,34 @@ func (e *ExternalTargetFieldApi) GetExtraProperties() map[string]interface{} { return e.extraProperties } +func (e *ExternalTargetFieldApi) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetName(name *string) { + e.Name = name + e.require(externalTargetFieldApiFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetDescription(description *string) { + e.Description = description + e.require(externalTargetFieldApiFieldDescription) +} + +// SetIsMapped sets the IsMapped field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApi) SetIsMapped(isMapped *string) { + e.IsMapped = isMapped + e.require(externalTargetFieldApiFieldIsMapped) +} + func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApi var value unmarshaler @@ -182,6 +448,17 @@ func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApi) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApi) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -194,6 +471,20 @@ func (e *ExternalTargetFieldApi) String() string { return fmt.Sprintf("%#v", e) } +var ( + externalTargetFieldApiResponseFieldTicket = big.NewInt(1 << 0) + externalTargetFieldApiResponseFieldComment = big.NewInt(1 << 1) + externalTargetFieldApiResponseFieldProject = big.NewInt(1 << 2) + externalTargetFieldApiResponseFieldCollection = big.NewInt(1 << 3) + externalTargetFieldApiResponseFieldUser = big.NewInt(1 << 4) + externalTargetFieldApiResponseFieldRole = big.NewInt(1 << 5) + externalTargetFieldApiResponseFieldAccount = big.NewInt(1 << 6) + externalTargetFieldApiResponseFieldTeam = big.NewInt(1 << 7) + externalTargetFieldApiResponseFieldAttachment = big.NewInt(1 << 8) + externalTargetFieldApiResponseFieldTag = big.NewInt(1 << 9) + externalTargetFieldApiResponseFieldContact = big.NewInt(1 << 10) +) + type ExternalTargetFieldApiResponse struct { Ticket []*ExternalTargetFieldApi `json:"Ticket,omitempty" url:"Ticket,omitempty"` Comment []*ExternalTargetFieldApi `json:"Comment,omitempty" url:"Comment,omitempty"` @@ -207,6 +498,9 @@ type ExternalTargetFieldApiResponse struct { Tag []*ExternalTargetFieldApi `json:"Tag,omitempty" url:"Tag,omitempty"` Contact []*ExternalTargetFieldApi `json:"Contact,omitempty" url:"Contact,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -292,6 +586,90 @@ func (e *ExternalTargetFieldApiResponse) GetExtraProperties() map[string]interfa return e.extraProperties } +func (e *ExternalTargetFieldApiResponse) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetTicket sets the Ticket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTicket(ticket []*ExternalTargetFieldApi) { + e.Ticket = ticket + e.require(externalTargetFieldApiResponseFieldTicket) +} + +// SetComment sets the Comment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetComment(comment []*ExternalTargetFieldApi) { + e.Comment = comment + e.require(externalTargetFieldApiResponseFieldComment) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetProject(project []*ExternalTargetFieldApi) { + e.Project = project + e.require(externalTargetFieldApiResponseFieldProject) +} + +// SetCollection sets the Collection field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetCollection(collection []*ExternalTargetFieldApi) { + e.Collection = collection + e.require(externalTargetFieldApiResponseFieldCollection) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetUser(user []*ExternalTargetFieldApi) { + e.User = user + e.require(externalTargetFieldApiResponseFieldUser) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetRole(role []*ExternalTargetFieldApi) { + e.Role = role + e.require(externalTargetFieldApiResponseFieldRole) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetAccount(account []*ExternalTargetFieldApi) { + e.Account = account + e.require(externalTargetFieldApiResponseFieldAccount) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTeam(team []*ExternalTargetFieldApi) { + e.Team = team + e.require(externalTargetFieldApiResponseFieldTeam) +} + +// SetAttachment sets the Attachment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetAttachment(attachment []*ExternalTargetFieldApi) { + e.Attachment = attachment + e.require(externalTargetFieldApiResponseFieldAttachment) +} + +// SetTag sets the Tag field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetTag(tag []*ExternalTargetFieldApi) { + e.Tag = tag + e.require(externalTargetFieldApiResponseFieldTag) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ExternalTargetFieldApiResponse) SetContact(contact []*ExternalTargetFieldApi) { + e.Contact = contact + e.require(externalTargetFieldApiResponseFieldContact) +} + func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler ExternalTargetFieldApiResponse var value unmarshaler @@ -308,6 +686,17 @@ func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (e *ExternalTargetFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed ExternalTargetFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ExternalTargetFieldApiResponse) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -320,12 +709,22 @@ func (e *ExternalTargetFieldApiResponse) String() string { return fmt.Sprintf("%#v", e) } +var ( + fieldMappingApiInstanceFieldId = big.NewInt(1 << 0) + fieldMappingApiInstanceFieldIsIntegrationWide = big.NewInt(1 << 1) + fieldMappingApiInstanceFieldTargetField = big.NewInt(1 << 2) + fieldMappingApiInstanceFieldRemoteField = big.NewInt(1 << 3) +) + type FieldMappingApiInstance struct { Id *string `json:"id,omitempty" url:"id,omitempty"` IsIntegrationWide *bool `json:"is_integration_wide,omitempty" url:"is_integration_wide,omitempty"` TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty" url:"target_field,omitempty"` RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty" url:"remote_field,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -362,6 +761,41 @@ func (f *FieldMappingApiInstance) GetExtraProperties() map[string]interface{} { return f.extraProperties } +func (f *FieldMappingApiInstance) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetId(id *string) { + f.Id = id + f.require(fieldMappingApiInstanceFieldId) +} + +// SetIsIntegrationWide sets the IsIntegrationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetIsIntegrationWide(isIntegrationWide *bool) { + f.IsIntegrationWide = isIntegrationWide + f.require(fieldMappingApiInstanceFieldIsIntegrationWide) +} + +// SetTargetField sets the TargetField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetTargetField(targetField *FieldMappingApiInstanceTargetField) { + f.TargetField = targetField + f.require(fieldMappingApiInstanceFieldTargetField) +} + +// SetRemoteField sets the RemoteField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstance) SetRemoteField(remoteField *FieldMappingApiInstanceRemoteField) { + f.RemoteField = remoteField + f.require(fieldMappingApiInstanceFieldRemoteField) +} + func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstance var value unmarshaler @@ -378,6 +812,17 @@ func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstance) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstance + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstance) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -390,11 +835,20 @@ func (f *FieldMappingApiInstance) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldFieldSchema = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteField struct { RemoteKeyName *string `json:"remote_key_name,omitempty" url:"remote_key_name,omitempty"` Schema map[string]interface{} `json:"schema,omitempty" url:"schema,omitempty"` RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info" url:"remote_endpoint_info"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -424,6 +878,34 @@ func (f *FieldMappingApiInstanceRemoteField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteKeyName(remoteKeyName *string) { + f.RemoteKeyName = remoteKeyName + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteKeyName) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetSchema(schema map[string]interface{}) { + f.Schema = schema + f.require(fieldMappingApiInstanceRemoteFieldFieldSchema) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteField) SetRemoteEndpointInfo(remoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) { + f.RemoteEndpointInfo = remoteEndpointInfo + f.require(fieldMappingApiInstanceRemoteFieldFieldRemoteEndpointInfo) +} + func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteField var value unmarshaler @@ -440,6 +922,17 @@ func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceRemoteField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -452,11 +945,20 @@ func (f *FieldMappingApiInstanceRemoteField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { Method *string `json:"method,omitempty" url:"method,omitempty"` UrlPath *string `json:"url_path,omitempty" url:"url_path,omitempty"` FieldTraversalPath []string `json:"field_traversal_path,omitempty" url:"field_traversal_path,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -486,6 +988,34 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) GetExtraPropertie return f.extraProperties } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetMethod(method *string) { + f.Method = method + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetUrlPath(urlPath *string) { + f.UrlPath = urlPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []string) { + f.FieldTraversalPath = fieldTraversalPath + f.require(fieldMappingApiInstanceRemoteFieldRemoteEndpointInfoFieldFieldTraversalPath) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo var value unmarshaler @@ -502,6 +1032,17 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(dat return nil } +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -514,6 +1055,20 @@ func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceResponseFieldTicket = big.NewInt(1 << 0) + fieldMappingApiInstanceResponseFieldComment = big.NewInt(1 << 1) + fieldMappingApiInstanceResponseFieldProject = big.NewInt(1 << 2) + fieldMappingApiInstanceResponseFieldCollection = big.NewInt(1 << 3) + fieldMappingApiInstanceResponseFieldUser = big.NewInt(1 << 4) + fieldMappingApiInstanceResponseFieldRole = big.NewInt(1 << 5) + fieldMappingApiInstanceResponseFieldAccount = big.NewInt(1 << 6) + fieldMappingApiInstanceResponseFieldTeam = big.NewInt(1 << 7) + fieldMappingApiInstanceResponseFieldAttachment = big.NewInt(1 << 8) + fieldMappingApiInstanceResponseFieldTag = big.NewInt(1 << 9) + fieldMappingApiInstanceResponseFieldContact = big.NewInt(1 << 10) +) + type FieldMappingApiInstanceResponse struct { Ticket []*FieldMappingApiInstance `json:"Ticket,omitempty" url:"Ticket,omitempty"` Comment []*FieldMappingApiInstance `json:"Comment,omitempty" url:"Comment,omitempty"` @@ -527,6 +1082,9 @@ type FieldMappingApiInstanceResponse struct { Tag []*FieldMappingApiInstance `json:"Tag,omitempty" url:"Tag,omitempty"` Contact []*FieldMappingApiInstance `json:"Contact,omitempty" url:"Contact,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -612,6 +1170,90 @@ func (f *FieldMappingApiInstanceResponse) GetExtraProperties() map[string]interf return f.extraProperties } +func (f *FieldMappingApiInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetTicket sets the Ticket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTicket(ticket []*FieldMappingApiInstance) { + f.Ticket = ticket + f.require(fieldMappingApiInstanceResponseFieldTicket) +} + +// SetComment sets the Comment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetComment(comment []*FieldMappingApiInstance) { + f.Comment = comment + f.require(fieldMappingApiInstanceResponseFieldComment) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetProject(project []*FieldMappingApiInstance) { + f.Project = project + f.require(fieldMappingApiInstanceResponseFieldProject) +} + +// SetCollection sets the Collection field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetCollection(collection []*FieldMappingApiInstance) { + f.Collection = collection + f.require(fieldMappingApiInstanceResponseFieldCollection) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetUser(user []*FieldMappingApiInstance) { + f.User = user + f.require(fieldMappingApiInstanceResponseFieldUser) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetRole(role []*FieldMappingApiInstance) { + f.Role = role + f.require(fieldMappingApiInstanceResponseFieldRole) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetAccount(account []*FieldMappingApiInstance) { + f.Account = account + f.require(fieldMappingApiInstanceResponseFieldAccount) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTeam(team []*FieldMappingApiInstance) { + f.Team = team + f.require(fieldMappingApiInstanceResponseFieldTeam) +} + +// SetAttachment sets the Attachment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetAttachment(attachment []*FieldMappingApiInstance) { + f.Attachment = attachment + f.require(fieldMappingApiInstanceResponseFieldAttachment) +} + +// SetTag sets the Tag field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetTag(tag []*FieldMappingApiInstance) { + f.Tag = tag + f.require(fieldMappingApiInstanceResponseFieldTag) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceResponse) SetContact(contact []*FieldMappingApiInstance) { + f.Contact = contact + f.require(fieldMappingApiInstanceResponseFieldContact) +} + func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceResponse var value unmarshaler @@ -628,6 +1270,17 @@ func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -640,11 +1293,20 @@ func (f *FieldMappingApiInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingApiInstanceTargetFieldFieldName = big.NewInt(1 << 0) + fieldMappingApiInstanceTargetFieldFieldDescription = big.NewInt(1 << 1) + fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide = big.NewInt(1 << 2) +) + type FieldMappingApiInstanceTargetField struct { Name string `json:"name" url:"name"` Description string `json:"description" url:"description"` IsOrganizationWide bool `json:"is_organization_wide" url:"is_organization_wide"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -674,6 +1336,34 @@ func (f *FieldMappingApiInstanceTargetField) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldMappingApiInstanceTargetField) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetName(name string) { + f.Name = name + f.require(fieldMappingApiInstanceTargetFieldFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetDescription(description string) { + f.Description = description + f.require(fieldMappingApiInstanceTargetFieldFieldDescription) +} + +// SetIsOrganizationWide sets the IsOrganizationWide field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingApiInstanceTargetField) SetIsOrganizationWide(isOrganizationWide bool) { + f.IsOrganizationWide = isOrganizationWide + f.require(fieldMappingApiInstanceTargetFieldFieldIsOrganizationWide) +} + func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingApiInstanceTargetField var value unmarshaler @@ -690,6 +1380,17 @@ func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingApiInstanceTargetField) MarshalJSON() ([]byte, error) { + type embed FieldMappingApiInstanceTargetField + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingApiInstanceTargetField) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -702,12 +1403,22 @@ func (f *FieldMappingApiInstanceTargetField) String() string { return fmt.Sprintf("%#v", f) } +var ( + fieldMappingInstanceResponseFieldModel = big.NewInt(1 << 0) + fieldMappingInstanceResponseFieldWarnings = big.NewInt(1 << 1) + fieldMappingInstanceResponseFieldErrors = big.NewInt(1 << 2) + fieldMappingInstanceResponseFieldLogs = big.NewInt(1 << 3) +) + type FieldMappingInstanceResponse struct { Model *FieldMappingApiInstance `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -744,6 +1455,41 @@ func (f *FieldMappingInstanceResponse) GetExtraProperties() map[string]interface return f.extraProperties } +func (f *FieldMappingInstanceResponse) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetModel(model *FieldMappingApiInstance) { + f.Model = model + f.require(fieldMappingInstanceResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetWarnings(warnings []*WarningValidationProblem) { + f.Warnings = warnings + f.require(fieldMappingInstanceResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetErrors(errors []*ErrorValidationProblem) { + f.Errors = errors + f.require(fieldMappingInstanceResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldMappingInstanceResponse) SetLogs(logs []*DebugModeLog) { + f.Logs = logs + f.require(fieldMappingInstanceResponseFieldLogs) +} + func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { type unmarshaler FieldMappingInstanceResponse var value unmarshaler @@ -760,6 +1506,17 @@ func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldMappingInstanceResponse) MarshalJSON() ([]byte, error) { + type embed FieldMappingInstanceResponse + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldMappingInstanceResponse) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -772,11 +1529,20 @@ func (f *FieldMappingInstanceResponse) String() string { return fmt.Sprintf("%#v", f) } +var ( + remoteEndpointInfoFieldMethod = big.NewInt(1 << 0) + remoteEndpointInfoFieldUrlPath = big.NewInt(1 << 1) + remoteEndpointInfoFieldFieldTraversalPath = big.NewInt(1 << 2) +) + type RemoteEndpointInfo struct { Method string `json:"method" url:"method"` UrlPath string `json:"url_path" url:"url_path"` FieldTraversalPath []interface{} `json:"field_traversal_path" url:"field_traversal_path"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -806,6 +1572,34 @@ func (r *RemoteEndpointInfo) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteEndpointInfo) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetMethod(method string) { + r.Method = method + r.require(remoteEndpointInfoFieldMethod) +} + +// SetUrlPath sets the UrlPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetUrlPath(urlPath string) { + r.UrlPath = urlPath + r.require(remoteEndpointInfoFieldUrlPath) +} + +// SetFieldTraversalPath sets the FieldTraversalPath field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteEndpointInfo) SetFieldTraversalPath(fieldTraversalPath []interface{}) { + r.FieldTraversalPath = fieldTraversalPath + r.require(remoteEndpointInfoFieldFieldTraversalPath) +} + func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { type unmarshaler RemoteEndpointInfo var value unmarshaler @@ -822,6 +1616,17 @@ func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteEndpointInfo) MarshalJSON() ([]byte, error) { + type embed RemoteEndpointInfo + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteEndpointInfo) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -834,6 +1639,15 @@ func (r *RemoteEndpointInfo) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldApiFieldSchema = big.NewInt(1 << 0) + remoteFieldApiFieldRemoteKeyName = big.NewInt(1 << 1) + remoteFieldApiFieldRemoteEndpointInfo = big.NewInt(1 << 2) + remoteFieldApiFieldExampleValues = big.NewInt(1 << 3) + remoteFieldApiFieldAdvancedMetadata = big.NewInt(1 << 4) + remoteFieldApiFieldCoverage = big.NewInt(1 << 5) +) + type RemoteFieldApi struct { Schema map[string]interface{} `json:"schema" url:"schema"` RemoteKeyName string `json:"remote_key_name" url:"remote_key_name"` @@ -842,6 +1656,9 @@ type RemoteFieldApi struct { AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty" url:"advanced_metadata,omitempty"` Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty" url:"coverage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -892,6 +1709,55 @@ func (r *RemoteFieldApi) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApi) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetSchema sets the Schema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetSchema(schema map[string]interface{}) { + r.Schema = schema + r.require(remoteFieldApiFieldSchema) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteKeyName(remoteKeyName string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldApiFieldRemoteKeyName) +} + +// SetRemoteEndpointInfo sets the RemoteEndpointInfo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetRemoteEndpointInfo(remoteEndpointInfo *RemoteEndpointInfo) { + r.RemoteEndpointInfo = remoteEndpointInfo + r.require(remoteFieldApiFieldRemoteEndpointInfo) +} + +// SetExampleValues sets the ExampleValues field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetExampleValues(exampleValues []interface{}) { + r.ExampleValues = exampleValues + r.require(remoteFieldApiFieldExampleValues) +} + +// SetAdvancedMetadata sets the AdvancedMetadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetAdvancedMetadata(advancedMetadata *AdvancedMetadata) { + r.AdvancedMetadata = advancedMetadata + r.require(remoteFieldApiFieldAdvancedMetadata) +} + +// SetCoverage sets the Coverage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApi) SetCoverage(coverage *RemoteFieldApiCoverage) { + r.Coverage = coverage + r.require(remoteFieldApiFieldCoverage) +} + func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApi var value unmarshaler @@ -908,6 +1774,17 @@ func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApi) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApi + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApi) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -982,6 +1859,20 @@ func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) e return fmt.Errorf("type %T does not include a non-empty union type", r) } +var ( + remoteFieldApiResponseFieldTicket = big.NewInt(1 << 0) + remoteFieldApiResponseFieldComment = big.NewInt(1 << 1) + remoteFieldApiResponseFieldProject = big.NewInt(1 << 2) + remoteFieldApiResponseFieldCollection = big.NewInt(1 << 3) + remoteFieldApiResponseFieldUser = big.NewInt(1 << 4) + remoteFieldApiResponseFieldRole = big.NewInt(1 << 5) + remoteFieldApiResponseFieldAccount = big.NewInt(1 << 6) + remoteFieldApiResponseFieldTeam = big.NewInt(1 << 7) + remoteFieldApiResponseFieldAttachment = big.NewInt(1 << 8) + remoteFieldApiResponseFieldTag = big.NewInt(1 << 9) + remoteFieldApiResponseFieldContact = big.NewInt(1 << 10) +) + type RemoteFieldApiResponse struct { Ticket []*RemoteFieldApi `json:"Ticket,omitempty" url:"Ticket,omitempty"` Comment []*RemoteFieldApi `json:"Comment,omitempty" url:"Comment,omitempty"` @@ -995,6 +1886,9 @@ type RemoteFieldApiResponse struct { Tag []*RemoteFieldApi `json:"Tag,omitempty" url:"Tag,omitempty"` Contact []*RemoteFieldApi `json:"Contact,omitempty" url:"Contact,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1080,6 +1974,90 @@ func (r *RemoteFieldApiResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldApiResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetTicket sets the Ticket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTicket(ticket []*RemoteFieldApi) { + r.Ticket = ticket + r.require(remoteFieldApiResponseFieldTicket) +} + +// SetComment sets the Comment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetComment(comment []*RemoteFieldApi) { + r.Comment = comment + r.require(remoteFieldApiResponseFieldComment) +} + +// SetProject sets the Project field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetProject(project []*RemoteFieldApi) { + r.Project = project + r.require(remoteFieldApiResponseFieldProject) +} + +// SetCollection sets the Collection field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetCollection(collection []*RemoteFieldApi) { + r.Collection = collection + r.require(remoteFieldApiResponseFieldCollection) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetUser(user []*RemoteFieldApi) { + r.User = user + r.require(remoteFieldApiResponseFieldUser) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetRole(role []*RemoteFieldApi) { + r.Role = role + r.require(remoteFieldApiResponseFieldRole) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetAccount(account []*RemoteFieldApi) { + r.Account = account + r.require(remoteFieldApiResponseFieldAccount) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTeam(team []*RemoteFieldApi) { + r.Team = team + r.require(remoteFieldApiResponseFieldTeam) +} + +// SetAttachment sets the Attachment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetAttachment(attachment []*RemoteFieldApi) { + r.Attachment = attachment + r.require(remoteFieldApiResponseFieldAttachment) +} + +// SetTag sets the Tag field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetTag(tag []*RemoteFieldApi) { + r.Tag = tag + r.require(remoteFieldApiResponseFieldTag) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldApiResponse) SetContact(contact []*RemoteFieldApi) { + r.Contact = contact + r.require(remoteFieldApiResponseFieldContact) +} + func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldApiResponse var value unmarshaler @@ -1096,6 +2074,17 @@ func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldApiResponse) MarshalJSON() ([]byte, error) { + type embed RemoteFieldApiResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldApiResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { diff --git a/ticketing/fieldmapping/client.go b/ticketing/fieldmapping/client.go index 53a82fb..ef0d815 100644 --- a/ticketing/fieldmapping/client.go +++ b/ticketing/fieldmapping/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,42 +38,15 @@ func (c *Client) FieldMappingsRetrieve( request *ticketing.FieldMappingsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.FieldMappingApiInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ticketing/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.FieldMappingApiInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -81,44 +55,15 @@ func (c *Client) FieldMappingsCreate( request *ticketing.CreateFieldMappingRequest, opts ...option.RequestOption, ) (*ticketing.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.FieldMappingsCreate( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ticketing/v1/field-mappings" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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. @@ -127,38 +72,15 @@ func (c *Client) FieldMappingsDestroy( fieldMappingId string, opts ...option.RequestOption, ) (*ticketing.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsDestroy( + ctx, fieldMappingId, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodDelete, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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. @@ -168,40 +90,16 @@ func (c *Client) FieldMappingsPartialUpdate( request *ticketing.PatchedEditFieldMappingRequest, opts ...option.RequestOption, ) (*ticketing.FieldMappingInstanceResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/field-mappings/%v", + response, err := c.WithRawResponse.FieldMappingsPartialUpdate( + ctx, fieldMappingId, + request, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.FieldMappingInstanceResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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/). @@ -210,42 +108,15 @@ func (c *Client) RemoteFieldsRetrieve( request *ticketing.RemoteFieldsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.RemoteFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.RemoteFieldsRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ticketing/v1/remote-fields" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.RemoteFieldApiResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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/). @@ -253,33 +124,12 @@ func (c *Client) TargetFieldsRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ticketing.ExternalTargetFieldApiResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/target-fields" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.ExternalTargetFieldApiResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.TargetFieldsRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/fieldmapping/raw_client.go b/ticketing/fieldmapping/raw_client.go new file mode 100644 index 0000000..7fff861 --- /dev/null +++ b/ticketing/fieldmapping/raw_client.go @@ -0,0 +1,302 @@ +// Code generated by Fern. DO NOT EDIT. + +package fieldmapping + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) FieldMappingsRetrieve( + ctx context.Context, + request *ticketing.FieldMappingsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.FieldMappingApiInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.FieldMappingApiInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.FieldMappingApiInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsCreate( + ctx context.Context, + request *ticketing.CreateFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/field-mappings" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsDestroy( + ctx context.Context, + fieldMappingId string, + opts ...option.RequestOption, +) (*core.Response[*ticketing.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) FieldMappingsPartialUpdate( + ctx context.Context, + fieldMappingId string, + request *ticketing.PatchedEditFieldMappingRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.FieldMappingInstanceResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/field-mappings/%v", + fieldMappingId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.FieldMappingInstanceResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.FieldMappingInstanceResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) RemoteFieldsRetrieve( + ctx context.Context, + request *ticketing.RemoteFieldsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.RemoteFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/remote-fields" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.RemoteFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.RemoteFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) TargetFieldsRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ticketing.ExternalTargetFieldApiResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/target-fields" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.ExternalTargetFieldApiResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.ExternalTargetFieldApiResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/fieldmapping/ticketing_field_mapping_test/ticketing_field_mapping_test.go b/ticketing/fieldmapping/ticketing_field_mapping_test/ticketing_field_mapping_test.go new file mode 100644 index 0000000..3e70a0c --- /dev/null +++ b/ticketing/fieldmapping/ticketing_field_mapping_test/ticketing_field_mapping_test.go @@ -0,0 +1,210 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_field_mapping_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingFieldMappingFieldMappingsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.FieldMappingsRetrieveRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.FieldMapping.FieldMappingsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestTicketingFieldMappingFieldMappingsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.CreateFieldMappingRequest{ + ExcludeRemoteFieldMetadata: merge.Bool( + true, + ), + TargetFieldName: "example_target_field_name", + TargetFieldDescription: "this is a example description of the target field", + RemoteFieldTraversalPath: []any{ + "example_remote_field", + }, + RemoteMethod: "GET", + RemoteUrlPath: "/example-url-path", + CommonModelName: "ExampleCommonModel", + } + _, invocationErr := client.Ticketing.FieldMapping.FieldMappingsCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/field-mappings", map[string]string{"exclude_remote_field_metadata": "true"}, 1) +} + +func TestTicketingFieldMappingFieldMappingsDestroyWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + response, invocationErr := client.Ticketing.FieldMapping.FieldMappingsDestroy( + context.TODO(), + "field_mapping_id", + ) + + // DELETE operations may return nil response body, which is acceptable + if invocationErr != nil && response == nil { + // This is expected for DELETE operations that return 204 No Content + require.Contains(t, invocationErr.Error(), "but the server responded with nothing", "Expected empty response error") + } else { + require.NoError(t, invocationErr, "Client method call should succeed") + } + VerifyRequestCount(t, "DELETE", "/ticketing/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestTicketingFieldMappingFieldMappingsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.PatchedEditFieldMappingRequest{} + _, invocationErr := client.Ticketing.FieldMapping.FieldMappingsPartialUpdate( + context.TODO(), + "field_mapping_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/ticketing/v1/field-mappings/field_mapping_id", nil, 1) +} + +func TestTicketingFieldMappingRemoteFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.RemoteFieldsRetrieveRequest{ + CommonModels: merge.String( + "common_models", + ), + IncludeExampleValues: merge.String( + "include_example_values", + ), + } + _, invocationErr := client.Ticketing.FieldMapping.RemoteFieldsRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/remote-fields", map[string]string{"common_models": "common_models", "include_example_values": "include_example_values"}, 1) +} + +func TestTicketingFieldMappingTargetFieldsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.FieldMapping.TargetFieldsRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/target-fields", nil, 1) +} diff --git a/ticketing/forceresync/client.go b/ticketing/forceresync/client.go index 14d4654..33e28bf 100644 --- a/ticketing/forceresync/client.go +++ b/ticketing/forceresync/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,33 +37,12 @@ func (c *Client) SyncStatusResyncCreate( ctx context.Context, opts ...option.RequestOption, ) ([]*ticketing.SyncStatus, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/sync-status/resync" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*ticketing.SyncStatus - if err := c.caller.Call( + response, err := c.WithRawResponse.SyncStatusResyncCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/forceresync/raw_client.go b/ticketing/forceresync/raw_client.go new file mode 100644 index 0000000..4512cae --- /dev/null +++ b/ticketing/forceresync/raw_client.go @@ -0,0 +1,70 @@ +// Code generated by Fern. DO NOT EDIT. + +package forceresync + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) SyncStatusResyncCreate( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*ticketing.SyncStatus], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/sync-status/resync" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*ticketing.SyncStatus + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*ticketing.SyncStatus]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/forceresync/ticketing_force_resync_test/ticketing_force_resync_test.go b/ticketing/forceresync/ticketing_force_resync_test/ticketing_force_resync_test.go new file mode 100644 index 0000000..99e814b --- /dev/null +++ b/ticketing/forceresync/ticketing_force_resync_test/ticketing_force_resync_test.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_force_resync_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingForceResyncSyncStatusResyncCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.ForceResync.SyncStatusResyncCreate( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/sync-status/resync", nil, 1) +} diff --git a/ticketing/generate_key.go b/ticketing/generate_key.go index 93d4082..2270a6c 100644 --- a/ticketing/generate_key.go +++ b/ticketing/generate_key.go @@ -2,7 +2,32 @@ package ticketing +import ( + big "math/big" +) + +var ( + generateRemoteKeyRequestFieldName = big.NewInt(1 << 0) +) + type GenerateRemoteKeyRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GenerateRemoteKeyRequest) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GenerateRemoteKeyRequest) SetName(name string) { + g.Name = name + g.require(generateRemoteKeyRequestFieldName) } diff --git a/ticketing/generatekey/client.go b/ticketing/generatekey/client.go index 9779bf0..9c3f543 100644 --- a/ticketing/generatekey/client.go +++ b/ticketing/generatekey/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *ticketing.GenerateRemoteKeyRequest, opts ...option.RequestOption, ) (*ticketing.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/generate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/generatekey/raw_client.go b/ticketing/generatekey/raw_client.go new file mode 100644 index 0000000..99ea07b --- /dev/null +++ b/ticketing/generatekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package generatekey + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.GenerateRemoteKeyRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/generate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/generatekey/ticketing_generate_key_test/ticketing_generate_key_test.go b/ticketing/generatekey/ticketing_generate_key_test/ticketing_generate_key_test.go new file mode 100644 index 0000000..bba28fe --- /dev/null +++ b/ticketing/generatekey/ticketing_generate_key_test/ticketing_generate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_generate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingGenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.GenerateRemoteKeyRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Ticketing.GenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/generate-key", nil, 1) +} diff --git a/ticketing/issues.go b/ticketing/issues.go index db7970d..9e429f3 100644 --- a/ticketing/issues.go +++ b/ticketing/issues.go @@ -6,9 +6,27 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + issuesListRequestFieldAccountToken = big.NewInt(1 << 0) + issuesListRequestFieldCursor = big.NewInt(1 << 1) + issuesListRequestFieldEndDate = big.NewInt(1 << 2) + issuesListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + issuesListRequestFieldFirstIncidentTimeAfter = big.NewInt(1 << 4) + issuesListRequestFieldFirstIncidentTimeBefore = big.NewInt(1 << 5) + issuesListRequestFieldIncludeMuted = big.NewInt(1 << 6) + issuesListRequestFieldIntegrationName = big.NewInt(1 << 7) + issuesListRequestFieldLastIncidentTimeAfter = big.NewInt(1 << 8) + issuesListRequestFieldLastIncidentTimeBefore = big.NewInt(1 << 9) + issuesListRequestFieldLinkedAccountId = big.NewInt(1 << 10) + issuesListRequestFieldPageSize = big.NewInt(1 << 11) + issuesListRequestFieldStartDate = big.NewInt(1 << 12) + issuesListRequestFieldStatus = big.NewInt(1 << 13) +) + type IssuesListRequest struct { AccountToken *string `json:"-" url:"account_token,omitempty"` // The pagination cursor value. @@ -38,6 +56,114 @@ type IssuesListRequest struct { // * `ONGOING` - ONGOING // * `RESOLVED` - RESOLVED Status *IssuesListRequestStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *IssuesListRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetAccountToken sets the AccountToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetAccountToken(accountToken *string) { + i.AccountToken = accountToken + i.require(issuesListRequestFieldAccountToken) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetCursor(cursor *string) { + i.Cursor = cursor + i.require(issuesListRequestFieldCursor) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndDate(endDate *string) { + i.EndDate = endDate + i.require(issuesListRequestFieldEndDate) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + i.EndUserOrganizationName = endUserOrganizationName + i.require(issuesListRequestFieldEndUserOrganizationName) +} + +// SetFirstIncidentTimeAfter sets the FirstIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeAfter(firstIncidentTimeAfter *time.Time) { + i.FirstIncidentTimeAfter = firstIncidentTimeAfter + i.require(issuesListRequestFieldFirstIncidentTimeAfter) +} + +// SetFirstIncidentTimeBefore sets the FirstIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetFirstIncidentTimeBefore(firstIncidentTimeBefore *time.Time) { + i.FirstIncidentTimeBefore = firstIncidentTimeBefore + i.require(issuesListRequestFieldFirstIncidentTimeBefore) +} + +// SetIncludeMuted sets the IncludeMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIncludeMuted(includeMuted *string) { + i.IncludeMuted = includeMuted + i.require(issuesListRequestFieldIncludeMuted) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetIntegrationName(integrationName *string) { + i.IntegrationName = integrationName + i.require(issuesListRequestFieldIntegrationName) +} + +// SetLastIncidentTimeAfter sets the LastIncidentTimeAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeAfter(lastIncidentTimeAfter *time.Time) { + i.LastIncidentTimeAfter = lastIncidentTimeAfter + i.require(issuesListRequestFieldLastIncidentTimeAfter) +} + +// SetLastIncidentTimeBefore sets the LastIncidentTimeBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLastIncidentTimeBefore(lastIncidentTimeBefore *time.Time) { + i.LastIncidentTimeBefore = lastIncidentTimeBefore + i.require(issuesListRequestFieldLastIncidentTimeBefore) +} + +// SetLinkedAccountId sets the LinkedAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetLinkedAccountId(linkedAccountId *string) { + i.LinkedAccountId = linkedAccountId + i.require(issuesListRequestFieldLinkedAccountId) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetPageSize(pageSize *int) { + i.PageSize = pageSize + i.require(issuesListRequestFieldPageSize) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStartDate(startDate *string) { + i.StartDate = startDate + i.require(issuesListRequestFieldStartDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IssuesListRequest) SetStatus(status *IssuesListRequestStatus) { + i.Status = status + i.require(issuesListRequestFieldStatus) } type IssuesListRequestStatus string @@ -62,6 +188,17 @@ func (i IssuesListRequestStatus) Ptr() *IssuesListRequestStatus { return &i } +var ( + issueFieldId = big.NewInt(1 << 0) + issueFieldStatus = big.NewInt(1 << 1) + issueFieldErrorDescription = big.NewInt(1 << 2) + issueFieldEndUser = big.NewInt(1 << 3) + issueFieldFirstIncidentTime = big.NewInt(1 << 4) + issueFieldLastIncidentTime = big.NewInt(1 << 5) + issueFieldIsMuted = big.NewInt(1 << 6) + issueFieldErrorDetails = big.NewInt(1 << 7) +) + type Issue struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -76,6 +213,9 @@ type Issue struct { IsMuted *bool `json:"is_muted,omitempty" url:"is_muted,omitempty"` ErrorDetails []string `json:"error_details,omitempty" url:"error_details,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +280,69 @@ func (i *Issue) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *Issue) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetId(id *string) { + i.Id = id + i.require(issueFieldId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetStatus(status *IssueStatus) { + i.Status = status + i.require(issueFieldStatus) +} + +// SetErrorDescription sets the ErrorDescription field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDescription(errorDescription string) { + i.ErrorDescription = errorDescription + i.require(issueFieldErrorDescription) +} + +// SetEndUser sets the EndUser field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetEndUser(endUser map[string]interface{}) { + i.EndUser = endUser + i.require(issueFieldEndUser) +} + +// SetFirstIncidentTime sets the FirstIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetFirstIncidentTime(firstIncidentTime *time.Time) { + i.FirstIncidentTime = firstIncidentTime + i.require(issueFieldFirstIncidentTime) +} + +// SetLastIncidentTime sets the LastIncidentTime field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetLastIncidentTime(lastIncidentTime *time.Time) { + i.LastIncidentTime = lastIncidentTime + i.require(issueFieldLastIncidentTime) +} + +// SetIsMuted sets the IsMuted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetIsMuted(isMuted *bool) { + i.IsMuted = isMuted + i.require(issueFieldIsMuted) +} + +// SetErrorDetails sets the ErrorDetails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *Issue) SetErrorDetails(errorDetails []string) { + i.ErrorDetails = errorDetails + i.require(issueFieldErrorDetails) +} + func (i *Issue) UnmarshalJSON(data []byte) error { type embed Issue var unmarshaler = struct { @@ -175,7 +378,8 @@ func (i *Issue) MarshalJSON() ([]byte, error) { FirstIncidentTime: internal.NewOptionalDateTime(i.FirstIncidentTime), LastIncidentTime: internal.NewOptionalDateTime(i.LastIncidentTime), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) } func (i *Issue) String() string { @@ -280,11 +484,20 @@ func (i IssueStatusEnum) Ptr() *IssueStatusEnum { return &i } +var ( + paginatedIssueListFieldNext = big.NewInt(1 << 0) + paginatedIssueListFieldPrevious = big.NewInt(1 << 1) + paginatedIssueListFieldResults = big.NewInt(1 << 2) +) + type PaginatedIssueList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Issue `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -314,6 +527,34 @@ func (p *PaginatedIssueList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedIssueList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetNext(next *string) { + p.Next = next + p.require(paginatedIssueListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedIssueListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedIssueList) SetResults(results []*Issue) { + p.Results = results + p.require(paginatedIssueListFieldResults) +} + func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedIssueList var value unmarshaler @@ -330,6 +571,17 @@ func (p *PaginatedIssueList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedIssueList) MarshalJSON() ([]byte, error) { + type embed PaginatedIssueList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedIssueList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ticketing/issues/client.go b/ticketing/issues/client.go index ea0e8cf..bec50ba 100644 --- a/ticketing/issues/client.go +++ b/ticketing/issues/client.go @@ -4,7 +4,6 @@ package issues import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.IssuesListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Issue], error) { +) (*core.Page[*string, *ticketing.Issue], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedIssueList) *internal.PageResponse[*string, *ticketing.Issue] { + readPageResponse := func(response *ticketing.PaginatedIssueList) *core.PageResponse[*string, *ticketing.Issue] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Issue]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Issue]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,36 +97,13 @@ func (c *Client) Retrieve( id string, opts ...option.RequestOption, ) (*ticketing.Issue, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/issues/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Issue - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/issues/raw_client.go b/ticketing/issues/raw_client.go new file mode 100644 index 0000000..402e252 --- /dev/null +++ b/ticketing/issues/raw_client.go @@ -0,0 +1,74 @@ +// Code generated by Fern. DO NOT EDIT. + +package issues + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Issue], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/issues/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Issue + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Issue]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/issues/ticketing_issues_test/ticketing_issues_test.go b/ticketing/issues/ticketing_issues_test/ticketing_issues_test.go new file mode 100644 index 0000000..f022398 --- /dev/null +++ b/ticketing/issues/ticketing_issues_test/ticketing_issues_test.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_issues_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingIssuesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.IssuesListRequest{ + AccountToken: merge.String( + "account_token", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndDate: merge.String( + "end_date", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + FirstIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + FirstIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeMuted: merge.String( + "include_muted", + ), + IntegrationName: merge.String( + "integration_name", + ), + LastIncidentTimeAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LastIncidentTimeBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + LinkedAccountId: merge.String( + "linked_account_id", + ), + PageSize: merge.Int( + 1, + ), + StartDate: merge.String( + "start_date", + ), + Status: ticketing.IssuesListRequestStatusOngoing.Ptr(), + } + _, invocationErr := client.Ticketing.Issues.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/issues", map[string]string{"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"}, 1) +} + +func TestTicketingIssuesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.Issues.Retrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/issues/id", nil, 1) +} diff --git a/ticketing/link_token.go b/ticketing/link_token.go index 3634735..3752227 100644 --- a/ticketing/link_token.go +++ b/ticketing/link_token.go @@ -6,6 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + endUserDetailsRequestFieldEndUserEmailAddress = big.NewInt(1 << 0) + endUserDetailsRequestFieldEndUserOrganizationName = big.NewInt(1 << 1) + endUserDetailsRequestFieldEndUserOriginId = big.NewInt(1 << 2) + endUserDetailsRequestFieldCategories = big.NewInt(1 << 3) + endUserDetailsRequestFieldIntegration = big.NewInt(1 << 4) + endUserDetailsRequestFieldLinkExpiryMins = big.NewInt(1 << 5) + endUserDetailsRequestFieldShouldCreateMagicLinkUrl = big.NewInt(1 << 6) + endUserDetailsRequestFieldHideAdminMagicLink = big.NewInt(1 << 7) + endUserDetailsRequestFieldCommonModels = big.NewInt(1 << 8) + endUserDetailsRequestFieldCategoryCommonModelScopes = big.NewInt(1 << 9) + endUserDetailsRequestFieldLanguage = big.NewInt(1 << 10) + endUserDetailsRequestFieldAreSyncsDisabled = big.NewInt(1 << 11) + endUserDetailsRequestFieldIntegrationSpecificConfig = big.NewInt(1 << 12) ) type EndUserDetailsRequest struct { @@ -38,6 +55,107 @@ type EndUserDetailsRequest struct { AreSyncsDisabled *bool `json:"are_syncs_disabled,omitempty" url:"-"` // A JSON object containing integration-specific configuration options. IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (e *EndUserDetailsRequest) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserEmailAddress(endUserEmailAddress string) { + e.EndUserEmailAddress = endUserEmailAddress + e.require(endUserDetailsRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOrganizationName(endUserOrganizationName string) { + e.EndUserOrganizationName = endUserOrganizationName + e.require(endUserDetailsRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetEndUserOriginId(endUserOriginId string) { + e.EndUserOriginId = endUserOriginId + e.require(endUserDetailsRequestFieldEndUserOriginId) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategories(categories []CategoriesEnum) { + e.Categories = categories + e.require(endUserDetailsRequestFieldCategories) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegration(integration *string) { + e.Integration = integration + e.require(endUserDetailsRequestFieldIntegration) +} + +// SetLinkExpiryMins sets the LinkExpiryMins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLinkExpiryMins(linkExpiryMins *int) { + e.LinkExpiryMins = linkExpiryMins + e.require(endUserDetailsRequestFieldLinkExpiryMins) +} + +// SetShouldCreateMagicLinkUrl sets the ShouldCreateMagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetShouldCreateMagicLinkUrl(shouldCreateMagicLinkUrl *bool) { + e.ShouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl + e.require(endUserDetailsRequestFieldShouldCreateMagicLinkUrl) +} + +// SetHideAdminMagicLink sets the HideAdminMagicLink field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetHideAdminMagicLink(hideAdminMagicLink *bool) { + e.HideAdminMagicLink = hideAdminMagicLink + e.require(endUserDetailsRequestFieldHideAdminMagicLink) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCommonModels(commonModels []*CommonModelScopesBodyRequest) { + e.CommonModels = commonModels + e.require(endUserDetailsRequestFieldCommonModels) +} + +// SetCategoryCommonModelScopes sets the CategoryCommonModelScopes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetCategoryCommonModelScopes(categoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest) { + e.CategoryCommonModelScopes = categoryCommonModelScopes + e.require(endUserDetailsRequestFieldCategoryCommonModelScopes) +} + +// SetLanguage sets the Language field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetLanguage(language *EndUserDetailsRequestLanguage) { + e.Language = language + e.require(endUserDetailsRequestFieldLanguage) +} + +// SetAreSyncsDisabled sets the AreSyncsDisabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetAreSyncsDisabled(areSyncsDisabled *bool) { + e.AreSyncsDisabled = areSyncsDisabled + e.require(endUserDetailsRequestFieldAreSyncsDisabled) +} + +// SetIntegrationSpecificConfig sets the IntegrationSpecificConfig field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *EndUserDetailsRequest) SetIntegrationSpecificConfig(integrationSpecificConfig map[string]interface{}) { + e.IntegrationSpecificConfig = integrationSpecificConfig + e.require(endUserDetailsRequestFieldIntegrationSpecificConfig) } // The following subset of IETF language tags can be used to configure localization. @@ -106,11 +224,20 @@ func (e *EndUserDetailsRequestLanguage) Accept(visitor EndUserDetailsRequestLang return fmt.Errorf("type %T does not include a non-empty union type", e) } +var ( + commonModelScopesBodyRequestFieldModelId = big.NewInt(1 << 0) + commonModelScopesBodyRequestFieldEnabledActions = big.NewInt(1 << 1) + commonModelScopesBodyRequestFieldDisabledFields = big.NewInt(1 << 2) +) + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id" url:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions" url:"enabled_actions"` DisabledFields []string `json:"disabled_fields" url:"disabled_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -140,6 +267,34 @@ func (c *CommonModelScopesBodyRequest) GetExtraProperties() map[string]interface return c.extraProperties } +func (c *CommonModelScopesBodyRequest) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetModelId(modelId string) { + c.ModelId = modelId + c.require(commonModelScopesBodyRequestFieldModelId) +} + +// SetEnabledActions sets the EnabledActions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetEnabledActions(enabledActions []EnabledActionsEnum) { + c.EnabledActions = enabledActions + c.require(commonModelScopesBodyRequestFieldEnabledActions) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopesBodyRequest) SetDisabledFields(disabledFields []string) { + c.DisabledFields = disabledFields + c.require(commonModelScopesBodyRequestFieldDisabledFields) +} + func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopesBodyRequest var value unmarshaler @@ -156,6 +311,17 @@ func (c *CommonModelScopesBodyRequest) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopesBodyRequest) MarshalJSON() ([]byte, error) { + type embed CommonModelScopesBodyRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopesBodyRequest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -216,11 +382,20 @@ func (l LanguageEnum) Ptr() *LanguageEnum { return &l } +var ( + linkTokenFieldLinkToken = big.NewInt(1 << 0) + linkTokenFieldIntegrationName = big.NewInt(1 << 1) + linkTokenFieldMagicLinkUrl = big.NewInt(1 << 2) +) + type LinkToken struct { LinkToken string `json:"link_token" url:"link_token"` IntegrationName *string `json:"integration_name,omitempty" url:"integration_name,omitempty"` MagicLinkUrl *string `json:"magic_link_url,omitempty" url:"magic_link_url,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -250,6 +425,34 @@ func (l *LinkToken) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkToken) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkToken sets the LinkToken field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetLinkToken(linkToken string) { + l.LinkToken = linkToken + l.require(linkTokenFieldLinkToken) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkTokenFieldIntegrationName) +} + +// SetMagicLinkUrl sets the MagicLinkUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkToken) SetMagicLinkUrl(magicLinkUrl *string) { + l.MagicLinkUrl = magicLinkUrl + l.require(linkTokenFieldMagicLinkUrl) +} + func (l *LinkToken) UnmarshalJSON(data []byte) error { type unmarshaler LinkToken var value unmarshaler @@ -266,6 +469,17 @@ func (l *LinkToken) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkToken) MarshalJSON() ([]byte, error) { + type embed LinkToken + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkToken) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { diff --git a/ticketing/linked_accounts.go b/ticketing/linked_accounts.go index fc93c07..172906c 100644 --- a/ticketing/linked_accounts.go +++ b/ticketing/linked_accounts.go @@ -6,9 +6,26 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + linkedAccountsListRequestFieldCategory = big.NewInt(1 << 0) + linkedAccountsListRequestFieldCursor = big.NewInt(1 << 1) + linkedAccountsListRequestFieldEndUserEmailAddress = big.NewInt(1 << 2) + linkedAccountsListRequestFieldEndUserOrganizationName = big.NewInt(1 << 3) + linkedAccountsListRequestFieldEndUserOriginId = big.NewInt(1 << 4) + linkedAccountsListRequestFieldEndUserOriginIds = big.NewInt(1 << 5) + linkedAccountsListRequestFieldId = big.NewInt(1 << 6) + linkedAccountsListRequestFieldIds = big.NewInt(1 << 7) + linkedAccountsListRequestFieldIncludeDuplicates = big.NewInt(1 << 8) + linkedAccountsListRequestFieldIntegrationName = big.NewInt(1 << 9) + linkedAccountsListRequestFieldIsTestAccount = big.NewInt(1 << 10) + linkedAccountsListRequestFieldPageSize = big.NewInt(1 << 11) + linkedAccountsListRequestFieldStatus = big.NewInt(1 << 12) +) + type LinkedAccountsListRequest struct { // Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` // @@ -43,6 +60,107 @@ type LinkedAccountsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` Status *string `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountsListRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCategory(category *LinkedAccountsListRequestCategory) { + l.Category = category + l.require(linkedAccountsListRequestFieldCategory) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetCursor(cursor *string) { + l.Cursor = cursor + l.require(linkedAccountsListRequestFieldCursor) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserEmailAddress(endUserEmailAddress *string) { + l.EndUserEmailAddress = endUserEmailAddress + l.require(linkedAccountsListRequestFieldEndUserEmailAddress) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOrganizationName(endUserOrganizationName *string) { + l.EndUserOrganizationName = endUserOrganizationName + l.require(linkedAccountsListRequestFieldEndUserOrganizationName) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginId(endUserOriginId *string) { + l.EndUserOriginId = endUserOriginId + l.require(linkedAccountsListRequestFieldEndUserOriginId) +} + +// SetEndUserOriginIds sets the EndUserOriginIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetEndUserOriginIds(endUserOriginIds *string) { + l.EndUserOriginIds = endUserOriginIds + l.require(linkedAccountsListRequestFieldEndUserOriginIds) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetId(id *string) { + l.Id = id + l.require(linkedAccountsListRequestFieldId) +} + +// SetIds sets the Ids field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIds(ids *string) { + l.Ids = ids + l.require(linkedAccountsListRequestFieldIds) +} + +// SetIncludeDuplicates sets the IncludeDuplicates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIncludeDuplicates(includeDuplicates *bool) { + l.IncludeDuplicates = includeDuplicates + l.require(linkedAccountsListRequestFieldIncludeDuplicates) +} + +// SetIntegrationName sets the IntegrationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIntegrationName(integrationName *string) { + l.IntegrationName = integrationName + l.require(linkedAccountsListRequestFieldIntegrationName) +} + +// SetIsTestAccount sets the IsTestAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetIsTestAccount(isTestAccount *string) { + l.IsTestAccount = isTestAccount + l.require(linkedAccountsListRequestFieldIsTestAccount) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetPageSize(pageSize *int) { + l.PageSize = pageSize + l.require(linkedAccountsListRequestFieldPageSize) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountsListRequest) SetStatus(status *string) { + l.Status = status + l.require(linkedAccountsListRequestFieldStatus) } type LinkedAccountsListRequestCategory string @@ -88,6 +206,22 @@ func (l LinkedAccountsListRequestCategory) Ptr() *LinkedAccountsListRequestCateg // // ### Usage Example // View a list of your organization's `LinkedAccount` objects. +var ( + accountDetailsAndActionsFieldId = big.NewInt(1 << 0) + accountDetailsAndActionsFieldCategory = big.NewInt(1 << 1) + accountDetailsAndActionsFieldStatus = big.NewInt(1 << 2) + accountDetailsAndActionsFieldStatusDetail = big.NewInt(1 << 3) + accountDetailsAndActionsFieldEndUserOriginId = big.NewInt(1 << 4) + accountDetailsAndActionsFieldEndUserOrganizationName = big.NewInt(1 << 5) + accountDetailsAndActionsFieldEndUserEmailAddress = big.NewInt(1 << 6) + accountDetailsAndActionsFieldSubdomain = big.NewInt(1 << 7) + accountDetailsAndActionsFieldWebhookListenerUrl = big.NewInt(1 << 8) + accountDetailsAndActionsFieldIsDuplicate = big.NewInt(1 << 9) + accountDetailsAndActionsFieldIntegration = big.NewInt(1 << 10) + accountDetailsAndActionsFieldAccountType = big.NewInt(1 << 11) + accountDetailsAndActionsFieldCompletedAt = big.NewInt(1 << 12) +) + type AccountDetailsAndActions struct { Id string `json:"id" url:"id"` Category *AccountDetailsAndActionsCategory `json:"category,omitempty" url:"category,omitempty"` @@ -105,6 +239,9 @@ type AccountDetailsAndActions struct { AccountType string `json:"account_type" url:"account_type"` CompletedAt time.Time `json:"completed_at" url:"completed_at"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -204,6 +341,104 @@ func (a *AccountDetailsAndActions) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountDetailsAndActions) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetId(id string) { + a.Id = id + a.require(accountDetailsAndActionsFieldId) +} + +// SetCategory sets the Category field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCategory(category *AccountDetailsAndActionsCategory) { + a.Category = category + a.require(accountDetailsAndActionsFieldCategory) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatus(status *AccountDetailsAndActionsStatus) { + a.Status = status + a.require(accountDetailsAndActionsFieldStatus) +} + +// SetStatusDetail sets the StatusDetail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetStatusDetail(statusDetail *string) { + a.StatusDetail = statusDetail + a.require(accountDetailsAndActionsFieldStatusDetail) +} + +// SetEndUserOriginId sets the EndUserOriginId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOriginId(endUserOriginId *string) { + a.EndUserOriginId = endUserOriginId + a.require(accountDetailsAndActionsFieldEndUserOriginId) +} + +// SetEndUserOrganizationName sets the EndUserOrganizationName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserOrganizationName(endUserOrganizationName string) { + a.EndUserOrganizationName = endUserOrganizationName + a.require(accountDetailsAndActionsFieldEndUserOrganizationName) +} + +// SetEndUserEmailAddress sets the EndUserEmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetEndUserEmailAddress(endUserEmailAddress string) { + a.EndUserEmailAddress = endUserEmailAddress + a.require(accountDetailsAndActionsFieldEndUserEmailAddress) +} + +// SetSubdomain sets the Subdomain field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetSubdomain(subdomain *string) { + a.Subdomain = subdomain + a.require(accountDetailsAndActionsFieldSubdomain) +} + +// SetWebhookListenerUrl sets the WebhookListenerUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetWebhookListenerUrl(webhookListenerUrl string) { + a.WebhookListenerUrl = webhookListenerUrl + a.require(accountDetailsAndActionsFieldWebhookListenerUrl) +} + +// SetIsDuplicate sets the IsDuplicate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIsDuplicate(isDuplicate *bool) { + a.IsDuplicate = isDuplicate + a.require(accountDetailsAndActionsFieldIsDuplicate) +} + +// SetIntegration sets the Integration field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetIntegration(integration *AccountDetailsAndActionsIntegration) { + a.Integration = integration + a.require(accountDetailsAndActionsFieldIntegration) +} + +// SetAccountType sets the AccountType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetAccountType(accountType string) { + a.AccountType = accountType + a.require(accountDetailsAndActionsFieldAccountType) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActions) SetCompletedAt(completedAt time.Time) { + a.CompletedAt = completedAt + a.require(accountDetailsAndActionsFieldCompletedAt) +} + func (a *AccountDetailsAndActions) UnmarshalJSON(data []byte) error { type embed AccountDetailsAndActions var unmarshaler = struct { @@ -235,7 +470,8 @@ func (a *AccountDetailsAndActions) MarshalJSON() ([]byte, error) { embed: embed(*a), CompletedAt: internal.NewDateTime(a.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *AccountDetailsAndActions) String() string { @@ -312,6 +548,17 @@ func (a *AccountDetailsAndActionsCategory) Accept(visitor AccountDetailsAndActio return fmt.Errorf("type %T does not include a non-empty union type", a) } +var ( + accountDetailsAndActionsIntegrationFieldName = big.NewInt(1 << 0) + accountDetailsAndActionsIntegrationFieldCategories = big.NewInt(1 << 1) + accountDetailsAndActionsIntegrationFieldImage = big.NewInt(1 << 2) + accountDetailsAndActionsIntegrationFieldSquareImage = big.NewInt(1 << 3) + accountDetailsAndActionsIntegrationFieldColor = big.NewInt(1 << 4) + accountDetailsAndActionsIntegrationFieldSlug = big.NewInt(1 << 5) + accountDetailsAndActionsIntegrationFieldPassthroughAvailable = big.NewInt(1 << 6) + accountDetailsAndActionsIntegrationFieldAvailableModelOperations = big.NewInt(1 << 7) +) + type AccountDetailsAndActionsIntegration struct { Name string `json:"name" url:"name"` Categories []CategoriesEnum `json:"categories" url:"categories"` @@ -322,6 +569,9 @@ type AccountDetailsAndActionsIntegration struct { PassthroughAvailable bool `json:"passthrough_available" url:"passthrough_available"` AvailableModelOperations []*ModelOperation `json:"available_model_operations,omitempty" url:"available_model_operations,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -386,6 +636,69 @@ func (a *AccountDetailsAndActionsIntegration) GetExtraProperties() map[string]in return a.extraProperties } +func (a *AccountDetailsAndActionsIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetName(name string) { + a.Name = name + a.require(accountDetailsAndActionsIntegrationFieldName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountDetailsAndActionsIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetImage(image *string) { + a.Image = image + a.require(accountDetailsAndActionsIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountDetailsAndActionsIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetColor(color string) { + a.Color = color + a.require(accountDetailsAndActionsIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetSlug(slug string) { + a.Slug = slug + a.require(accountDetailsAndActionsIntegrationFieldSlug) +} + +// SetPassthroughAvailable sets the PassthroughAvailable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetPassthroughAvailable(passthroughAvailable bool) { + a.PassthroughAvailable = passthroughAvailable + a.require(accountDetailsAndActionsIntegrationFieldPassthroughAvailable) +} + +// SetAvailableModelOperations sets the AvailableModelOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDetailsAndActionsIntegration) SetAvailableModelOperations(availableModelOperations []*ModelOperation) { + a.AvailableModelOperations = availableModelOperations + a.require(accountDetailsAndActionsIntegrationFieldAvailableModelOperations) +} + func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountDetailsAndActionsIntegration var value unmarshaler @@ -402,6 +715,17 @@ func (a *AccountDetailsAndActionsIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountDetailsAndActionsIntegration) MarshalJSON() ([]byte, error) { + type embed AccountDetailsAndActionsIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountDetailsAndActionsIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -508,11 +832,20 @@ func (a AccountDetailsAndActionsStatusEnum) Ptr() *AccountDetailsAndActionsStatu return &a } +var ( + paginatedAccountDetailsAndActionsListFieldNext = big.NewInt(1 << 0) + paginatedAccountDetailsAndActionsListFieldPrevious = big.NewInt(1 << 1) + paginatedAccountDetailsAndActionsListFieldResults = big.NewInt(1 << 2) +) + type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*AccountDetailsAndActions `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -542,6 +875,34 @@ func (p *PaginatedAccountDetailsAndActionsList) GetExtraProperties() map[string] return p.extraProperties } +func (p *PaginatedAccountDetailsAndActionsList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetNext(next *string) { + p.Next = next + p.require(paginatedAccountDetailsAndActionsListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedAccountDetailsAndActionsListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedAccountDetailsAndActionsList) SetResults(results []*AccountDetailsAndActions) { + p.Results = results + p.require(paginatedAccountDetailsAndActionsListFieldResults) +} + func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedAccountDetailsAndActionsList var value unmarshaler @@ -558,6 +919,17 @@ func (p *PaginatedAccountDetailsAndActionsList) UnmarshalJSON(data []byte) error return nil } +func (p *PaginatedAccountDetailsAndActionsList) MarshalJSON() ([]byte, error) { + type embed PaginatedAccountDetailsAndActionsList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedAccountDetailsAndActionsList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ticketing/linkedaccounts/client.go b/ticketing/linkedaccounts/client.go index 415cde9..cfa8804 100644 --- a/ticketing/linkedaccounts/client.go +++ b/ticketing/linkedaccounts/client.go @@ -4,7 +4,6 @@ package linkedaccounts import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.LinkedAccountsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.AccountDetailsAndActions], error) { +) (*core.Page[*string, *ticketing.AccountDetailsAndActions], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedAccountDetailsAndActionsList) *internal.PageResponse[*string, *ticketing.AccountDetailsAndActions] { + readPageResponse := func(response *ticketing.PaginatedAccountDetailsAndActionsList) *core.PageResponse[*string, *ticketing.AccountDetailsAndActions] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.AccountDetailsAndActions]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.AccountDetailsAndActions]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ticketing/linkedaccounts/raw_client.go b/ticketing/linkedaccounts/raw_client.go new file mode 100644 index 0000000..cb54205 --- /dev/null +++ b/ticketing/linkedaccounts/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package linkedaccounts + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/ticketing/linkedaccounts/ticketing_linked_accounts_test/ticketing_linked_accounts_test.go b/ticketing/linkedaccounts/ticketing_linked_accounts_test/ticketing_linked_accounts_test.go new file mode 100644 index 0000000..c0a4ebf --- /dev/null +++ b/ticketing/linkedaccounts/ticketing_linked_accounts_test/ticketing_linked_accounts_test.go @@ -0,0 +1,121 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_linked_accounts_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingLinkedAccountsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.LinkedAccountsListRequest{ + Category: ticketing.LinkedAccountsListRequestCategoryAccounting.Ptr(), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EndUserEmailAddress: merge.String( + "end_user_email_address", + ), + EndUserOrganizationName: merge.String( + "end_user_organization_name", + ), + EndUserOriginId: merge.String( + "end_user_origin_id", + ), + EndUserOriginIds: merge.String( + "end_user_origin_ids", + ), + Id: merge.String( + "id", + ), + Ids: merge.String( + "ids", + ), + IncludeDuplicates: merge.Bool( + true, + ), + IntegrationName: merge.String( + "integration_name", + ), + IsTestAccount: merge.String( + "is_test_account", + ), + PageSize: merge.Int( + 1, + ), + Status: merge.String( + "status", + ), + } + _, invocationErr := client.Ticketing.LinkedAccounts.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/linked-accounts", map[string]string{"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"}, 1) +} diff --git a/ticketing/linktoken/client.go b/ticketing/linktoken/client.go index 2dba090..7cd17e0 100644 --- a/ticketing/linktoken/client.go +++ b/ticketing/linktoken/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *ticketing.EndUserDetailsRequest, opts ...option.RequestOption, ) (*ticketing.LinkToken, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/link-token" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.LinkToken - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/linktoken/raw_client.go b/ticketing/linktoken/raw_client.go new file mode 100644 index 0000000..fe2ef93 --- /dev/null +++ b/ticketing/linktoken/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package linktoken + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.EndUserDetailsRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.LinkToken], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/link-token" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.LinkToken + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.LinkToken]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/linktoken/ticketing_link_token_test/ticketing_link_token_test.go b/ticketing/linktoken/ticketing_link_token_test/ticketing_link_token_test.go new file mode 100644 index 0000000..9626247 --- /dev/null +++ b/ticketing/linktoken/ticketing_link_token_test/ticketing_link_token_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_link_token_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingLinkTokenCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.EndUserDetailsRequest{ + EndUserEmailAddress: "example@gmail.com", + EndUserOrganizationName: "Test Organization", + EndUserOriginId: "12345", + Categories: []ticketing.CategoriesEnum{ + ticketing.CategoriesEnumHris, + ticketing.CategoriesEnumAts, + }, + } + _, invocationErr := client.Ticketing.LinkToken.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/link-token", nil, 1) +} diff --git a/ticketing/passthrough/client.go b/ticketing/passthrough/client.go index 09c1bd1..60344a8 100644 --- a/ticketing/passthrough/client.go +++ b/ticketing/passthrough/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *ticketing.DataPassthroughRequest, opts ...option.RequestOption, ) (*ticketing.RemoteResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/passthrough" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.RemoteResponse - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/passthrough/raw_client.go b/ticketing/passthrough/raw_client.go new file mode 100644 index 0000000..06dcdf2 --- /dev/null +++ b/ticketing/passthrough/raw_client.go @@ -0,0 +1,72 @@ +// Code generated by Fern. DO NOT EDIT. + +package passthrough + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.DataPassthroughRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.RemoteResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/passthrough" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.RemoteResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.RemoteResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/passthrough/ticketing_passthrough_test/ticketing_passthrough_test.go b/ticketing/passthrough/ticketing_passthrough_test/ticketing_passthrough_test.go new file mode 100644 index 0000000..1149db4 --- /dev/null +++ b/ticketing/passthrough/ticketing_passthrough_test/ticketing_passthrough_test.go @@ -0,0 +1,85 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_passthrough_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingPassthroughCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.DataPassthroughRequest{ + Method: ticketing.MethodEnumGet, + Path: "/scooters", + } + _, invocationErr := client.Ticketing.Passthrough.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/passthrough", nil, 1) +} diff --git a/ticketing/projects.go b/ticketing/projects.go index 510e477..864d9e1 100644 --- a/ticketing/projects.go +++ b/ticketing/projects.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + projectsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + projectsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + projectsListRequestFieldCursor = big.NewInt(1 << 2) + projectsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + projectsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + projectsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + projectsListRequestFieldModifiedAfter = big.NewInt(1 << 6) + projectsListRequestFieldModifiedBefore = big.NewInt(1 << 7) + projectsListRequestFieldPageSize = big.NewInt(1 << 8) + projectsListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type ProjectsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,13 +44,122 @@ type ProjectsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (p *ProjectsListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetCreatedAfter(createdAfter *time.Time) { + p.CreatedAfter = createdAfter + p.require(projectsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetCreatedBefore(createdBefore *time.Time) { + p.CreatedBefore = createdBefore + p.require(projectsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(projectsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(projectsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(projectsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(projectsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + p.ModifiedAfter = modifiedAfter + p.require(projectsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + p.ModifiedBefore = modifiedBefore + p.require(projectsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(projectsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsListRequest) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(projectsListRequestFieldRemoteId) +} + +var ( + projectsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + projectsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type ProjectsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *ProjectsRetrieveRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(projectsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(projectsRetrieveRequestFieldIncludeShellData) } type ProjectsUsersListRequestExpandItem string @@ -61,11 +184,20 @@ func (p ProjectsUsersListRequestExpandItem) Ptr() *ProjectsUsersListRequestExpan return &p } +var ( + paginatedProjectListFieldNext = big.NewInt(1 << 0) + paginatedProjectListFieldPrevious = big.NewInt(1 << 1) + paginatedProjectListFieldResults = big.NewInt(1 << 2) +) + type PaginatedProjectList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Project `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -95,6 +227,34 @@ func (p *PaginatedProjectList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedProjectList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedProjectList) SetNext(next *string) { + p.Next = next + p.require(paginatedProjectListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedProjectList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedProjectListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedProjectList) SetResults(results []*Project) { + p.Results = results + p.require(paginatedProjectListFieldResults) +} + func (p *PaginatedProjectList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedProjectList var value unmarshaler @@ -111,6 +271,17 @@ func (p *PaginatedProjectList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedProjectList) MarshalJSON() ([]byte, error) { + type embed PaginatedProjectList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedProjectList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -129,6 +300,18 @@ func (p *PaginatedProjectList) String() string { // // ### Usage Example // TODO +var ( + projectFieldId = big.NewInt(1 << 0) + projectFieldRemoteId = big.NewInt(1 << 1) + projectFieldCreatedAt = big.NewInt(1 << 2) + projectFieldModifiedAt = big.NewInt(1 << 3) + projectFieldName = big.NewInt(1 << 4) + projectFieldDescription = big.NewInt(1 << 5) + projectFieldRemoteWasDeleted = big.NewInt(1 << 6) + projectFieldFieldMappings = big.NewInt(1 << 7) + projectFieldRemoteData = big.NewInt(1 << 8) +) + type Project struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -146,6 +329,9 @@ type Project struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -217,6 +403,76 @@ func (p *Project) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *Project) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetId(id *string) { + p.Id = id + p.require(projectFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetRemoteId(remoteId *string) { + p.RemoteId = remoteId + p.require(projectFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetCreatedAt(createdAt *time.Time) { + p.CreatedAt = createdAt + p.require(projectFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetModifiedAt(modifiedAt *time.Time) { + p.ModifiedAt = modifiedAt + p.require(projectFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetName(name *string) { + p.Name = name + p.require(projectFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetDescription(description *string) { + p.Description = description + p.require(projectFieldDescription) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetRemoteWasDeleted(remoteWasDeleted *bool) { + p.RemoteWasDeleted = remoteWasDeleted + p.require(projectFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetFieldMappings(fieldMappings map[string]interface{}) { + p.FieldMappings = fieldMappings + p.require(projectFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *Project) SetRemoteData(remoteData []*RemoteData) { + p.RemoteData = remoteData + p.require(projectFieldRemoteData) +} + func (p *Project) UnmarshalJSON(data []byte) error { type embed Project var unmarshaler = struct { @@ -252,7 +508,8 @@ func (p *Project) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(p.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(p.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *Project) String() string { @@ -267,6 +524,15 @@ func (p *Project) String() string { return fmt.Sprintf("%#v", p) } +var ( + projectsUsersListRequestFieldCursor = big.NewInt(1 << 0) + projectsUsersListRequestFieldExpand = big.NewInt(1 << 1) + projectsUsersListRequestFieldIncludeDeletedData = big.NewInt(1 << 2) + projectsUsersListRequestFieldIncludeRemoteData = big.NewInt(1 << 3) + projectsUsersListRequestFieldIncludeShellData = big.NewInt(1 << 4) + projectsUsersListRequestFieldPageSize = big.NewInt(1 << 5) +) + type ProjectsUsersListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -280,4 +546,56 @@ type ProjectsUsersListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *ProjectsUsersListRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsUsersListRequest) SetCursor(cursor *string) { + p.Cursor = cursor + p.require(projectsUsersListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsUsersListRequest) SetExpand(expand []*ProjectsUsersListRequestExpandItem) { + p.Expand = expand + p.require(projectsUsersListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsUsersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + p.IncludeDeletedData = includeDeletedData + p.require(projectsUsersListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsUsersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + p.IncludeRemoteData = includeRemoteData + p.require(projectsUsersListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsUsersListRequest) SetIncludeShellData(includeShellData *bool) { + p.IncludeShellData = includeShellData + p.require(projectsUsersListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProjectsUsersListRequest) SetPageSize(pageSize *int) { + p.PageSize = pageSize + p.require(projectsUsersListRequestFieldPageSize) } diff --git a/ticketing/projects/client.go b/ticketing/projects/client.go index cce80e4..c3e9a99 100644 --- a/ticketing/projects/client.go +++ b/ticketing/projects/client.go @@ -4,7 +4,6 @@ package projects import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.ProjectsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Project], error) { +) (*core.Page[*string, *ticketing.Project], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedProjectList) *internal.PageResponse[*string, *ticketing.Project] { + readPageResponse := func(response *ticketing.PaginatedProjectList) *core.PageResponse[*string, *ticketing.Project] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Project]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Project]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,45 +98,16 @@ func (c *Client) Retrieve( request *ticketing.ProjectsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Project, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/projects/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Project - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `User` objects. @@ -145,7 +116,7 @@ func (c *Client) UsersList( parentId string, request *ticketing.ProjectsUsersListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.User], error) { +) (*core.Page[*string, *ticketing.User], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -161,13 +132,12 @@ func (c *Client) UsersList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -184,11 +154,11 @@ func (c *Client) UsersList( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedUserList) *internal.PageResponse[*string, *ticketing.User] { + readPageResponse := func(response *ticketing.PaginatedUserList) *core.PageResponse[*string, *ticketing.User] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.User]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.User]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ticketing/projects/raw_client.go b/ticketing/projects/raw_client.go new file mode 100644 index 0000000..7907523 --- /dev/null +++ b/ticketing/projects/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package projects + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.ProjectsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Project], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/projects/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Project + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Project]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/projects/ticketing_projects_test/ticketing_projects_test.go b/ticketing/projects/ticketing_projects_test/ticketing_projects_test.go new file mode 100644 index 0000000..2814b47 --- /dev/null +++ b/ticketing/projects/ticketing_projects_test/ticketing_projects_test.go @@ -0,0 +1,187 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_projects_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingProjectsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.ProjectsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ticketing.Projects.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/projects", map[string]string{"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"}, 1) +} + +func TestTicketingProjectsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.ProjectsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Projects.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/projects/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} + +func TestTicketingProjectsUsersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.ProjectsUsersListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Ticketing.Projects.UsersList( + context.TODO(), + "parent_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/projects/parent_id/users", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} diff --git a/ticketing/regenerate_key.go b/ticketing/regenerate_key.go index 5c05eb4..f79a605 100644 --- a/ticketing/regenerate_key.go +++ b/ticketing/regenerate_key.go @@ -2,7 +2,32 @@ package ticketing +import ( + big "math/big" +) + +var ( + remoteKeyForRegenerationRequestFieldName = big.NewInt(1 << 0) +) + type RemoteKeyForRegenerationRequest struct { // The name of the remote key Name string `json:"name" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoteKeyForRegenerationRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKeyForRegenerationRequest) SetName(name string) { + r.Name = name + r.require(remoteKeyForRegenerationRequestFieldName) } diff --git a/ticketing/regeneratekey/client.go b/ticketing/regeneratekey/client.go index 77151fd..b34e2e3 100644 --- a/ticketing/regeneratekey/client.go +++ b/ticketing/regeneratekey/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,35 +38,13 @@ func (c *Client) Create( request *ticketing.RemoteKeyForRegenerationRequest, opts ...option.RequestOption, ) (*ticketing.RemoteKey, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/regenerate-key" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.RemoteKey - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/regeneratekey/raw_client.go b/ticketing/regeneratekey/raw_client.go new file mode 100644 index 0000000..cc0dcb7 --- /dev/null +++ b/ticketing/regeneratekey/raw_client.go @@ -0,0 +1,73 @@ +// Code generated by Fern. DO NOT EDIT. + +package regeneratekey + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.RemoteKeyForRegenerationRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.RemoteKey], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/regenerate-key" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.RemoteKey + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.RemoteKey]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/regeneratekey/ticketing_regenerate_key_test/ticketing_regenerate_key_test.go b/ticketing/regeneratekey/ticketing_regenerate_key_test/ticketing_regenerate_key_test.go new file mode 100644 index 0000000..6f3e00f --- /dev/null +++ b/ticketing/regeneratekey/ticketing_regenerate_key_test/ticketing_regenerate_key_test.go @@ -0,0 +1,84 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_regenerate_key_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingRegenerateKeyCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.RemoteKeyForRegenerationRequest{ + Name: "Remote Deployment Key 1", + } + _, invocationErr := client.Ticketing.RegenerateKey.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/regenerate-key", nil, 1) +} diff --git a/ticketing/roles.go b/ticketing/roles.go index 56e4d5e..5b58199 100644 --- a/ticketing/roles.go +++ b/ticketing/roles.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + rolesListRequestFieldCreatedAfter = big.NewInt(1 << 0) + rolesListRequestFieldCreatedBefore = big.NewInt(1 << 1) + rolesListRequestFieldCursor = big.NewInt(1 << 2) + rolesListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + rolesListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + rolesListRequestFieldIncludeShellData = big.NewInt(1 << 5) + rolesListRequestFieldModifiedAfter = big.NewInt(1 << 6) + rolesListRequestFieldModifiedBefore = big.NewInt(1 << 7) + rolesListRequestFieldPageSize = big.NewInt(1 << 8) + rolesListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type RolesListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,20 +44,138 @@ type RolesListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RolesListRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetCreatedAfter(createdAfter *time.Time) { + r.CreatedAfter = createdAfter + r.require(rolesListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetCreatedBefore(createdBefore *time.Time) { + r.CreatedBefore = createdBefore + r.require(rolesListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetCursor(cursor *string) { + r.Cursor = cursor + r.require(rolesListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + r.IncludeDeletedData = includeDeletedData + r.require(rolesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + r.IncludeRemoteData = includeRemoteData + r.require(rolesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetIncludeShellData(includeShellData *bool) { + r.IncludeShellData = includeShellData + r.require(rolesListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + r.ModifiedAfter = modifiedAfter + r.require(rolesListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + r.ModifiedBefore = modifiedBefore + r.require(rolesListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetPageSize(pageSize *int) { + r.PageSize = pageSize + r.require(rolesListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesListRequest) SetRemoteId(remoteId *string) { + r.RemoteId = remoteId + r.require(rolesListRequestFieldRemoteId) } +var ( + rolesRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + rolesRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type RolesRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (r *RolesRetrieveRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + r.IncludeRemoteData = includeRemoteData + r.require(rolesRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RolesRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + r.IncludeShellData = includeShellData + r.require(rolesRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedRoleListFieldNext = big.NewInt(1 << 0) + paginatedRoleListFieldPrevious = big.NewInt(1 << 1) + paginatedRoleListFieldResults = big.NewInt(1 << 2) +) + type PaginatedRoleList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Role `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -73,6 +205,34 @@ func (p *PaginatedRoleList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedRoleList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRoleList) SetNext(next *string) { + p.Next = next + p.require(paginatedRoleListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRoleList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedRoleListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRoleList) SetResults(results []*Role) { + p.Results = results + p.require(paginatedRoleListFieldResults) +} + func (p *PaginatedRoleList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedRoleList var value unmarshaler @@ -89,6 +249,17 @@ func (p *PaginatedRoleList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedRoleList) MarshalJSON() ([]byte, error) { + type embed PaginatedRoleList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedRoleList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ticketing/roles/client.go b/ticketing/roles/client.go index da4bf4a..4bac101 100644 --- a/ticketing/roles/client.go +++ b/ticketing/roles/client.go @@ -4,7 +4,6 @@ package roles import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.RolesListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Role], error) { +) (*core.Page[*string, *ticketing.Role], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedRoleList) *internal.PageResponse[*string, *ticketing.Role] { + readPageResponse := func(response *ticketing.PaginatedRoleList) *core.PageResponse[*string, *ticketing.Role] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Role]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Role]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ticketing.RolesRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Role, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/roles/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Role - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ticketing/roles/raw_client.go b/ticketing/roles/raw_client.go new file mode 100644 index 0000000..ce9c7b4 --- /dev/null +++ b/ticketing/roles/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package roles + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.RolesRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Role], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/roles/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Role + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Role]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/roles/ticketing_roles_test/ticketing_roles_test.go b/ticketing/roles/ticketing_roles_test/ticketing_roles_test.go new file mode 100644 index 0000000..fc7e9f0 --- /dev/null +++ b/ticketing/roles/ticketing_roles_test/ticketing_roles_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_roles_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingRolesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.RolesListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ticketing.Roles.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/roles", map[string]string{"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"}, 1) +} + +func TestTicketingRolesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.RolesRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Roles.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/roles/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ticketing/scopes.go b/ticketing/scopes.go index 02a8526..e1f81ef 100644 --- a/ticketing/scopes.go +++ b/ticketing/scopes.go @@ -6,17 +6,46 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels = big.NewInt(1 << 0) ) type LinkedAccountCommonModelScopeDeserializerRequest struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LinkedAccountCommonModelScopeDeserializerRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountCommonModelScopeDeserializerRequest) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializerRequest) { + l.CommonModels = commonModels + l.require(linkedAccountCommonModelScopeDeserializerRequestFieldCommonModels) } +var ( + commonModelScopeApiFieldCommonModels = big.NewInt(1 << 0) +) + type CommonModelScopeApi struct { // The common models you want to update the scopes for CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models" url:"common_models"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -32,6 +61,20 @@ func (c *CommonModelScopeApi) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *CommonModelScopeApi) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetCommonModels sets the CommonModels field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CommonModelScopeApi) SetCommonModels(commonModels []*IndividualCommonModelScopeDeserializer) { + c.CommonModels = commonModels + c.require(commonModelScopeApiFieldCommonModels) +} + func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { type unmarshaler CommonModelScopeApi var value unmarshaler @@ -48,6 +91,17 @@ func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { return nil } +func (c *CommonModelScopeApi) MarshalJSON() ([]byte, error) { + type embed CommonModelScopeApi + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (c *CommonModelScopeApi) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { @@ -60,10 +114,18 @@ func (c *CommonModelScopeApi) String() string { return fmt.Sprintf("%#v", c) } +var ( + fieldPermissionDeserializerFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializer struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -86,6 +148,27 @@ func (f *FieldPermissionDeserializer) GetExtraProperties() map[string]interface{ return f.extraProperties } +func (f *FieldPermissionDeserializer) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializer) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerFieldDisabledFields) +} + func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializer var value unmarshaler @@ -102,6 +185,17 @@ func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializer) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -114,11 +208,20 @@ func (f *FieldPermissionDeserializer) String() string { return fmt.Sprintf("%#v", f) } +var ( + individualCommonModelScopeDeserializerFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializer struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -148,6 +251,34 @@ func (i *IndividualCommonModelScopeDeserializer) GetExtraProperties() map[string return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializer) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializer) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializer) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializer) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializer var value unmarshaler @@ -164,6 +295,17 @@ func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) erro return nil } +func (i *IndividualCommonModelScopeDeserializer) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializer) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -176,9 +318,16 @@ func (i *IndividualCommonModelScopeDeserializer) String() string { return fmt.Sprintf("%#v", i) } +var ( + modelPermissionDeserializerFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializer struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -194,6 +343,20 @@ func (m *ModelPermissionDeserializer) GetExtraProperties() map[string]interface{ return m.extraProperties } +func (m *ModelPermissionDeserializer) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializer) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerFieldIsEnabled) +} + func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializer var value unmarshaler @@ -210,6 +373,17 @@ func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializer) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializer + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializer) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { diff --git a/ticketing/scopes/client.go b/ticketing/scopes/client.go index 5f5030c..5a9de55 100644 --- a/ticketing/scopes/client.go +++ b/ticketing/scopes/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) DefaultScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ticketing.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/default-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.DefaultScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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). @@ -72,35 +52,14 @@ func (c *Client) LinkedAccountScopesRetrieve( ctx context.Context, opts ...option.RequestOption, ) (*ticketing.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesRetrieve( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // 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) @@ -109,35 +68,13 @@ func (c *Client) LinkedAccountScopesCreate( request *ticketing.LinkedAccountCommonModelScopeDeserializerRequest, opts ...option.RequestOption, ) (*ticketing.CommonModelScopeApi, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/linked-account-scopes" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.CommonModelScopeApi - if err := c.caller.Call( + response, err := c.WithRawResponse.LinkedAccountScopesCreate( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/scopes/raw_client.go b/ticketing/scopes/raw_client.go new file mode 100644 index 0000000..d32ec62 --- /dev/null +++ b/ticketing/scopes/raw_client.go @@ -0,0 +1,151 @@ +// Code generated by Fern. DO NOT EDIT. + +package scopes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) DefaultScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ticketing.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/default-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesRetrieve( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*ticketing.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) LinkedAccountScopesCreate( + ctx context.Context, + request *ticketing.LinkedAccountCommonModelScopeDeserializerRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.CommonModelScopeApi], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/linked-account-scopes" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.CommonModelScopeApi + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.CommonModelScopeApi]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/scopes/ticketing_scopes_test/ticketing_scopes_test.go b/ticketing/scopes/ticketing_scopes_test/ticketing_scopes_test.go new file mode 100644 index 0000000..99a5c50 --- /dev/null +++ b/ticketing/scopes/ticketing_scopes_test/ticketing_scopes_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_scopes_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingScopesDefaultScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.Scopes.DefaultScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/default-scopes", nil, 1) +} + +func TestTicketingScopesLinkedAccountScopesRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.Scopes.LinkedAccountScopesRetrieve( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/linked-account-scopes", nil, 1) +} + +func TestTicketingScopesLinkedAccountScopesCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.LinkedAccountCommonModelScopeDeserializerRequest{ + CommonModels: []*ticketing.IndividualCommonModelScopeDeserializerRequest{ + &ticketing.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Employee", + ModelPermissions: map[string]*ticketing.ModelPermissionDeserializerRequest{ + "READ": &ticketing.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + true, + ), + }, + "WRITE": &ticketing.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + FieldPermissions: &ticketing.FieldPermissionDeserializerRequest{ + EnabledFields: []any{ + "avatar", + "home_location", + }, + DisabledFields: []any{ + "work_location", + }, + }, + }, + &ticketing.IndividualCommonModelScopeDeserializerRequest{ + ModelName: "Benefit", + ModelPermissions: map[string]*ticketing.ModelPermissionDeserializerRequest{ + "WRITE": &ticketing.ModelPermissionDeserializerRequest{ + IsEnabled: merge.Bool( + false, + ), + }, + }, + }, + }, + } + _, invocationErr := client.Ticketing.Scopes.LinkedAccountScopesCreate( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/linked-account-scopes", nil, 1) +} diff --git a/ticketing/sync_status.go b/ticketing/sync_status.go index 39aeb7a..29a4f14 100644 --- a/ticketing/sync_status.go +++ b/ticketing/sync_status.go @@ -6,6 +6,12 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + syncStatusListRequestFieldCursor = big.NewInt(1 << 0) + syncStatusListRequestFieldPageSize = big.NewInt(1 << 1) ) type SyncStatusListRequest struct { @@ -13,13 +19,46 @@ type SyncStatusListRequest struct { Cursor *string `json:"-" url:"cursor,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (s *SyncStatusListRequest) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetCursor(cursor *string) { + s.Cursor = cursor + s.require(syncStatusListRequestFieldCursor) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatusListRequest) SetPageSize(pageSize *int) { + s.PageSize = pageSize + s.require(syncStatusListRequestFieldPageSize) +} + +var ( + paginatedSyncStatusListFieldNext = big.NewInt(1 << 0) + paginatedSyncStatusListFieldPrevious = big.NewInt(1 << 1) + paginatedSyncStatusListFieldResults = big.NewInt(1 << 2) +) + type PaginatedSyncStatusList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*SyncStatus `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -49,6 +88,34 @@ func (p *PaginatedSyncStatusList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedSyncStatusList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetNext(next *string) { + p.Next = next + p.require(paginatedSyncStatusListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedSyncStatusListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedSyncStatusList) SetResults(results []*SyncStatus) { + p.Results = results + p.require(paginatedSyncStatusListFieldResults) +} + func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedSyncStatusList var value unmarshaler @@ -65,6 +132,17 @@ func (p *PaginatedSyncStatusList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedSyncStatusList) MarshalJSON() ([]byte, error) { + type embed PaginatedSyncStatusList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedSyncStatusList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ticketing/syncstatus/client.go b/ticketing/syncstatus/client.go index ff38765..96eb759 100644 --- a/ticketing/syncstatus/client.go +++ b/ticketing/syncstatus/client.go @@ -4,7 +4,6 @@ package syncstatus import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.SyncStatusListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.SyncStatus], error) { +) (*core.Page[*string, *ticketing.SyncStatus], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedSyncStatusList) *internal.PageResponse[*string, *ticketing.SyncStatus] { + readPageResponse := func(response *ticketing.PaginatedSyncStatusList) *core.PageResponse[*string, *ticketing.SyncStatus] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.SyncStatus]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.SyncStatus]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ticketing/syncstatus/raw_client.go b/ticketing/syncstatus/raw_client.go new file mode 100644 index 0000000..bf7298f --- /dev/null +++ b/ticketing/syncstatus/raw_client.go @@ -0,0 +1,27 @@ +// Code generated by Fern. DO NOT EDIT. + +package syncstatus + +import ( + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} diff --git a/ticketing/syncstatus/ticketing_sync_status_test/ticketing_sync_status_test.go b/ticketing/syncstatus/ticketing_sync_status_test/ticketing_sync_status_test.go new file mode 100644 index 0000000..95ab172 --- /dev/null +++ b/ticketing/syncstatus/ticketing_sync_status_test/ticketing_sync_status_test.go @@ -0,0 +1,90 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_sync_status_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingSyncStatusListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.SyncStatusListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Ticketing.SyncStatus.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/sync-status", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "page_size": "1"}, 1) +} diff --git a/ticketing/tags.go b/ticketing/tags.go index ee152d1..2e04731 100644 --- a/ticketing/tags.go +++ b/ticketing/tags.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + tagsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + tagsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + tagsListRequestFieldCursor = big.NewInt(1 << 2) + tagsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + tagsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + tagsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + tagsListRequestFieldModifiedAfter = big.NewInt(1 << 6) + tagsListRequestFieldModifiedBefore = big.NewInt(1 << 7) + tagsListRequestFieldPageSize = big.NewInt(1 << 8) + tagsListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type TagsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,20 +44,138 @@ type TagsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TagsListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(tagsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(tagsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(tagsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(tagsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(tagsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(tagsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(tagsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(tagsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(tagsListRequestFieldPageSize) } +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(tagsListRequestFieldRemoteId) +} + +var ( + tagsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + tagsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type TagsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (t *TagsRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(tagsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TagsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(tagsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedTagListFieldNext = big.NewInt(1 << 0) + paginatedTagListFieldPrevious = big.NewInt(1 << 1) + paginatedTagListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTagList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Tag `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -73,6 +205,34 @@ func (p *PaginatedTagList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedTagList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTagList) SetNext(next *string) { + p.Next = next + p.require(paginatedTagListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTagList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTagListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTagList) SetResults(results []*Tag) { + p.Results = results + p.require(paginatedTagListFieldResults) +} + func (p *PaginatedTagList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTagList var value unmarshaler @@ -89,6 +249,17 @@ func (p *PaginatedTagList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTagList) MarshalJSON() ([]byte, error) { + type embed PaginatedTagList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTagList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -107,6 +278,17 @@ func (p *PaginatedTagList) String() string { // // ### Usage Example // TODO +var ( + tagFieldRemoteId = big.NewInt(1 << 0) + tagFieldCreatedAt = big.NewInt(1 << 1) + tagFieldModifiedAt = big.NewInt(1 << 2) + tagFieldId = big.NewInt(1 << 3) + tagFieldName = big.NewInt(1 << 4) + tagFieldRemoteWasDeleted = big.NewInt(1 << 5) + tagFieldFieldMappings = big.NewInt(1 << 6) + tagFieldRemoteData = big.NewInt(1 << 7) +) + type Tag struct { // The third-party API ID of the matching object. RemoteId *string `json:"remote_id,omitempty" url:"remote_id,omitempty"` @@ -122,6 +304,9 @@ type Tag struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -186,6 +371,69 @@ func (t *Tag) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *Tag) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(tagFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(tagFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(tagFieldModifiedAt) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetId(id *string) { + t.Id = id + t.require(tagFieldId) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetName(name *string) { + t.Name = name + t.require(tagFieldName) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(tagFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(tagFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Tag) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(tagFieldRemoteData) +} + func (t *Tag) UnmarshalJSON(data []byte) error { type embed Tag var unmarshaler = struct { @@ -221,7 +469,8 @@ func (t *Tag) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *Tag) String() string { diff --git a/ticketing/tags/client.go b/ticketing/tags/client.go index b8433f6..4d579ee 100644 --- a/ticketing/tags/client.go +++ b/ticketing/tags/client.go @@ -4,7 +4,6 @@ package tags import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.TagsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Tag], error) { +) (*core.Page[*string, *ticketing.Tag], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedTagList) *internal.PageResponse[*string, *ticketing.Tag] { + readPageResponse := func(response *ticketing.PaginatedTagList) *core.PageResponse[*string, *ticketing.Tag] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Tag]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Tag]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ticketing.TagsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Tag, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/tags/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Tag - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ticketing/tags/raw_client.go b/ticketing/tags/raw_client.go new file mode 100644 index 0000000..86afd03 --- /dev/null +++ b/ticketing/tags/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package tags + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.TagsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Tag], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/tags/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Tag + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Tag]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/tags/ticketing_tags_test/ticketing_tags_test.go b/ticketing/tags/ticketing_tags_test/ticketing_tags_test.go new file mode 100644 index 0000000..d9343a6 --- /dev/null +++ b/ticketing/tags/ticketing_tags_test/ticketing_tags_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_tags_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingTagsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TagsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ticketing.Tags.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/tags", map[string]string{"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"}, 1) +} + +func TestTicketingTagsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TagsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Tags.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/tags/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ticketing/teams.go b/ticketing/teams.go index 2745ca6..3197c0d 100644 --- a/ticketing/teams.go +++ b/ticketing/teams.go @@ -6,9 +6,23 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + teamsListRequestFieldCreatedAfter = big.NewInt(1 << 0) + teamsListRequestFieldCreatedBefore = big.NewInt(1 << 1) + teamsListRequestFieldCursor = big.NewInt(1 << 2) + teamsListRequestFieldIncludeDeletedData = big.NewInt(1 << 3) + teamsListRequestFieldIncludeRemoteData = big.NewInt(1 << 4) + teamsListRequestFieldIncludeShellData = big.NewInt(1 << 5) + teamsListRequestFieldModifiedAfter = big.NewInt(1 << 6) + teamsListRequestFieldModifiedBefore = big.NewInt(1 << 7) + teamsListRequestFieldPageSize = big.NewInt(1 << 8) + teamsListRequestFieldRemoteId = big.NewInt(1 << 9) +) + type TeamsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -30,20 +44,138 @@ type TeamsListRequest struct { PageSize *int `json:"-" url:"page_size,omitempty"` // The API provider's ID for the given object. RemoteId *string `json:"-" url:"remote_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TeamsListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(teamsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(teamsListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(teamsListRequestFieldCursor) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(teamsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(teamsListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(teamsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(teamsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(teamsListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(teamsListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(teamsListRequestFieldRemoteId) } +var ( + teamsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 0) + teamsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 1) +) + type TeamsRetrieveRequest struct { // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (t *TeamsRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(teamsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TeamsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(teamsRetrieveRequestFieldIncludeShellData) +} + +var ( + paginatedTeamListFieldNext = big.NewInt(1 << 0) + paginatedTeamListFieldPrevious = big.NewInt(1 << 1) + paginatedTeamListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTeamList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Team `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -73,6 +205,34 @@ func (p *PaginatedTeamList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedTeamList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTeamList) SetNext(next *string) { + p.Next = next + p.require(paginatedTeamListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTeamList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTeamListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTeamList) SetResults(results []*Team) { + p.Results = results + p.require(paginatedTeamListFieldResults) +} + func (p *PaginatedTeamList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTeamList var value unmarshaler @@ -89,6 +249,17 @@ func (p *PaginatedTeamList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTeamList) MarshalJSON() ([]byte, error) { + type embed PaginatedTeamList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTeamList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { diff --git a/ticketing/teams/client.go b/ticketing/teams/client.go index 063fc35..b2c96fe 100644 --- a/ticketing/teams/client.go +++ b/ticketing/teams/client.go @@ -4,7 +4,6 @@ package teams import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.TeamsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Team], error) { +) (*core.Page[*string, *ticketing.Team], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedTeamList) *internal.PageResponse[*string, *ticketing.Team] { + readPageResponse := func(response *ticketing.PaginatedTeamList) *core.PageResponse[*string, *ticketing.Team] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Team]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Team]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ticketing.TeamsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Team, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/teams/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Team - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ticketing/teams/raw_client.go b/ticketing/teams/raw_client.go new file mode 100644 index 0000000..b4e444b --- /dev/null +++ b/ticketing/teams/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package teams + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.TeamsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Team], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/teams/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Team + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Team]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/teams/ticketing_teams_test/ticketing_teams_test.go b/ticketing/teams/ticketing_teams_test/ticketing_teams_test.go new file mode 100644 index 0000000..d414c97 --- /dev/null +++ b/ticketing/teams/ticketing_teams_test/ticketing_teams_test.go @@ -0,0 +1,150 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_teams_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingTeamsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TeamsListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + } + _, invocationErr := client.Ticketing.Teams.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/teams", map[string]string{"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"}, 1) +} + +func TestTicketingTeamsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TeamsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Teams.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/teams/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ticketing/tickets.go b/ticketing/tickets.go index da27dae..28c4dde 100644 --- a/ticketing/tickets.go +++ b/ticketing/tickets.go @@ -6,16 +6,92 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) +var ( + ticketEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + ticketEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + ticketEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type TicketEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *TicketRequest `json:"model,omitempty" url:"-"` -} + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TicketEndpointRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + t.IsDebugMode = isDebugMode + t.require(ticketEndpointRequestFieldIsDebugMode) +} + +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketEndpointRequest) SetRunAsync(runAsync *bool) { + t.RunAsync = runAsync + t.require(ticketEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketEndpointRequest) SetModel(model *TicketRequest) { + t.Model = model + t.require(ticketEndpointRequestFieldModel) +} + +var ( + ticketsListRequestFieldAccountId = big.NewInt(1 << 0) + ticketsListRequestFieldAssigneeIds = big.NewInt(1 << 1) + ticketsListRequestFieldCollectionIds = big.NewInt(1 << 2) + ticketsListRequestFieldCompletedAfter = big.NewInt(1 << 3) + ticketsListRequestFieldCompletedBefore = big.NewInt(1 << 4) + ticketsListRequestFieldContactId = big.NewInt(1 << 5) + ticketsListRequestFieldCreatedAfter = big.NewInt(1 << 6) + ticketsListRequestFieldCreatedBefore = big.NewInt(1 << 7) + ticketsListRequestFieldCreatorId = big.NewInt(1 << 8) + ticketsListRequestFieldCreatorIds = big.NewInt(1 << 9) + ticketsListRequestFieldCursor = big.NewInt(1 << 10) + ticketsListRequestFieldDueAfter = big.NewInt(1 << 11) + ticketsListRequestFieldDueBefore = big.NewInt(1 << 12) + ticketsListRequestFieldExpand = big.NewInt(1 << 13) + ticketsListRequestFieldIncludeDeletedData = big.NewInt(1 << 14) + ticketsListRequestFieldIncludeRemoteData = big.NewInt(1 << 15) + ticketsListRequestFieldIncludeRemoteFields = big.NewInt(1 << 16) + ticketsListRequestFieldIncludeShellData = big.NewInt(1 << 17) + ticketsListRequestFieldModifiedAfter = big.NewInt(1 << 18) + ticketsListRequestFieldModifiedBefore = big.NewInt(1 << 19) + ticketsListRequestFieldName = big.NewInt(1 << 20) + ticketsListRequestFieldPageSize = big.NewInt(1 << 21) + ticketsListRequestFieldParentTicketId = big.NewInt(1 << 22) + ticketsListRequestFieldPriority = big.NewInt(1 << 23) + ticketsListRequestFieldRemoteCreatedAfter = big.NewInt(1 << 24) + ticketsListRequestFieldRemoteCreatedBefore = big.NewInt(1 << 25) + ticketsListRequestFieldRemoteFields = big.NewInt(1 << 26) + ticketsListRequestFieldRemoteId = big.NewInt(1 << 27) + ticketsListRequestFieldRemoteUpdatedAfter = big.NewInt(1 << 28) + ticketsListRequestFieldRemoteUpdatedBefore = big.NewInt(1 << 29) + ticketsListRequestFieldShowEnumOrigins = big.NewInt(1 << 30) + ticketsListRequestFieldStatus = big.NewInt(1 << 31) + ticketsListRequestFieldTags = big.NewInt(1 << 32) + ticketsListRequestFieldTicketType = big.NewInt(1 << 33) + ticketsListRequestFieldTicketUrl = big.NewInt(1 << 34) +) type TicketsListRequest struct { // If provided, will only return tickets for this account. @@ -36,6 +112,8 @@ type TicketsListRequest struct { CreatedBefore *time.Time `json:"-" url:"created_before,omitempty"` // If provided, will only return tickets created by this creator_id. CreatorId *string `json:"-" url:"creator_id,omitempty"` + // If provided, will only return tickets created by the creator_ids; multiple creator_ids can be separated by commas. + CreatorIds *string `json:"-" url:"creator_ids,omitempty"` // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` // If provided, will only return tickets due after this datetime. @@ -56,6 +134,8 @@ type TicketsListRequest struct { ModifiedAfter *time.Time `json:"-" url:"modified_after,omitempty"` // If provided, only objects synced by Merge before this date time will be returned. ModifiedBefore *time.Time `json:"-" url:"modified_before,omitempty"` + // If provided, will only return tickets with this name. + Name *string `json:"-" url:"name,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` // If provided, will only return sub tickets of the parent_ticket_id. @@ -82,30 +162,362 @@ type TicketsListRequest struct { // A comma separated list 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) ShowEnumOrigins *TicketsListRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` // If provided, will only return tickets of this status. - Status *string `json:"-" url:"status,omitempty"` + Status *TicketsListRequestStatus `json:"-" url:"status,omitempty"` // If provided, will only return tickets matching the tags; multiple tags can be separated by commas. Tags *string `json:"-" url:"tags,omitempty"` // If provided, will only return tickets of this type. TicketType *string `json:"-" url:"ticket_type,omitempty"` // If provided, will only return tickets where the URL matches or contains the substring TicketUrl *string `json:"-" url:"ticket_url,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TicketsListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetAccountId sets the AccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetAccountId(accountId *string) { + t.AccountId = accountId + t.require(ticketsListRequestFieldAccountId) +} + +// SetAssigneeIds sets the AssigneeIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetAssigneeIds(assigneeIds *string) { + t.AssigneeIds = assigneeIds + t.require(ticketsListRequestFieldAssigneeIds) +} + +// SetCollectionIds sets the CollectionIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetCollectionIds(collectionIds *string) { + t.CollectionIds = collectionIds + t.require(ticketsListRequestFieldCollectionIds) +} + +// SetCompletedAfter sets the CompletedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetCompletedAfter(completedAfter *time.Time) { + t.CompletedAfter = completedAfter + t.require(ticketsListRequestFieldCompletedAfter) +} + +// SetCompletedBefore sets the CompletedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetCompletedBefore(completedBefore *time.Time) { + t.CompletedBefore = completedBefore + t.require(ticketsListRequestFieldCompletedBefore) +} + +// SetContactId sets the ContactId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetContactId(contactId *string) { + t.ContactId = contactId + t.require(ticketsListRequestFieldContactId) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetCreatedAfter(createdAfter *time.Time) { + t.CreatedAfter = createdAfter + t.require(ticketsListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetCreatedBefore(createdBefore *time.Time) { + t.CreatedBefore = createdBefore + t.require(ticketsListRequestFieldCreatedBefore) +} + +// SetCreatorId sets the CreatorId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetCreatorId(creatorId *string) { + t.CreatorId = creatorId + t.require(ticketsListRequestFieldCreatorId) +} + +// SetCreatorIds sets the CreatorIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetCreatorIds(creatorIds *string) { + t.CreatorIds = creatorIds + t.require(ticketsListRequestFieldCreatorIds) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(ticketsListRequestFieldCursor) +} + +// SetDueAfter sets the DueAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetDueAfter(dueAfter *time.Time) { + t.DueAfter = dueAfter + t.require(ticketsListRequestFieldDueAfter) +} + +// SetDueBefore sets the DueBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetDueBefore(dueBefore *time.Time) { + t.DueBefore = dueBefore + t.require(ticketsListRequestFieldDueBefore) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetExpand(expand []*TicketsListRequestExpandItem) { + t.Expand = expand + t.require(ticketsListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(ticketsListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(ticketsListRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + t.IncludeRemoteFields = includeRemoteFields + t.require(ticketsListRequestFieldIncludeRemoteFields) } +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(ticketsListRequestFieldIncludeShellData) +} + +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + t.ModifiedAfter = modifiedAfter + t.require(ticketsListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + t.ModifiedBefore = modifiedBefore + t.require(ticketsListRequestFieldModifiedBefore) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetName(name *string) { + t.Name = name + t.require(ticketsListRequestFieldName) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(ticketsListRequestFieldPageSize) +} + +// SetParentTicketId sets the ParentTicketId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetParentTicketId(parentTicketId *string) { + t.ParentTicketId = parentTicketId + t.require(ticketsListRequestFieldParentTicketId) +} + +// SetPriority sets the Priority field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetPriority(priority *TicketsListRequestPriority) { + t.Priority = priority + t.require(ticketsListRequestFieldPriority) +} + +// SetRemoteCreatedAfter sets the RemoteCreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetRemoteCreatedAfter(remoteCreatedAfter *time.Time) { + t.RemoteCreatedAfter = remoteCreatedAfter + t.require(ticketsListRequestFieldRemoteCreatedAfter) +} + +// SetRemoteCreatedBefore sets the RemoteCreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetRemoteCreatedBefore(remoteCreatedBefore *time.Time) { + t.RemoteCreatedBefore = remoteCreatedBefore + t.require(ticketsListRequestFieldRemoteCreatedBefore) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetRemoteFields(remoteFields *TicketsListRequestRemoteFields) { + t.RemoteFields = remoteFields + t.require(ticketsListRequestFieldRemoteFields) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(ticketsListRequestFieldRemoteId) +} + +// SetRemoteUpdatedAfter sets the RemoteUpdatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetRemoteUpdatedAfter(remoteUpdatedAfter *time.Time) { + t.RemoteUpdatedAfter = remoteUpdatedAfter + t.require(ticketsListRequestFieldRemoteUpdatedAfter) +} + +// SetRemoteUpdatedBefore sets the RemoteUpdatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetRemoteUpdatedBefore(remoteUpdatedBefore *time.Time) { + t.RemoteUpdatedBefore = remoteUpdatedBefore + t.require(ticketsListRequestFieldRemoteUpdatedBefore) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetShowEnumOrigins(showEnumOrigins *TicketsListRequestShowEnumOrigins) { + t.ShowEnumOrigins = showEnumOrigins + t.require(ticketsListRequestFieldShowEnumOrigins) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetStatus(status *TicketsListRequestStatus) { + t.Status = status + t.require(ticketsListRequestFieldStatus) +} + +// SetTags sets the Tags field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetTags(tags *string) { + t.Tags = tags + t.require(ticketsListRequestFieldTags) +} + +// SetTicketType sets the TicketType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetTicketType(ticketType *string) { + t.TicketType = ticketType + t.require(ticketsListRequestFieldTicketType) +} + +// SetTicketUrl sets the TicketUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsListRequest) SetTicketUrl(ticketUrl *string) { + t.TicketUrl = ticketUrl + t.require(ticketsListRequestFieldTicketUrl) +} + +var ( + ticketsMetaPostRetrieveRequestFieldCollectionId = big.NewInt(1 << 0) + ticketsMetaPostRetrieveRequestFieldTicketType = big.NewInt(1 << 1) +) + type TicketsMetaPostRetrieveRequest struct { // If provided, will only return tickets for this collection. CollectionId *string `json:"-" url:"collection_id,omitempty"` // If provided, will only return tickets for this ticket type. TicketType *string `json:"-" url:"ticket_type,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TicketsMetaPostRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCollectionId sets the CollectionId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsMetaPostRetrieveRequest) SetCollectionId(collectionId *string) { + t.CollectionId = collectionId + t.require(ticketsMetaPostRetrieveRequestFieldCollectionId) +} + +// SetTicketType sets the TicketType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsMetaPostRetrieveRequest) SetTicketType(ticketType *string) { + t.TicketType = ticketType + t.require(ticketsMetaPostRetrieveRequestFieldTicketType) } +var ( + patchedTicketEndpointRequestFieldIsDebugMode = big.NewInt(1 << 0) + patchedTicketEndpointRequestFieldRunAsync = big.NewInt(1 << 1) + patchedTicketEndpointRequestFieldModel = big.NewInt(1 << 2) +) + type PatchedTicketEndpointRequest struct { // Whether to include debug fields (such as log file links) in the response. IsDebugMode *bool `json:"-" url:"is_debug_mode,omitempty"` // Whether or not third-party updates should be run asynchronously. RunAsync *bool `json:"-" url:"run_async,omitempty"` Model *PatchedTicketRequest `json:"model,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PatchedTicketEndpointRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetIsDebugMode sets the IsDebugMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketEndpointRequest) SetIsDebugMode(isDebugMode *bool) { + p.IsDebugMode = isDebugMode + p.require(patchedTicketEndpointRequestFieldIsDebugMode) } +// SetRunAsync sets the RunAsync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketEndpointRequest) SetRunAsync(runAsync *bool) { + p.RunAsync = runAsync + p.require(patchedTicketEndpointRequestFieldRunAsync) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketEndpointRequest) SetModel(model *PatchedTicketRequest) { + p.Model = model + p.require(patchedTicketEndpointRequestFieldModel) +} + +var ( + ticketsRemoteFieldClassesListRequestFieldCursor = big.NewInt(1 << 0) + ticketsRemoteFieldClassesListRequestFieldIds = big.NewInt(1 << 1) + ticketsRemoteFieldClassesListRequestFieldIncludeDeletedData = big.NewInt(1 << 2) + ticketsRemoteFieldClassesListRequestFieldIncludeRemoteData = big.NewInt(1 << 3) + ticketsRemoteFieldClassesListRequestFieldIncludeShellData = big.NewInt(1 << 4) + ticketsRemoteFieldClassesListRequestFieldIsCommonModelField = big.NewInt(1 << 5) + ticketsRemoteFieldClassesListRequestFieldIsCustom = big.NewInt(1 << 6) + ticketsRemoteFieldClassesListRequestFieldPageSize = big.NewInt(1 << 7) +) + type TicketsRemoteFieldClassesListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -123,8 +535,83 @@ type TicketsRemoteFieldClassesListRequest struct { IsCustom *bool `json:"-" url:"is_custom,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` } +func (t *TicketsRemoteFieldClassesListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRemoteFieldClassesListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(ticketsRemoteFieldClassesListRequestFieldCursor) +} + +// SetIds sets the Ids field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRemoteFieldClassesListRequest) SetIds(ids *string) { + t.Ids = ids + t.require(ticketsRemoteFieldClassesListRequestFieldIds) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRemoteFieldClassesListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(ticketsRemoteFieldClassesListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRemoteFieldClassesListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(ticketsRemoteFieldClassesListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRemoteFieldClassesListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(ticketsRemoteFieldClassesListRequestFieldIncludeShellData) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRemoteFieldClassesListRequest) SetIsCommonModelField(isCommonModelField *bool) { + t.IsCommonModelField = isCommonModelField + t.require(ticketsRemoteFieldClassesListRequestFieldIsCommonModelField) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRemoteFieldClassesListRequest) SetIsCustom(isCustom *bool) { + t.IsCustom = isCustom + t.require(ticketsRemoteFieldClassesListRequestFieldIsCustom) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRemoteFieldClassesListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(ticketsRemoteFieldClassesListRequestFieldPageSize) +} + +var ( + ticketsRetrieveRequestFieldExpand = big.NewInt(1 << 0) + ticketsRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + ticketsRetrieveRequestFieldIncludeRemoteFields = big.NewInt(1 << 2) + ticketsRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 3) + ticketsRetrieveRequestFieldRemoteFields = big.NewInt(1 << 4) + ticketsRetrieveRequestFieldShowEnumOrigins = big.NewInt(1 << 5) +) + type TicketsRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*TicketsRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -138,6 +625,58 @@ type TicketsRetrieveRequest struct { RemoteFields *TicketsRetrieveRequestRemoteFields `json:"-" url:"remote_fields,omitempty"` // A comma separated list 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) ShowEnumOrigins *TicketsRetrieveRequestShowEnumOrigins `json:"-" url:"show_enum_origins,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TicketsRetrieveRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRetrieveRequest) SetExpand(expand []*TicketsRetrieveRequestExpandItem) { + t.Expand = expand + t.require(ticketsRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(ticketsRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeRemoteFields sets the IncludeRemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRetrieveRequest) SetIncludeRemoteFields(includeRemoteFields *bool) { + t.IncludeRemoteFields = includeRemoteFields + t.require(ticketsRetrieveRequestFieldIncludeRemoteFields) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(ticketsRetrieveRequestFieldIncludeShellData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRetrieveRequest) SetRemoteFields(remoteFields *TicketsRetrieveRequestRemoteFields) { + t.RemoteFields = remoteFields + t.require(ticketsRetrieveRequestFieldRemoteFields) +} + +// SetShowEnumOrigins sets the ShowEnumOrigins field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsRetrieveRequest) SetShowEnumOrigins(showEnumOrigins *TicketsRetrieveRequestShowEnumOrigins) { + t.ShowEnumOrigins = showEnumOrigins + t.require(ticketsRetrieveRequestFieldShowEnumOrigins) } type TicketsListRequestExpandItem string @@ -282,6 +821,37 @@ func (t TicketsListRequestShowEnumOrigins) Ptr() *TicketsListRequestShowEnumOrig return &t } +type TicketsListRequestStatus string + +const ( + TicketsListRequestStatusEmpty TicketsListRequestStatus = "" + TicketsListRequestStatusClosed TicketsListRequestStatus = "CLOSED" + TicketsListRequestStatusInProgress TicketsListRequestStatus = "IN_PROGRESS" + TicketsListRequestStatusOnHold TicketsListRequestStatus = "ON_HOLD" + TicketsListRequestStatusOpen TicketsListRequestStatus = "OPEN" +) + +func NewTicketsListRequestStatusFromString(s string) (TicketsListRequestStatus, error) { + switch s { + case "": + return TicketsListRequestStatusEmpty, nil + case "CLOSED": + return TicketsListRequestStatusClosed, nil + case "IN_PROGRESS": + return TicketsListRequestStatusInProgress, nil + case "ON_HOLD": + return TicketsListRequestStatusOnHold, nil + case "OPEN": + return TicketsListRequestStatusOpen, nil + } + var t TicketsListRequestStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (t TicketsListRequestStatus) Ptr() *TicketsListRequestStatus { + return &t +} + type TicketsRetrieveRequestExpandItem string const ( @@ -418,11 +988,20 @@ func (t TicketsViewersListRequestExpandItem) Ptr() *TicketsViewersListRequestExp return &t } +var ( + paginatedRemoteFieldClassListFieldNext = big.NewInt(1 << 0) + paginatedRemoteFieldClassListFieldPrevious = big.NewInt(1 << 1) + paginatedRemoteFieldClassListFieldResults = big.NewInt(1 << 2) +) + type PaginatedRemoteFieldClassList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*RemoteFieldClass `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -452,6 +1031,34 @@ func (p *PaginatedRemoteFieldClassList) GetExtraProperties() map[string]interfac return p.extraProperties } +func (p *PaginatedRemoteFieldClassList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteFieldClassList) SetNext(next *string) { + p.Next = next + p.require(paginatedRemoteFieldClassListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteFieldClassList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedRemoteFieldClassListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedRemoteFieldClassList) SetResults(results []*RemoteFieldClass) { + p.Results = results + p.require(paginatedRemoteFieldClassListFieldResults) +} + func (p *PaginatedRemoteFieldClassList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedRemoteFieldClassList var value unmarshaler @@ -468,6 +1075,17 @@ func (p *PaginatedRemoteFieldClassList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedRemoteFieldClassList) MarshalJSON() ([]byte, error) { + type embed PaginatedRemoteFieldClassList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedRemoteFieldClassList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -480,11 +1098,20 @@ func (p *PaginatedRemoteFieldClassList) String() string { return fmt.Sprintf("%#v", p) } +var ( + paginatedTicketListFieldNext = big.NewInt(1 << 0) + paginatedTicketListFieldPrevious = big.NewInt(1 << 1) + paginatedTicketListFieldResults = big.NewInt(1 << 2) +) + type PaginatedTicketList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Ticket `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -514,6 +1141,34 @@ func (p *PaginatedTicketList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedTicketList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTicketList) SetNext(next *string) { + p.Next = next + p.require(paginatedTicketListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTicketList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedTicketListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedTicketList) SetResults(results []*Ticket) { + p.Results = results + p.require(paginatedTicketListFieldResults) +} + func (p *PaginatedTicketList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedTicketList var value unmarshaler @@ -530,6 +1185,17 @@ func (p *PaginatedTicketList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedTicketList) MarshalJSON() ([]byte, error) { + type embed PaginatedTicketList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedTicketList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -547,6 +1213,30 @@ func (p *PaginatedTicketList) String() string { // The `Ticket` object is used to represent a ticket, issue, task or case. // ### Usage Example // TODO +var ( + patchedTicketRequestFieldName = big.NewInt(1 << 0) + patchedTicketRequestFieldAssignees = big.NewInt(1 << 1) + patchedTicketRequestFieldAssignedTeams = big.NewInt(1 << 2) + patchedTicketRequestFieldCreator = big.NewInt(1 << 3) + patchedTicketRequestFieldDueDate = big.NewInt(1 << 4) + patchedTicketRequestFieldStatus = big.NewInt(1 << 5) + patchedTicketRequestFieldDescription = big.NewInt(1 << 6) + patchedTicketRequestFieldCollections = big.NewInt(1 << 7) + patchedTicketRequestFieldTicketType = big.NewInt(1 << 8) + patchedTicketRequestFieldAccount = big.NewInt(1 << 9) + patchedTicketRequestFieldContact = big.NewInt(1 << 10) + patchedTicketRequestFieldParentTicket = big.NewInt(1 << 11) + patchedTicketRequestFieldAccessLevel = big.NewInt(1 << 12) + patchedTicketRequestFieldTags = big.NewInt(1 << 13) + patchedTicketRequestFieldRoles = big.NewInt(1 << 14) + patchedTicketRequestFieldCompletedAt = big.NewInt(1 << 15) + patchedTicketRequestFieldTicketUrl = big.NewInt(1 << 16) + patchedTicketRequestFieldPriority = big.NewInt(1 << 17) + patchedTicketRequestFieldIntegrationParams = big.NewInt(1 << 18) + patchedTicketRequestFieldLinkedAccountParams = big.NewInt(1 << 19) + patchedTicketRequestFieldRemoteFields = big.NewInt(1 << 20) +) + type PatchedTicketRequest struct { // The ticket's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -601,6 +1291,9 @@ type PatchedTicketRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -756,6 +1449,160 @@ func (p *PatchedTicketRequest) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PatchedTicketRequest) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetName(name *string) { + p.Name = name + p.require(patchedTicketRequestFieldName) +} + +// SetAssignees sets the Assignees field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetAssignees(assignees []*string) { + p.Assignees = assignees + p.require(patchedTicketRequestFieldAssignees) +} + +// SetAssignedTeams sets the AssignedTeams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetAssignedTeams(assignedTeams []*string) { + p.AssignedTeams = assignedTeams + p.require(patchedTicketRequestFieldAssignedTeams) +} + +// SetCreator sets the Creator field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetCreator(creator *string) { + p.Creator = creator + p.require(patchedTicketRequestFieldCreator) +} + +// SetDueDate sets the DueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetDueDate(dueDate *time.Time) { + p.DueDate = dueDate + p.require(patchedTicketRequestFieldDueDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetStatus(status *PatchedTicketRequestStatus) { + p.Status = status + p.require(patchedTicketRequestFieldStatus) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetDescription(description *string) { + p.Description = description + p.require(patchedTicketRequestFieldDescription) +} + +// SetCollections sets the Collections field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetCollections(collections []*string) { + p.Collections = collections + p.require(patchedTicketRequestFieldCollections) +} + +// SetTicketType sets the TicketType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetTicketType(ticketType *string) { + p.TicketType = ticketType + p.require(patchedTicketRequestFieldTicketType) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetAccount(account *string) { + p.Account = account + p.require(patchedTicketRequestFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetContact(contact *string) { + p.Contact = contact + p.require(patchedTicketRequestFieldContact) +} + +// SetParentTicket sets the ParentTicket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetParentTicket(parentTicket *string) { + p.ParentTicket = parentTicket + p.require(patchedTicketRequestFieldParentTicket) +} + +// SetAccessLevel sets the AccessLevel field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetAccessLevel(accessLevel *PatchedTicketRequestAccessLevel) { + p.AccessLevel = accessLevel + p.require(patchedTicketRequestFieldAccessLevel) +} + +// SetTags sets the Tags field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetTags(tags []*string) { + p.Tags = tags + p.require(patchedTicketRequestFieldTags) +} + +// SetRoles sets the Roles field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetRoles(roles []*string) { + p.Roles = roles + p.require(patchedTicketRequestFieldRoles) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetCompletedAt(completedAt *time.Time) { + p.CompletedAt = completedAt + p.require(patchedTicketRequestFieldCompletedAt) +} + +// SetTicketUrl sets the TicketUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetTicketUrl(ticketUrl *string) { + p.TicketUrl = ticketUrl + p.require(patchedTicketRequestFieldTicketUrl) +} + +// SetPriority sets the Priority field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetPriority(priority *PriorityEnum) { + p.Priority = priority + p.require(patchedTicketRequestFieldPriority) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + p.IntegrationParams = integrationParams + p.require(patchedTicketRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + p.LinkedAccountParams = linkedAccountParams + p.require(patchedTicketRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatchedTicketRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + p.RemoteFields = remoteFields + p.require(patchedTicketRequestFieldRemoteFields) +} + func (p *PatchedTicketRequest) UnmarshalJSON(data []byte) error { type embed PatchedTicketRequest var unmarshaler = struct { @@ -791,7 +1638,8 @@ func (p *PatchedTicketRequest) MarshalJSON() ([]byte, error) { DueDate: internal.NewOptionalDateTime(p.DueDate), CompletedAt: internal.NewOptionalDateTime(p.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } func (p *PatchedTicketRequest) String() string { @@ -942,10 +1790,18 @@ func (p *PatchedTicketRequestStatus) Accept(visitor PatchedTicketRequestStatusVi return fmt.Errorf("type %T does not include a non-empty union type", p) } +var ( + remoteFieldRequestFieldRemoteFieldClass = big.NewInt(1 << 0) + remoteFieldRequestFieldValue = big.NewInt(1 << 1) +) + type RemoteFieldRequest struct { RemoteFieldClass *RemoteFieldRequestRemoteFieldClass `json:"remote_field_class" url:"remote_field_class"` Value interface{} `json:"value,omitempty" url:"value,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -968,6 +1824,27 @@ func (r *RemoteFieldRequest) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldRequest) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetRemoteFieldClass sets the RemoteFieldClass field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldRequest) SetRemoteFieldClass(remoteFieldClass *RemoteFieldRequestRemoteFieldClass) { + r.RemoteFieldClass = remoteFieldClass + r.require(remoteFieldRequestFieldRemoteFieldClass) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldRequest) SetValue(value interface{}) { + r.Value = value + r.require(remoteFieldRequestFieldValue) +} + func (r *RemoteFieldRequest) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldRequest var value unmarshaler @@ -984,6 +1861,17 @@ func (r *RemoteFieldRequest) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldRequest) MarshalJSON() ([]byte, error) { + type embed RemoteFieldRequest + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldRequest) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -1063,6 +1951,31 @@ func (r *RemoteFieldRequestRemoteFieldClass) Accept(visitor RemoteFieldRequestRe // The `Ticket` object is used to represent a ticket, issue, task or case. // ### Usage Example // TODO +var ( + ticketRequestFieldName = big.NewInt(1 << 0) + ticketRequestFieldAssignees = big.NewInt(1 << 1) + ticketRequestFieldAssignedTeams = big.NewInt(1 << 2) + ticketRequestFieldCreator = big.NewInt(1 << 3) + ticketRequestFieldDueDate = big.NewInt(1 << 4) + ticketRequestFieldStatus = big.NewInt(1 << 5) + ticketRequestFieldDescription = big.NewInt(1 << 6) + ticketRequestFieldCollections = big.NewInt(1 << 7) + ticketRequestFieldTicketType = big.NewInt(1 << 8) + ticketRequestFieldAccount = big.NewInt(1 << 9) + ticketRequestFieldContact = big.NewInt(1 << 10) + ticketRequestFieldParentTicket = big.NewInt(1 << 11) + ticketRequestFieldAttachments = big.NewInt(1 << 12) + ticketRequestFieldAccessLevel = big.NewInt(1 << 13) + ticketRequestFieldTags = big.NewInt(1 << 14) + ticketRequestFieldRoles = big.NewInt(1 << 15) + ticketRequestFieldCompletedAt = big.NewInt(1 << 16) + ticketRequestFieldTicketUrl = big.NewInt(1 << 17) + ticketRequestFieldPriority = big.NewInt(1 << 18) + ticketRequestFieldIntegrationParams = big.NewInt(1 << 19) + ticketRequestFieldLinkedAccountParams = big.NewInt(1 << 20) + ticketRequestFieldRemoteFields = big.NewInt(1 << 21) +) + type TicketRequest struct { // The ticket's name. Name *string `json:"name,omitempty" url:"name,omitempty"` @@ -1118,6 +2031,9 @@ type TicketRequest struct { LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty" url:"linked_account_params,omitempty"` RemoteFields []*RemoteFieldRequest `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1280,6 +2196,167 @@ func (t *TicketRequest) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TicketRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetName(name *string) { + t.Name = name + t.require(ticketRequestFieldName) +} + +// SetAssignees sets the Assignees field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetAssignees(assignees []*TicketRequestAssigneesItem) { + t.Assignees = assignees + t.require(ticketRequestFieldAssignees) +} + +// SetAssignedTeams sets the AssignedTeams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetAssignedTeams(assignedTeams []*TicketRequestAssignedTeamsItem) { + t.AssignedTeams = assignedTeams + t.require(ticketRequestFieldAssignedTeams) +} + +// SetCreator sets the Creator field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetCreator(creator *TicketRequestCreator) { + t.Creator = creator + t.require(ticketRequestFieldCreator) +} + +// SetDueDate sets the DueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetDueDate(dueDate *time.Time) { + t.DueDate = dueDate + t.require(ticketRequestFieldDueDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetStatus(status *TicketRequestStatus) { + t.Status = status + t.require(ticketRequestFieldStatus) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetDescription(description *string) { + t.Description = description + t.require(ticketRequestFieldDescription) +} + +// SetCollections sets the Collections field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetCollections(collections []*TicketRequestCollectionsItem) { + t.Collections = collections + t.require(ticketRequestFieldCollections) +} + +// SetTicketType sets the TicketType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetTicketType(ticketType *string) { + t.TicketType = ticketType + t.require(ticketRequestFieldTicketType) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetAccount(account *TicketRequestAccount) { + t.Account = account + t.require(ticketRequestFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetContact(contact *TicketRequestContact) { + t.Contact = contact + t.require(ticketRequestFieldContact) +} + +// SetParentTicket sets the ParentTicket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetParentTicket(parentTicket *TicketRequestParentTicket) { + t.ParentTicket = parentTicket + t.require(ticketRequestFieldParentTicket) +} + +// SetAttachments sets the Attachments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetAttachments(attachments []*TicketRequestAttachmentsItem) { + t.Attachments = attachments + t.require(ticketRequestFieldAttachments) +} + +// SetAccessLevel sets the AccessLevel field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetAccessLevel(accessLevel *TicketRequestAccessLevel) { + t.AccessLevel = accessLevel + t.require(ticketRequestFieldAccessLevel) +} + +// SetTags sets the Tags field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetTags(tags []*string) { + t.Tags = tags + t.require(ticketRequestFieldTags) +} + +// SetRoles sets the Roles field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetRoles(roles []*string) { + t.Roles = roles + t.require(ticketRequestFieldRoles) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetCompletedAt(completedAt *time.Time) { + t.CompletedAt = completedAt + t.require(ticketRequestFieldCompletedAt) +} + +// SetTicketUrl sets the TicketUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetTicketUrl(ticketUrl *string) { + t.TicketUrl = ticketUrl + t.require(ticketRequestFieldTicketUrl) +} + +// SetPriority sets the Priority field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetPriority(priority *TicketRequestPriority) { + t.Priority = priority + t.require(ticketRequestFieldPriority) +} + +// SetIntegrationParams sets the IntegrationParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetIntegrationParams(integrationParams map[string]interface{}) { + t.IntegrationParams = integrationParams + t.require(ticketRequestFieldIntegrationParams) +} + +// SetLinkedAccountParams sets the LinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetLinkedAccountParams(linkedAccountParams map[string]interface{}) { + t.LinkedAccountParams = linkedAccountParams + t.require(ticketRequestFieldLinkedAccountParams) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketRequest) SetRemoteFields(remoteFields []*RemoteFieldRequest) { + t.RemoteFields = remoteFields + t.require(ticketRequestFieldRemoteFields) +} + func (t *TicketRequest) UnmarshalJSON(data []byte) error { type embed TicketRequest var unmarshaler = struct { @@ -1315,7 +2392,8 @@ func (t *TicketRequest) MarshalJSON() ([]byte, error) { DueDate: internal.NewOptionalDateTime(t.DueDate), CompletedAt: internal.NewOptionalDateTime(t.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *TicketRequest) String() string { @@ -2034,12 +3112,22 @@ func (t *TicketRequestStatus) Accept(visitor TicketRequestStatusVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", t) } +var ( + ticketResponseFieldModel = big.NewInt(1 << 0) + ticketResponseFieldWarnings = big.NewInt(1 << 1) + ticketResponseFieldErrors = big.NewInt(1 << 2) + ticketResponseFieldLogs = big.NewInt(1 << 3) +) + type TicketResponse struct { Model *Ticket `json:"model" url:"model"` Warnings []*WarningValidationProblem `json:"warnings" url:"warnings"` Errors []*ErrorValidationProblem `json:"errors" url:"errors"` Logs []*DebugModeLog `json:"logs,omitempty" url:"logs,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2076,6 +3164,41 @@ func (t *TicketResponse) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *TicketResponse) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetModel sets the Model field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketResponse) SetModel(model *Ticket) { + t.Model = model + t.require(ticketResponseFieldModel) +} + +// SetWarnings sets the Warnings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketResponse) SetWarnings(warnings []*WarningValidationProblem) { + t.Warnings = warnings + t.require(ticketResponseFieldWarnings) +} + +// SetErrors sets the Errors field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketResponse) SetErrors(errors []*ErrorValidationProblem) { + t.Errors = errors + t.require(ticketResponseFieldErrors) +} + +// SetLogs sets the Logs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketResponse) SetLogs(logs []*DebugModeLog) { + t.Logs = logs + t.require(ticketResponseFieldLogs) +} + func (t *TicketResponse) UnmarshalJSON(data []byte) error { type unmarshaler TicketResponse var value unmarshaler @@ -2092,6 +3215,17 @@ func (t *TicketResponse) UnmarshalJSON(data []byte) error { return nil } +func (t *TicketResponse) MarshalJSON() ([]byte, error) { + type embed TicketResponse + var marshaler = struct { + embed + }{ + embed: embed(*t), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (t *TicketResponse) String() string { if len(t.rawJSON) > 0 { if value, err := internal.StringifyJSON(t.rawJSON); err == nil { @@ -2104,6 +3238,15 @@ func (t *TicketResponse) String() string { return fmt.Sprintf("%#v", t) } +var ( + ticketsViewersListRequestFieldCursor = big.NewInt(1 << 0) + ticketsViewersListRequestFieldExpand = big.NewInt(1 << 1) + ticketsViewersListRequestFieldIncludeDeletedData = big.NewInt(1 << 2) + ticketsViewersListRequestFieldIncludeRemoteData = big.NewInt(1 << 3) + ticketsViewersListRequestFieldIncludeShellData = big.NewInt(1 << 4) + ticketsViewersListRequestFieldPageSize = big.NewInt(1 << 5) +) + type TicketsViewersListRequest struct { // The pagination cursor value. Cursor *string `json:"-" url:"cursor,omitempty"` @@ -2117,4 +3260,56 @@ type TicketsViewersListRequest struct { IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` // Number of results to return per page. PageSize *int `json:"-" url:"page_size,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (t *TicketsViewersListRequest) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsViewersListRequest) SetCursor(cursor *string) { + t.Cursor = cursor + t.require(ticketsViewersListRequestFieldCursor) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsViewersListRequest) SetExpand(expand []*TicketsViewersListRequestExpandItem) { + t.Expand = expand + t.require(ticketsViewersListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsViewersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + t.IncludeDeletedData = includeDeletedData + t.require(ticketsViewersListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsViewersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + t.IncludeRemoteData = includeRemoteData + t.require(ticketsViewersListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsViewersListRequest) SetIncludeShellData(includeShellData *bool) { + t.IncludeShellData = includeShellData + t.require(ticketsViewersListRequestFieldIncludeShellData) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *TicketsViewersListRequest) SetPageSize(pageSize *int) { + t.PageSize = pageSize + t.require(ticketsViewersListRequestFieldPageSize) } diff --git a/ticketing/tickets/client.go b/ticketing/tickets/client.go index 5a7a090..1877dcc 100644 --- a/ticketing/tickets/client.go +++ b/ticketing/tickets/client.go @@ -4,7 +4,6 @@ package tickets import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.TicketsListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Ticket], error) { +) (*core.Page[*string, *ticketing.Ticket], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedTicketList) *internal.PageResponse[*string, *ticketing.Ticket] { + readPageResponse := func(response *ticketing.PaginatedTicketList) *core.PageResponse[*string, *ticketing.Ticket] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Ticket]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Ticket]{ Next: next, Results: results, Done: next == zeroValue, @@ -97,44 +97,15 @@ func (c *Client) Create( request *ticketing.TicketEndpointRequest, opts ...option.RequestOption, ) (*ticketing.TicketResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ticketing/v1/tickets" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.TicketResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a `Ticket` object with the given `id`. @@ -144,45 +115,16 @@ func (c *Client) Retrieve( request *ticketing.TicketsRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.Ticket, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/tickets/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.Ticket - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Updates a `Ticket` object with the given `id`. @@ -192,47 +134,16 @@ func (c *Client) PartialUpdate( request *ticketing.PatchedTicketEndpointRequest, opts ...option.RequestOption, ) (*ticketing.TicketResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/tickets/%v", + response, err := c.WithRawResponse.PartialUpdate( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.TicketResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPatch, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // 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) @@ -241,7 +152,7 @@ func (c *Client) ViewersList( ticketId string, request *ticketing.TicketsViewersListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.Viewer], error) { +) (*core.Page[*string, *ticketing.Viewer], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -257,13 +168,12 @@ func (c *Client) ViewersList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -280,11 +190,11 @@ func (c *Client) ViewersList( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedViewerList) *internal.PageResponse[*string, *ticketing.Viewer] { + readPageResponse := func(response *ticketing.PaginatedViewerList) *core.PageResponse[*string, *ticketing.Viewer] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.Viewer]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.Viewer]{ Next: next, Results: results, Done: next == zeroValue, @@ -304,38 +214,15 @@ func (c *Client) MetaPatchRetrieve( id string, opts ...option.RequestOption, ) (*ticketing.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/tickets/meta/patch/%v", + response, err := c.WithRawResponse.MetaPatchRetrieve( + ctx, id, + opts..., ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Returns metadata for `Ticket` POSTs. @@ -344,42 +231,15 @@ func (c *Client) MetaPostRetrieve( request *ticketing.TicketsMetaPostRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.MetaResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", + response, err := c.WithRawResponse.MetaPostRetrieve( + ctx, + request, + opts..., ) - endpointURL := baseURL + "/ticketing/v1/tickets/meta/post" - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.MetaResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } // Returns a list of `RemoteFieldClass` objects. @@ -387,7 +247,7 @@ func (c *Client) RemoteFieldClassesList( ctx context.Context, request *ticketing.TicketsRemoteFieldClassesListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.RemoteFieldClass], error) { +) (*core.Page[*string, *ticketing.RemoteFieldClass], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -400,13 +260,12 @@ func (c *Client) RemoteFieldClassesList( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -423,11 +282,11 @@ func (c *Client) RemoteFieldClassesList( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedRemoteFieldClassList) *internal.PageResponse[*string, *ticketing.RemoteFieldClass] { + readPageResponse := func(response *ticketing.PaginatedRemoteFieldClassList) *core.PageResponse[*string, *ticketing.RemoteFieldClass] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.RemoteFieldClass]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.RemoteFieldClass]{ Next: next, Results: results, Done: next == zeroValue, diff --git a/ticketing/tickets/raw_client.go b/ticketing/tickets/raw_client.go new file mode 100644 index 0000000..cd6f4c3 --- /dev/null +++ b/ticketing/tickets/raw_client.go @@ -0,0 +1,274 @@ +// Code generated by Fern. DO NOT EDIT. + +package tickets + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.TicketEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.TicketResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/tickets" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.TicketResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.TicketResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.TicketsRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.Ticket], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/tickets/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.Ticket + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.Ticket]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) PartialUpdate( + ctx context.Context, + id string, + request *ticketing.PatchedTicketEndpointRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.TicketResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/tickets/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.TicketResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.TicketResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPatchRetrieve( + ctx context.Context, + id string, + opts ...option.RequestOption, +) (*core.Response[*ticketing.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/tickets/meta/patch/%v", + id, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) MetaPostRetrieve( + ctx context.Context, + request *ticketing.TicketsMetaPostRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.MetaResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/tickets/meta/post" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.MetaResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.MetaResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/tickets/ticketing_tickets_test/ticketing_tickets_test.go b/ticketing/tickets/ticketing_tickets_test/ticketing_tickets_test.go new file mode 100644 index 0000000..230d31d --- /dev/null +++ b/ticketing/tickets/ticketing_tickets_test/ticketing_tickets_test.go @@ -0,0 +1,420 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_tickets_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingTicketsListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TicketsListRequest{ + AccountId: merge.String( + "account_id", + ), + AssigneeIds: merge.String( + "assignee_ids", + ), + CollectionIds: merge.String( + "collection_ids", + ), + CompletedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CompletedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ContactId: merge.String( + "contact_id", + ), + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatorId: merge.String( + "creator_id", + ), + CreatorIds: merge.String( + "creator_ids", + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + DueAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + DueBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Name: merge.String( + "name", + ), + PageSize: merge.Int( + 1, + ), + ParentTicketId: merge.String( + "parent_ticket_id", + ), + Priority: ticketing.TicketsListRequestPriorityHigh.Ptr(), + RemoteCreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteCreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteFields: ticketing.TicketsListRequestRemoteFieldsPriority.Ptr(), + RemoteId: merge.String( + "remote_id", + ), + RemoteUpdatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + RemoteUpdatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ShowEnumOrigins: ticketing.TicketsListRequestShowEnumOriginsPriority.Ptr(), + Status: ticketing.TicketsListRequestStatusEmpty.Ptr(), + Tags: merge.String( + "tags", + ), + TicketType: merge.String( + "ticket_type", + ), + TicketUrl: merge.String( + "ticket_url", + ), + } + _, invocationErr := client.Ticketing.Tickets.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/tickets", map[string]string{"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"}, 1) +} + +func TestTicketingTicketsCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TicketEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.TicketRequest{}, + } + _, invocationErr := client.Ticketing.Tickets.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/tickets", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestTicketingTicketsRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TicketsRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeRemoteFields: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + RemoteFields: ticketing.TicketsRetrieveRequestRemoteFieldsPriority.Ptr(), + ShowEnumOrigins: ticketing.TicketsRetrieveRequestShowEnumOriginsPriority.Ptr(), + } + _, invocationErr := client.Ticketing.Tickets.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/tickets/id", map[string]string{"include_remote_data": "true", "include_remote_fields": "true", "include_shell_data": "true", "remote_fields": "priority", "show_enum_origins": "priority"}, 1) +} + +func TestTicketingTicketsPartialUpdateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.PatchedTicketEndpointRequest{ + IsDebugMode: merge.Bool( + true, + ), + RunAsync: merge.Bool( + true, + ), + Model: &ticketing.PatchedTicketRequest{}, + } + _, invocationErr := client.Ticketing.Tickets.PartialUpdate( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "PATCH", "/ticketing/v1/tickets/id", map[string]string{"is_debug_mode": "true", "run_async": "true"}, 1) +} + +func TestTicketingTicketsViewersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TicketsViewersListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Ticketing.Tickets.ViewersList( + context.TODO(), + "ticket_id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/tickets/ticket_id/viewers", map[string]string{"cursor": "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", "include_deleted_data": "true", "include_remote_data": "true", "include_shell_data": "true", "page_size": "1"}, 1) +} + +func TestTicketingTicketsMetaPatchRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.Tickets.MetaPatchRetrieve( + context.TODO(), + "id", + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/tickets/meta/patch/id", nil, 1) +} + +func TestTicketingTicketsMetaPostRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TicketsMetaPostRetrieveRequest{ + CollectionId: merge.String( + "collection_id", + ), + TicketType: merge.String( + "ticket_type", + ), + } + _, invocationErr := client.Ticketing.Tickets.MetaPostRetrieve( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/tickets/meta/post", map[string]string{"collection_id": "collection_id", "ticket_type": "ticket_type"}, 1) +} + +func TestTicketingTicketsRemoteFieldClassesListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.TicketsRemoteFieldClassesListRequest{ + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + Ids: merge.String( + "ids", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + IsCommonModelField: merge.Bool( + true, + ), + IsCustom: merge.Bool( + true, + ), + PageSize: merge.Int( + 1, + ), + } + _, invocationErr := client.Ticketing.Tickets.RemoteFieldClassesList( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/tickets/remote-field-classes", map[string]string{"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"}, 1) +} diff --git a/ticketing/types.go b/ticketing/types.go index 5e23b92..c78e525 100644 --- a/ticketing/types.go +++ b/ticketing/types.go @@ -6,6 +6,7 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" time "time" ) @@ -17,6 +18,18 @@ import ( // // ### Usage Example // TODO +var ( + accountFieldId = big.NewInt(1 << 0) + accountFieldRemoteId = big.NewInt(1 << 1) + accountFieldCreatedAt = big.NewInt(1 << 2) + accountFieldModifiedAt = big.NewInt(1 << 3) + accountFieldName = big.NewInt(1 << 4) + accountFieldDomains = big.NewInt(1 << 5) + accountFieldRemoteWasDeleted = big.NewInt(1 << 6) + accountFieldFieldMappings = big.NewInt(1 << 7) + accountFieldRemoteData = big.NewInt(1 << 8) +) + type Account struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -34,6 +47,9 @@ type Account struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -105,6 +121,76 @@ func (a *Account) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Account) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetId(id *string) { + a.Id = id + a.require(accountFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(accountFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(accountFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(accountFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetName(name *string) { + a.Name = name + a.require(accountFieldName) +} + +// SetDomains sets the Domains field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetDomains(domains []*string) { + a.Domains = domains + a.require(accountFieldDomains) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteWasDeleted(remoteWasDeleted *bool) { + a.RemoteWasDeleted = remoteWasDeleted + a.require(accountFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetFieldMappings(fieldMappings map[string]interface{}) { + a.FieldMappings = fieldMappings + a.require(accountFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Account) SetRemoteData(remoteData []*RemoteData) { + a.RemoteData = remoteData + a.require(accountFieldRemoteData) +} + func (a *Account) UnmarshalJSON(data []byte) error { type embed Account var unmarshaler = struct { @@ -140,7 +226,8 @@ func (a *Account) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(a.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Account) String() string { @@ -155,6 +242,19 @@ func (a *Account) String() string { return fmt.Sprintf("%#v", a) } +var ( + accountIntegrationFieldName = big.NewInt(1 << 0) + accountIntegrationFieldAbbreviatedName = big.NewInt(1 << 1) + accountIntegrationFieldCategories = big.NewInt(1 << 2) + accountIntegrationFieldImage = big.NewInt(1 << 3) + accountIntegrationFieldSquareImage = big.NewInt(1 << 4) + accountIntegrationFieldColor = big.NewInt(1 << 5) + accountIntegrationFieldSlug = big.NewInt(1 << 6) + accountIntegrationFieldApiEndpointsToDocumentationUrls = big.NewInt(1 << 7) + accountIntegrationFieldWebhookSetupGuideUrl = big.NewInt(1 << 8) + accountIntegrationFieldCategoryBetaStatus = big.NewInt(1 << 9) +) + type AccountIntegration struct { // Company name. Name string `json:"name" url:"name"` @@ -176,6 +276,9 @@ type AccountIntegration struct { // Category or categories this integration is in beta status for. CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty" url:"category_beta_status,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -254,6 +357,83 @@ func (a *AccountIntegration) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *AccountIntegration) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetName(name string) { + a.Name = name + a.require(accountIntegrationFieldName) +} + +// SetAbbreviatedName sets the AbbreviatedName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetAbbreviatedName(abbreviatedName *string) { + a.AbbreviatedName = abbreviatedName + a.require(accountIntegrationFieldAbbreviatedName) +} + +// SetCategories sets the Categories field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategories(categories []CategoriesEnum) { + a.Categories = categories + a.require(accountIntegrationFieldCategories) +} + +// SetImage sets the Image field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetImage(image *string) { + a.Image = image + a.require(accountIntegrationFieldImage) +} + +// SetSquareImage sets the SquareImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSquareImage(squareImage *string) { + a.SquareImage = squareImage + a.require(accountIntegrationFieldSquareImage) +} + +// SetColor sets the Color field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetColor(color *string) { + a.Color = color + a.require(accountIntegrationFieldColor) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetSlug(slug *string) { + a.Slug = slug + a.require(accountIntegrationFieldSlug) +} + +// SetApiEndpointsToDocumentationUrls sets the ApiEndpointsToDocumentationUrls field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetApiEndpointsToDocumentationUrls(apiEndpointsToDocumentationUrls map[string]interface{}) { + a.ApiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls + a.require(accountIntegrationFieldApiEndpointsToDocumentationUrls) +} + +// SetWebhookSetupGuideUrl sets the WebhookSetupGuideUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetWebhookSetupGuideUrl(webhookSetupGuideUrl *string) { + a.WebhookSetupGuideUrl = webhookSetupGuideUrl + a.require(accountIntegrationFieldWebhookSetupGuideUrl) +} + +// SetCategoryBetaStatus sets the CategoryBetaStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountIntegration) SetCategoryBetaStatus(categoryBetaStatus map[string]interface{}) { + a.CategoryBetaStatus = categoryBetaStatus + a.require(accountIntegrationFieldCategoryBetaStatus) +} + func (a *AccountIntegration) UnmarshalJSON(data []byte) error { type unmarshaler AccountIntegration var value unmarshaler @@ -270,6 +450,17 @@ func (a *AccountIntegration) UnmarshalJSON(data []byte) error { return nil } +func (a *AccountIntegration) MarshalJSON() ([]byte, error) { + type embed AccountIntegration + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (a *AccountIntegration) String() string { if len(a.rawJSON) > 0 { if value, err := internal.StringifyJSON(a.rawJSON); err == nil { @@ -288,6 +479,22 @@ func (a *AccountIntegration) String() string { // // ### Usage Example // TODO +var ( + attachmentFieldId = big.NewInt(1 << 0) + attachmentFieldRemoteId = big.NewInt(1 << 1) + attachmentFieldCreatedAt = big.NewInt(1 << 2) + attachmentFieldModifiedAt = big.NewInt(1 << 3) + attachmentFieldFileName = big.NewInt(1 << 4) + attachmentFieldTicket = big.NewInt(1 << 5) + attachmentFieldFileUrl = big.NewInt(1 << 6) + attachmentFieldContentType = big.NewInt(1 << 7) + attachmentFieldUploadedBy = big.NewInt(1 << 8) + attachmentFieldRemoteCreatedAt = big.NewInt(1 << 9) + attachmentFieldRemoteWasDeleted = big.NewInt(1 << 10) + attachmentFieldFieldMappings = big.NewInt(1 << 11) + attachmentFieldRemoteData = big.NewInt(1 << 12) +) + type Attachment struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -313,6 +520,9 @@ type Attachment struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -412,6 +622,104 @@ func (a *Attachment) GetExtraProperties() map[string]interface{} { return a.extraProperties } +func (a *Attachment) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetId(id *string) { + a.Id = id + a.require(attachmentFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetRemoteId(remoteId *string) { + a.RemoteId = remoteId + a.require(attachmentFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetCreatedAt(createdAt *time.Time) { + a.CreatedAt = createdAt + a.require(attachmentFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetModifiedAt(modifiedAt *time.Time) { + a.ModifiedAt = modifiedAt + a.require(attachmentFieldModifiedAt) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetFileName(fileName *string) { + a.FileName = fileName + a.require(attachmentFieldFileName) +} + +// SetTicket sets the Ticket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetTicket(ticket *AttachmentTicket) { + a.Ticket = ticket + a.require(attachmentFieldTicket) +} + +// SetFileUrl sets the FileUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetFileUrl(fileUrl *string) { + a.FileUrl = fileUrl + a.require(attachmentFieldFileUrl) +} + +// SetContentType sets the ContentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetContentType(contentType *string) { + a.ContentType = contentType + a.require(attachmentFieldContentType) +} + +// SetUploadedBy sets the UploadedBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetUploadedBy(uploadedBy *string) { + a.UploadedBy = uploadedBy + a.require(attachmentFieldUploadedBy) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + a.RemoteCreatedAt = remoteCreatedAt + a.require(attachmentFieldRemoteCreatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetRemoteWasDeleted(remoteWasDeleted *bool) { + a.RemoteWasDeleted = remoteWasDeleted + a.require(attachmentFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetFieldMappings(fieldMappings map[string]interface{}) { + a.FieldMappings = fieldMappings + a.require(attachmentFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Attachment) SetRemoteData(remoteData []*RemoteData) { + a.RemoteData = remoteData + a.require(attachmentFieldRemoteData) +} + func (a *Attachment) UnmarshalJSON(data []byte) error { type embed Attachment var unmarshaler = struct { @@ -451,7 +759,8 @@ func (a *Attachment) MarshalJSON() ([]byte, error) { ModifiedAt: internal.NewOptionalDateTime(a.ModifiedAt), RemoteCreatedAt: internal.NewOptionalDateTime(a.RemoteCreatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) } func (a *Attachment) String() string { @@ -623,6 +932,24 @@ func (c CategoryEnum) Ptr() *CategoryEnum { // // ### Usage Example // TODO +var ( + collectionFieldId = big.NewInt(1 << 0) + collectionFieldRemoteId = big.NewInt(1 << 1) + collectionFieldCreatedAt = big.NewInt(1 << 2) + collectionFieldModifiedAt = big.NewInt(1 << 3) + collectionFieldName = big.NewInt(1 << 4) + collectionFieldDescription = big.NewInt(1 << 5) + collectionFieldAccessLevel = big.NewInt(1 << 6) + collectionFieldCollectionType = big.NewInt(1 << 7) + collectionFieldParentCollection = big.NewInt(1 << 8) + collectionFieldCollectionUrl = big.NewInt(1 << 9) + collectionFieldRemoteCreatedAt = big.NewInt(1 << 10) + collectionFieldRemoteUpdatedAt = big.NewInt(1 << 11) + collectionFieldRemoteWasDeleted = big.NewInt(1 << 12) + collectionFieldFieldMappings = big.NewInt(1 << 13) + collectionFieldRemoteData = big.NewInt(1 << 14) +) + type Collection struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -649,11 +976,20 @@ type Collection struct { CollectionType *CollectionTypeEnum `json:"collection_type,omitempty" url:"collection_type,omitempty"` // The parent collection for this collection. ParentCollection *CollectionParentCollection `json:"parent_collection,omitempty" url:"parent_collection,omitempty"` + // The 3rd party url of the Collection. + CollectionUrl *string `json:"collection_url,omitempty" url:"collection_url,omitempty"` + // When the third party's collection was created. + RemoteCreatedAt *time.Time `json:"remote_created_at,omitempty" url:"remote_created_at,omitempty"` + // When the third party's collection was updated. + RemoteUpdatedAt *time.Time `json:"remote_updated_at,omitempty" url:"remote_updated_at,omitempty"` // Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty" url:"remote_was_deleted,omitempty"` FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -721,6 +1057,27 @@ func (c *Collection) GetParentCollection() *CollectionParentCollection { return c.ParentCollection } +func (c *Collection) GetCollectionUrl() *string { + if c == nil { + return nil + } + return c.CollectionUrl +} + +func (c *Collection) GetRemoteCreatedAt() *time.Time { + if c == nil { + return nil + } + return c.RemoteCreatedAt +} + +func (c *Collection) GetRemoteUpdatedAt() *time.Time { + if c == nil { + return nil + } + return c.RemoteUpdatedAt +} + func (c *Collection) GetRemoteWasDeleted() *bool { if c == nil { return nil @@ -746,12 +1103,126 @@ func (c *Collection) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *Collection) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetId(id *string) { + c.Id = id + c.require(collectionFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(collectionFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(collectionFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(collectionFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetName(name *string) { + c.Name = name + c.require(collectionFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetDescription(description *string) { + c.Description = description + c.require(collectionFieldDescription) +} + +// SetAccessLevel sets the AccessLevel field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetAccessLevel(accessLevel *CollectionAccessLevel) { + c.AccessLevel = accessLevel + c.require(collectionFieldAccessLevel) +} + +// SetCollectionType sets the CollectionType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetCollectionType(collectionType *CollectionTypeEnum) { + c.CollectionType = collectionType + c.require(collectionFieldCollectionType) +} + +// SetParentCollection sets the ParentCollection field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetParentCollection(parentCollection *CollectionParentCollection) { + c.ParentCollection = parentCollection + c.require(collectionFieldParentCollection) +} + +// SetCollectionUrl sets the CollectionUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetCollectionUrl(collectionUrl *string) { + c.CollectionUrl = collectionUrl + c.require(collectionFieldCollectionUrl) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + c.RemoteCreatedAt = remoteCreatedAt + c.require(collectionFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + c.RemoteUpdatedAt = remoteUpdatedAt + c.require(collectionFieldRemoteUpdatedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(collectionFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(collectionFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Collection) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(collectionFieldRemoteData) +} + func (c *Collection) UnmarshalJSON(data []byte) error { type embed Collection var unmarshaler = struct { embed - CreatedAt *internal.DateTime `json:"created_at,omitempty"` - ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` + CreatedAt *internal.DateTime `json:"created_at,omitempty"` + ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` + RemoteCreatedAt *internal.DateTime `json:"remote_created_at,omitempty"` + RemoteUpdatedAt *internal.DateTime `json:"remote_updated_at,omitempty"` }{ embed: embed(*c), } @@ -761,6 +1232,8 @@ func (c *Collection) UnmarshalJSON(data []byte) error { *c = Collection(unmarshaler.embed) c.CreatedAt = unmarshaler.CreatedAt.TimePtr() c.ModifiedAt = unmarshaler.ModifiedAt.TimePtr() + c.RemoteCreatedAt = unmarshaler.RemoteCreatedAt.TimePtr() + c.RemoteUpdatedAt = unmarshaler.RemoteUpdatedAt.TimePtr() extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -774,14 +1247,19 @@ func (c *Collection) MarshalJSON() ([]byte, error) { type embed Collection var marshaler = struct { embed - CreatedAt *internal.DateTime `json:"created_at,omitempty"` - ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` + CreatedAt *internal.DateTime `json:"created_at,omitempty"` + ModifiedAt *internal.DateTime `json:"modified_at,omitempty"` + RemoteCreatedAt *internal.DateTime `json:"remote_created_at,omitempty"` + RemoteUpdatedAt *internal.DateTime `json:"remote_updated_at,omitempty"` }{ - embed: embed(*c), - CreatedAt: internal.NewOptionalDateTime(c.CreatedAt), - ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), + embed: embed(*c), + CreatedAt: internal.NewOptionalDateTime(c.CreatedAt), + ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), + RemoteCreatedAt: internal.NewOptionalDateTime(c.RemoteCreatedAt), + RemoteUpdatedAt: internal.NewOptionalDateTime(c.RemoteUpdatedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *Collection) String() string { @@ -989,6 +1467,21 @@ func (c CollectionTypeEnum) Ptr() *CollectionTypeEnum { // // ### Usage Example // TODO +var ( + contactFieldId = big.NewInt(1 << 0) + contactFieldRemoteId = big.NewInt(1 << 1) + contactFieldCreatedAt = big.NewInt(1 << 2) + contactFieldModifiedAt = big.NewInt(1 << 3) + contactFieldName = big.NewInt(1 << 4) + contactFieldEmailAddress = big.NewInt(1 << 5) + contactFieldPhoneNumber = big.NewInt(1 << 6) + contactFieldDetails = big.NewInt(1 << 7) + contactFieldAccount = big.NewInt(1 << 8) + contactFieldRemoteWasDeleted = big.NewInt(1 << 9) + contactFieldFieldMappings = big.NewInt(1 << 10) + contactFieldRemoteData = big.NewInt(1 << 11) +) + type Contact struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -1012,6 +1505,9 @@ type Contact struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1104,6 +1600,97 @@ func (c *Contact) GetExtraProperties() map[string]interface{} { return c.extraProperties } +func (c *Contact) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetId(id *string) { + c.Id = id + c.require(contactFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteId(remoteId *string) { + c.RemoteId = remoteId + c.require(contactFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetCreatedAt(createdAt *time.Time) { + c.CreatedAt = createdAt + c.require(contactFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetModifiedAt(modifiedAt *time.Time) { + c.ModifiedAt = modifiedAt + c.require(contactFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetName(name *string) { + c.Name = name + c.require(contactFieldName) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetEmailAddress(emailAddress *string) { + c.EmailAddress = emailAddress + c.require(contactFieldEmailAddress) +} + +// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetPhoneNumber(phoneNumber *string) { + c.PhoneNumber = phoneNumber + c.require(contactFieldPhoneNumber) +} + +// SetDetails sets the Details field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetDetails(details *string) { + c.Details = details + c.require(contactFieldDetails) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetAccount(account *ContactAccount) { + c.Account = account + c.require(contactFieldAccount) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteWasDeleted(remoteWasDeleted *bool) { + c.RemoteWasDeleted = remoteWasDeleted + c.require(contactFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetFieldMappings(fieldMappings map[string]interface{}) { + c.FieldMappings = fieldMappings + c.require(contactFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *Contact) SetRemoteData(remoteData []*RemoteData) { + c.RemoteData = remoteData + c.require(contactFieldRemoteData) +} + func (c *Contact) UnmarshalJSON(data []byte) error { type embed Contact var unmarshaler = struct { @@ -1139,7 +1726,8 @@ func (c *Contact) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(c.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(c.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } func (c *Contact) String() string { @@ -1223,6 +1811,17 @@ func (c *ContactAccount) Accept(visitor ContactAccountVisitor) error { // // ### Usage Example // Create a `DataPassthrough` to get team hierarchies from your Rippling integration. +var ( + dataPassthroughRequestFieldMethod = big.NewInt(1 << 0) + dataPassthroughRequestFieldPath = big.NewInt(1 << 1) + dataPassthroughRequestFieldBaseUrlOverride = big.NewInt(1 << 2) + dataPassthroughRequestFieldData = big.NewInt(1 << 3) + dataPassthroughRequestFieldMultipartFormData = big.NewInt(1 << 4) + dataPassthroughRequestFieldHeaders = big.NewInt(1 << 5) + dataPassthroughRequestFieldRequestFormat = big.NewInt(1 << 6) + dataPassthroughRequestFieldNormalizeResponse = big.NewInt(1 << 7) +) + type DataPassthroughRequest struct { Method MethodEnum `json:"method" url:"method"` // The path of the request in the third party's platform. @@ -1239,6 +1838,9 @@ type DataPassthroughRequest struct { // 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`. NormalizeResponse *bool `json:"normalize_response,omitempty" url:"normalize_response,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1303,6 +1905,69 @@ func (d *DataPassthroughRequest) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DataPassthroughRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMethod(method MethodEnum) { + d.Method = method + d.require(dataPassthroughRequestFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetPath(path string) { + d.Path = path + d.require(dataPassthroughRequestFieldPath) +} + +// SetBaseUrlOverride sets the BaseUrlOverride field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetBaseUrlOverride(baseUrlOverride *string) { + d.BaseUrlOverride = baseUrlOverride + d.require(dataPassthroughRequestFieldBaseUrlOverride) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetData(data *string) { + d.Data = data + d.require(dataPassthroughRequestFieldData) +} + +// SetMultipartFormData sets the MultipartFormData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetMultipartFormData(multipartFormData []*MultipartFormFieldRequest) { + d.MultipartFormData = multipartFormData + d.require(dataPassthroughRequestFieldMultipartFormData) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetHeaders(headers map[string]interface{}) { + d.Headers = headers + d.require(dataPassthroughRequestFieldHeaders) +} + +// SetRequestFormat sets the RequestFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetRequestFormat(requestFormat *RequestFormatEnum) { + d.RequestFormat = requestFormat + d.require(dataPassthroughRequestFieldRequestFormat) +} + +// SetNormalizeResponse sets the NormalizeResponse field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DataPassthroughRequest) SetNormalizeResponse(normalizeResponse *bool) { + d.NormalizeResponse = normalizeResponse + d.require(dataPassthroughRequestFieldNormalizeResponse) +} + func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { type unmarshaler DataPassthroughRequest var value unmarshaler @@ -1319,6 +1984,17 @@ func (d *DataPassthroughRequest) UnmarshalJSON(data []byte) error { return nil } +func (d *DataPassthroughRequest) MarshalJSON() ([]byte, error) { + type embed DataPassthroughRequest + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DataPassthroughRequest) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -1331,11 +2007,20 @@ func (d *DataPassthroughRequest) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModeLogFieldLogId = big.NewInt(1 << 0) + debugModeLogFieldDashboardView = big.NewInt(1 << 1) + debugModeLogFieldLogSummary = big.NewInt(1 << 2) +) + type DebugModeLog struct { LogId string `json:"log_id" url:"log_id"` DashboardView string `json:"dashboard_view" url:"dashboard_view"` LogSummary *DebugModelLogSummary `json:"log_summary" url:"log_summary"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1365,6 +2050,34 @@ func (d *DebugModeLog) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModeLog) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetLogId sets the LogId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogId(logId string) { + d.LogId = logId + d.require(debugModeLogFieldLogId) +} + +// SetDashboardView sets the DashboardView field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetDashboardView(dashboardView string) { + d.DashboardView = dashboardView + d.require(debugModeLogFieldDashboardView) +} + +// SetLogSummary sets the LogSummary field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModeLog) SetLogSummary(logSummary *DebugModelLogSummary) { + d.LogSummary = logSummary + d.require(debugModeLogFieldLogSummary) +} + func (d *DebugModeLog) UnmarshalJSON(data []byte) error { type unmarshaler DebugModeLog var value unmarshaler @@ -1381,6 +2094,17 @@ func (d *DebugModeLog) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModeLog) MarshalJSON() ([]byte, error) { + type embed DebugModeLog + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModeLog) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -1393,11 +2117,20 @@ func (d *DebugModeLog) String() string { return fmt.Sprintf("%#v", d) } +var ( + debugModelLogSummaryFieldUrl = big.NewInt(1 << 0) + debugModelLogSummaryFieldMethod = big.NewInt(1 << 1) + debugModelLogSummaryFieldStatusCode = big.NewInt(1 << 2) +) + type DebugModelLogSummary struct { Url string `json:"url" url:"url"` Method string `json:"method" url:"method"` StatusCode int `json:"status_code" url:"status_code"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1427,6 +2160,34 @@ func (d *DebugModelLogSummary) GetExtraProperties() map[string]interface{} { return d.extraProperties } +func (d *DebugModelLogSummary) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetUrl sets the Url field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetUrl(url string) { + d.Url = url + d.require(debugModelLogSummaryFieldUrl) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetMethod(method string) { + d.Method = method + d.require(debugModelLogSummaryFieldMethod) +} + +// SetStatusCode sets the StatusCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DebugModelLogSummary) SetStatusCode(statusCode int) { + d.StatusCode = statusCode + d.require(debugModelLogSummaryFieldStatusCode) +} + func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { type unmarshaler DebugModelLogSummary var value unmarshaler @@ -1443,6 +2204,17 @@ func (d *DebugModelLogSummary) UnmarshalJSON(data []byte) error { return nil } +func (d *DebugModelLogSummary) MarshalJSON() ([]byte, error) { + type embed DebugModelLogSummary + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (d *DebugModelLogSummary) String() string { if len(d.rawJSON) > 0 { if value, err := internal.StringifyJSON(d.rawJSON); err == nil { @@ -1483,12 +2255,22 @@ func (e EncodingEnum) Ptr() *EncodingEnum { return &e } +var ( + errorValidationProblemFieldSource = big.NewInt(1 << 0) + errorValidationProblemFieldTitle = big.NewInt(1 << 1) + errorValidationProblemFieldDetail = big.NewInt(1 << 2) + errorValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type ErrorValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1525,8 +2307,43 @@ func (e *ErrorValidationProblem) GetExtraProperties() map[string]interface{} { return e.extraProperties } -func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { - type unmarshaler ErrorValidationProblem +func (e *ErrorValidationProblem) require(field *big.Int) { + if e.explicitFields == nil { + e.explicitFields = big.NewInt(0) + } + e.explicitFields.Or(e.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetSource(source *ValidationProblemSource) { + e.Source = source + e.require(errorValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetTitle(title string) { + e.Title = title + e.require(errorValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetDetail(detail string) { + e.Detail = detail + e.require(errorValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (e *ErrorValidationProblem) SetProblemType(problemType string) { + e.ProblemType = problemType + e.require(errorValidationProblemFieldProblemType) +} + +func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { + type unmarshaler ErrorValidationProblem var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err @@ -1541,6 +2358,17 @@ func (e *ErrorValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (e *ErrorValidationProblem) MarshalJSON() ([]byte, error) { + type embed ErrorValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (e *ErrorValidationProblem) String() string { if len(e.rawJSON) > 0 { if value, err := internal.StringifyJSON(e.rawJSON); err == nil { @@ -1593,10 +2421,18 @@ func (f FieldFormatEnum) Ptr() *FieldFormatEnum { return &f } +var ( + fieldPermissionDeserializerRequestFieldEnabledFields = big.NewInt(1 << 0) + fieldPermissionDeserializerRequestFieldDisabledFields = big.NewInt(1 << 1) +) + type FieldPermissionDeserializerRequest struct { EnabledFields []interface{} `json:"enabled_fields,omitempty" url:"enabled_fields,omitempty"` DisabledFields []interface{} `json:"disabled_fields,omitempty" url:"disabled_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1619,6 +2455,27 @@ func (f *FieldPermissionDeserializerRequest) GetExtraProperties() map[string]int return f.extraProperties } +func (f *FieldPermissionDeserializerRequest) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetEnabledFields sets the EnabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetEnabledFields(enabledFields []interface{}) { + f.EnabledFields = enabledFields + f.require(fieldPermissionDeserializerRequestFieldEnabledFields) +} + +// SetDisabledFields sets the DisabledFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FieldPermissionDeserializerRequest) SetDisabledFields(disabledFields []interface{}) { + f.DisabledFields = disabledFields + f.require(fieldPermissionDeserializerRequestFieldDisabledFields) +} + func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler FieldPermissionDeserializerRequest var value unmarshaler @@ -1635,6 +2492,17 @@ func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (f *FieldPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed FieldPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*f), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (f *FieldPermissionDeserializerRequest) String() string { if len(f.rawJSON) > 0 { if value, err := internal.StringifyJSON(f.rawJSON); err == nil { @@ -1687,11 +2555,20 @@ func (f FieldTypeEnum) Ptr() *FieldTypeEnum { return &f } +var ( + individualCommonModelScopeDeserializerRequestFieldModelName = big.NewInt(1 << 0) + individualCommonModelScopeDeserializerRequestFieldModelPermissions = big.NewInt(1 << 1) + individualCommonModelScopeDeserializerRequestFieldFieldPermissions = big.NewInt(1 << 2) +) + type IndividualCommonModelScopeDeserializerRequest struct { ModelName string `json:"model_name" url:"model_name"` ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty" url:"model_permissions,omitempty"` FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty" url:"field_permissions,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1721,6 +2598,34 @@ func (i *IndividualCommonModelScopeDeserializerRequest) GetExtraProperties() map return i.extraProperties } +func (i *IndividualCommonModelScopeDeserializerRequest) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelName(modelName string) { + i.ModelName = modelName + i.require(individualCommonModelScopeDeserializerRequestFieldModelName) +} + +// SetModelPermissions sets the ModelPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetModelPermissions(modelPermissions map[string]*ModelPermissionDeserializerRequest) { + i.ModelPermissions = modelPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldModelPermissions) +} + +// SetFieldPermissions sets the FieldPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *IndividualCommonModelScopeDeserializerRequest) SetFieldPermissions(fieldPermissions *FieldPermissionDeserializerRequest) { + i.FieldPermissions = fieldPermissions + i.require(individualCommonModelScopeDeserializerRequestFieldFieldPermissions) +} + func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler IndividualCommonModelScopeDeserializerRequest var value unmarshaler @@ -1737,6 +2642,17 @@ func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byt return nil } +func (i *IndividualCommonModelScopeDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed IndividualCommonModelScopeDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *IndividualCommonModelScopeDeserializerRequest) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -1789,11 +2705,20 @@ func (i ItemFormatEnum) Ptr() *ItemFormatEnum { return &i } +var ( + itemSchemaFieldItemType = big.NewInt(1 << 0) + itemSchemaFieldItemFormat = big.NewInt(1 << 1) + itemSchemaFieldItemChoices = big.NewInt(1 << 2) +) + type ItemSchema struct { ItemType *ItemTypeEnum `json:"item_type,omitempty" url:"item_type,omitempty"` ItemFormat *ItemFormatEnum `json:"item_format,omitempty" url:"item_format,omitempty"` ItemChoices []string `json:"item_choices,omitempty" url:"item_choices,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1823,6 +2748,34 @@ func (i *ItemSchema) GetExtraProperties() map[string]interface{} { return i.extraProperties } +func (i *ItemSchema) require(field *big.Int) { + if i.explicitFields == nil { + i.explicitFields = big.NewInt(0) + } + i.explicitFields.Or(i.explicitFields, field) +} + +// SetItemType sets the ItemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemSchema) SetItemType(itemType *ItemTypeEnum) { + i.ItemType = itemType + i.require(itemSchemaFieldItemType) +} + +// SetItemFormat sets the ItemFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemSchema) SetItemFormat(itemFormat *ItemFormatEnum) { + i.ItemFormat = itemFormat + i.require(itemSchemaFieldItemFormat) +} + +// SetItemChoices sets the ItemChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemSchema) SetItemChoices(itemChoices []string) { + i.ItemChoices = itemChoices + i.require(itemSchemaFieldItemChoices) +} + func (i *ItemSchema) UnmarshalJSON(data []byte) error { type unmarshaler ItemSchema var value unmarshaler @@ -1839,6 +2792,17 @@ func (i *ItemSchema) UnmarshalJSON(data []byte) error { return nil } +func (i *ItemSchema) MarshalJSON() ([]byte, error) { + type embed ItemSchema + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (i *ItemSchema) String() string { if len(i.rawJSON) > 0 { if value, err := internal.StringifyJSON(i.rawJSON); err == nil { @@ -1931,10 +2895,18 @@ func (l LastSyncResultEnum) Ptr() *LastSyncResultEnum { return &l } +var ( + linkedAccountStatusFieldLinkedAccountStatus = big.NewInt(1 << 0) + linkedAccountStatusFieldCanMakeRequest = big.NewInt(1 << 1) +) + type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status" url:"linked_account_status"` CanMakeRequest bool `json:"can_make_request" url:"can_make_request"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -1957,6 +2929,27 @@ func (l *LinkedAccountStatus) GetExtraProperties() map[string]interface{} { return l.extraProperties } +func (l *LinkedAccountStatus) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLinkedAccountStatus sets the LinkedAccountStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetLinkedAccountStatus(linkedAccountStatus string) { + l.LinkedAccountStatus = linkedAccountStatus + l.require(linkedAccountStatusFieldLinkedAccountStatus) +} + +// SetCanMakeRequest sets the CanMakeRequest field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LinkedAccountStatus) SetCanMakeRequest(canMakeRequest bool) { + l.CanMakeRequest = canMakeRequest + l.require(linkedAccountStatusFieldCanMakeRequest) +} + func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { type unmarshaler LinkedAccountStatus var value unmarshaler @@ -1973,6 +2966,17 @@ func (l *LinkedAccountStatus) UnmarshalJSON(data []byte) error { return nil } +func (l *LinkedAccountStatus) MarshalJSON() ([]byte, error) { + type embed LinkedAccountStatus + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (l *LinkedAccountStatus) String() string { if len(l.rawJSON) > 0 { if value, err := internal.StringifyJSON(l.rawJSON); err == nil { @@ -1985,6 +2989,14 @@ func (l *LinkedAccountStatus) String() string { return fmt.Sprintf("%#v", l) } +var ( + metaResponseFieldRequestSchema = big.NewInt(1 << 0) + metaResponseFieldRemoteFieldClasses = big.NewInt(1 << 1) + metaResponseFieldStatus = big.NewInt(1 << 2) + metaResponseFieldHasConditionalParams = big.NewInt(1 << 3) + metaResponseFieldHasRequiredLinkedAccountParams = big.NewInt(1 << 4) +) + type MetaResponse struct { RequestSchema map[string]interface{} `json:"request_schema" url:"request_schema"` RemoteFieldClasses map[string]interface{} `json:"remote_field_classes,omitempty" url:"remote_field_classes,omitempty"` @@ -1992,6 +3004,9 @@ type MetaResponse struct { HasConditionalParams bool `json:"has_conditional_params" url:"has_conditional_params"` HasRequiredLinkedAccountParams bool `json:"has_required_linked_account_params" url:"has_required_linked_account_params"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2035,6 +3050,48 @@ func (m *MetaResponse) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *MetaResponse) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetRequestSchema sets the RequestSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRequestSchema(requestSchema map[string]interface{}) { + m.RequestSchema = requestSchema + m.require(metaResponseFieldRequestSchema) +} + +// SetRemoteFieldClasses sets the RemoteFieldClasses field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetRemoteFieldClasses(remoteFieldClasses map[string]interface{}) { + m.RemoteFieldClasses = remoteFieldClasses + m.require(metaResponseFieldRemoteFieldClasses) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetStatus(status *LinkedAccountStatus) { + m.Status = status + m.require(metaResponseFieldStatus) +} + +// SetHasConditionalParams sets the HasConditionalParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasConditionalParams(hasConditionalParams bool) { + m.HasConditionalParams = hasConditionalParams + m.require(metaResponseFieldHasConditionalParams) +} + +// SetHasRequiredLinkedAccountParams sets the HasRequiredLinkedAccountParams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MetaResponse) SetHasRequiredLinkedAccountParams(hasRequiredLinkedAccountParams bool) { + m.HasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams + m.require(metaResponseFieldHasRequiredLinkedAccountParams) +} + func (m *MetaResponse) UnmarshalJSON(data []byte) error { type unmarshaler MetaResponse var value unmarshaler @@ -2051,6 +3108,17 @@ func (m *MetaResponse) UnmarshalJSON(data []byte) error { return nil } +func (m *MetaResponse) MarshalJSON() ([]byte, error) { + type embed MetaResponse + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MetaResponse) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -2113,12 +3181,22 @@ func (m MethodEnum) Ptr() *MethodEnum { // // ### Usage Example // View what operations are supported for the `Candidate` endpoint. +var ( + modelOperationFieldModelName = big.NewInt(1 << 0) + modelOperationFieldAvailableOperations = big.NewInt(1 << 1) + modelOperationFieldRequiredPostParameters = big.NewInt(1 << 2) + modelOperationFieldSupportedFields = big.NewInt(1 << 3) +) + type ModelOperation struct { ModelName string `json:"model_name" url:"model_name"` AvailableOperations []string `json:"available_operations" url:"available_operations"` RequiredPostParameters []string `json:"required_post_parameters" url:"required_post_parameters"` SupportedFields []string `json:"supported_fields" url:"supported_fields"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2155,6 +3233,41 @@ func (m *ModelOperation) GetExtraProperties() map[string]interface{} { return m.extraProperties } +func (m *ModelOperation) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetModelName(modelName string) { + m.ModelName = modelName + m.require(modelOperationFieldModelName) +} + +// SetAvailableOperations sets the AvailableOperations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetAvailableOperations(availableOperations []string) { + m.AvailableOperations = availableOperations + m.require(modelOperationFieldAvailableOperations) +} + +// SetRequiredPostParameters sets the RequiredPostParameters field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetRequiredPostParameters(requiredPostParameters []string) { + m.RequiredPostParameters = requiredPostParameters + m.require(modelOperationFieldRequiredPostParameters) +} + +// SetSupportedFields sets the SupportedFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelOperation) SetSupportedFields(supportedFields []string) { + m.SupportedFields = supportedFields + m.require(modelOperationFieldSupportedFields) +} + func (m *ModelOperation) UnmarshalJSON(data []byte) error { type unmarshaler ModelOperation var value unmarshaler @@ -2171,6 +3284,17 @@ func (m *ModelOperation) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelOperation) MarshalJSON() ([]byte, error) { + type embed ModelOperation + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelOperation) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -2183,9 +3307,16 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +var ( + modelPermissionDeserializerRequestFieldIsEnabled = big.NewInt(1 << 0) +) + type ModelPermissionDeserializerRequest struct { IsEnabled *bool `json:"is_enabled,omitempty" url:"is_enabled,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2201,6 +3332,20 @@ func (m *ModelPermissionDeserializerRequest) GetExtraProperties() map[string]int return m.extraProperties } +func (m *ModelPermissionDeserializerRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetIsEnabled sets the IsEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ModelPermissionDeserializerRequest) SetIsEnabled(isEnabled *bool) { + m.IsEnabled = isEnabled + m.require(modelPermissionDeserializerRequestFieldIsEnabled) +} + func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { type unmarshaler ModelPermissionDeserializerRequest var value unmarshaler @@ -2217,6 +3362,17 @@ func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *ModelPermissionDeserializerRequest) MarshalJSON() ([]byte, error) { + type embed ModelPermissionDeserializerRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *ModelPermissionDeserializerRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -2235,6 +3391,14 @@ func (m *ModelPermissionDeserializerRequest) String() string { // // ### Usage Example // Create a `MultipartFormField` to define a multipart form entry. +var ( + multipartFormFieldRequestFieldName = big.NewInt(1 << 0) + multipartFormFieldRequestFieldData = big.NewInt(1 << 1) + multipartFormFieldRequestFieldEncoding = big.NewInt(1 << 2) + multipartFormFieldRequestFieldFileName = big.NewInt(1 << 3) + multipartFormFieldRequestFieldContentType = big.NewInt(1 << 4) +) + type MultipartFormFieldRequest struct { // The name of the form field Name string `json:"name" url:"name"` @@ -2251,6 +3415,9 @@ type MultipartFormFieldRequest struct { // The MIME type of the file, if the field is for a file. ContentType *string `json:"content_type,omitempty" url:"content_type,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2294,6 +3461,48 @@ func (m *MultipartFormFieldRequest) GetExtraProperties() map[string]interface{} return m.extraProperties } +func (m *MultipartFormFieldRequest) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetName(name string) { + m.Name = name + m.require(multipartFormFieldRequestFieldName) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetData(data string) { + m.Data = data + m.require(multipartFormFieldRequestFieldData) +} + +// SetEncoding sets the Encoding field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetEncoding(encoding *MultipartFormFieldRequestEncoding) { + m.Encoding = encoding + m.require(multipartFormFieldRequestFieldEncoding) +} + +// SetFileName sets the FileName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetFileName(fileName *string) { + m.FileName = fileName + m.require(multipartFormFieldRequestFieldFileName) +} + +// SetContentType sets the ContentType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MultipartFormFieldRequest) SetContentType(contentType *string) { + m.ContentType = contentType + m.require(multipartFormFieldRequestFieldContentType) +} + func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { type unmarshaler MultipartFormFieldRequest var value unmarshaler @@ -2310,6 +3519,17 @@ func (m *MultipartFormFieldRequest) UnmarshalJSON(data []byte) error { return nil } +func (m *MultipartFormFieldRequest) MarshalJSON() ([]byte, error) { + type embed MultipartFormFieldRequest + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (m *MultipartFormFieldRequest) String() string { if len(m.rawJSON) > 0 { if value, err := internal.StringifyJSON(m.rawJSON); err == nil { @@ -2389,11 +3609,20 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq return fmt.Errorf("type %T does not include a non-empty union type", m) } +var ( + paginatedUserListFieldNext = big.NewInt(1 << 0) + paginatedUserListFieldPrevious = big.NewInt(1 << 1) + paginatedUserListFieldResults = big.NewInt(1 << 2) +) + type PaginatedUserList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*User `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2423,6 +3652,34 @@ func (p *PaginatedUserList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedUserList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedUserList) SetNext(next *string) { + p.Next = next + p.require(paginatedUserListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedUserList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedUserListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedUserList) SetResults(results []*User) { + p.Results = results + p.require(paginatedUserListFieldResults) +} + func (p *PaginatedUserList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedUserList var value unmarshaler @@ -2439,6 +3696,17 @@ func (p *PaginatedUserList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedUserList) MarshalJSON() ([]byte, error) { + type embed PaginatedUserList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedUserList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -2451,11 +3719,20 @@ func (p *PaginatedUserList) String() string { return fmt.Sprintf("%#v", p) } +var ( + paginatedViewerListFieldNext = big.NewInt(1 << 0) + paginatedViewerListFieldPrevious = big.NewInt(1 << 1) + paginatedViewerListFieldResults = big.NewInt(1 << 2) +) + type PaginatedViewerList struct { Next *string `json:"next,omitempty" url:"next,omitempty"` Previous *string `json:"previous,omitempty" url:"previous,omitempty"` Results []*Viewer `json:"results,omitempty" url:"results,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2485,6 +3762,34 @@ func (p *PaginatedViewerList) GetExtraProperties() map[string]interface{} { return p.extraProperties } +func (p *PaginatedViewerList) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetNext sets the Next field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedViewerList) SetNext(next *string) { + p.Next = next + p.require(paginatedViewerListFieldNext) +} + +// SetPrevious sets the Previous field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedViewerList) SetPrevious(previous *string) { + p.Previous = previous + p.require(paginatedViewerListFieldPrevious) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PaginatedViewerList) SetResults(results []*Viewer) { + p.Results = results + p.require(paginatedViewerListFieldResults) +} + func (p *PaginatedViewerList) UnmarshalJSON(data []byte) error { type unmarshaler PaginatedViewerList var value unmarshaler @@ -2501,6 +3806,17 @@ func (p *PaginatedViewerList) UnmarshalJSON(data []byte) error { return nil } +func (p *PaginatedViewerList) MarshalJSON() ([]byte, error) { + type embed PaginatedViewerList + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (p *PaginatedViewerList) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { @@ -2551,11 +3867,19 @@ func (p PriorityEnum) Ptr() *PriorityEnum { // // ### Usage Example // TODO +var ( + remoteDataFieldPath = big.NewInt(1 << 0) + remoteDataFieldData = big.NewInt(1 << 1) +) + type RemoteData struct { // The third-party API path that is being called. Path string `json:"path" url:"path"` Data interface{} `json:"data,omitempty" url:"data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2578,6 +3902,27 @@ func (r *RemoteData) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteData) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetPath(path string) { + r.Path = path + r.require(remoteDataFieldPath) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteData) SetData(data interface{}) { + r.Data = data + r.require(remoteDataFieldData) +} + func (r *RemoteData) UnmarshalJSON(data []byte) error { type unmarshaler RemoteData var value unmarshaler @@ -2594,6 +3939,17 @@ func (r *RemoteData) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteData) MarshalJSON() ([]byte, error) { + type embed RemoteData + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteData) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -2606,10 +3962,18 @@ func (r *RemoteData) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldFieldRemoteFieldClass = big.NewInt(1 << 0) + remoteFieldFieldValue = big.NewInt(1 << 1) +) + type RemoteField struct { RemoteFieldClass *RemoteFieldRemoteFieldClass `json:"remote_field_class" url:"remote_field_class"` Value interface{} `json:"value,omitempty" url:"value,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2632,6 +3996,27 @@ func (r *RemoteField) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteField) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetRemoteFieldClass sets the RemoteFieldClass field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteField) SetRemoteFieldClass(remoteFieldClass *RemoteFieldRemoteFieldClass) { + r.RemoteFieldClass = remoteFieldClass + r.require(remoteFieldFieldRemoteFieldClass) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteField) SetValue(value interface{}) { + r.Value = value + r.require(remoteFieldFieldValue) +} + func (r *RemoteField) UnmarshalJSON(data []byte) error { type unmarshaler RemoteField var value unmarshaler @@ -2648,6 +4033,17 @@ func (r *RemoteField) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteField) MarshalJSON() ([]byte, error) { + type embed RemoteField + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteField) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -2660,17 +4056,35 @@ func (r *RemoteField) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldClassFieldId = big.NewInt(1 << 0) + remoteFieldClassFieldDisplayName = big.NewInt(1 << 1) + remoteFieldClassFieldRemoteKeyName = big.NewInt(1 << 2) + remoteFieldClassFieldDescription = big.NewInt(1 << 3) + remoteFieldClassFieldIsCustom = big.NewInt(1 << 4) + remoteFieldClassFieldIsCommonModelField = big.NewInt(1 << 5) + remoteFieldClassFieldIsRequired = big.NewInt(1 << 6) + remoteFieldClassFieldFieldType = big.NewInt(1 << 7) + remoteFieldClassFieldFieldFormat = big.NewInt(1 << 8) + remoteFieldClassFieldFieldChoices = big.NewInt(1 << 9) + remoteFieldClassFieldItemSchema = big.NewInt(1 << 10) +) + type RemoteFieldClass struct { - Id *string `json:"id,omitempty" url:"id,omitempty"` - DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` - RemoteKeyName *string `json:"remote_key_name,omitempty" url:"remote_key_name,omitempty"` - Description *string `json:"description,omitempty" url:"description,omitempty"` - IsCustom *bool `json:"is_custom,omitempty" url:"is_custom,omitempty"` - IsRequired *bool `json:"is_required,omitempty" url:"is_required,omitempty"` - FieldType *FieldTypeEnum `json:"field_type,omitempty" url:"field_type,omitempty"` - FieldFormat *FieldFormatEnum `json:"field_format,omitempty" url:"field_format,omitempty"` - FieldChoices []*RemoteFieldClassFieldChoicesItem `json:"field_choices,omitempty" url:"field_choices,omitempty"` - ItemSchema *ItemSchema `json:"item_schema,omitempty" url:"item_schema,omitempty"` + Id *string `json:"id,omitempty" url:"id,omitempty"` + DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` + RemoteKeyName *string `json:"remote_key_name,omitempty" url:"remote_key_name,omitempty"` + Description *string `json:"description,omitempty" url:"description,omitempty"` + IsCustom *bool `json:"is_custom,omitempty" url:"is_custom,omitempty"` + IsCommonModelField *bool `json:"is_common_model_field,omitempty" url:"is_common_model_field,omitempty"` + IsRequired *bool `json:"is_required,omitempty" url:"is_required,omitempty"` + FieldType *FieldTypeEnum `json:"field_type,omitempty" url:"field_type,omitempty"` + FieldFormat *FieldFormatEnum `json:"field_format,omitempty" url:"field_format,omitempty"` + FieldChoices []*RemoteFieldClassFieldChoicesItem `json:"field_choices,omitempty" url:"field_choices,omitempty"` + ItemSchema *ItemSchema `json:"item_schema,omitempty" url:"item_schema,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` extraProperties map[string]interface{} rawJSON json.RawMessage @@ -2711,6 +4125,13 @@ func (r *RemoteFieldClass) GetIsCustom() *bool { return r.IsCustom } +func (r *RemoteFieldClass) GetIsCommonModelField() *bool { + if r == nil { + return nil + } + return r.IsCommonModelField +} + func (r *RemoteFieldClass) GetIsRequired() *bool { if r == nil { return nil @@ -2750,6 +4171,90 @@ func (r *RemoteFieldClass) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteFieldClass) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetId(id *string) { + r.Id = id + r.require(remoteFieldClassFieldId) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetDisplayName(displayName *string) { + r.DisplayName = displayName + r.require(remoteFieldClassFieldDisplayName) +} + +// SetRemoteKeyName sets the RemoteKeyName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetRemoteKeyName(remoteKeyName *string) { + r.RemoteKeyName = remoteKeyName + r.require(remoteFieldClassFieldRemoteKeyName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetDescription(description *string) { + r.Description = description + r.require(remoteFieldClassFieldDescription) +} + +// SetIsCustom sets the IsCustom field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetIsCustom(isCustom *bool) { + r.IsCustom = isCustom + r.require(remoteFieldClassFieldIsCustom) +} + +// SetIsCommonModelField sets the IsCommonModelField field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetIsCommonModelField(isCommonModelField *bool) { + r.IsCommonModelField = isCommonModelField + r.require(remoteFieldClassFieldIsCommonModelField) +} + +// SetIsRequired sets the IsRequired field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetIsRequired(isRequired *bool) { + r.IsRequired = isRequired + r.require(remoteFieldClassFieldIsRequired) +} + +// SetFieldType sets the FieldType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetFieldType(fieldType *FieldTypeEnum) { + r.FieldType = fieldType + r.require(remoteFieldClassFieldFieldType) +} + +// SetFieldFormat sets the FieldFormat field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetFieldFormat(fieldFormat *FieldFormatEnum) { + r.FieldFormat = fieldFormat + r.require(remoteFieldClassFieldFieldFormat) +} + +// SetFieldChoices sets the FieldChoices field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetFieldChoices(fieldChoices []*RemoteFieldClassFieldChoicesItem) { + r.FieldChoices = fieldChoices + r.require(remoteFieldClassFieldFieldChoices) +} + +// SetItemSchema sets the ItemSchema field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClass) SetItemSchema(itemSchema *ItemSchema) { + r.ItemSchema = itemSchema + r.require(remoteFieldClassFieldItemSchema) +} + func (r *RemoteFieldClass) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldClass var value unmarshaler @@ -2766,6 +4271,17 @@ func (r *RemoteFieldClass) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldClass) MarshalJSON() ([]byte, error) { + type embed RemoteFieldClass + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldClass) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -2778,10 +4294,18 @@ func (r *RemoteFieldClass) String() string { return fmt.Sprintf("%#v", r) } +var ( + remoteFieldClassFieldChoicesItemFieldValue = big.NewInt(1 << 0) + remoteFieldClassFieldChoicesItemFieldDisplayName = big.NewInt(1 << 1) +) + type RemoteFieldClassFieldChoicesItem struct { Value interface{} `json:"value,omitempty" url:"value,omitempty"` DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2804,6 +4328,27 @@ func (r *RemoteFieldClassFieldChoicesItem) GetExtraProperties() map[string]inter return r.extraProperties } +func (r *RemoteFieldClassFieldChoicesItem) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassFieldChoicesItem) SetValue(value interface{}) { + r.Value = value + r.require(remoteFieldClassFieldChoicesItemFieldValue) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteFieldClassFieldChoicesItem) SetDisplayName(displayName *string) { + r.DisplayName = displayName + r.require(remoteFieldClassFieldChoicesItemFieldDisplayName) +} + func (r *RemoteFieldClassFieldChoicesItem) UnmarshalJSON(data []byte) error { type unmarshaler RemoteFieldClassFieldChoicesItem var value unmarshaler @@ -2820,6 +4365,17 @@ func (r *RemoteFieldClassFieldChoicesItem) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteFieldClassFieldChoicesItem) MarshalJSON() ([]byte, error) { + type embed RemoteFieldClassFieldChoicesItem + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteFieldClassFieldChoicesItem) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -2900,10 +4456,18 @@ func (r *RemoteFieldRemoteFieldClass) Accept(visitor RemoteFieldRemoteFieldClass // // ### Usage Example // Post a `GenerateRemoteKey` to receive a new `RemoteKey`. +var ( + remoteKeyFieldName = big.NewInt(1 << 0) + remoteKeyFieldKey = big.NewInt(1 << 1) +) + type RemoteKey struct { Name string `json:"name" url:"name"` Key string `json:"key" url:"key"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -2926,6 +4490,27 @@ func (r *RemoteKey) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteKey) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetName(name string) { + r.Name = name + r.require(remoteKeyFieldName) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteKey) SetKey(key string) { + r.Key = key + r.require(remoteKeyFieldKey) +} + func (r *RemoteKey) UnmarshalJSON(data []byte) error { type unmarshaler RemoteKey var value unmarshaler @@ -2937,9 +4522,20 @@ func (r *RemoteKey) UnmarshalJSON(data []byte) error { if err != nil { return err } - r.extraProperties = extraProperties - r.rawJSON = json.RawMessage(data) - return nil + r.extraProperties = extraProperties + r.rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteKey) MarshalJSON() ([]byte, error) { + type embed RemoteKey + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) } func (r *RemoteKey) String() string { @@ -2960,6 +4556,16 @@ func (r *RemoteKey) String() string { // // ### Usage Example // View the `RemoteResponse` returned from your `DataPassthrough`. +var ( + remoteResponseFieldMethod = big.NewInt(1 << 0) + remoteResponseFieldPath = big.NewInt(1 << 1) + remoteResponseFieldStatus = big.NewInt(1 << 2) + remoteResponseFieldResponse = big.NewInt(1 << 3) + remoteResponseFieldResponseHeaders = big.NewInt(1 << 4) + remoteResponseFieldResponseType = big.NewInt(1 << 5) + remoteResponseFieldHeaders = big.NewInt(1 << 6) +) + type RemoteResponse struct { Method string `json:"method" url:"method"` Path string `json:"path" url:"path"` @@ -2969,6 +4575,9 @@ type RemoteResponse struct { ResponseType *RemoteResponseResponseType `json:"response_type,omitempty" url:"response_type,omitempty"` Headers map[string]interface{} `json:"headers,omitempty" url:"headers,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3026,6 +4635,62 @@ func (r *RemoteResponse) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *RemoteResponse) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetMethod(method string) { + r.Method = method + r.require(remoteResponseFieldMethod) +} + +// SetPath sets the Path field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetPath(path string) { + r.Path = path + r.require(remoteResponseFieldPath) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetStatus(status int) { + r.Status = status + r.require(remoteResponseFieldStatus) +} + +// SetResponse sets the Response field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponse(response interface{}) { + r.Response = response + r.require(remoteResponseFieldResponse) +} + +// SetResponseHeaders sets the ResponseHeaders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseHeaders(responseHeaders map[string]interface{}) { + r.ResponseHeaders = responseHeaders + r.require(remoteResponseFieldResponseHeaders) +} + +// SetResponseType sets the ResponseType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetResponseType(responseType *RemoteResponseResponseType) { + r.ResponseType = responseType + r.require(remoteResponseFieldResponseType) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoteResponse) SetHeaders(headers map[string]interface{}) { + r.Headers = headers + r.require(remoteResponseFieldHeaders) +} + func (r *RemoteResponse) UnmarshalJSON(data []byte) error { type unmarshaler RemoteResponse var value unmarshaler @@ -3042,6 +4707,17 @@ func (r *RemoteResponse) UnmarshalJSON(data []byte) error { return nil } +func (r *RemoteResponse) MarshalJSON() ([]byte, error) { + type embed RemoteResponse + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (r *RemoteResponse) String() string { if len(r.rawJSON) > 0 { if value, err := internal.StringifyJSON(r.rawJSON); err == nil { @@ -3174,6 +4850,19 @@ func (r ResponseTypeEnum) Ptr() *ResponseTypeEnum { // // ### Usage Example // TODO +var ( + roleFieldId = big.NewInt(1 << 0) + roleFieldRemoteId = big.NewInt(1 << 1) + roleFieldCreatedAt = big.NewInt(1 << 2) + roleFieldModifiedAt = big.NewInt(1 << 3) + roleFieldName = big.NewInt(1 << 4) + roleFieldTicketActions = big.NewInt(1 << 5) + roleFieldTicketAccess = big.NewInt(1 << 6) + roleFieldRemoteWasDeleted = big.NewInt(1 << 7) + roleFieldFieldMappings = big.NewInt(1 << 8) + roleFieldRemoteData = big.NewInt(1 << 9) +) + type Role struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -3197,6 +4886,9 @@ type Role struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3275,6 +4967,83 @@ func (r *Role) GetExtraProperties() map[string]interface{} { return r.extraProperties } +func (r *Role) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetId(id *string) { + r.Id = id + r.require(roleFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetRemoteId(remoteId *string) { + r.RemoteId = remoteId + r.require(roleFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetCreatedAt(createdAt *time.Time) { + r.CreatedAt = createdAt + r.require(roleFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetModifiedAt(modifiedAt *time.Time) { + r.ModifiedAt = modifiedAt + r.require(roleFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetName(name *string) { + r.Name = name + r.require(roleFieldName) +} + +// SetTicketActions sets the TicketActions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetTicketActions(ticketActions []*RoleTicketActionsItem) { + r.TicketActions = ticketActions + r.require(roleFieldTicketActions) +} + +// SetTicketAccess sets the TicketAccess field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetTicketAccess(ticketAccess *RoleTicketAccess) { + r.TicketAccess = ticketAccess + r.require(roleFieldTicketAccess) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetRemoteWasDeleted(remoteWasDeleted *bool) { + r.RemoteWasDeleted = remoteWasDeleted + r.require(roleFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetFieldMappings(fieldMappings map[string]interface{}) { + r.FieldMappings = fieldMappings + r.require(roleFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *Role) SetRemoteData(remoteData []*RemoteData) { + r.RemoteData = remoteData + r.require(roleFieldRemoteData) +} + func (r *Role) UnmarshalJSON(data []byte) error { type embed Role var unmarshaler = struct { @@ -3310,7 +5079,8 @@ func (r *Role) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(r.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(r.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) } func (r *Role) String() string { @@ -3524,6 +5294,18 @@ func (s StatusFd5Enum) Ptr() *StatusFd5Enum { // // ### Usage Example // View the `SyncStatus` for an account to see how recently its models were synced. +var ( + syncStatusFieldModelName = big.NewInt(1 << 0) + syncStatusFieldModelId = big.NewInt(1 << 1) + syncStatusFieldLastSyncStart = big.NewInt(1 << 2) + syncStatusFieldNextSyncStart = big.NewInt(1 << 3) + syncStatusFieldLastSyncResult = big.NewInt(1 << 4) + syncStatusFieldLastSyncFinished = big.NewInt(1 << 5) + syncStatusFieldStatus = big.NewInt(1 << 6) + syncStatusFieldIsInitialSync = big.NewInt(1 << 7) + syncStatusFieldSelectiveSyncConfigurationsUsage = big.NewInt(1 << 8) +) + type SyncStatus struct { ModelName string `json:"model_name" url:"model_name"` ModelId string `json:"model_id" url:"model_id"` @@ -3535,6 +5317,9 @@ type SyncStatus struct { IsInitialSync bool `json:"is_initial_sync" url:"is_initial_sync"` SelectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum `json:"selective_sync_configurations_usage,omitempty" url:"selective_sync_configurations_usage,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3606,6 +5391,76 @@ func (s *SyncStatus) GetExtraProperties() map[string]interface{} { return s.extraProperties } +func (s *SyncStatus) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetModelName sets the ModelName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelName(modelName string) { + s.ModelName = modelName + s.require(syncStatusFieldModelName) +} + +// SetModelId sets the ModelId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetModelId(modelId string) { + s.ModelId = modelId + s.require(syncStatusFieldModelId) +} + +// SetLastSyncStart sets the LastSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncStart(lastSyncStart *time.Time) { + s.LastSyncStart = lastSyncStart + s.require(syncStatusFieldLastSyncStart) +} + +// SetNextSyncStart sets the NextSyncStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetNextSyncStart(nextSyncStart *time.Time) { + s.NextSyncStart = nextSyncStart + s.require(syncStatusFieldNextSyncStart) +} + +// SetLastSyncResult sets the LastSyncResult field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncResult(lastSyncResult *SyncStatusLastSyncResult) { + s.LastSyncResult = lastSyncResult + s.require(syncStatusFieldLastSyncResult) +} + +// SetLastSyncFinished sets the LastSyncFinished field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetLastSyncFinished(lastSyncFinished *time.Time) { + s.LastSyncFinished = lastSyncFinished + s.require(syncStatusFieldLastSyncFinished) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetStatus(status *SyncStatusStatus) { + s.Status = status + s.require(syncStatusFieldStatus) +} + +// SetIsInitialSync sets the IsInitialSync field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetIsInitialSync(isInitialSync bool) { + s.IsInitialSync = isInitialSync + s.require(syncStatusFieldIsInitialSync) +} + +// SetSelectiveSyncConfigurationsUsage sets the SelectiveSyncConfigurationsUsage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SyncStatus) SetSelectiveSyncConfigurationsUsage(selectiveSyncConfigurationsUsage *SelectiveSyncConfigurationsUsageEnum) { + s.SelectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage + s.require(syncStatusFieldSelectiveSyncConfigurationsUsage) +} + func (s *SyncStatus) UnmarshalJSON(data []byte) error { type embed SyncStatus var unmarshaler = struct { @@ -3645,7 +5500,8 @@ func (s *SyncStatus) MarshalJSON() ([]byte, error) { NextSyncStart: internal.NewOptionalDateTime(s.NextSyncStart), LastSyncFinished: internal.NewOptionalDateTime(s.LastSyncFinished), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } func (s *SyncStatus) String() string { @@ -3790,6 +5646,18 @@ func (s *SyncStatusStatus) Accept(visitor SyncStatusStatusVisitor) error { // // ### Usage Example // TODO +var ( + teamFieldId = big.NewInt(1 << 0) + teamFieldRemoteId = big.NewInt(1 << 1) + teamFieldCreatedAt = big.NewInt(1 << 2) + teamFieldModifiedAt = big.NewInt(1 << 3) + teamFieldName = big.NewInt(1 << 4) + teamFieldDescription = big.NewInt(1 << 5) + teamFieldRemoteWasDeleted = big.NewInt(1 << 6) + teamFieldFieldMappings = big.NewInt(1 << 7) + teamFieldRemoteData = big.NewInt(1 << 8) +) + type Team struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -3807,6 +5675,9 @@ type Team struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -3878,6 +5749,76 @@ func (t *Team) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *Team) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetId(id *string) { + t.Id = id + t.require(teamFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(teamFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(teamFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(teamFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetName(name *string) { + t.Name = name + t.require(teamFieldName) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetDescription(description *string) { + t.Description = description + t.require(teamFieldDescription) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(teamFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(teamFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Team) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(teamFieldRemoteData) +} + func (t *Team) UnmarshalJSON(data []byte) error { type embed Team var unmarshaler = struct { @@ -3913,7 +5854,8 @@ func (t *Team) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(t.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(t.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *Team) String() string { @@ -3933,6 +5875,38 @@ func (t *Team) String() string { // The `Ticket` object is used to represent a ticket, issue, task or case. // ### Usage Example // TODO +var ( + ticketFieldId = big.NewInt(1 << 0) + ticketFieldRemoteId = big.NewInt(1 << 1) + ticketFieldCreatedAt = big.NewInt(1 << 2) + ticketFieldModifiedAt = big.NewInt(1 << 3) + ticketFieldName = big.NewInt(1 << 4) + ticketFieldAssignees = big.NewInt(1 << 5) + ticketFieldAssignedTeams = big.NewInt(1 << 6) + ticketFieldCreator = big.NewInt(1 << 7) + ticketFieldDueDate = big.NewInt(1 << 8) + ticketFieldStatus = big.NewInt(1 << 9) + ticketFieldDescription = big.NewInt(1 << 10) + ticketFieldCollections = big.NewInt(1 << 11) + ticketFieldTicketType = big.NewInt(1 << 12) + ticketFieldAccount = big.NewInt(1 << 13) + ticketFieldContact = big.NewInt(1 << 14) + ticketFieldParentTicket = big.NewInt(1 << 15) + ticketFieldAttachments = big.NewInt(1 << 16) + ticketFieldAccessLevel = big.NewInt(1 << 17) + ticketFieldTags = big.NewInt(1 << 18) + ticketFieldRoles = big.NewInt(1 << 19) + ticketFieldTicketUrl = big.NewInt(1 << 20) + ticketFieldPriority = big.NewInt(1 << 21) + ticketFieldRemoteCreatedAt = big.NewInt(1 << 22) + ticketFieldRemoteUpdatedAt = big.NewInt(1 << 23) + ticketFieldCompletedAt = big.NewInt(1 << 24) + ticketFieldRemoteWasDeleted = big.NewInt(1 << 25) + ticketFieldFieldMappings = big.NewInt(1 << 26) + ticketFieldRemoteData = big.NewInt(1 << 27) + ticketFieldRemoteFields = big.NewInt(1 << 28) +) + type Ticket struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -4001,6 +5975,9 @@ type Ticket struct { RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty" url:"remote_fields,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -4212,6 +6189,216 @@ func (t *Ticket) GetExtraProperties() map[string]interface{} { return t.extraProperties } +func (t *Ticket) require(field *big.Int) { + if t.explicitFields == nil { + t.explicitFields = big.NewInt(0) + } + t.explicitFields.Or(t.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetId(id *string) { + t.Id = id + t.require(ticketFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetRemoteId(remoteId *string) { + t.RemoteId = remoteId + t.require(ticketFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetCreatedAt(createdAt *time.Time) { + t.CreatedAt = createdAt + t.require(ticketFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetModifiedAt(modifiedAt *time.Time) { + t.ModifiedAt = modifiedAt + t.require(ticketFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetName(name *string) { + t.Name = name + t.require(ticketFieldName) +} + +// SetAssignees sets the Assignees field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetAssignees(assignees []*TicketAssigneesItem) { + t.Assignees = assignees + t.require(ticketFieldAssignees) +} + +// SetAssignedTeams sets the AssignedTeams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetAssignedTeams(assignedTeams []*TicketAssignedTeamsItem) { + t.AssignedTeams = assignedTeams + t.require(ticketFieldAssignedTeams) +} + +// SetCreator sets the Creator field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetCreator(creator *TicketCreator) { + t.Creator = creator + t.require(ticketFieldCreator) +} + +// SetDueDate sets the DueDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetDueDate(dueDate *time.Time) { + t.DueDate = dueDate + t.require(ticketFieldDueDate) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetStatus(status *TicketStatus) { + t.Status = status + t.require(ticketFieldStatus) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetDescription(description *string) { + t.Description = description + t.require(ticketFieldDescription) +} + +// SetCollections sets the Collections field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetCollections(collections []*TicketCollectionsItem) { + t.Collections = collections + t.require(ticketFieldCollections) +} + +// SetTicketType sets the TicketType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetTicketType(ticketType *string) { + t.TicketType = ticketType + t.require(ticketFieldTicketType) +} + +// SetAccount sets the Account field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetAccount(account *TicketAccount) { + t.Account = account + t.require(ticketFieldAccount) +} + +// SetContact sets the Contact field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetContact(contact *TicketContact) { + t.Contact = contact + t.require(ticketFieldContact) +} + +// SetParentTicket sets the ParentTicket field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetParentTicket(parentTicket *TicketParentTicket) { + t.ParentTicket = parentTicket + t.require(ticketFieldParentTicket) +} + +// SetAttachments sets the Attachments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetAttachments(attachments []*TicketAttachmentsItem) { + t.Attachments = attachments + t.require(ticketFieldAttachments) +} + +// SetAccessLevel sets the AccessLevel field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetAccessLevel(accessLevel *TicketAccessLevel) { + t.AccessLevel = accessLevel + t.require(ticketFieldAccessLevel) +} + +// SetTags sets the Tags field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetTags(tags []*string) { + t.Tags = tags + t.require(ticketFieldTags) +} + +// SetRoles sets the Roles field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetRoles(roles []*string) { + t.Roles = roles + t.require(ticketFieldRoles) +} + +// SetTicketUrl sets the TicketUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetTicketUrl(ticketUrl *string) { + t.TicketUrl = ticketUrl + t.require(ticketFieldTicketUrl) +} + +// SetPriority sets the Priority field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetPriority(priority *TicketPriority) { + t.Priority = priority + t.require(ticketFieldPriority) +} + +// SetRemoteCreatedAt sets the RemoteCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetRemoteCreatedAt(remoteCreatedAt *time.Time) { + t.RemoteCreatedAt = remoteCreatedAt + t.require(ticketFieldRemoteCreatedAt) +} + +// SetRemoteUpdatedAt sets the RemoteUpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetRemoteUpdatedAt(remoteUpdatedAt *time.Time) { + t.RemoteUpdatedAt = remoteUpdatedAt + t.require(ticketFieldRemoteUpdatedAt) +} + +// SetCompletedAt sets the CompletedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetCompletedAt(completedAt *time.Time) { + t.CompletedAt = completedAt + t.require(ticketFieldCompletedAt) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetRemoteWasDeleted(remoteWasDeleted *bool) { + t.RemoteWasDeleted = remoteWasDeleted + t.require(ticketFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetFieldMappings(fieldMappings map[string]interface{}) { + t.FieldMappings = fieldMappings + t.require(ticketFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetRemoteData(remoteData []*RemoteData) { + t.RemoteData = remoteData + t.require(ticketFieldRemoteData) +} + +// SetRemoteFields sets the RemoteFields field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (t *Ticket) SetRemoteFields(remoteFields []*RemoteField) { + t.RemoteFields = remoteFields + t.require(ticketFieldRemoteFields) +} + func (t *Ticket) UnmarshalJSON(data []byte) error { type embed Ticket var unmarshaler = struct { @@ -4263,7 +6450,8 @@ func (t *Ticket) MarshalJSON() ([]byte, error) { RemoteUpdatedAt: internal.NewOptionalDateTime(t.RemoteUpdatedAt), CompletedAt: internal.NewOptionalDateTime(t.CompletedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, t.explicitFields) + return json.Marshal(explicitMarshaler) } func (t *Ticket) String() string { @@ -5121,6 +7309,22 @@ func (t TicketStatusEnum) Ptr() *TicketStatusEnum { // // ### Usage Example // TODO +var ( + userFieldId = big.NewInt(1 << 0) + userFieldRemoteId = big.NewInt(1 << 1) + userFieldCreatedAt = big.NewInt(1 << 2) + userFieldModifiedAt = big.NewInt(1 << 3) + userFieldName = big.NewInt(1 << 4) + userFieldEmailAddress = big.NewInt(1 << 5) + userFieldIsActive = big.NewInt(1 << 6) + userFieldTeams = big.NewInt(1 << 7) + userFieldRoles = big.NewInt(1 << 8) + userFieldAvatar = big.NewInt(1 << 9) + userFieldRemoteWasDeleted = big.NewInt(1 << 10) + userFieldFieldMappings = big.NewInt(1 << 11) + userFieldRemoteData = big.NewInt(1 << 12) +) + type User struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -5144,6 +7348,9 @@ type User struct { FieldMappings map[string]interface{} `json:"field_mappings,omitempty" url:"field_mappings,omitempty"` RemoteData []*RemoteData `json:"remote_data,omitempty" url:"remote_data,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5243,6 +7450,104 @@ func (u *User) GetExtraProperties() map[string]interface{} { return u.extraProperties } +func (u *User) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetId(id *string) { + u.Id = id + u.require(userFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteId(remoteId *string) { + u.RemoteId = remoteId + u.require(userFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetCreatedAt(createdAt *time.Time) { + u.CreatedAt = createdAt + u.require(userFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetModifiedAt(modifiedAt *time.Time) { + u.ModifiedAt = modifiedAt + u.require(userFieldModifiedAt) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetName(name *string) { + u.Name = name + u.require(userFieldName) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetEmailAddress(emailAddress *string) { + u.EmailAddress = emailAddress + u.require(userFieldEmailAddress) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetIsActive(isActive *bool) { + u.IsActive = isActive + u.require(userFieldIsActive) +} + +// SetTeams sets the Teams field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetTeams(teams []*UserTeamsItem) { + u.Teams = teams + u.require(userFieldTeams) +} + +// SetRoles sets the Roles field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRoles(roles []*UserRolesItem) { + u.Roles = roles + u.require(userFieldRoles) +} + +// SetAvatar sets the Avatar field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetAvatar(avatar *string) { + u.Avatar = avatar + u.require(userFieldAvatar) +} + +// SetRemoteWasDeleted sets the RemoteWasDeleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteWasDeleted(remoteWasDeleted *bool) { + u.RemoteWasDeleted = remoteWasDeleted + u.require(userFieldRemoteWasDeleted) +} + +// SetFieldMappings sets the FieldMappings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetFieldMappings(fieldMappings map[string]interface{}) { + u.FieldMappings = fieldMappings + u.require(userFieldFieldMappings) +} + +// SetRemoteData sets the RemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *User) SetRemoteData(remoteData []*RemoteData) { + u.RemoteData = remoteData + u.require(userFieldRemoteData) +} + func (u *User) UnmarshalJSON(data []byte) error { type embed User var unmarshaler = struct { @@ -5278,7 +7583,8 @@ func (u *User) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(u.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(u.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) } func (u *User) String() string { @@ -5417,9 +7723,16 @@ func (u *UserTeamsItem) Accept(visitor UserTeamsItemVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", u) } +var ( + validationProblemSourceFieldPointer = big.NewInt(1 << 0) +) + type ValidationProblemSource struct { Pointer string `json:"pointer" url:"pointer"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5435,6 +7748,20 @@ func (v *ValidationProblemSource) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *ValidationProblemSource) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetPointer sets the Pointer field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *ValidationProblemSource) SetPointer(pointer string) { + v.Pointer = pointer + v.require(validationProblemSourceFieldPointer) +} + func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { type unmarshaler ValidationProblemSource var value unmarshaler @@ -5451,6 +7778,17 @@ func (v *ValidationProblemSource) UnmarshalJSON(data []byte) error { return nil } +func (v *ValidationProblemSource) MarshalJSON() ([]byte, error) { + type embed ValidationProblemSource + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (v *ValidationProblemSource) String() string { if len(v.rawJSON) > 0 { if value, err := internal.StringifyJSON(v.rawJSON); err == nil { @@ -5469,6 +7807,15 @@ func (v *ValidationProblemSource) String() string { // // ### Usage Example // TODO +var ( + viewerFieldId = big.NewInt(1 << 0) + viewerFieldRemoteId = big.NewInt(1 << 1) + viewerFieldCreatedAt = big.NewInt(1 << 2) + viewerFieldModifiedAt = big.NewInt(1 << 3) + viewerFieldTeam = big.NewInt(1 << 4) + viewerFieldUser = big.NewInt(1 << 5) +) + type Viewer struct { Id *string `json:"id,omitempty" url:"id,omitempty"` // The third-party API ID of the matching object. @@ -5482,6 +7829,9 @@ type Viewer struct { // The User this Viewer belongs to. User *ViewerUser `json:"user,omitempty" url:"user,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5532,6 +7882,55 @@ func (v *Viewer) GetExtraProperties() map[string]interface{} { return v.extraProperties } +func (v *Viewer) require(field *big.Int) { + if v.explicitFields == nil { + v.explicitFields = big.NewInt(0) + } + v.explicitFields.Or(v.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *Viewer) SetId(id *string) { + v.Id = id + v.require(viewerFieldId) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *Viewer) SetRemoteId(remoteId *string) { + v.RemoteId = remoteId + v.require(viewerFieldRemoteId) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *Viewer) SetCreatedAt(createdAt *time.Time) { + v.CreatedAt = createdAt + v.require(viewerFieldCreatedAt) +} + +// SetModifiedAt sets the ModifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *Viewer) SetModifiedAt(modifiedAt *time.Time) { + v.ModifiedAt = modifiedAt + v.require(viewerFieldModifiedAt) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *Viewer) SetTeam(team *ViewerTeam) { + v.Team = team + v.require(viewerFieldTeam) +} + +// SetUser sets the User field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (v *Viewer) SetUser(user *ViewerUser) { + v.User = user + v.require(viewerFieldUser) +} + func (v *Viewer) UnmarshalJSON(data []byte) error { type embed Viewer var unmarshaler = struct { @@ -5567,7 +7966,8 @@ func (v *Viewer) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewOptionalDateTime(v.CreatedAt), ModifiedAt: internal.NewOptionalDateTime(v.ModifiedAt), } - return json.Marshal(marshaler) + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) } func (v *Viewer) String() string { @@ -5708,12 +8108,22 @@ func (v *ViewerUser) Accept(visitor ViewerUserVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", v) } +var ( + warningValidationProblemFieldSource = big.NewInt(1 << 0) + warningValidationProblemFieldTitle = big.NewInt(1 << 1) + warningValidationProblemFieldDetail = big.NewInt(1 << 2) + warningValidationProblemFieldProblemType = big.NewInt(1 << 3) +) + type WarningValidationProblem struct { Source *ValidationProblemSource `json:"source,omitempty" url:"source,omitempty"` Title string `json:"title" url:"title"` Detail string `json:"detail" url:"detail"` ProblemType string `json:"problem_type" url:"problem_type"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -5750,6 +8160,41 @@ func (w *WarningValidationProblem) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WarningValidationProblem) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetSource(source *ValidationProblemSource) { + w.Source = source + w.require(warningValidationProblemFieldSource) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetTitle(title string) { + w.Title = title + w.require(warningValidationProblemFieldTitle) +} + +// SetDetail sets the Detail field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetDetail(detail string) { + w.Detail = detail + w.require(warningValidationProblemFieldDetail) +} + +// SetProblemType sets the ProblemType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WarningValidationProblem) SetProblemType(problemType string) { + w.ProblemType = problemType + w.require(warningValidationProblemFieldProblemType) +} + func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { type unmarshaler WarningValidationProblem var value unmarshaler @@ -5766,6 +8211,17 @@ func (w *WarningValidationProblem) UnmarshalJSON(data []byte) error { return nil } +func (w *WarningValidationProblem) MarshalJSON() ([]byte, error) { + type embed WarningValidationProblem + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WarningValidationProblem) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/ticketing/users.go b/ticketing/users.go index a1b8270..92847a2 100644 --- a/ticketing/users.go +++ b/ticketing/users.go @@ -4,9 +4,26 @@ package ticketing import ( fmt "fmt" + big "math/big" time "time" ) +var ( + usersListRequestFieldCreatedAfter = big.NewInt(1 << 0) + usersListRequestFieldCreatedBefore = big.NewInt(1 << 1) + usersListRequestFieldCursor = big.NewInt(1 << 2) + usersListRequestFieldEmailAddress = big.NewInt(1 << 3) + usersListRequestFieldExpand = big.NewInt(1 << 4) + usersListRequestFieldIncludeDeletedData = big.NewInt(1 << 5) + usersListRequestFieldIncludeRemoteData = big.NewInt(1 << 6) + usersListRequestFieldIncludeShellData = big.NewInt(1 << 7) + usersListRequestFieldModifiedAfter = big.NewInt(1 << 8) + usersListRequestFieldModifiedBefore = big.NewInt(1 << 9) + usersListRequestFieldPageSize = big.NewInt(1 << 10) + usersListRequestFieldRemoteId = big.NewInt(1 << 11) + usersListRequestFieldTeam = big.NewInt(1 << 12) +) + type UsersListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-" url:"created_after,omitempty"` @@ -34,8 +51,115 @@ type UsersListRequest struct { RemoteId *string `json:"-" url:"remote_id,omitempty"` // If provided, will only return users matching in this team. Team *string `json:"-" url:"team,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UsersListRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetCreatedAfter sets the CreatedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCreatedAfter(createdAfter *time.Time) { + u.CreatedAfter = createdAfter + u.require(usersListRequestFieldCreatedAfter) +} + +// SetCreatedBefore sets the CreatedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCreatedBefore(createdBefore *time.Time) { + u.CreatedBefore = createdBefore + u.require(usersListRequestFieldCreatedBefore) +} + +// SetCursor sets the Cursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetCursor(cursor *string) { + u.Cursor = cursor + u.require(usersListRequestFieldCursor) +} + +// SetEmailAddress sets the EmailAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetEmailAddress(emailAddress *string) { + u.EmailAddress = emailAddress + u.require(usersListRequestFieldEmailAddress) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetExpand(expand []*UsersListRequestExpandItem) { + u.Expand = expand + u.require(usersListRequestFieldExpand) +} + +// SetIncludeDeletedData sets the IncludeDeletedData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeDeletedData(includeDeletedData *bool) { + u.IncludeDeletedData = includeDeletedData + u.require(usersListRequestFieldIncludeDeletedData) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeRemoteData(includeRemoteData *bool) { + u.IncludeRemoteData = includeRemoteData + u.require(usersListRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetIncludeShellData(includeShellData *bool) { + u.IncludeShellData = includeShellData + u.require(usersListRequestFieldIncludeShellData) } +// SetModifiedAfter sets the ModifiedAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetModifiedAfter(modifiedAfter *time.Time) { + u.ModifiedAfter = modifiedAfter + u.require(usersListRequestFieldModifiedAfter) +} + +// SetModifiedBefore sets the ModifiedBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetModifiedBefore(modifiedBefore *time.Time) { + u.ModifiedBefore = modifiedBefore + u.require(usersListRequestFieldModifiedBefore) +} + +// SetPageSize sets the PageSize field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetPageSize(pageSize *int) { + u.PageSize = pageSize + u.require(usersListRequestFieldPageSize) +} + +// SetRemoteId sets the RemoteId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetRemoteId(remoteId *string) { + u.RemoteId = remoteId + u.require(usersListRequestFieldRemoteId) +} + +// SetTeam sets the Team field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersListRequest) SetTeam(team *string) { + u.Team = team + u.require(usersListRequestFieldTeam) +} + +var ( + usersRetrieveRequestFieldExpand = big.NewInt(1 << 0) + usersRetrieveRequestFieldIncludeRemoteData = big.NewInt(1 << 1) + usersRetrieveRequestFieldIncludeShellData = big.NewInt(1 << 2) +) + type UsersRetrieveRequest struct { // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand []*UsersRetrieveRequestExpandItem `json:"-" url:"expand,omitempty"` @@ -43,6 +167,37 @@ type UsersRetrieveRequest struct { IncludeRemoteData *bool `json:"-" url:"include_remote_data,omitempty"` // Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). IncludeShellData *bool `json:"-" url:"include_shell_data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UsersRetrieveRequest) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetExpand sets the Expand field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetExpand(expand []*UsersRetrieveRequestExpandItem) { + u.Expand = expand + u.require(usersRetrieveRequestFieldExpand) +} + +// SetIncludeRemoteData sets the IncludeRemoteData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetIncludeRemoteData(includeRemoteData *bool) { + u.IncludeRemoteData = includeRemoteData + u.require(usersRetrieveRequestFieldIncludeRemoteData) +} + +// SetIncludeShellData sets the IncludeShellData field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsersRetrieveRequest) SetIncludeShellData(includeShellData *bool) { + u.IncludeShellData = includeShellData + u.require(usersRetrieveRequestFieldIncludeShellData) } type UsersListRequestExpandItem string diff --git a/ticketing/users/client.go b/ticketing/users/client.go index 4bfae4a..401c78f 100644 --- a/ticketing/users/client.go +++ b/ticketing/users/client.go @@ -4,7 +4,6 @@ package users import ( context "context" - fmt "fmt" core "github.com/merge-api/merge-go-client/v2/core" internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" @@ -13,22 +12,24 @@ import ( ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -37,7 +38,7 @@ func (c *Client) List( ctx context.Context, request *ticketing.UsersListRequest, opts ...option.RequestOption, -) (*core.Page[*ticketing.User], error) { +) (*core.Page[*string, *ticketing.User], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -50,13 +51,12 @@ func (c *Client) List( return nil, err } headers := internal.MergeHeaders( - c.header.Clone(), + c.options.ToHeader(), options.ToHeader(), ) - - prepareCall := func(pageRequest *internal.PageRequest[*string]) *internal.CallParams { + prepareCall := func(pageRequest *core.PageRequest[*string]) *internal.CallParams { if pageRequest.Cursor != nil { - queryParams.Set("cursor", fmt.Sprintf("%v", *pageRequest.Cursor)) + queryParams.Set("cursor", *pageRequest.Cursor) } nextURL := endpointURL if len(queryParams) > 0 { @@ -73,11 +73,11 @@ func (c *Client) List( Response: pageRequest.Response, } } - readPageResponse := func(response *ticketing.PaginatedUserList) *internal.PageResponse[*string, *ticketing.User] { + readPageResponse := func(response *ticketing.PaginatedUserList) *core.PageResponse[*string, *ticketing.User] { var zeroValue *string - next := response.Next - results := response.Results - return &internal.PageResponse[*string, *ticketing.User]{ + next := response.GetNext() + results := response.GetResults() + return &core.PageResponse[*string, *ticketing.User]{ Next: next, Results: results, Done: next == zeroValue, @@ -98,43 +98,14 @@ func (c *Client) Retrieve( request *ticketing.UsersRetrieveRequest, opts ...option.RequestOption, ) (*ticketing.User, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := internal.EncodeURL( - baseURL+"/ticketing/v1/users/%v", + response, err := c.WithRawResponse.Retrieve( + ctx, id, + request, + opts..., ) - queryParams, err := internal.QueryValues(request) if err != nil { return nil, err } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *ticketing.User - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil + return response.Body, nil } diff --git a/ticketing/users/raw_client.go b/ticketing/users/raw_client.go new file mode 100644 index 0000000..b1a2766 --- /dev/null +++ b/ticketing/users/raw_client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package users + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Retrieve( + ctx context.Context, + id string, + request *ticketing.UsersRetrieveRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.User], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/ticketing/v1/users/%v", + id, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *ticketing.User + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.User]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/users/ticketing_users_test/ticketing_users_test.go b/ticketing/users/ticketing_users_test/ticketing_users_test.go new file mode 100644 index 0000000..5a4434b --- /dev/null +++ b/ticketing/users/ticketing_users_test/ticketing_users_test.go @@ -0,0 +1,156 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_users_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + merge "github.com/merge-api/merge-go-client/v2" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingUsersListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.UsersListRequest{ + CreatedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + CreatedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + Cursor: merge.String( + "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ), + EmailAddress: merge.String( + "email_address", + ), + IncludeDeletedData: merge.Bool( + true, + ), + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + ModifiedAfter: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + ModifiedBefore: merge.Time( + merge.MustParseDateTime( + "2024-01-15T09:30:00Z", + ), + ), + PageSize: merge.Int( + 1, + ), + RemoteId: merge.String( + "remote_id", + ), + Team: merge.String( + "team", + ), + } + _, invocationErr := client.Ticketing.Users.List( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/users", map[string]string{"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"}, 1) +} + +func TestTicketingUsersRetrieveWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.UsersRetrieveRequest{ + IncludeRemoteData: merge.Bool( + true, + ), + IncludeShellData: merge.Bool( + true, + ), + } + _, invocationErr := client.Ticketing.Users.Retrieve( + context.TODO(), + "id", + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/users/id", map[string]string{"include_remote_data": "true", "include_shell_data": "true"}, 1) +} diff --git a/ticketing/webhook_receivers.go b/ticketing/webhook_receivers.go index 9c2170b..9c365f1 100644 --- a/ticketing/webhook_receivers.go +++ b/ticketing/webhook_receivers.go @@ -6,19 +6,66 @@ import ( json "encoding/json" fmt "fmt" internal "github.com/merge-api/merge-go-client/v2/internal" + big "math/big" +) + +var ( + webhookReceiverRequestFieldEvent = big.NewInt(1 << 0) + webhookReceiverRequestFieldIsActive = big.NewInt(1 << 1) + webhookReceiverRequestFieldKey = big.NewInt(1 << 2) ) type WebhookReceiverRequest struct { Event string `json:"event" url:"-"` IsActive bool `json:"is_active" url:"-"` Key *string `json:"key,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (w *WebhookReceiverRequest) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverRequestFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverRequestFieldIsActive) } +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiverRequest) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverRequestFieldKey) +} + +var ( + webhookReceiverFieldEvent = big.NewInt(1 << 0) + webhookReceiverFieldIsActive = big.NewInt(1 << 1) + webhookReceiverFieldKey = big.NewInt(1 << 2) +) + type WebhookReceiver struct { Event string `json:"event" url:"event"` IsActive bool `json:"is_active" url:"is_active"` Key *string `json:"key,omitempty" url:"key,omitempty"` + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + extraProperties map[string]interface{} rawJSON json.RawMessage } @@ -48,6 +95,34 @@ func (w *WebhookReceiver) GetExtraProperties() map[string]interface{} { return w.extraProperties } +func (w *WebhookReceiver) require(field *big.Int) { + if w.explicitFields == nil { + w.explicitFields = big.NewInt(0) + } + w.explicitFields.Or(w.explicitFields, field) +} + +// SetEvent sets the Event field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetEvent(event string) { + w.Event = event + w.require(webhookReceiverFieldEvent) +} + +// SetIsActive sets the IsActive field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetIsActive(isActive bool) { + w.IsActive = isActive + w.require(webhookReceiverFieldIsActive) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (w *WebhookReceiver) SetKey(key *string) { + w.Key = key + w.require(webhookReceiverFieldKey) +} + func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { type unmarshaler WebhookReceiver var value unmarshaler @@ -64,6 +139,17 @@ func (w *WebhookReceiver) UnmarshalJSON(data []byte) error { return nil } +func (w *WebhookReceiver) MarshalJSON() ([]byte, error) { + type embed WebhookReceiver + var marshaler = struct { + embed + }{ + embed: embed(*w), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, w.explicitFields) + return json.Marshal(explicitMarshaler) +} + func (w *WebhookReceiver) String() string { if len(w.rawJSON) > 0 { if value, err := internal.StringifyJSON(w.rawJSON); err == nil { diff --git a/ticketing/webhookreceivers/client.go b/ticketing/webhookreceivers/client.go index c251417..b81bf79 100644 --- a/ticketing/webhookreceivers/client.go +++ b/ticketing/webhookreceivers/client.go @@ -8,26 +8,27 @@ import ( internal "github.com/merge-api/merge-go-client/v2/internal" option "github.com/merge-api/merge-go-client/v2/option" ticketing "github.com/merge-api/merge-go-client/v2/ticketing" - http "net/http" ) type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions baseURL string caller *internal.Caller - header http.Header } -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) +func NewClient(options *core.RequestOptions) *Client { return &Client{ - baseURL: options.BaseURL, + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, caller: internal.NewCaller( &internal.CallerParams{ Client: options.HTTPClient, MaxAttempts: options.MaxAttempts, }, ), - header: options.ToHeader(), } } @@ -36,35 +37,14 @@ func (c *Client) List( ctx context.Context, opts ...option.RequestOption, ) ([]*ticketing.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response []*ticketing.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.List( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } // Creates a `WebhookReceiver` object with the given values. @@ -73,35 +53,13 @@ func (c *Client) Create( request *ticketing.WebhookReceiverRequest, opts ...option.RequestOption, ) (*ticketing.WebhookReceiver, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/ticketing/v1/webhook-receivers" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *ticketing.WebhookReceiver - if err := c.caller.Call( + response, err := c.WithRawResponse.Create( ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { + request, + opts..., + ) + if err != nil { return nil, err } - return response, nil + return response.Body, nil } diff --git a/ticketing/webhookreceivers/raw_client.go b/ticketing/webhookreceivers/raw_client.go new file mode 100644 index 0000000..3ca33f4 --- /dev/null +++ b/ticketing/webhookreceivers/raw_client.go @@ -0,0 +1,112 @@ +// Code generated by Fern. DO NOT EDIT. + +package webhookreceivers + +import ( + context "context" + core "github.com/merge-api/merge-go-client/v2/core" + internal "github.com/merge-api/merge-go-client/v2/internal" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[[]*ticketing.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response []*ticketing.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[[]*ticketing.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *ticketing.WebhookReceiverRequest, + opts ...option.RequestOption, +) (*core.Response[*ticketing.WebhookReceiver], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := baseURL + "/ticketing/v1/webhook-receivers" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *ticketing.WebhookReceiver + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*ticketing.WebhookReceiver]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/ticketing/webhookreceivers/ticketing_webhook_receivers_test/ticketing_webhook_receivers_test.go b/ticketing/webhookreceivers/ticketing_webhook_receivers_test/ticketing_webhook_receivers_test.go new file mode 100644 index 0000000..73a7bb3 --- /dev/null +++ b/ticketing/webhookreceivers/ticketing_webhook_receivers_test/ticketing_webhook_receivers_test.go @@ -0,0 +1,103 @@ +// Code generated by Fern. DO NOT EDIT. + +package ticketing_webhook_receivers_test + +import ( + bytes "bytes" + context "context" + json "encoding/json" + client "github.com/merge-api/merge-go-client/v2/client" + option "github.com/merge-api/merge-go-client/v2/option" + ticketing "github.com/merge-api/merge-go-client/v2/ticketing" + require "github.com/stretchr/testify/require" + http "net/http" + testing "testing" +) + +func ResetWireMockRequests( + t *testing.T, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + _, err := http.Post(WiremockAdminURL+"/requests/reset", "application/json", nil) + require.NoError(t, err) +} + +func VerifyRequestCount( + t *testing.T, + method string, + urlPath string, + queryParams map[string]string, + expected int, +) { + WiremockAdminURL := "http://localhost:8080/__admin" + var reqBody bytes.Buffer + reqBody.WriteString(`{"method":"`) + reqBody.WriteString(method) + reqBody.WriteString(`","urlPath":"`) + reqBody.WriteString(urlPath) + reqBody.WriteString(`"}`) + if len(queryParams) > 0 { + reqBody.WriteString(`,"queryParameters":{`) + first := true + for key, value := range queryParams { + if !first { + reqBody.WriteString(",") + } + reqBody.WriteString(`"`) + reqBody.WriteString(key) + reqBody.WriteString(`":{"equalTo":"`) + reqBody.WriteString(value) + reqBody.WriteString(`"}`) + first = false + } + reqBody.WriteString("}") + } + resp, err := http.Post(WiremockAdminURL+"/requests/find", "application/json", &reqBody) + require.NoError(t, err) + var result struct { + Requests []interface{} `json:"requests"` + } + json.NewDecoder(resp.Body).Decode(&result) + require.Equal(t, expected, len(result.Requests)) +} + +func TestTicketingWebhookReceiversListWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + _, invocationErr := client.Ticketing.WebhookReceivers.List( + context.TODO(), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "GET", "/ticketing/v1/webhook-receivers", nil, 1) +} + +func TestTicketingWebhookReceiversCreateWithWireMock( + t *testing.T, +) { + ResetWireMockRequests(t) + WireMockBaseURL := "http://localhost:8080" + client := client.NewClient( + option.WithBaseURL( + WireMockBaseURL, + ), + ) + request := &ticketing.WebhookReceiverRequest{ + Event: "event", + IsActive: true, + } + _, invocationErr := client.Ticketing.WebhookReceivers.Create( + context.TODO(), + request, + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "POST", "/ticketing/v1/webhook-receivers", nil, 1) +} diff --git a/wiremock/docker-compose.test.yml b/wiremock/docker-compose.test.yml new file mode 100644 index 0000000..b65fc88 --- /dev/null +++ b/wiremock/docker-compose.test.yml @@ -0,0 +1,8 @@ +services: + wiremock: + image: wiremock/wiremock:3.9.1 + ports: + - "8080:8080" + volumes: + - ./wiremock-mappings.json:/home/wiremock/mappings/wiremock-mappings.json + command: ["--global-response-templating", "--verbose"] diff --git a/wiremock/wiremock-mappings.json b/wiremock/wiremock-mappings.json new file mode 100644 index 0000000..a286daf --- /dev/null +++ b/wiremock/wiremock-mappings.json @@ -0,0 +1 @@ +{"mappings":[{"id":"c02bc7b3-97e0-42e3-9270-912e20d342a8","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/account-details","method":"GET"},"response":{"status":200,"body":"{\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\",\n \"integration\": \"BambooHR\",\n \"integration_slug\": \"bamboohr\",\n \"category\": \"hris\",\n \"end_user_origin_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"end_user_organization_name\": \"Waystar Royco\",\n \"end_user_email_address\": \"kendall.roy@waystar-royco.com\",\n \"status\": \"COMPLETE\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c02bc7b3-97e0-42e3-9270-912e20d342a8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"05aa94ae-77ac-4dcc-809e-9319d01b8d30","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/account-token/{public_token}","method":"GET","pathParameters":{"public_token":{"equalTo":"public_token"}}},"response":{"status":200,"body":"{\n \"account_token\": \"T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB\",\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"05aa94ae-77ac-4dcc-809e-9319d01b8d30","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1a9c9579-0511-4b84-82a4-f7c8c53373c6","name":"list - default","request":{"urlPathTemplate":"/ats/v1/activities","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"198123\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"user\": \"user\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"activity_type\": \"NOTE\",\n \"subject\": \"Gil Feig's interview\",\n \"body\": \"Candidate loves integrations!\",\n \"visibility\": \"ADMIN_ONLY\",\n \"candidate\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1a9c9579-0511-4b84-82a4-f7c8c53373c6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"ea75a904-bdb0-43d4-a995-ff602780d9c1","name":"create - default","request":{"urlPathTemplate":"/ats/v1/activities","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"198123\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"user\": \"user\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"activity_type\": \"NOTE\",\n \"subject\": \"Gil Feig's interview\",\n \"body\": \"Candidate loves integrations!\",\n \"visibility\": \"ADMIN_ONLY\",\n \"candidate\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ea75a904-bdb0-43d4-a995-ff602780d9c1","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"12e2a9ff-8775-41f8-9585-f4d9f362a39e","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/activities/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"198123\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"user\": \"user\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"activity_type\": \"NOTE\",\n \"subject\": \"Gil Feig's interview\",\n \"body\": \"Candidate loves integrations!\",\n \"visibility\": \"ADMIN_ONLY\",\n \"candidate\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"12e2a9ff-8775-41f8-9585-f4d9f362a39e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1b86c371-e599-4bf0-a008-c28bf737fe05","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/ats/v1/activities/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1b86c371-e599-4bf0-a008-c28bf737fe05","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f0f5c03c-cdfa-43b4-81ec-226ff9a92c18","name":"list - default","request":{"urlPathTemplate":"/ats/v1/applications","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"92e8a369-fffe-430d-b93a-f7e8a16563f1\",\n \"remote_id\": \"98796\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"candidate\": \"candidate\",\n \"job\": \"job\",\n \"applied_at\": \"2021-10-15T00:00:00Z\",\n \"rejected_at\": \"2021-11-15T00:00:00Z\",\n \"offers\": [\n \"e9b5c11d-c588-468e-8567-cd6992e42b62\"\n ],\n \"source\": \"Campus recruiting event\",\n \"credited_to\": \"credited_to\",\n \"screening_question_answers\": [\n \"screening_question_answers\",\n \"screening_question_answers\"\n ],\n \"current_stage\": \"current_stage\",\n \"reject_reason\": \"reject_reason\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/candidacies\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f0f5c03c-cdfa-43b4-81ec-226ff9a92c18","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"5a874841-93af-4424-bdde-2cee617e85d4","name":"create - default","request":{"urlPathTemplate":"/ats/v1/applications","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"92e8a369-fffe-430d-b93a-f7e8a16563f1\",\n \"remote_id\": \"98796\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"candidate\": \"candidate\",\n \"job\": \"job\",\n \"applied_at\": \"2021-10-15T00:00:00Z\",\n \"rejected_at\": \"2021-11-15T00:00:00Z\",\n \"offers\": [\n \"e9b5c11d-c588-468e-8567-cd6992e42b62\"\n ],\n \"source\": \"Campus recruiting event\",\n \"credited_to\": \"credited_to\",\n \"screening_question_answers\": [\n \"screening_question_answers\",\n \"screening_question_answers\"\n ],\n \"current_stage\": \"current_stage\",\n \"reject_reason\": \"reject_reason\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/candidacies\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5a874841-93af-4424-bdde-2cee617e85d4","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"a8a2e56d-6197-4aab-8607-75c5397e29e4","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/applications/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"92e8a369-fffe-430d-b93a-f7e8a16563f1\",\n \"remote_id\": \"98796\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"candidate\": \"candidate\",\n \"job\": \"job\",\n \"applied_at\": \"2021-10-15T00:00:00Z\",\n \"rejected_at\": \"2021-11-15T00:00:00Z\",\n \"offers\": [\n \"e9b5c11d-c588-468e-8567-cd6992e42b62\"\n ],\n \"source\": \"Campus recruiting event\",\n \"credited_to\": \"credited_to\",\n \"screening_question_answers\": [\n \"screening_question_answers\",\n \"screening_question_answers\"\n ],\n \"current_stage\": \"current_stage\",\n \"reject_reason\": \"reject_reason\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/candidacies\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a8a2e56d-6197-4aab-8607-75c5397e29e4","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"551dfa26-37fe-4c89-af19-94bc2322b03c","name":"changeStageCreate - default","request":{"urlPathTemplate":"/ats/v1/applications/{id}/change-stage","method":"POST","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"92e8a369-fffe-430d-b93a-f7e8a16563f1\",\n \"remote_id\": \"98796\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"candidate\": \"candidate\",\n \"job\": \"job\",\n \"applied_at\": \"2021-10-15T00:00:00Z\",\n \"rejected_at\": \"2021-11-15T00:00:00Z\",\n \"offers\": [\n \"e9b5c11d-c588-468e-8567-cd6992e42b62\"\n ],\n \"source\": \"Campus recruiting event\",\n \"credited_to\": \"credited_to\",\n \"screening_question_answers\": [\n \"screening_question_answers\",\n \"screening_question_answers\"\n ],\n \"current_stage\": \"current_stage\",\n \"reject_reason\": \"reject_reason\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/candidacies\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"551dfa26-37fe-4c89-af19-94bc2322b03c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"4d4d499a-3494-46d1-a1ad-6aeb23771ef9","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/ats/v1/applications/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4d4d499a-3494-46d1-a1ad-6aeb23771ef9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"50f1d6ad-4ea2-4a2d-9fce-77b2a1ab48e5","name":"create - default","request":{"urlPathTemplate":"/ats/v1/async-passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"async_passthrough_receipt_id\": \"fd29020f-2695-445e-922e-dcd5e81903fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"50f1d6ad-4ea2-4a2d-9fce-77b2a1ab48e5","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"568a0b74-2c2d-4739-bce0-f05afe920550","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/async-passthrough/{async_passthrough_receipt_id}","method":"GET","pathParameters":{"async_passthrough_receipt_id":{"equalTo":"async_passthrough_receipt_id"}}},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"568a0b74-2c2d-4739-bce0-f05afe920550","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"459631c6-d599-473f-a2cf-67f31c9d48c9","name":"list - default","request":{"urlPathTemplate":"/ats/v1/attachments","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"remote_id\": \"11167\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"file_name\": \"Candidate Resume\",\n \"file_url\": \"http://alturl.com/p749b\",\n \"candidate\": \"2872ba14-4084-492b-be96-e5eee6fc33ef\",\n \"attachment_type\": \"RESUME\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/attachments\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"459631c6-d599-473f-a2cf-67f31c9d48c9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"41ac97c6-8fb3-4cd9-92b3-e22e26926272","name":"create - default","request":{"urlPathTemplate":"/ats/v1/attachments","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"remote_id\": \"11167\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"file_name\": \"Candidate Resume\",\n \"file_url\": \"http://alturl.com/p749b\",\n \"candidate\": \"2872ba14-4084-492b-be96-e5eee6fc33ef\",\n \"attachment_type\": \"RESUME\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/attachments\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"41ac97c6-8fb3-4cd9-92b3-e22e26926272","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"d3558d83-62ee-4cc3-9ac9-a6cd89cc1ddf","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/attachments/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"remote_id\": \"11167\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"file_name\": \"Candidate Resume\",\n \"file_url\": \"http://alturl.com/p749b\",\n \"candidate\": \"2872ba14-4084-492b-be96-e5eee6fc33ef\",\n \"attachment_type\": \"RESUME\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/attachments\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d3558d83-62ee-4cc3-9ac9-a6cd89cc1ddf","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"2b608a35-a2b8-45a7-9c5f-50f2a2a1558d","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/ats/v1/attachments/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2b608a35-a2b8-45a7-9c5f-50f2a2a1558d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"b834d94d-ed5b-41bd-b981-a5868d34ceed","name":"list - default","request":{"urlPathTemplate":"/ats/v1/audit-trail","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b5ceea2a-7171-47ce-8090-165cfce5572c\",\n \"user_name\": \"Gil Feig\",\n \"user_email\": \"hello@merge.dev\",\n \"role\": \"ADMIN\",\n \"ip_address\": \"192.0.2.123\",\n \"event_type\": \"CREATED_REMOTE_PRODUCTION_API_KEY\",\n \"event_description\": \"Organization-wide Scopes for model hris.Employee updated from Read to Read+Write\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b834d94d-ed5b-41bd-b981-a5868d34ceed","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"3b74ee30-ade7-4016-b202-a4c74c53c74f","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/available-actions","method":"GET"},"response":{"status":200,"body":"{\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3b74ee30-ade7-4016-b202-a4c74c53c74f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"0ab863fa-3d27-4984-9571-c38fb425bf3f","name":"list - default","request":{"urlPathTemplate":"/ats/v1/candidates","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"521b18c2-4d01-4297-b451-19858d07c133\",\n \"remote_id\": \"21198\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"company\": \"Columbia Dining App.\",\n \"title\": \"Software Engineer\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-16T00:00:00Z\",\n \"last_interaction_at\": \"2021-10-17T00:00:00Z\",\n \"is_private\": true,\n \"can_email\": true,\n \"locations\": [\n \"San Francisco\",\n \"New York\",\n \"Miami\"\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"+1234567890\",\n \"phone_number_type\": \"MOBILE\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"hello@merge.dev\",\n \"email_address_type\": \"PERSONAL\"\n }\n ],\n \"urls\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"http://alturl.com/p749b\",\n \"url_type\": \"BLOG\"\n }\n ],\n \"tags\": [\n \"High-Priority\"\n ],\n \"applications\": [\n \"29eb9867-ce2a-403f-b8ce-f2844b89f078\",\n \"b4d08e5c-de00-4d64-a29f-66addac9af99\",\n \"4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56\"\n ],\n \"attachments\": [\n \"bea08964-32b4-4a20-8bb4-2612ba09de1d\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/candidates\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0ab863fa-3d27-4984-9571-c38fb425bf3f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"5d9c3362-2708-42f6-8bc2-3ed9011fa225","name":"create - default","request":{"urlPathTemplate":"/ats/v1/candidates","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"521b18c2-4d01-4297-b451-19858d07c133\",\n \"remote_id\": \"21198\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"company\": \"Columbia Dining App.\",\n \"title\": \"Software Engineer\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-16T00:00:00Z\",\n \"last_interaction_at\": \"2021-10-17T00:00:00Z\",\n \"is_private\": true,\n \"can_email\": true,\n \"locations\": [\n \"San Francisco\",\n \"New York\",\n \"Miami\"\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"+1234567890\",\n \"phone_number_type\": \"MOBILE\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"hello@merge.dev\",\n \"email_address_type\": \"PERSONAL\"\n }\n ],\n \"urls\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"http://alturl.com/p749b\",\n \"url_type\": \"BLOG\"\n }\n ],\n \"tags\": [\n \"High-Priority\"\n ],\n \"applications\": [\n \"29eb9867-ce2a-403f-b8ce-f2844b89f078\",\n \"b4d08e5c-de00-4d64-a29f-66addac9af99\",\n \"4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56\"\n ],\n \"attachments\": [\n \"bea08964-32b4-4a20-8bb4-2612ba09de1d\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/candidates\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5d9c3362-2708-42f6-8bc2-3ed9011fa225","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"b1415c72-7950-4e89-b7eb-23a9dbfd51e7","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/candidates/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"521b18c2-4d01-4297-b451-19858d07c133\",\n \"remote_id\": \"21198\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"company\": \"Columbia Dining App.\",\n \"title\": \"Software Engineer\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-16T00:00:00Z\",\n \"last_interaction_at\": \"2021-10-17T00:00:00Z\",\n \"is_private\": true,\n \"can_email\": true,\n \"locations\": [\n \"San Francisco\",\n \"New York\",\n \"Miami\"\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"+1234567890\",\n \"phone_number_type\": \"MOBILE\",\n \"remote_was_deleted\": true\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"hello@merge.dev\",\n \"email_address_type\": \"PERSONAL\",\n \"remote_was_deleted\": true\n }\n ],\n \"urls\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"http://alturl.com/p749b\",\n \"url_type\": \"BLOG\",\n \"remote_was_deleted\": true\n }\n ],\n \"tags\": [\n \"High-Priority\"\n ],\n \"applications\": [\n \"29eb9867-ce2a-403f-b8ce-f2844b89f078\",\n \"b4d08e5c-de00-4d64-a29f-66addac9af99\",\n \"4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56\"\n ],\n \"attachments\": [\n \"bea08964-32b4-4a20-8bb4-2612ba09de1d\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/candidates\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b1415c72-7950-4e89-b7eb-23a9dbfd51e7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"7063a9da-b7f3-4c49-9d48-c0d4be3cb7d9","name":"partialUpdate - default","request":{"urlPathTemplate":"/ats/v1/candidates/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"521b18c2-4d01-4297-b451-19858d07c133\",\n \"remote_id\": \"21198\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"company\": \"Columbia Dining App.\",\n \"title\": \"Software Engineer\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-16T00:00:00Z\",\n \"last_interaction_at\": \"2021-10-17T00:00:00Z\",\n \"is_private\": true,\n \"can_email\": true,\n \"locations\": [\n \"San Francisco\",\n \"New York\",\n \"Miami\"\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"+1234567890\",\n \"phone_number_type\": \"MOBILE\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"hello@merge.dev\",\n \"email_address_type\": \"PERSONAL\"\n }\n ],\n \"urls\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"http://alturl.com/p749b\",\n \"url_type\": \"BLOG\"\n }\n ],\n \"tags\": [\n \"High-Priority\"\n ],\n \"applications\": [\n \"29eb9867-ce2a-403f-b8ce-f2844b89f078\",\n \"b4d08e5c-de00-4d64-a29f-66addac9af99\",\n \"4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56\"\n ],\n \"attachments\": [\n \"bea08964-32b4-4a20-8bb4-2612ba09de1d\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/candidates\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7063a9da-b7f3-4c49-9d48-c0d4be3cb7d9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"099cfa2c-0989-4338-988d-f6c9a36409d7","name":"ignoreCreate - default","request":{"urlPathTemplate":"/ats/v1/candidates/ignore/{model_id}","method":"POST","pathParameters":{"model_id":{"equalTo":"model_id"}}},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"099cfa2c-0989-4338-988d-f6c9a36409d7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"e890006c-850d-4d8e-9204-73cd3adf0cba","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/ats/v1/candidates/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e890006c-850d-4d8e-9204-73cd3adf0cba","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"9297794a-4699-4e94-8441-137ffb593b3e","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/ats/v1/candidates/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9297794a-4699-4e94-8441-137ffb593b3e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"32a26582-7d2e-4fda-8801-b8011af1e641","name":"default_scopes_retrieve - default","request":{"urlPathTemplate":"/ats/v1/default-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"32a26582-7d2e-4fda-8801-b8011af1e641","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"014ee88a-c81b-42a0-b210-4ba3f1b9eb5b","name":"linked_account_scopes_retrieve - default","request":{"urlPathTemplate":"/ats/v1/linked-account-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"014ee88a-c81b-42a0-b210-4ba3f1b9eb5b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"b5bec6a8-74e3-4d70-9c60-5ec6125ce333","name":"linked_account_scopes_create - default","request":{"urlPathTemplate":"/ats/v1/linked-account-scopes","method":"POST"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b5bec6a8-74e3-4d70-9c60-5ec6125ce333","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f97a6a3b-eb9f-4af5-a2c7-fc3c6773fe2a","name":"delete - default","request":{"urlPathTemplate":"/ats/v1/delete-account","method":"POST"},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"f97a6a3b-eb9f-4af5-a2c7-fc3c6773fe2a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f3b47ae8-d5dd-413e-bceb-79b04ec4e7da","name":"list - default","request":{"urlPathTemplate":"/ats/v1/departments","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"remote_id\": \"23456\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Engineering\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/departments\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f3b47ae8-d5dd-413e-bceb-79b04ec4e7da","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"34064342-d927-4cea-8f65-df62d69b5f90","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/departments/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"remote_id\": \"23456\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Engineering\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/departments\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"34064342-d927-4cea-8f65-df62d69b5f90","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"b04b0c10-ca47-45ab-b8da-5f7245a18ce8","name":"list - default","request":{"urlPathTemplate":"/ats/v1/eeocs","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"f7dd7b4f-237e-4772-8bd4-3246384c6c58\",\n \"remote_id\": \"76\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"candidate\": \"candidate\",\n \"submitted_at\": \"2021-10-15T00:00:00Z\",\n \"race\": \"AMERICAN_INDIAN_OR_ALASKAN_NATIVE\",\n \"gender\": \"MALE\",\n \"veteran_status\": \"I_AM_NOT_A_PROTECTED_VETERAN\",\n \"disability_status\": \"YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/eeoc\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b04b0c10-ca47-45ab-b8da-5f7245a18ce8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"5dd3e9a1-04f3-4b37-baa0-4a66fa1b2f92","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/eeocs/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"f7dd7b4f-237e-4772-8bd4-3246384c6c58\",\n \"remote_id\": \"76\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"candidate\": \"candidate\",\n \"submitted_at\": \"2021-10-15T00:00:00Z\",\n \"race\": \"AMERICAN_INDIAN_OR_ALASKAN_NATIVE\",\n \"gender\": \"MALE\",\n \"veteran_status\": \"I_AM_NOT_A_PROTECTED_VETERAN\",\n \"disability_status\": \"YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/eeoc\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5dd3e9a1-04f3-4b37-baa0-4a66fa1b2f92","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1d996d25-0102-435b-83d2-e103acb2f26e","name":"field_mappings_retrieve - default","request":{"urlPathTemplate":"/ats/v1/field-mappings","method":"GET"},"response":{"status":200,"body":"{\n \"Activity\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Application\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Attachment\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Candidate\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Department\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"EEOC\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"ScheduledInterview\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Job\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"JobPosting\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"JobInterviewStage\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Offer\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Office\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"RejectReason\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Scorecard\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Tag\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"RemoteUser\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1d996d25-0102-435b-83d2-e103acb2f26e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2d12f14c-88ee-454a-b20e-eed463e6d5ad","name":"field_mappings_create - default","request":{"urlPathTemplate":"/ats/v1/field-mappings","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2d12f14c-88ee-454a-b20e-eed463e6d5ad","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"115c0546-c88a-4a7a-8cb4-26d34940ec27","name":"field_mappings_destroy - default","request":{"urlPathTemplate":"/ats/v1/field-mappings/{field_mapping_id}","method":"DELETE","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":204,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"115c0546-c88a-4a7a-8cb4-26d34940ec27","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"c2940984-faab-407d-9752-e42f568aab76","name":"field_mappings_partial_update - default","request":{"urlPathTemplate":"/ats/v1/field-mappings/{field_mapping_id}","method":"PATCH","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c2940984-faab-407d-9752-e42f568aab76","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f5c592c5-399c-4264-ac73-22e487cf5168","name":"remote_fields_retrieve - default","request":{"urlPathTemplate":"/ats/v1/remote-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Activity\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Application\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Attachment\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Candidate\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Department\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"EEOC\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"ScheduledInterview\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Job\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"JobPosting\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"JobInterviewStage\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Offer\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Office\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"RejectReason\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Scorecard\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Tag\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"RemoteUser\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f5c592c5-399c-4264-ac73-22e487cf5168","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2e57438c-cbb4-4ea0-956d-21077d902111","name":"target_fields_retrieve - default","request":{"urlPathTemplate":"/ats/v1/target-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Activity\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Application\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Attachment\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Candidate\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Department\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"EEOC\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"ScheduledInterview\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Job\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"JobPosting\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"JobInterviewStage\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Offer\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Office\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"RejectReason\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Scorecard\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Tag\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"RemoteUser\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2e57438c-cbb4-4ea0-956d-21077d902111","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e8890140-f80c-4d47-a5fd-be2e643cf822","name":"create - default","request":{"urlPathTemplate":"/ats/v1/generate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e8890140-f80c-4d47-a5fd-be2e643cf822","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ad57e82d-aa5a-4188-a531-c433a7f66a9d","name":"list - default","request":{"urlPathTemplate":"/ats/v1/interviews","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b8faf072-98b9-4445-8a9a-6b4950efca19\",\n \"remote_id\": \"3\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"application\": \"application\",\n \"job_interview_stage\": \"job_interview_stage\",\n \"organizer\": \"organizer\",\n \"interviewers\": [\n \"f9813dd5-e70b-484c-91d8-00acd6065b07\",\n \"89a86fcf-d540-4e6b-ac3d-ce07c4ec9b3c\"\n ],\n \"location\": \"Embarcadero Center 2\",\n \"start_at\": \"2021-10-15T00:00:00Z\",\n \"end_at\": \"2021-10-15T02:00:00Z\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-15T00:00:00Z\",\n \"status\": \"SCHEDULED\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/interviews\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ad57e82d-aa5a-4188-a531-c433a7f66a9d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"d834ada3-de05-42d8-9104-651d6b68609f","name":"create - default","request":{"urlPathTemplate":"/ats/v1/interviews","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"b8faf072-98b9-4445-8a9a-6b4950efca19\",\n \"remote_id\": \"3\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"application\": \"application\",\n \"job_interview_stage\": \"job_interview_stage\",\n \"organizer\": \"organizer\",\n \"interviewers\": [\n \"f9813dd5-e70b-484c-91d8-00acd6065b07\",\n \"89a86fcf-d540-4e6b-ac3d-ce07c4ec9b3c\"\n ],\n \"location\": \"Embarcadero Center 2\",\n \"start_at\": \"2021-10-15T00:00:00Z\",\n \"end_at\": \"2021-10-15T02:00:00Z\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-15T00:00:00Z\",\n \"status\": \"SCHEDULED\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/interviews\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d834ada3-de05-42d8-9104-651d6b68609f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f39e78b4-3f23-45b3-b81d-bfeb7f490610","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/interviews/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"b8faf072-98b9-4445-8a9a-6b4950efca19\",\n \"remote_id\": \"3\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"application\": \"application\",\n \"job_interview_stage\": \"job_interview_stage\",\n \"organizer\": \"organizer\",\n \"interviewers\": [\n \"f9813dd5-e70b-484c-91d8-00acd6065b07\",\n \"89a86fcf-d540-4e6b-ac3d-ce07c4ec9b3c\"\n ],\n \"location\": \"Embarcadero Center 2\",\n \"start_at\": \"2021-10-15T00:00:00Z\",\n \"end_at\": \"2021-10-15T02:00:00Z\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-15T00:00:00Z\",\n \"status\": \"SCHEDULED\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/interviews\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f39e78b4-3f23-45b3-b81d-bfeb7f490610","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"d142919c-2aec-4f92-9db1-edc80e1c5af5","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/ats/v1/interviews/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d142919c-2aec-4f92-9db1-edc80e1c5af5","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a2ffcb76-48f6-46d6-a274-9a54f89c79f2","name":"list - default","request":{"urlPathTemplate":"/ats/v1/issues","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a2ffcb76-48f6-46d6-a274-9a54f89c79f2","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"885e5f2b-68f5-4a07-ac15-4c3a37cefe86","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/issues/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"885e5f2b-68f5-4a07-ac15-4c3a37cefe86","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6ad0de6f-83d0-4cc5-b501-dc227a3e493a","name":"list - default","request":{"urlPathTemplate":"/ats/v1/job-interview-stages","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"f9813dd5-e70b-484c-91d8-00acd6065b07\",\n \"remote_id\": \"876556788\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Phone Screen\",\n \"job\": \"job\",\n \"stage_order\": 2,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/interview-stages\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6ad0de6f-83d0-4cc5-b501-dc227a3e493a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"6acab2cd-4ca2-4691-8036-6a57cadab178","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/job-interview-stages/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"f9813dd5-e70b-484c-91d8-00acd6065b07\",\n \"remote_id\": \"876556788\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Phone Screen\",\n \"job\": \"job\",\n \"stage_order\": 2,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/interview-stages\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6acab2cd-4ca2-4691-8036-6a57cadab178","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"9a0f6605-0a89-48fd-bba2-da4a660b9ebd","name":"list - default","request":{"urlPathTemplate":"/ats/v1/job-postings","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"156a2bef-57e5-4def-8ed2-7c41bd9a554t\",\n \"remote_id\": \"1341324\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"title\": \"Platform - NYC\",\n \"job_posting_urls\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"https://merge.dev/careers\",\n \"url_type\": \"JOB_POSTING\"\n }\n ],\n \"job\": \"job\",\n \"status\": \"PUBLISHED\",\n \"content\": \"Apply at https://merge.dev/careers\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-16T00:00:00Z\",\n \"is_internal\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/positions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9a0f6605-0a89-48fd-bba2-da4a660b9ebd","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"44aee7d7-875e-431c-9bc4-e8864dedc5eb","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/job-postings/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"156a2bef-57e5-4def-8ed2-7c41bd9a554t\",\n \"remote_id\": \"1341324\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"title\": \"Platform - NYC\",\n \"job_posting_urls\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"https://merge.dev/careers\",\n \"url_type\": \"JOB_POSTING\",\n \"remote_was_deleted\": true\n }\n ],\n \"job\": \"job\",\n \"status\": \"PUBLISHED\",\n \"content\": \"Apply at https://merge.dev/careers\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-16T00:00:00Z\",\n \"is_internal\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/positions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"44aee7d7-875e-431c-9bc4-e8864dedc5eb","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"c8a4308f-3ad6-4286-9dee-bfe801bf542d","name":"list - default","request":{"urlPathTemplate":"/ats/v1/jobs","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"022a2bef-57e5-4def-8ed2-7c41bd9a5ed8\",\n \"remote_id\": \"8765432\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Software Engineer (Merge is actually hiring btw)\",\n \"description\": \"If you're reading this documentation, you might be a good fit for Merge!\",\n \"code\": \"C0025\",\n \"status\": \"OPEN\",\n \"type\": \"POSTING\",\n \"job_postings\": [\n \"2r3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"543ed912-33ec-444e-a215-8d71cc42fc12\"\n ],\n \"job_posting_urls\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"https://merge.dev/careers\",\n \"url_type\": \"JOB_POSTING\"\n }\n ],\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-16T00:00:00Z\",\n \"confidential\": true,\n \"departments\": [\n \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"d6e687d6-0c36-48a1-8114-35324b5cb38f\"\n ],\n \"offices\": [\n \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\"\n ],\n \"hiring_managers\": [\n \"787ed912-33ec-444e-a215-8d71cc42fc12\"\n ],\n \"recruiters\": [\n \"787ed912-33ec-444e-a215-8d71cc42fc12\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/positions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c8a4308f-3ad6-4286-9dee-bfe801bf542d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"3cca748f-a27f-4f1d-96cd-c1a2e4e9a18e","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/jobs/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"022a2bef-57e5-4def-8ed2-7c41bd9a5ed8\",\n \"remote_id\": \"8765432\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Software Engineer (Merge is actually hiring btw)\",\n \"description\": \"If you're reading this documentation, you might be a good fit for Merge!\",\n \"code\": \"C0025\",\n \"status\": \"OPEN\",\n \"type\": \"POSTING\",\n \"job_postings\": [\n \"2r3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"543ed912-33ec-444e-a215-8d71cc42fc12\"\n ],\n \"job_posting_urls\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"value\": \"https://merge.dev/careers\",\n \"url_type\": \"JOB_POSTING\",\n \"remote_was_deleted\": true\n }\n ],\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"remote_updated_at\": \"2021-10-16T00:00:00Z\",\n \"confidential\": true,\n \"departments\": [\n \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"d6e687d6-0c36-48a1-8114-35324b5cb38f\"\n ],\n \"offices\": [\n \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\"\n ],\n \"hiring_managers\": [\n \"787ed912-33ec-444e-a215-8d71cc42fc12\"\n ],\n \"recruiters\": [\n \"787ed912-33ec-444e-a215-8d71cc42fc12\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/positions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3cca748f-a27f-4f1d-96cd-c1a2e4e9a18e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"aff8e772-e6f4-44fb-8d74-54cec32aff33","name":"screeningQuestionsList - default","request":{"urlPathTemplate":"/ats/v1/jobs/{job_id}/screening-questions","method":"GET","pathParameters":{"job_id":{"equalTo":"job_id"}}},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0238cbc6-6040-430a-848e-aaiehfhdbadf4ae\",\n \"remote_id\": \"23729392\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"job\": \"job\",\n \"description\": \"Are you currently authorized to work for any employer in the country outlined for this role?\",\n \"title\": \"Work Authorisation\",\n \"type\": \"DATE\",\n \"required\": true,\n \"options\": [\n {\n \"remote_id\": \"19281\",\n \"label\": \"I am currently authorised\"\n },\n {\n \"remote_id\": \"38372\",\n \"label\": \"I am currently not eligible\"\n }\n ],\n \"remote_was_deleted\": true\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"aff8e772-e6f4-44fb-8d74-54cec32aff33","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"d7977d50-0adc-4bec-acd7-c0a343fa974b","name":"create - default","request":{"urlPathTemplate":"/ats/v1/link-token","method":"POST"},"response":{"status":200,"body":"{\n \"link_token\": \"necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0\",\n \"integration_name\": \"Lever\",\n \"magic_link_url\": \"https://link.merge.dev/asdfjkl12345jsndfgi2i83n\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d7977d50-0adc-4bec-acd7-c0a343fa974b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"90c4a36f-d51c-4407-94b2-c850597cf2cc","name":"list - default","request":{"urlPathTemplate":"/ats/v1/linked-accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"e59b1821-f85c-4e28-a6b3-1804156f3563\",\n \"category\": \"hris\",\n \"status\": \"COMPLETE\",\n \"status_detail\": \"Invalid login credentials\",\n \"end_user_origin_id\": \"3ac95cde-6c7f-4eef-afec-be710b42308d\",\n \"end_user_organization_name\": \"Foo Bar, LLC\",\n \"end_user_email_address\": \"hradmin@foobar.dev\",\n \"subdomain\": \"foobar\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"integration\": {\n \"name\": \"name\",\n \"categories\": [\n \"hris\"\n ],\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n },\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"90c4a36f-d51c-4407-94b2-c850597cf2cc","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1ba4e4d5-f7fd-44f5-9814-66633cfe59be","name":"list - default","request":{"urlPathTemplate":"/ats/v1/offers","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"dd85625c-6a59-446f-a317-6de64d83bae7\",\n \"remote_id\": \"9876\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"application\": \"application\",\n \"creator\": \"creator\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"closed_at\": \"2021-10-16T00:00:00Z\",\n \"sent_at\": \"2021-10-15T00:00:00Z\",\n \"start_date\": \"2021-11-15T00:00:00Z\",\n \"status\": \"DRAFT\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/offers\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1ba4e4d5-f7fd-44f5-9814-66633cfe59be","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"add1e515-b23c-4a62-97a8-75a30efbaf27","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/offers/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"dd85625c-6a59-446f-a317-6de64d83bae7\",\n \"remote_id\": \"9876\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"application\": \"application\",\n \"creator\": \"creator\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"closed_at\": \"2021-10-16T00:00:00Z\",\n \"sent_at\": \"2021-10-15T00:00:00Z\",\n \"start_date\": \"2021-11-15T00:00:00Z\",\n \"status\": \"DRAFT\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/offers\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"add1e515-b23c-4a62-97a8-75a30efbaf27","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"d25493b0-3d97-4a16-a2e2-0a391a142d2c","name":"list - default","request":{"urlPathTemplate":"/ats/v1/offices","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\",\n \"remote_id\": \"876556788\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"SF Office\",\n \"location\": \"Embarcadero Center 2\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/locations\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d25493b0-3d97-4a16-a2e2-0a391a142d2c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"ef7eb76f-1a87-4727-bb38-b245c66063b9","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/offices/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\",\n \"remote_id\": \"876556788\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"SF Office\",\n \"location\": \"Embarcadero Center 2\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/locations\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ef7eb76f-1a87-4727-bb38-b245c66063b9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"490b597b-c9cf-465f-bff7-c52cabbeef5e","name":"create - default","request":{"urlPathTemplate":"/ats/v1/passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"490b597b-c9cf-465f-bff7-c52cabbeef5e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"7a2ddf83-d00f-41a3-a9d8-d0977e7d04fa","name":"create - default","request":{"urlPathTemplate":"/ats/v1/regenerate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7a2ddf83-d00f-41a3-a9d8-d0977e7d04fa","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"951bd6fe-0f4f-4eda-825a-d1e52f2c4c1c","name":"list - default","request":{"urlPathTemplate":"/ats/v1/reject-reasons","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"8be99a4a-f8d4-4339-bf1e-30eac970e217\",\n \"remote_id\": \"876556788\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Not passionate enough about APIs.\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/rejection-reasons\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"951bd6fe-0f4f-4eda-825a-d1e52f2c4c1c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"7cb52dee-55f1-400b-8ba9-59817b8e1a9e","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/reject-reasons/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"8be99a4a-f8d4-4339-bf1e-30eac970e217\",\n \"remote_id\": \"876556788\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Not passionate enough about APIs.\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/rejection-reasons\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7cb52dee-55f1-400b-8ba9-59817b8e1a9e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6c8c11b0-ecd7-4350-b39b-068573a4b60a","name":"list - default","request":{"urlPathTemplate":"/ats/v1/scorecards","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3eab2f17-eeb1-450d-97f0-029d8be1e06f\",\n \"remote_id\": \"22234\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"application\": \"application\",\n \"interview\": \"interview\",\n \"interviewer\": \"interviewer\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"submitted_at\": \"2021-10-15T00:00:00Z\",\n \"overall_recommendation\": \"DEFINITELY_NO\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/ratings\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6c8c11b0-ecd7-4350-b39b-068573a4b60a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e77a9a3d-0854-4c66-82f5-2dcdbb2ea449","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/scorecards/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3eab2f17-eeb1-450d-97f0-029d8be1e06f\",\n \"remote_id\": \"22234\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"application\": \"application\",\n \"interview\": \"interview\",\n \"interviewer\": \"interviewer\",\n \"remote_created_at\": \"2021-10-15T00:00:00Z\",\n \"submitted_at\": \"2021-10-15T00:00:00Z\",\n \"overall_recommendation\": \"DEFINITELY_NO\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/ratings\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e77a9a3d-0854-4c66-82f5-2dcdbb2ea449","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"d134eeea-2ef9-49d9-abe6-bef3b3050c9a","name":"list - default","request":{"urlPathTemplate":"/ats/v1/sync-status","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"model_name\": \"Candidate\",\n \"model_id\": \"ats.Candidate\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d134eeea-2ef9-49d9-abe6-bef3b3050c9a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"b40d6ca9-5b24-43fc-9d73-de13a1e92127","name":"sync_status_resync_create - default","request":{"urlPathTemplate":"/ats/v1/sync-status/resync","method":"POST"},"response":{"status":200,"body":"[\n {\n \"model_name\": \"Candidate\",\n \"model_id\": \"ats.Candidate\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"b40d6ca9-5b24-43fc-9d73-de13a1e92127","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"23fdccf3-9931-4ade-813f-1da219814691","name":"list - default","request":{"urlPathTemplate":"/ats/v1/tags","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"remote_id\": \"4567\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"High-Priority\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/tags\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"23fdccf3-9931-4ade-813f-1da219814691","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"c24973b5-40ec-4fe6-a68c-af0cb7d8e41e","name":"list - default","request":{"urlPathTemplate":"/ats/v1/users","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b82302de-852e-4e60-b050-edf9da3b7c02\",\n \"remote_id\": \"344321\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Shensi\",\n \"last_name\": \"Ding\",\n \"email\": \"hello@merge.dev\",\n \"disabled\": true,\n \"remote_created_at\": \"2020-11-10T00:00:00Z\",\n \"access_role\": \"SUPER_ADMIN\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/users\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c24973b5-40ec-4fe6-a68c-af0cb7d8e41e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"727083a4-b8f4-45f1-9d42-013df7a7c908","name":"retrieve - default","request":{"urlPathTemplate":"/ats/v1/users/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"b82302de-852e-4e60-b050-edf9da3b7c02\",\n \"remote_id\": \"344321\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Shensi\",\n \"last_name\": \"Ding\",\n \"email\": \"hello@merge.dev\",\n \"disabled\": true,\n \"remote_created_at\": \"2020-11-10T00:00:00Z\",\n \"access_role\": \"SUPER_ADMIN\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/users\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"727083a4-b8f4-45f1-9d42-013df7a7c908","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"cd30f40c-4000-4903-b961-e18aab527573","name":"list - default","request":{"urlPathTemplate":"/ats/v1/webhook-receivers","method":"GET"},"response":{"status":200,"body":"[\n {\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"cd30f40c-4000-4903-b961-e18aab527573","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f5f4acfc-9d47-405b-aa52-b8df9228230e","name":"create - default","request":{"urlPathTemplate":"/ats/v1/webhook-receivers","method":"POST"},"response":{"status":201,"body":"{\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f5f4acfc-9d47-405b-aa52-b8df9228230e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ac48c746-01ba-4511-81d2-0590fb4f12c3","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/account-details","method":"GET"},"response":{"status":200,"body":"{\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\",\n \"integration\": \"BambooHR\",\n \"integration_slug\": \"bamboohr\",\n \"category\": \"hris\",\n \"end_user_origin_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"end_user_organization_name\": \"Waystar Royco\",\n \"end_user_email_address\": \"kendall.roy@waystar-royco.com\",\n \"status\": \"COMPLETE\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ac48c746-01ba-4511-81d2-0590fb4f12c3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"ac228d8a-74b3-4e70-9aa2-a8348dc0a28a","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/account-token/{public_token}","method":"GET","pathParameters":{"public_token":{"equalTo":"public_token"}}},"response":{"status":200,"body":"{\n \"account_token\": \"T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB\",\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ac228d8a-74b3-4e70-9aa2-a8348dc0a28a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"64f0fa69-434b-4118-a33a-8ae5e8f18ff8","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/accounting-periods","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3015f7b1-4d01-460d-bfab-02a52d16cbd0\",\n \"remote_id\": \"2804580\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"April 2020 Financials\",\n \"status\": \"ACTIVE\",\n \"start_date\": \"2020-03-31T00:00:00Z\",\n \"end_date\": \"2020-05-01T00:00:00Z\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"64f0fa69-434b-4118-a33a-8ae5e8f18ff8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"9a3e6321-1c19-4219-b44a-fe8d0454898a","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/accounting-periods/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3015f7b1-4d01-460d-bfab-02a52d16cbd0\",\n \"remote_id\": \"2804580\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"April 2020 Financials\",\n \"status\": \"ACTIVE\",\n \"start_date\": \"2020-03-31T00:00:00Z\",\n \"end_date\": \"2020-05-01T00:00:00Z\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9a3e6321-1c19-4219-b44a-fe8d0454898a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"c8cd4cb7-00aa-4caf-a233-50b99414cb2f","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"21\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Cash\",\n \"description\": \"Cash\",\n \"classification\": \"ASSET\",\n \"type\": \"Asset\",\n \"account_type\": \"BANK\",\n \"status\": \"ACTIVE\",\n \"current_balance\": 1.1,\n \"currency\": \"XUA\",\n \"account_number\": \"X12Y9AB\",\n \"parent_account\": \"22d92d6c-22f9-11ed-861d-0242ac120002\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c8cd4cb7-00aa-4caf-a233-50b99414cb2f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"684177e8-1e10-4fcf-abab-31f383f37ef9","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/accounts","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"21\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Cash\",\n \"description\": \"Cash\",\n \"classification\": \"ASSET\",\n \"type\": \"Asset\",\n \"account_type\": \"BANK\",\n \"status\": \"ACTIVE\",\n \"current_balance\": 1.1,\n \"currency\": \"XUA\",\n \"account_number\": \"X12Y9AB\",\n \"parent_account\": \"22d92d6c-22f9-11ed-861d-0242ac120002\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"684177e8-1e10-4fcf-abab-31f383f37ef9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"c151eb18-41fb-48cf-b189-e9a49195f2b7","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/accounts/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"21\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Cash\",\n \"description\": \"Cash\",\n \"classification\": \"ASSET\",\n \"type\": \"Asset\",\n \"account_type\": \"BANK\",\n \"status\": \"ACTIVE\",\n \"current_balance\": 1.1,\n \"currency\": \"XUA\",\n \"account_number\": \"X12Y9AB\",\n \"parent_account\": \"22d92d6c-22f9-11ed-861d-0242ac120002\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c151eb18-41fb-48cf-b189-e9a49195f2b7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f3cb1ea6-9f38-4d28-aa84-a6967a90ba80","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/accounts/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f3cb1ea6-9f38-4d28-aa84-a6967a90ba80","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2861a155-e080-4624-b6cd-b13d1fefa2d7","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/addresses/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"type\": \"BILLING\",\n \"street_1\": \"2920 Broadway\",\n \"street_2\": \"2nd Floor\",\n \"city\": \"New York\",\n \"state\": {\n \"key\": \"value\"\n },\n \"country_subdivision\": \"NY\",\n \"country\": \"AF\",\n \"zip_code\": \"10027\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2861a155-e080-4624-b6cd-b13d1fefa2d7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"96e6b64c-5451-4828-95c9-78bff783f33d","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/async-passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"async_passthrough_receipt_id\": \"fd29020f-2695-445e-922e-dcd5e81903fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"96e6b64c-5451-4828-95c9-78bff783f33d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"78bc2fae-3e4c-4b99-8f86-9e063945d262","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/async-passthrough/{async_passthrough_receipt_id}","method":"GET","pathParameters":{"async_passthrough_receipt_id":{"equalTo":"async_passthrough_receipt_id"}}},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"78bc2fae-3e4c-4b99-8f86-9e063945d262","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ff396986-58d2-450d-8064-0cd7c2ce2ec1","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/async-tasks/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"status\": \"QUEUED\",\n \"result\": {\n \"status_code\": 201,\n \"response\": {\n \"model\": {\n \"id\": \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\",\n \"remote_id\": \"990110\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"integration_params\": {\n \"unique_integration_field\": \"unique_integration_field_value\"\n },\n \"linked_account_params\": {\n \"unique_linked_account_field\": \"unique_linked_account_field_value\"\n },\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"type\": \"ACCOUNTS_RECEIVABLE\",\n \"contact\": \"022a2bef-57e5-4def-8ed2-7c41bd9a5ed8\",\n \"number\": \"AIQ12546\",\n \"issue_date\": \"2020-03-31T00:00:00Z\",\n \"due_date\": \"2020-04-15T00:00:00Z\",\n \"memo\": \"Weekly Payment\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"7442f0d5-722d-45bd-b807-6e38489d37fe\",\n \"paid_on_date\": \"2020-04-01T00:00:00Z\",\n \"currency\": \"USD\",\n \"exchange_rate\": \"2.9\",\n \"status\": \"DRAFT\",\n \"total_discount\": 0,\n \"sub_total\": 100,\n \"total_tax_amount\": 5,\n \"total_amount\": 105,\n \"balance\": 105,\n \"inclusive_of_tax\": false,\n \"remote_updated_at\": \"2020-04-01T00:00:00Z\",\n \"tracking_categories\": [\n \"7dc5ca17-d311-44cd-9ce0-333080367a18\",\n \"6aa0700c-48e1-4c4a-8162-02e6a582df05\",\n \"8c933d61-8f5b-4360-ac0c-c9dc87bee763\"\n ],\n \"purchase_orders\": [\n \"e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7\",\n \"dd70ca2f-b120-46fa-889a-9604037f45fd\",\n \"889b281d-739c-4759-95b8-0aedb3947131\"\n ],\n \"accounting_period\": \"7dc5ca17-d311-44cd-9ce0-333080367a18\",\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"9017594e-dc33-4113-a5d2-b0f928e34fdd\"\n ],\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n }\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ff396986-58d2-450d-8064-0cd7c2ce2ec1","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"87737994-a374-4ca7-a0d8-10a6f5f57f3f","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/attachments","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"1018270\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"file_name\": \"invoice.png\",\n \"file_url\": \"https://merge-brand.s3.amazonaws.com/20210315/rect-logo-270x80%402x.png\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"87737994-a374-4ca7-a0d8-10a6f5f57f3f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"11be3a52-d93f-4ecb-935b-519d74aee920","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/attachments","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"1018270\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"file_name\": \"invoice.png\",\n \"file_url\": \"https://merge-brand.s3.amazonaws.com/20210315/rect-logo-270x80%402x.png\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"11be3a52-d93f-4ecb-935b-519d74aee920","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"5879176e-de3e-4038-a93d-294995e7e4a3","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/attachments/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"1018270\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"file_name\": \"invoice.png\",\n \"file_url\": \"https://merge-brand.s3.amazonaws.com/20210315/rect-logo-270x80%402x.png\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5879176e-de3e-4038-a93d-294995e7e4a3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"440f6808-cc9e-4120-a1d1-c1255333d040","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/attachments/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"440f6808-cc9e-4120-a1d1-c1255333d040","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"6a30d713-fafc-4d7a-b710-67ffc61108f1","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/audit-trail","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b5ceea2a-7171-47ce-8090-165cfce5572c\",\n \"user_name\": \"Gil Feig\",\n \"user_email\": \"hello@merge.dev\",\n \"role\": \"ADMIN\",\n \"ip_address\": \"192.0.2.123\",\n \"event_type\": \"CREATED_REMOTE_PRODUCTION_API_KEY\",\n \"event_description\": \"Organization-wide Scopes for model hris.Employee updated from Read to Read+Write\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6a30d713-fafc-4d7a-b710-67ffc61108f1","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"c8a6d239-9ce4-4304-899d-f7f97edb3e60","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/available-actions","method":"GET"},"response":{"status":200,"body":"{\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c8a6d239-9ce4-4304-899d-f7f97edb3e60","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2d9a0613-c786-401b-b530-3546a63c1825","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/balance-sheets","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\",\n \"remote_id\": \"8937018\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"BalanceSheet\",\n \"currency\": \"XUA\",\n \"company\": \"company\",\n \"date\": \"2021-10-01T00:00:00Z\",\n \"net_assets\": 1000,\n \"assets\": [\n {\n \"remote_id\": \"10010\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Assets\",\n \"value\": 1000,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ]\n }\n ],\n \"liabilities\": [\n {\n \"remote_id\": \"10011\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Liabilities\",\n \"value\": 500,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ]\n }\n ],\n \"equity\": [\n {\n \"remote_id\": \"10012\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Equity\",\n \"value\": 500,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ]\n }\n ],\n \"remote_generated_at\": \"2021-10-01T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2d9a0613-c786-401b-b530-3546a63c1825","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"9daaaeb8-6f29-46f5-900f-d8f960fff4e3","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/balance-sheets/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\",\n \"remote_id\": \"8937018\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"BalanceSheet\",\n \"currency\": \"XUA\",\n \"company\": \"company\",\n \"date\": \"2021-10-01T00:00:00Z\",\n \"net_assets\": 1000,\n \"assets\": [\n {\n \"remote_id\": \"10010\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Assets\",\n \"value\": 1000,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"liabilities\": [\n {\n \"remote_id\": \"10011\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Liabilities\",\n \"value\": 500,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"equity\": [\n {\n \"remote_id\": \"10012\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Equity\",\n \"value\": 500,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"remote_generated_at\": \"2021-10-01T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9daaaeb8-6f29-46f5-900f-d8f960fff4e3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"39efaf15-ea16-41f1-80c0-c378e4c24edd","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/bank-feed-accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"source_account_id\": \"123566909\",\n \"target_account_id\": \"49cd5a42-b311-4750-9361-52e2ed1d4653\",\n \"source_account_name\": \"Travel Bank Account\",\n \"source_account_number\": \"12567\",\n \"target_account_name\": \"Netsuite Travel Bank Account\",\n \"currency\": \"XUA\",\n \"feed_status\": \"ACTIVE\",\n \"feed_start_date\": \"2024-02-02T00:00:00Z\",\n \"source_account_balance\": 123.94,\n \"account_type\": \"BANK\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n null\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"39efaf15-ea16-41f1-80c0-c378e4c24edd","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e53bb439-877e-4ed8-a991-78b299056602","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/bank-feed-accounts","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"source_account_id\": \"123566909\",\n \"target_account_id\": \"49cd5a42-b311-4750-9361-52e2ed1d4653\",\n \"source_account_name\": \"Travel Bank Account\",\n \"source_account_number\": \"12567\",\n \"target_account_name\": \"Netsuite Travel Bank Account\",\n \"currency\": \"XUA\",\n \"feed_status\": \"ACTIVE\",\n \"feed_start_date\": \"2024-02-02T00:00:00Z\",\n \"source_account_balance\": 123.94,\n \"account_type\": \"BANK\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"key\": \"value\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e53bb439-877e-4ed8-a991-78b299056602","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f78d70d5-9841-45f2-b580-aa8d2e52c1d2","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/bank-feed-accounts/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"source_account_id\": \"123566909\",\n \"target_account_id\": \"49cd5a42-b311-4750-9361-52e2ed1d4653\",\n \"source_account_name\": \"Travel Bank Account\",\n \"source_account_number\": \"12567\",\n \"target_account_name\": \"Netsuite Travel Bank Account\",\n \"currency\": \"XUA\",\n \"feed_status\": \"ACTIVE\",\n \"feed_start_date\": \"2024-02-02T00:00:00Z\",\n \"source_account_balance\": 123.94,\n \"account_type\": \"BANK\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"key\": \"value\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f78d70d5-9841-45f2-b580-aa8d2e52c1d2","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"8d7a7075-cb45-4107-9f88-fddee518b4f2","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/bank-feed-accounts/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8d7a7075-cb45-4107-9f88-fddee518b4f2","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"da83631a-236c-4fdf-9ca7-114749ddd6db","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/bank-feed-transactions","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"bank_feed_account\": \"bank_feed_account\",\n \"transaction_date\": \"2024-02-02T00:00:00Z\",\n \"posted_date\": \"2024-02-03T00:00:00Z\",\n \"amount\": 100.1,\n \"description\": \"Lunch expense\",\n \"transaction_type\": \"payment\",\n \"payee\": \"Elmo's diner\",\n \"credit_or_debit\": \"CREDIT\",\n \"source_transaction_id\": \"124569\",\n \"remote_was_deleted\": true,\n \"is_processed\": true\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"da83631a-236c-4fdf-9ca7-114749ddd6db","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"8f9c412a-cb03-4e35-bd6d-3194a8eee72f","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/bank-feed-transactions","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"bank_feed_account\": \"bank_feed_account\",\n \"transaction_date\": \"2024-02-02T00:00:00Z\",\n \"posted_date\": \"2024-02-03T00:00:00Z\",\n \"amount\": 100.1,\n \"description\": \"Lunch expense\",\n \"transaction_type\": \"payment\",\n \"payee\": \"Elmo's diner\",\n \"credit_or_debit\": \"CREDIT\",\n \"source_transaction_id\": \"124569\",\n \"remote_was_deleted\": true,\n \"is_processed\": true\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8f9c412a-cb03-4e35-bd6d-3194a8eee72f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ce201072-0d5c-48d7-9de6-2e5012ada132","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/bank-feed-transactions/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"bank_feed_account\": \"bank_feed_account\",\n \"transaction_date\": \"2024-02-02T00:00:00Z\",\n \"posted_date\": \"2024-02-03T00:00:00Z\",\n \"amount\": 100.1,\n \"description\": \"Lunch expense\",\n \"transaction_type\": \"payment\",\n \"payee\": \"Elmo's diner\",\n \"credit_or_debit\": \"CREDIT\",\n \"source_transaction_id\": \"124569\",\n \"remote_was_deleted\": true,\n \"is_processed\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ce201072-0d5c-48d7-9de6-2e5012ada132","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"198f17e4-4798-427a-b867-07596f87569a","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/bank-feed-transactions/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"198f17e4-4798-427a-b867-07596f87569a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"27498b18-fb72-4ba6-b7fe-1231c7456c58","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/cash-flow-statements","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"remote_id\": \"8211088\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"CashFlow\",\n \"currency\": \"XUA\",\n \"company\": \"company\",\n \"start_period\": \"2020-01-01T00:00:00Z\",\n \"end_period\": \"2020-03-31T00:00:00Z\",\n \"cash_at_beginning_of_period\": 5000,\n \"cash_at_end_of_period\": 4063.52,\n \"operating_activities\": [\n {\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-09-18T00:00:00Z\",\n \"name\": \"Operating Activities\",\n \"value\": 1000,\n \"sub_items\": [\n {\n \"remote_id\": \"23042938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-09-18T00:00:00Z\",\n \"name\": \"Net Income\",\n \"value\": 1097.13\n }\n ]\n }\n ],\n \"investing_activities\": [\n {\n \"remote_id\": \"192406939\",\n \"created_at\": \"2021-11-15T00:00:00Z\",\n \"modified_at\": \"2021-11-18T00:00:00Z\",\n \"name\": \"Equipment\",\n \"value\": 1000,\n \"sub_items\": [\n {\n \"created_at\": \"2021-11-15T00:00:00Z\",\n \"modified_at\": \"2021-09-18T00:00:00Z\",\n \"name\": \"Equipment\",\n \"value\": 1000\n }\n ]\n }\n ],\n \"financing_activities\": [\n {\n \"remote_id\": \"192406939\",\n \"created_at\": \"2021-11-15T00:00:00Z\",\n \"modified_at\": \"2021-11-15T00:00:00Z\",\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ]\n }\n ],\n \"remote_generated_at\": \"2020-04-01T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"27498b18-fb72-4ba6-b7fe-1231c7456c58","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"40f4ca70-e9a5-469d-bd80-c03ee8e38d49","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/cash-flow-statements/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"remote_id\": \"8211088\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"CashFlow\",\n \"currency\": \"XUA\",\n \"company\": \"company\",\n \"start_period\": \"2020-01-01T00:00:00Z\",\n \"end_period\": \"2020-03-31T00:00:00Z\",\n \"cash_at_beginning_of_period\": 5000,\n \"cash_at_end_of_period\": 4063.52,\n \"operating_activities\": [\n {\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-09-18T00:00:00Z\",\n \"name\": \"Operating Activities\",\n \"value\": 1000,\n \"sub_items\": [\n {\n \"remote_id\": \"23042938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-09-18T00:00:00Z\",\n \"name\": \"Net Income\",\n \"value\": 1097.13\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"investing_activities\": [\n {\n \"remote_id\": \"192406939\",\n \"created_at\": \"2021-11-15T00:00:00Z\",\n \"modified_at\": \"2021-11-18T00:00:00Z\",\n \"name\": \"Equipment\",\n \"value\": 1000,\n \"sub_items\": [\n {\n \"created_at\": \"2021-11-15T00:00:00Z\",\n \"modified_at\": \"2021-09-18T00:00:00Z\",\n \"name\": \"Equipment\",\n \"value\": 1000\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"financing_activities\": [\n {\n \"remote_id\": \"192406939\",\n \"created_at\": \"2021-11-15T00:00:00Z\",\n \"modified_at\": \"2021-11-15T00:00:00Z\",\n \"name\": \"Revenue\",\n \"value\": 1000,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"remote_generated_at\": \"2020-04-01T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"40f4ca70-e9a5-469d-bd80-c03ee8e38d49","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"dab8d60c-495c-4eac-87fb-0a65fc81dbf6","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/company-info","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"65d8ffd0-211b-4ba4-b85a-fbe2ce220982\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Merge Pickleball Company\",\n \"legal_name\": \"Merge Pickleball Company Inc.\",\n \"tax_number\": \"11-0011000\",\n \"fiscal_year_end_month\": 12,\n \"fiscal_year_end_day\": 31,\n \"currency\": {\n \"key\": \"value\"\n },\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"urls\": [\n null\n ],\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"2920 Broadway\",\n \"street_2\": \"2nd Floor\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"country\": \"US\",\n \"zip_code\": \"10027\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\"\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"dab8d60c-495c-4eac-87fb-0a65fc81dbf6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"7c6be981-ff4c-48d5-97e4-dfe8ec15add3","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/company-info/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"65d8ffd0-211b-4ba4-b85a-fbe2ce220982\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Merge Pickleball Company\",\n \"legal_name\": \"Merge Pickleball Company Inc.\",\n \"tax_number\": \"11-0011000\",\n \"fiscal_year_end_month\": 12,\n \"fiscal_year_end_day\": 31,\n \"currency\": {\n \"key\": \"value\"\n },\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"urls\": [\n \"urls\"\n ],\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"type\": \"BILLING\",\n \"street_1\": \"2920 Broadway\",\n \"street_2\": \"2nd Floor\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"country_subdivision\": \"NY\",\n \"country\": \"US\",\n \"zip_code\": \"10027\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"number\": \"+3198675309\",\n \"type\": \"Mobile\"\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7c6be981-ff4c-48d5-97e4-dfe8ec15add3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"2ef66c6d-007d-47b1-92e4-a1e2104f40c7","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/contacts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"remote_id\": \"11167\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig's pickleball store\",\n \"is_supplier\": true,\n \"is_customer\": true,\n \"email_address\": \"pickleball@merge.dev\",\n \"tax_number\": \"12-3456789\",\n \"status\": \"ACTIVE\",\n \"currency\": \"USD\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"addresses\": [\n \"2f2702aa-8948-492b-a412-2acdf6d2c499\",\n \"d98c7428-8dda-48a8-a1da-c570f65e2375\"\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"number\": \"+3198675309\",\n \"type\": \"Mobile\"\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2ef66c6d-007d-47b1-92e4-a1e2104f40c7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"00744dd8-1712-4006-a805-1beab9dc5d07","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/contacts","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"remote_id\": \"11167\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig's pickleball store\",\n \"is_supplier\": true,\n \"is_customer\": true,\n \"email_address\": \"pickleball@merge.dev\",\n \"tax_number\": \"12-3456789\",\n \"status\": \"ACTIVE\",\n \"currency\": \"USD\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"addresses\": [\n \"2f2702aa-8948-492b-a412-2acdf6d2c499\",\n \"d98c7428-8dda-48a8-a1da-c570f65e2375\"\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"number\": \"+3198675309\",\n \"type\": \"Mobile\"\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"00744dd8-1712-4006-a805-1beab9dc5d07","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"aab7c6c9-f9ff-449c-9634-f6746c98269d","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/contacts/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"remote_id\": \"11167\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig's pickleball store\",\n \"is_supplier\": true,\n \"is_customer\": true,\n \"email_address\": \"pickleball@merge.dev\",\n \"tax_number\": \"12-3456789\",\n \"status\": \"ACTIVE\",\n \"currency\": \"USD\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"addresses\": [\n \"2f2702aa-8948-492b-a412-2acdf6d2c499\",\n \"d98c7428-8dda-48a8-a1da-c570f65e2375\"\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"number\": \"+3198675309\",\n \"type\": \"Mobile\"\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"aab7c6c9-f9ff-449c-9634-f6746c98269d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"9546dcbd-af56-49a6-a360-5634eaeb333c","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/contacts/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9546dcbd-af56-49a6-a360-5634eaeb333c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"23cec0d2-b763-4be9-8889-a09a57ce0141","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/contacts/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"23cec0d2-b763-4be9-8889-a09a57ce0141","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2021c8d3-30be-4b25-bf30-50d3536c22fe","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/credit-notes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"remote_id\": \"123877\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"status\": \"SUBMITTED\",\n \"number\": \"CN-29\",\n \"contact\": \"contact\",\n \"company\": \"company\",\n \"exchange_rate\": \"2.9\",\n \"total_amount\": 50,\n \"remaining_credit\": 20,\n \"inclusive_of_tax\": true,\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"item\": \"0e3fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"name\": \"Basic Monthly\",\n \"description\": \"prorated amount for items\",\n \"quantity\": \"quantity\",\n \"memo\": \"privNote\",\n \"unit_price\": \"5.0\",\n \"tax_rate\": \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"total_line_amount\": \"5.0\",\n \"tracking_categories\": [\n \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"account\": \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"remote_was_deleted\": true\n }\n ],\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"currency\": \"XUA\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"a9a94a75-19c1-41fe-90d8-d9ba959c38e5\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"applied_to_lines\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"invoice\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2021c8d3-30be-4b25-bf30-50d3536c22fe","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"4aa7d999-5d12-494c-8d40-dbfda8153d81","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/credit-notes","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"remote_id\": \"123877\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"status\": \"SUBMITTED\",\n \"number\": \"CN-29\",\n \"contact\": \"contact\",\n \"company\": \"company\",\n \"exchange_rate\": \"2.9\",\n \"total_amount\": 50,\n \"remaining_credit\": 20,\n \"inclusive_of_tax\": true,\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"item\": \"0e3fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"name\": \"Basic Monthly\",\n \"description\": \"prorated amount for items\",\n \"quantity\": \"quantity\",\n \"memo\": \"privNote\",\n \"unit_price\": \"5.0\",\n \"tax_rate\": \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"total_line_amount\": \"5.0\",\n \"tracking_categories\": [\n \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"account\": \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"remote_was_deleted\": true\n }\n ],\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"currency\": \"XUA\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"a9a94a75-19c1-41fe-90d8-d9ba959c38e5\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"applied_to_lines\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"invoice\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4aa7d999-5d12-494c-8d40-dbfda8153d81","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1a8ac73e-4fc4-484d-ac6d-94e2dbc04c6a","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/credit-notes/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"remote_id\": \"123877\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"status\": \"SUBMITTED\",\n \"number\": \"CN-29\",\n \"contact\": \"contact\",\n \"company\": \"company\",\n \"exchange_rate\": \"2.9\",\n \"total_amount\": 50,\n \"remaining_credit\": 20,\n \"inclusive_of_tax\": true,\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"item\": \"0e3fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"name\": \"Basic Monthly\",\n \"description\": \"prorated amount for items\",\n \"quantity\": \"quantity\",\n \"memo\": \"privNote\",\n \"unit_price\": \"5.0\",\n \"tax_rate\": \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"total_line_amount\": \"5.0\",\n \"tracking_categories\": [\n \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"account\": \"8d9fd929-436c-4fd4-a48b-0c61f68d6178\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"remote_was_deleted\": true\n }\n ],\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"currency\": \"XUA\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"a9a94a75-19c1-41fe-90d8-d9ba959c38e5\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"applied_to_lines\": [\n {\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"invoice\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\",\n \"remote_was_deleted\": true\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1a8ac73e-4fc4-484d-ac6d-94e2dbc04c6a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"7a88d19b-8405-44d2-90df-cd69f598018a","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/credit-notes/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7a88d19b-8405-44d2-90df-cd69f598018a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"881d86be-e646-4877-8fb6-ff7e3f2510d8","name":"default_scopes_retrieve - default","request":{"urlPathTemplate":"/accounting/v1/default-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"881d86be-e646-4877-8fb6-ff7e3f2510d8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"c8cb7b25-e95f-4737-a37e-51ecd11b665a","name":"linked_account_scopes_retrieve - default","request":{"urlPathTemplate":"/accounting/v1/linked-account-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c8cb7b25-e95f-4737-a37e-51ecd11b665a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"50fc5733-0415-4dd7-b689-2a4a03cc9f9f","name":"linked_account_scopes_create - default","request":{"urlPathTemplate":"/accounting/v1/linked-account-scopes","method":"POST"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"50fc5733-0415-4dd7-b689-2a4a03cc9f9f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"0e0549da-cdec-400e-89ef-439e598ff471","name":"delete - default","request":{"urlPathTemplate":"/accounting/v1/delete-account","method":"POST"},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"0e0549da-cdec-400e-89ef-439e598ff471","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"07e26058-25f4-4a1a-8383-897f87dfa7eb","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/employees","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"remote_id\": \"11167\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"is_contractor\": true,\n \"employee_number\": \"325462\",\n \"email_address\": \"johnsmith@merge.dev\",\n \"company\": \"company\",\n \"status\": \"ACTIVE\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"07e26058-25f4-4a1a-8383-897f87dfa7eb","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"5e1dc4e6-d78c-4195-8bef-ef4256f95f60","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/employees/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"remote_id\": \"11167\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"is_contractor\": true,\n \"employee_number\": \"325462\",\n \"email_address\": \"johnsmith@merge.dev\",\n \"company\": \"company\",\n \"status\": \"ACTIVE\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5e1dc4e6-d78c-4195-8bef-ef4256f95f60","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"35ef9726-9403-44fe-be70-7f8e0b6a232b","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/expenses","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2024-01-15T09:30:00Z\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"account\": \"account\",\n \"contact\": \"contact\",\n \"total_amount\": 10000,\n \"sub_total\": 1.1,\n \"total_tax_amount\": 1.1,\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"inclusive_of_tax\": true,\n \"company\": \"company\",\n \"employee\": \"employee\",\n \"memo\": \"New employee supplies\",\n \"lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"item\": \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"net_amount\": 25.54,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"7442f0d5-722d-45bd-b807-6e38489d37fe\",\n \"account\": \"2a56344a-a491-11ec-b909-0242ac120002\",\n \"contact\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"description\": \"MacBook Pro\",\n \"exchange_rate\": \"2.9\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121223\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"item\": \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"net_amount\": 10,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"account\": \"2a56344a-a491-11ec-b909-0242ac120002\",\n \"description\": \"Desk Lamp\"\n }\n ],\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"remote_was_deleted\": true,\n \"accounting_period\": \"accounting_period\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"35ef9726-9403-44fe-be70-7f8e0b6a232b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"29d172d7-2b92-4119-a851-00a2683028e5","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/expenses","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2024-01-15T09:30:00Z\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"account\": \"account\",\n \"contact\": \"contact\",\n \"total_amount\": 10000,\n \"sub_total\": 1.1,\n \"total_tax_amount\": 1.1,\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"inclusive_of_tax\": true,\n \"company\": \"company\",\n \"employee\": \"employee\",\n \"memo\": \"New employee supplies\",\n \"lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"item\": \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"net_amount\": 25.54,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"7442f0d5-722d-45bd-b807-6e38489d37fe\",\n \"account\": \"2a56344a-a491-11ec-b909-0242ac120002\",\n \"contact\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"description\": \"MacBook Pro\",\n \"exchange_rate\": \"2.9\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121223\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"item\": \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"net_amount\": 10,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"account\": \"2a56344a-a491-11ec-b909-0242ac120002\",\n \"description\": \"Desk Lamp\"\n }\n ],\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"remote_was_deleted\": true,\n \"accounting_period\": \"accounting_period\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"29d172d7-2b92-4119-a851-00a2683028e5","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1dd4b3a9-18de-4d32-888d-62a728803155","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/expenses/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2024-01-15T09:30:00Z\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"account\": \"account\",\n \"contact\": \"contact\",\n \"total_amount\": 10000,\n \"sub_total\": 1.1,\n \"total_tax_amount\": 1.1,\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"inclusive_of_tax\": true,\n \"company\": \"company\",\n \"employee\": \"employee\",\n \"memo\": \"New employee supplies\",\n \"lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"item\": \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"net_amount\": 25.54,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"7442f0d5-722d-45bd-b807-6e38489d37fe\",\n \"currency\": \"XUA\",\n \"account\": \"2a56344a-a491-11ec-b909-0242ac120002\",\n \"contact\": \"c640b80b-fac9-409f-aa19-1f9221aec445\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"description\": \"MacBook Pro\",\n \"exchange_rate\": \"2.9\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121223\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"item\": \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"net_amount\": 10,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"employee\",\n \"currency\": \"XUA\",\n \"account\": \"2a56344a-a491-11ec-b909-0242ac120002\",\n \"contact\": \"contact\",\n \"project\": \"project\",\n \"description\": \"Desk Lamp\",\n \"exchange_rate\": \"2.9\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"remote_was_deleted\": true\n }\n ],\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"remote_was_deleted\": true,\n \"accounting_period\": \"accounting_period\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1dd4b3a9-18de-4d32-888d-62a728803155","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f906ae44-bb90-4824-a4e8-4fe47fece141","name":"linesRemoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/expenses/lines/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f906ae44-bb90-4824-a4e8-4fe47fece141","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e387b650-1e3f-4208-a33a-a34aa9a36037","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/expenses/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e387b650-1e3f-4208-a33a-a34aa9a36037","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"bcf2dd02-bf79-4703-b8b0-1d26893408c7","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/expenses/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"bcf2dd02-bf79-4703-b8b0-1d26893408c7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"226a98c2-7e84-4724-bace-529f02311ad5","name":"field_mappings_retrieve - default","request":{"urlPathTemplate":"/accounting/v1/field-mappings","method":"GET"},"response":{"status":200,"body":"{\n \"Account\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"AccountingAttachment\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"BalanceSheet\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"CashFlowStatement\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"CompanyInfo\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Contact\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"IncomeStatement\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"CreditNote\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Item\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"PurchaseOrder\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"TrackingCategory\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"JournalEntry\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"TaxRate\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Invoice\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Payment\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Expense\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"VendorCredit\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Transaction\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"AccountingPeriod\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"GeneralLedgerTransaction\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"BankFeedAccount\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Employee\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"PaymentMethod\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Project\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"PaymentTerm\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"226a98c2-7e84-4724-bace-529f02311ad5","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"10e59de4-aa67-4057-b5c5-17b8c44ba57c","name":"field_mappings_create - default","request":{"urlPathTemplate":"/accounting/v1/field-mappings","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"10e59de4-aa67-4057-b5c5-17b8c44ba57c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"17affc86-414d-4f46-8f15-127e2c7bc977","name":"field_mappings_destroy - default","request":{"urlPathTemplate":"/accounting/v1/field-mappings/{field_mapping_id}","method":"DELETE","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":204,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"17affc86-414d-4f46-8f15-127e2c7bc977","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"c5be03de-323b-49ad-83fd-19ede6690c53","name":"field_mappings_partial_update - default","request":{"urlPathTemplate":"/accounting/v1/field-mappings/{field_mapping_id}","method":"PATCH","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c5be03de-323b-49ad-83fd-19ede6690c53","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"19120ce6-9ee2-4010-b43f-62320d45a789","name":"remote_fields_retrieve - default","request":{"urlPathTemplate":"/accounting/v1/remote-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Account\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"AccountingAttachment\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"BalanceSheet\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"CashFlowStatement\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"CompanyInfo\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Contact\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"IncomeStatement\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"CreditNote\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Item\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"PurchaseOrder\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"TrackingCategory\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"JournalEntry\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"TaxRate\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Invoice\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Payment\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Expense\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"VendorCredit\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Transaction\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"AccountingPeriod\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"GeneralLedgerTransaction\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"BankFeedAccount\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Employee\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"PaymentMethod\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Project\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"PaymentTerm\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"19120ce6-9ee2-4010-b43f-62320d45a789","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"9d554b19-8906-49e6-b37d-c513e9cafff7","name":"target_fields_retrieve - default","request":{"urlPathTemplate":"/accounting/v1/target-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Account\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"AccountingAttachment\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"BalanceSheet\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"CashFlowStatement\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"CompanyInfo\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Contact\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"IncomeStatement\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"CreditNote\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Item\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"PurchaseOrder\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"TrackingCategory\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"JournalEntry\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"TaxRate\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Invoice\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Payment\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Expense\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"VendorCredit\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Transaction\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"AccountingPeriod\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"GeneralLedgerTransaction\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"BankFeedAccount\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Employee\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"PaymentMethod\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Project\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"PaymentTerm\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9d554b19-8906-49e6-b37d-c513e9cafff7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"cd750921-cf74-415e-ae51-fe11e53a6548","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/general-ledger-transactions","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"underlying_transaction_remote_id\": \"1234\",\n \"underlying_transaction_type\": \"INVOICE\",\n \"accounting_period\": \"accounting_period\",\n \"company\": \"company\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"posting_date\": \"2020-03-31T00:00:00Z\",\n \"general_ledger_transaction_lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"123\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"account\": \"a47e11b6-c73b-4a0c-be31-130fc48177fa\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"contact\": \"d6e687d6-0c36-48a1-8114-35324b5cb38f\",\n \"base_currency\": \"USD\",\n \"transaction_currency\": \"USD\",\n \"exchange_rate\": \"exchange_rate\",\n \"description\": \"Invoice created\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"debit_amount\": \"debit_amount\",\n \"credit_amount\": \"credit_amount\",\n \"item\": \"a47e11b6-c73b-4a0c-be31-130fc48177fa\",\n \"foreign_debit_amount\": \"foreign_debit_amount\",\n \"foreign_credit_amount\": \"foreign_credit_amount\",\n \"remote_was_deleted\": false\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"cd750921-cf74-415e-ae51-fe11e53a6548","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"c0af585a-2948-4727-99c0-96558389d71e","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/general-ledger-transactions/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"underlying_transaction_remote_id\": \"1234\",\n \"underlying_transaction_type\": \"INVOICE\",\n \"accounting_period\": \"accounting_period\",\n \"company\": \"company\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"posting_date\": \"2020-03-31T00:00:00Z\",\n \"general_ledger_transaction_lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"123\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"account\": \"a47e11b6-c73b-4a0c-be31-130fc48177fa\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"employee\",\n \"contact\": \"d6e687d6-0c36-48a1-8114-35324b5cb38f\",\n \"project\": \"project\",\n \"base_currency\": \"USD\",\n \"transaction_currency\": \"USD\",\n \"exchange_rate\": \"exchange_rate\",\n \"description\": \"Invoice created\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"debit_amount\": \"debit_amount\",\n \"credit_amount\": \"credit_amount\",\n \"item\": \"a47e11b6-c73b-4a0c-be31-130fc48177fa\",\n \"foreign_debit_amount\": \"foreign_debit_amount\",\n \"foreign_credit_amount\": \"foreign_credit_amount\",\n \"remote_was_deleted\": false,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n }\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c0af585a-2948-4727-99c0-96558389d71e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"8b235976-659d-4f7f-9535-ec1a1107ecd9","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/generate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8b235976-659d-4f7f-9535-ec1a1107ecd9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"47369ba6-1754-486c-ba90-7f9413774a37","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/income-statements","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"1342348\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"IncomeStatement\",\n \"currency\": \"XUA\",\n \"company\": \"company\",\n \"start_period\": \"2024-01-15T09:30:00Z\",\n \"end_period\": \"2024-01-15T09:30:00Z\",\n \"income\": [\n {\n \"remote_id\": \"10299\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Total Income\",\n \"value\": 325,\n \"sub_items\": [\n {\n \"remote_id\": \"10200\",\n \"name\": \"Landscaping Services\",\n \"value\": 425\n },\n {\n \"remote_id\": \"10201\",\n \"name\": \"Pest Control Services\",\n \"value\": -100\n }\n ]\n }\n ],\n \"cost_of_sales\": [\n {\n \"remote_id\": \"10299\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Total COGS\",\n \"value\": 25,\n \"sub_items\": [\n {\n \"remote_id\": \"10200\",\n \"name\": \"Supplies\",\n \"value\": 10\n }\n ]\n }\n ],\n \"gross_profit\": 300,\n \"operating_expenses\": [\n {\n \"remote_id\": \"10299\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Total Operating Expenses\",\n \"value\": 100,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ]\n }\n ],\n \"net_operating_income\": 200,\n \"non_operating_expenses\": [\n {\n \"remote_id\": \"10299\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Total Non-Operating Expenses\",\n \"value\": 100,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ]\n }\n ],\n \"net_income\": 100,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"47369ba6-1754-486c-ba90-7f9413774a37","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"885ef5e4-58a8-4013-8970-52a448506636","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/income-statements/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"1342348\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"IncomeStatement\",\n \"currency\": \"XUA\",\n \"company\": \"company\",\n \"start_period\": \"2024-01-15T09:30:00Z\",\n \"end_period\": \"2024-01-15T09:30:00Z\",\n \"income\": [\n {\n \"remote_id\": \"10299\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Total Income\",\n \"value\": 325,\n \"sub_items\": [\n {\n \"remote_id\": \"10200\",\n \"name\": \"Landscaping Services\",\n \"value\": 425\n },\n {\n \"remote_id\": \"10201\",\n \"name\": \"Pest Control Services\",\n \"value\": -100\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"cost_of_sales\": [\n {\n \"remote_id\": \"10299\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Total COGS\",\n \"value\": 25,\n \"sub_items\": [\n {\n \"remote_id\": \"10200\",\n \"name\": \"Supplies\",\n \"value\": 10\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"gross_profit\": 300,\n \"operating_expenses\": [\n {\n \"remote_id\": \"10299\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Total Operating Expenses\",\n \"value\": 100,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"net_operating_income\": 200,\n \"non_operating_expenses\": [\n {\n \"remote_id\": \"10299\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Total Non-Operating Expenses\",\n \"value\": 100,\n \"sub_items\": [\n {\n \"remote_id\": \"10300\",\n \"name\": \"Revenue - San Francisco\",\n \"value\": 500\n },\n {\n \"remote_id\": \"10301\",\n \"name\": \"Revenue - New York\",\n \"value\": 500\n }\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"net_income\": 100,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"885ef5e4-58a8-4013-8970-52a448506636","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"62710e49-eb62-4d86-9ab3-9c5c5afaa11e","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/invoices","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\",\n \"remote_id\": \"990110\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"type\": \"ACCOUNTS_RECEIVABLE\",\n \"contact\": \"contact\",\n \"number\": \"AIQ12546\",\n \"issue_date\": \"2020-03-31T00:00:00Z\",\n \"due_date\": \"2020-04-15T00:00:00Z\",\n \"paid_on_date\": \"2020-04-01T00:00:00Z\",\n \"memo\": \"Weekly Payment\",\n \"company\": \"company\",\n \"employee\": \"employee\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"payment_term\": \"payment_term\",\n \"total_discount\": 1.1,\n \"sub_total\": 100,\n \"status\": \"PAID\",\n \"total_tax_amount\": 5,\n \"total_amount\": 105,\n \"balance\": 105,\n \"remote_updated_at\": \"2020-04-01T00:00:00Z\",\n \"tracking_categories\": [\n \"7dc5ca17-d311-44cd-9ce0-333080367a18\",\n \"6aa0700c-48e1-4c4a-8162-02e6a582df05\",\n \"8c933d61-8f5b-4360-ac0c-c9dc87bee763\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"purchase_orders\": [\n \"e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7\",\n \"dd70ca2f-b120-46fa-889a-9604037f45fd\",\n \"889b281d-739c-4759-95b8-0aedb3947131\"\n ],\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"9017594e-dc33-4113-a5d2-b0f928e34fdd\"\n ],\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"8765432\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball lessons\",\n \"unit_price\": 50,\n \"quantity\": 1,\n \"total_amount\": 50,\n \"employee\": \"7442f0d5-722d-45bd-b807-6e38489d37fe\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"currency\": \"USD\",\n \"exchange_rate\": \"2.9\",\n \"item\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"account\": \"cd0f32d4-a493-11ec-b909-0242ac120002\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\"\n }\n ],\n \"applied_credit_notes\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"credit_note\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"applied_vendor_credits\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"vendor_credit\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"inclusive_of_tax\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"62710e49-eb62-4d86-9ab3-9c5c5afaa11e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"5d134c4e-563c-4d07-975d-ac4eaf1a7f6c","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/invoices","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\",\n \"remote_id\": \"990110\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"type\": \"ACCOUNTS_RECEIVABLE\",\n \"contact\": \"contact\",\n \"number\": \"AIQ12546\",\n \"issue_date\": \"2020-03-31T00:00:00Z\",\n \"due_date\": \"2020-04-15T00:00:00Z\",\n \"paid_on_date\": \"2020-04-01T00:00:00Z\",\n \"memo\": \"Weekly Payment\",\n \"company\": \"company\",\n \"employee\": \"employee\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"payment_term\": \"payment_term\",\n \"total_discount\": 1.1,\n \"sub_total\": 100,\n \"status\": \"PAID\",\n \"total_tax_amount\": 5,\n \"total_amount\": 105,\n \"balance\": 105,\n \"remote_updated_at\": \"2020-04-01T00:00:00Z\",\n \"tracking_categories\": [\n \"7dc5ca17-d311-44cd-9ce0-333080367a18\",\n \"6aa0700c-48e1-4c4a-8162-02e6a582df05\",\n \"8c933d61-8f5b-4360-ac0c-c9dc87bee763\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"purchase_orders\": [\n \"e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7\",\n \"dd70ca2f-b120-46fa-889a-9604037f45fd\",\n \"889b281d-739c-4759-95b8-0aedb3947131\"\n ],\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"9017594e-dc33-4113-a5d2-b0f928e34fdd\"\n ],\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"8765432\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball lessons\",\n \"unit_price\": 50,\n \"quantity\": 1,\n \"total_amount\": 50,\n \"employee\": \"7442f0d5-722d-45bd-b807-6e38489d37fe\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"currency\": \"USD\",\n \"exchange_rate\": \"2.9\",\n \"item\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"account\": \"cd0f32d4-a493-11ec-b909-0242ac120002\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\"\n }\n ],\n \"applied_credit_notes\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"credit_note\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"applied_vendor_credits\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"vendor_credit\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"inclusive_of_tax\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5d134c4e-563c-4d07-975d-ac4eaf1a7f6c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ee012129-6eea-4a93-af1d-acc5fb657512","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/invoices/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\",\n \"remote_id\": \"990110\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"type\": \"ACCOUNTS_RECEIVABLE\",\n \"contact\": \"contact\",\n \"number\": \"AIQ12546\",\n \"issue_date\": \"2020-03-31T00:00:00Z\",\n \"due_date\": \"2020-04-15T00:00:00Z\",\n \"paid_on_date\": \"2020-04-01T00:00:00Z\",\n \"memo\": \"Weekly Payment\",\n \"company\": \"company\",\n \"employee\": \"employee\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"payment_term\": \"payment_term\",\n \"total_discount\": 1.1,\n \"sub_total\": 100,\n \"status\": \"PAID\",\n \"total_tax_amount\": 5,\n \"total_amount\": 105,\n \"balance\": 105,\n \"remote_updated_at\": \"2020-04-01T00:00:00Z\",\n \"tracking_categories\": [\n \"7dc5ca17-d311-44cd-9ce0-333080367a18\",\n \"6aa0700c-48e1-4c4a-8162-02e6a582df05\",\n \"8c933d61-8f5b-4360-ac0c-c9dc87bee763\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"purchase_orders\": [\n \"e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7\",\n \"dd70ca2f-b120-46fa-889a-9604037f45fd\",\n \"889b281d-739c-4759-95b8-0aedb3947131\"\n ],\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"9017594e-dc33-4113-a5d2-b0f928e34fdd\"\n ],\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"8765432\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball lessons\",\n \"unit_price\": 50,\n \"quantity\": 1,\n \"total_amount\": 50,\n \"employee\": \"7442f0d5-722d-45bd-b807-6e38489d37fe\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"currency\": \"USD\",\n \"exchange_rate\": \"2.9\",\n \"item\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"account\": \"cd0f32d4-a493-11ec-b909-0242ac120002\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ],\n \"applied_credit_notes\": [\n {\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"credit_note\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\",\n \"remote_was_deleted\": true\n }\n ],\n \"applied_vendor_credits\": [\n {\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"vendor_credit\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\",\n \"remote_was_deleted\": true\n }\n ],\n \"inclusive_of_tax\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ee012129-6eea-4a93-af1d-acc5fb657512","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"4a6629e7-6270-42e4-b1e7-e19d93f98ee7","name":"partialUpdate - default","request":{"urlPathTemplate":"/accounting/v1/invoices/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\",\n \"remote_id\": \"990110\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"type\": \"ACCOUNTS_RECEIVABLE\",\n \"contact\": \"contact\",\n \"number\": \"AIQ12546\",\n \"issue_date\": \"2020-03-31T00:00:00Z\",\n \"due_date\": \"2020-04-15T00:00:00Z\",\n \"paid_on_date\": \"2020-04-01T00:00:00Z\",\n \"memo\": \"Weekly Payment\",\n \"company\": \"company\",\n \"employee\": \"employee\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"payment_term\": \"payment_term\",\n \"total_discount\": 1.1,\n \"sub_total\": 100,\n \"status\": \"PAID\",\n \"total_tax_amount\": 5,\n \"total_amount\": 105,\n \"balance\": 105,\n \"remote_updated_at\": \"2020-04-01T00:00:00Z\",\n \"tracking_categories\": [\n \"7dc5ca17-d311-44cd-9ce0-333080367a18\",\n \"6aa0700c-48e1-4c4a-8162-02e6a582df05\",\n \"8c933d61-8f5b-4360-ac0c-c9dc87bee763\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"purchase_orders\": [\n \"e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7\",\n \"dd70ca2f-b120-46fa-889a-9604037f45fd\",\n \"889b281d-739c-4759-95b8-0aedb3947131\"\n ],\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"9017594e-dc33-4113-a5d2-b0f928e34fdd\"\n ],\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"8765432\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball lessons\",\n \"unit_price\": 50,\n \"quantity\": 1,\n \"total_amount\": 50,\n \"employee\": \"7442f0d5-722d-45bd-b807-6e38489d37fe\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"currency\": \"USD\",\n \"exchange_rate\": \"2.9\",\n \"item\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"account\": \"cd0f32d4-a493-11ec-b909-0242ac120002\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\"\n }\n ],\n \"applied_credit_notes\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"credit_note\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"applied_vendor_credits\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"vendor_credit\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"inclusive_of_tax\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4a6629e7-6270-42e4-b1e7-e19d93f98ee7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"fddc8378-1938-4ae1-a6e5-03cf703e3465","name":"lineItemsRemoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/invoices/line-items/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"fddc8378-1938-4ae1-a6e5-03cf703e3465","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"d9540c08-54f9-490d-93d8-0ea32feaca6c","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/invoices/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d9540c08-54f9-490d-93d8-0ea32feaca6c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"63fee0ad-097b-4894-94b5-87869431677e","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/invoices/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"63fee0ad-097b-4894-94b5-87869431677e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"be029676-3bb6-4d82-94ec-61c256f76d0f","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/invoices/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"be029676-3bb6-4d82-94ec-61c256f76d0f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f13cf7e2-99c8-4d47-ad49-5fc5d952158e","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/issues","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f13cf7e2-99c8-4d47-ad49-5fc5d952158e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e8a23467-c45f-42fc-89ad-53ca23264677","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/issues/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e8a23467-c45f-42fc-89ad-53ca23264677","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"57f72cc6-750d-4edd-8389-855243d2baa6","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/items","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"d2f972d0-2526-434b-9409-4c3b468e08f0\",\n \"remote_id\": \"12374\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Pickleball Paddle\",\n \"status\": \"ACTIVE\",\n \"type\": \"INVENTORY\",\n \"unit_price\": 10,\n \"purchase_price\": 25,\n \"purchase_account\": \"purchase_account\",\n \"sales_account\": \"sales_account\",\n \"company\": \"company\",\n \"purchase_tax_rate\": \"purchase_tax_rate\",\n \"sales_tax_rate\": \"sales_tax_rate\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"57f72cc6-750d-4edd-8389-855243d2baa6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"6d0b8cd3-a7d3-4cc9-a3a6-9124288fb1dc","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/items","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"d2f972d0-2526-434b-9409-4c3b468e08f0\",\n \"remote_id\": \"12374\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Pickleball Paddle\",\n \"status\": \"ACTIVE\",\n \"type\": \"INVENTORY\",\n \"unit_price\": 10,\n \"purchase_price\": 25,\n \"purchase_account\": \"purchase_account\",\n \"sales_account\": \"sales_account\",\n \"company\": \"company\",\n \"purchase_tax_rate\": \"purchase_tax_rate\",\n \"sales_tax_rate\": \"sales_tax_rate\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6d0b8cd3-a7d3-4cc9-a3a6-9124288fb1dc","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"adfbe125-8a2e-41ce-945f-38b2f86d6389","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/items/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"d2f972d0-2526-434b-9409-4c3b468e08f0\",\n \"remote_id\": \"12374\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Pickleball Paddle\",\n \"status\": \"ACTIVE\",\n \"type\": \"INVENTORY\",\n \"unit_price\": 10,\n \"purchase_price\": 25,\n \"purchase_account\": \"purchase_account\",\n \"sales_account\": \"sales_account\",\n \"company\": \"company\",\n \"purchase_tax_rate\": \"purchase_tax_rate\",\n \"sales_tax_rate\": \"sales_tax_rate\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"adfbe125-8a2e-41ce-945f-38b2f86d6389","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"87133c47-964c-4932-ba4b-5f6674d5a933","name":"partialUpdate - default","request":{"urlPathTemplate":"/accounting/v1/items/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"d2f972d0-2526-434b-9409-4c3b468e08f0\",\n \"remote_id\": \"12374\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Pickleball Paddle\",\n \"status\": \"ACTIVE\",\n \"type\": \"INVENTORY\",\n \"unit_price\": 10,\n \"purchase_price\": 25,\n \"purchase_account\": \"purchase_account\",\n \"sales_account\": \"sales_account\",\n \"company\": \"company\",\n \"purchase_tax_rate\": \"purchase_tax_rate\",\n \"sales_tax_rate\": \"sales_tax_rate\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"87133c47-964c-4932-ba4b-5f6674d5a933","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"e2c4ddd5-8ab3-462e-a823-34f5a7786cbe","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/items/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e2c4ddd5-8ab3-462e-a823-34f5a7786cbe","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"9cdbf2e7-33bb-4eec-ba3e-628331666966","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/items/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9cdbf2e7-33bb-4eec-ba3e-628331666966","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"7b965faf-fb2b-4aba-b292-90cf2a0b6e6d","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/journal-entries","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"4311155d-f236-4a5d-9e0f-1cb167e38f95\"\n ],\n \"memo\": \"Weekly Payment\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"company\",\n \"inclusive_of_tax\": true,\n \"lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"account\": \"9d892439-5fab-4dbb-8bd8-34f7f96c7912\",\n \"net_amount\": 25.54,\n \"tracking_categories\": [\n \"d25d609b-945f-4762-b55a-1c8fb220c43c\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"123c8r35-5kf5-12x5-r833-99bwf35210b5\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"d2d5ea3c-b032-11ec-b909-0242ac120002\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"description\": \"Cash payment for lunch\",\n \"exchange_rate\": \"2.9\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121223\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"account\": \"f963f34d-3d2f-4f77-b557-cf36bc7e6498\",\n \"net_amount\": 10\n }\n ],\n \"journal_number\": \"42\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"remote_was_deleted\": true,\n \"posting_status\": \"UNPOSTED\",\n \"accounting_period\": \"accounting_period\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7b965faf-fb2b-4aba-b292-90cf2a0b6e6d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"13876672-3489-462a-a576-27c7588005e0","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/journal-entries","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"4311155d-f236-4a5d-9e0f-1cb167e38f95\"\n ],\n \"memo\": \"Weekly Payment\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"company\",\n \"inclusive_of_tax\": true,\n \"lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"account\": \"9d892439-5fab-4dbb-8bd8-34f7f96c7912\",\n \"net_amount\": 25.54,\n \"tracking_categories\": [\n \"d25d609b-945f-4762-b55a-1c8fb220c43c\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"123c8r35-5kf5-12x5-r833-99bwf35210b5\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"d2d5ea3c-b032-11ec-b909-0242ac120002\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"description\": \"Cash payment for lunch\",\n \"exchange_rate\": \"2.9\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121223\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"account\": \"f963f34d-3d2f-4f77-b557-cf36bc7e6498\",\n \"net_amount\": 10\n }\n ],\n \"journal_number\": \"42\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"remote_was_deleted\": true,\n \"posting_status\": \"UNPOSTED\",\n \"accounting_period\": \"accounting_period\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"13876672-3489-462a-a576-27c7588005e0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"4d36bbc1-c51b-4f4c-82fc-5d67ffb12d5d","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/journal-entries/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"payments\": [\n \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\"\n ],\n \"applied_payments\": [\n \"4311155d-f236-4a5d-9e0f-1cb167e38f95\"\n ],\n \"memo\": \"Weekly Payment\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"company\",\n \"inclusive_of_tax\": true,\n \"lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"account\": \"9d892439-5fab-4dbb-8bd8-34f7f96c7912\",\n \"net_amount\": 25.54,\n \"tracking_categories\": [\n \"d25d609b-945f-4762-b55a-1c8fb220c43c\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"currency\": \"XUA\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"123c8r35-5kf5-12x5-r833-99bwf35210b5\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"d2d5ea3c-b032-11ec-b909-0242ac120002\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"description\": \"Cash payment for lunch\",\n \"exchange_rate\": \"2.9\",\n \"remote_was_deleted\": false,\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121223\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"account\": \"f963f34d-3d2f-4f77-b557-cf36bc7e6498\",\n \"net_amount\": 10,\n \"tracking_categories\": [\n \"d25d609b-945f-4762-b55a-1c8fb220c43c\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"currency\": \"XUA\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"employee\": \"123c8r35-5kf5-12x5-r833-99bwf35210b5\",\n \"project\": \"project\",\n \"contact\": \"d2d5ea3c-b032-11ec-b909-0242ac120002\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"description\": \"Cash payment for lunch\",\n \"exchange_rate\": \"2.9\",\n \"remote_was_deleted\": true,\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ],\n \"journal_number\": \"42\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"remote_was_deleted\": true,\n \"posting_status\": \"UNPOSTED\",\n \"accounting_period\": \"accounting_period\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4d36bbc1-c51b-4f4c-82fc-5d67ffb12d5d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"aa16a917-b504-4b8f-8e62-896e53bf05d9","name":"linesRemoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/journal-entries/lines/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"aa16a917-b504-4b8f-8e62-896e53bf05d9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"0dc243f1-1e00-4919-8147-3ff4105a9d60","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/journal-entries/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0dc243f1-1e00-4919-8147-3ff4105a9d60","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"d993f52e-a2db-4ad2-bfcb-23bd770c7a21","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/journal-entries/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d993f52e-a2db-4ad2-bfcb-23bd770c7a21","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"23fd4eb5-7a73-488b-bd98-ae81fc78c54b","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/link-token","method":"POST"},"response":{"status":200,"body":"{\n \"link_token\": \"necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0\",\n \"integration_name\": \"Lever\",\n \"magic_link_url\": \"https://link.merge.dev/asdfjkl12345jsndfgi2i83n\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"23fd4eb5-7a73-488b-bd98-ae81fc78c54b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"3c7d64ed-e89f-4042-a1d5-9eaee4cfe779","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/linked-accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"e59b1821-f85c-4e28-a6b3-1804156f3563\",\n \"category\": \"hris\",\n \"status\": \"COMPLETE\",\n \"status_detail\": \"Invalid login credentials\",\n \"end_user_origin_id\": \"3ac95cde-6c7f-4eef-afec-be710b42308d\",\n \"end_user_organization_name\": \"Foo Bar, LLC\",\n \"end_user_email_address\": \"hradmin@foobar.dev\",\n \"subdomain\": \"foobar\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"integration\": {\n \"name\": \"name\",\n \"categories\": [\n \"hris\"\n ],\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n },\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3c7d64ed-e89f-4042-a1d5-9eaee4cfe779","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f4d3d111-e525-45a5-95c5-214d99446edf","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f4d3d111-e525-45a5-95c5-214d99446edf","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"10fe7bbf-3e9d-49f8-85e2-176a268913c3","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/payment-methods","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"method_type\": \"CREDIT_CARD\",\n \"name\": \"John Smith's Credit Card\",\n \"is_active\": true,\n \"remote_updated_at\": \"2021-09-15T00:00:00Z\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"10fe7bbf-3e9d-49f8-85e2-176a268913c3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a6887312-5458-45e6-bde1-241bd5fe0f3b","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/payment-methods/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"method_type\": \"CREDIT_CARD\",\n \"name\": \"John Smith's Credit Card\",\n \"is_active\": true,\n \"remote_updated_at\": \"2021-09-15T00:00:00Z\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a6887312-5458-45e6-bde1-241bd5fe0f3b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"17de0d22-b5eb-4001-a0f0-f0592bb704fe","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/payment-terms","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Net 30\",\n \"is_active\": true,\n \"company\": \"company\",\n \"days_until_due\": 30,\n \"discount_days\": 15,\n \"remote_last_modified_at\": \"2024-10-16T00:00:00Z\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"17de0d22-b5eb-4001-a0f0-f0592bb704fe","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"7ab89a76-bf4f-4f2c-b00a-99fd589ba764","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/payment-terms/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Net 30\",\n \"is_active\": true,\n \"company\": \"company\",\n \"days_until_due\": 30,\n \"discount_days\": 15,\n \"remote_last_modified_at\": \"2024-10-16T00:00:00Z\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7ab89a76-bf4f-4f2c-b00a-99fd589ba764","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"dd7406a9-6a1a-4d94-aa4b-99547bc48a16","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/payments","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"contact\": \"contact\",\n \"account\": \"account\",\n \"payment_method\": \"payment_method\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"company\",\n \"total_amount\": 50,\n \"type\": \"ACCOUNTS_PAYABLE\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"applied_to_lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"234\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"applied_amount\": \"25\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"related_object_id\": \"a47e11b6-c73b-4a0c-be31-130fc48177fa\",\n \"related_object_type\": \"INVOICE\"\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"235\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"applied_amount\": \"25\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"related_object_id\": \"9b96a886-29a5-452b-8733-2a1e03497cf4\",\n \"related_object_type\": \"CREDIT_NOTE\"\n }\n ],\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"dd7406a9-6a1a-4d94-aa4b-99547bc48a16","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"daf2e79f-498f-456d-a9b1-a451d5fc8b6a","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/payments","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"contact\": \"contact\",\n \"account\": \"account\",\n \"payment_method\": \"payment_method\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"company\",\n \"total_amount\": 50,\n \"type\": \"ACCOUNTS_PAYABLE\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"applied_to_lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"234\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"applied_amount\": \"25\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"related_object_id\": \"a47e11b6-c73b-4a0c-be31-130fc48177fa\",\n \"related_object_type\": \"INVOICE\"\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"235\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"applied_amount\": \"25\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"related_object_id\": \"9b96a886-29a5-452b-8733-2a1e03497cf4\",\n \"related_object_type\": \"CREDIT_NOTE\"\n }\n ],\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"daf2e79f-498f-456d-a9b1-a451d5fc8b6a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f02213e4-4281-43ff-9333-bb3867286e62","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/payments/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"contact\": \"contact\",\n \"account\": \"account\",\n \"payment_method\": \"payment_method\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"company\",\n \"total_amount\": 50,\n \"type\": \"ACCOUNTS_PAYABLE\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"applied_to_lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"234\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"applied_amount\": \"25\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"related_object_id\": \"a47e11b6-c73b-4a0c-be31-130fc48177fa\",\n \"related_object_type\": \"INVOICE\"\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"235\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"applied_amount\": \"25\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"related_object_id\": \"9b96a886-29a5-452b-8733-2a1e03497cf4\",\n \"related_object_type\": \"CREDIT_NOTE\"\n }\n ],\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f02213e4-4281-43ff-9333-bb3867286e62","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ab3cc000-e96b-4c7b-89ed-765c5f990c1c","name":"partialUpdate - default","request":{"urlPathTemplate":"/accounting/v1/payments/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"b26fd49a-cbae-470a-a8f8-bcbc119e0390\",\n \"remote_id\": \"987300\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"contact\": \"contact\",\n \"account\": \"account\",\n \"payment_method\": \"payment_method\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"company\",\n \"total_amount\": 50,\n \"type\": \"ACCOUNTS_PAYABLE\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"applied_to_lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"234\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"applied_amount\": \"25\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"related_object_id\": \"a47e11b6-c73b-4a0c-be31-130fc48177fa\",\n \"related_object_type\": \"INVOICE\"\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"235\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"applied_amount\": \"25\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"related_object_id\": \"9b96a886-29a5-452b-8733-2a1e03497cf4\",\n \"related_object_type\": \"CREDIT_NOTE\"\n }\n ],\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ab3cc000-e96b-4c7b-89ed-765c5f990c1c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"99a97c65-139d-451a-ab1d-a371a79ed43c","name":"lineItemsRemoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/payments/line-items/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"99a97c65-139d-451a-ab1d-a371a79ed43c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"93d206cf-c384-4c26-9006-6fb944bbd4c9","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/payments/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"93d206cf-c384-4c26-9006-6fb944bbd4c9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6f701109-c4a1-4a96-aedc-00551fb31cd9","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/payments/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6f701109-c4a1-4a96-aedc-00551fb31cd9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"17b8b37b-1080-4332-a5b5-c2aeea9ff286","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/payments/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"17b8b37b-1080-4332-a5b5-c2aeea9ff286","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"7c02ecd3-8561-4d5c-b05e-26e89b5f5a87","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/phone-numbers/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"number\": \"+3198675309\",\n \"type\": \"Mobile\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7c02ecd3-8561-4d5c-b05e-26e89b5f5a87","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"7654eedf-7cf0-446b-addf-b4285eeb5dba","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/projects","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Permissions Mapping\",\n \"is_active\": true,\n \"company\": \"company\",\n \"contact\": \"contact\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7654eedf-7cf0-446b-addf-b4285eeb5dba","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"ac068c0e-db9a-46cd-b4fb-0308d09fad33","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/projects/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Permissions Mapping\",\n \"is_active\": true,\n \"company\": \"company\",\n \"contact\": \"contact\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ac068c0e-db9a-46cd-b4fb-0308d09fad33","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"789ff966-a06f-4ebb-9686-395b18474fd3","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/purchase-orders","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0048ea5b-911e-4dff-9364-92070dea62ff\",\n \"remote_id\": \"239741\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"status\": \"DRAFT\",\n \"issue_date\": \"2020-03-31T00:00:00Z\",\n \"purchase_order_number\": \"PO1234\",\n \"delivery_date\": \"2020-04-15T00:00:00Z\",\n \"delivery_address\": \"delivery_address\",\n \"customer\": \"3e442c5d-8f51-4103-b5c9-dcee39c30a08\",\n \"vendor\": \"vendor\",\n \"memo\": \"private note\",\n \"company\": \"company\",\n \"total_amount\": 260,\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"payment_term\": \"payment_term\",\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball paddles\",\n \"unit_price\": 25,\n \"quantity\": 10,\n \"item\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"tax_amount\": \"tax_amount\",\n \"total_line_amount\": \"total_line_amount\",\n \"currency\": \"USD\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball Balls\",\n \"unit_price\": 1,\n \"quantity\": 10,\n \"item\": \"249c9faa-3045-4a31-953b-8f22d3613301\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"tax_amount\": \"tax_amount\",\n \"total_line_amount\": \"total_line_amount\"\n }\n ],\n \"inclusive_of_tax\": true,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"789ff966-a06f-4ebb-9686-395b18474fd3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"aacf5d98-62c5-407e-ac1c-17687163a640","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/purchase-orders","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"0048ea5b-911e-4dff-9364-92070dea62ff\",\n \"remote_id\": \"239741\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"status\": \"DRAFT\",\n \"issue_date\": \"2020-03-31T00:00:00Z\",\n \"purchase_order_number\": \"PO1234\",\n \"delivery_date\": \"2020-04-15T00:00:00Z\",\n \"delivery_address\": \"delivery_address\",\n \"customer\": \"3e442c5d-8f51-4103-b5c9-dcee39c30a08\",\n \"vendor\": \"vendor\",\n \"memo\": \"private note\",\n \"company\": \"company\",\n \"total_amount\": 260,\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"payment_term\": \"payment_term\",\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball paddles\",\n \"unit_price\": 25,\n \"quantity\": 10,\n \"item\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"tax_amount\": \"tax_amount\",\n \"total_line_amount\": \"total_line_amount\",\n \"currency\": \"USD\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball Balls\",\n \"unit_price\": 1,\n \"quantity\": 10,\n \"item\": \"249c9faa-3045-4a31-953b-8f22d3613301\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"tax_amount\": \"tax_amount\",\n \"total_line_amount\": \"total_line_amount\"\n }\n ],\n \"inclusive_of_tax\": true,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"aacf5d98-62c5-407e-ac1c-17687163a640","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"dd2c1309-2c59-460c-9f72-9d0e99af9d66","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/purchase-orders/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"0048ea5b-911e-4dff-9364-92070dea62ff\",\n \"remote_id\": \"239741\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"status\": \"DRAFT\",\n \"issue_date\": \"2020-03-31T00:00:00Z\",\n \"purchase_order_number\": \"PO1234\",\n \"delivery_date\": \"2020-04-15T00:00:00Z\",\n \"delivery_address\": \"delivery_address\",\n \"customer\": \"3e442c5d-8f51-4103-b5c9-dcee39c30a08\",\n \"vendor\": \"vendor\",\n \"memo\": \"private note\",\n \"company\": \"company\",\n \"total_amount\": 260,\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"payment_term\": \"payment_term\",\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball paddles\",\n \"unit_price\": 25,\n \"quantity\": 10,\n \"item\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"account\": \"account\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"tax_amount\": \"tax_amount\",\n \"total_line_amount\": \"total_line_amount\",\n \"currency\": \"USD\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": false,\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"description\": \"Pickleball Balls\",\n \"unit_price\": 1,\n \"quantity\": 10,\n \"item\": \"249c9faa-3045-4a31-953b-8f22d3613301\",\n \"account\": \"account\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"tax_amount\": \"tax_amount\",\n \"total_line_amount\": \"total_line_amount\",\n \"currency\": \"XUA\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true,\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ],\n \"inclusive_of_tax\": true,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"accounting_period\": \"accounting_period\",\n \"remote_created_at\": \"2020-03-31T00:00:00Z\",\n \"remote_updated_at\": \"2020-03-31T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"dd2c1309-2c59-460c-9f72-9d0e99af9d66","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ed92d9c9-ef9c-4a4e-af12-c23c8d660c82","name":"lineItemsRemoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/purchase-orders/line-items/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ed92d9c9-ef9c-4a4e-af12-c23c8d660c82","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"29ac0db6-d168-4597-9c24-8872a2efe0c0","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/purchase-orders/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"29ac0db6-d168-4597-9c24-8872a2efe0c0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"fdc244bc-17fb-4d4f-b0f0-a828c90ec792","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/accounting/v1/purchase-orders/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n \"field_choices\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"fdc244bc-17fb-4d4f-b0f0-a828c90ec792","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"0e26052c-793c-488a-9846-b787197c0523","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/regenerate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0e26052c-793c-488a-9846-b787197c0523","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"168ddf32-158c-4ee6-8b23-5d8bd3aa2e4e","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/sync-status","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"model_name\": \"Invoice\",\n \"model_id\": \"accounting.Invoices\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"168ddf32-158c-4ee6-8b23-5d8bd3aa2e4e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"3392d69c-f90e-4dc5-8393-14104ff9df4d","name":"sync_status_resync_create - default","request":{"urlPathTemplate":"/accounting/v1/sync-status/resync","method":"POST"},"response":{"status":200,"body":"[\n {\n \"model_name\": \"Invoice\",\n \"model_id\": \"accounting.Invoices\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"3392d69c-f90e-4dc5-8393-14104ff9df4d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"a1301739-0f9d-4586-b15f-91ab3fb78b72","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/tax-rates","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b82302de-852e-4e60-b050-edf9da3b7c02\",\n \"remote_id\": \"039111\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"company\": \"company\",\n \"code\": \"890\",\n \"name\": \"State tax rate\",\n \"description\": \"Sales Tax\",\n \"status\": \"ACTIVE\",\n \"country\": \"US\",\n \"total_tax_rate\": 15,\n \"effective_tax_rate\": 15,\n \"tax_components\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"039111\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Drink Tax Component\",\n \"rate\": \"rate\",\n \"is_compound\": true,\n \"component_type\": \"SALES\"\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a1301739-0f9d-4586-b15f-91ab3fb78b72","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"b1e0c53d-59c7-40ae-92ce-42638bea9425","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/tax-rates/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"b82302de-852e-4e60-b050-edf9da3b7c02\",\n \"remote_id\": \"039111\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"company\": \"company\",\n \"code\": \"890\",\n \"name\": \"State tax rate\",\n \"description\": \"Sales Tax\",\n \"status\": \"ACTIVE\",\n \"country\": \"US\",\n \"total_tax_rate\": 15,\n \"effective_tax_rate\": 15,\n \"tax_components\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"039111\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Drink Tax Component\",\n \"rate\": \"rate\",\n \"is_compound\": true,\n \"component_type\": \"SALES\",\n \"remote_was_deleted\": true\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b1e0c53d-59c7-40ae-92ce-42638bea9425","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"55702302-3386-4ea9-be00-885264f68fcf","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/tracking-categories","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"948201\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Marketing Department\",\n \"status\": \"ACTIVE\",\n \"category_type\": \"CLASS\",\n \"parent_category\": \"d25d609b-945f-4762-b55a-1c8fb220c43c\",\n \"company\": \"company\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"55702302-3386-4ea9-be00-885264f68fcf","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"cb41db81-a983-4dfb-9c7f-72dab33b972b","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/tracking-categories/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"948201\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Marketing Department\",\n \"status\": \"ACTIVE\",\n \"category_type\": \"CLASS\",\n \"parent_category\": \"d25d609b-945f-4762-b55a-1c8fb220c43c\",\n \"company\": \"company\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"cb41db81-a983-4dfb-9c7f-72dab33b972b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"af55209c-da00-437a-8302-bd7293d9f45f","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/transactions","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0048ea5b-911e-4dff-9364-92070dea62ff\",\n \"remote_id\": \"239741\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_type\": \"estimate\",\n \"number\": \"122\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"account\": \"account\",\n \"contact\": \"contact\",\n \"inclusive_of_tax\": true,\n \"total_amount\": \"total_amount\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"memo\": \"Pickleball paddles\",\n \"unit_price\": \"25.0\",\n \"quantity\": \"10.0\",\n \"item\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"account\": \"2b38c085-2620-4269-b5ec-75dd9095ed2c\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"total_line_amount\": \"total_line_amount\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"currency\": \"USD\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"memo\": \"Pickleball balls\",\n \"unit_price\": \"25.0\",\n \"quantity\": \"10.0\",\n \"item\": \"249c9faa-3045-4a31-953b-8f22d3613301\",\n \"account\": \"3e442c5d-8f51-4103-b5c9-dcee39c30a08\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"total_line_amount\": \"total_line_amount\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\"\n }\n ],\n \"remote_was_deleted\": true,\n \"accounting_period\": \"accounting_period\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"af55209c-da00-437a-8302-bd7293d9f45f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"614c4e99-8197-4735-ac43-02a654b322c0","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/transactions/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"0048ea5b-911e-4dff-9364-92070dea62ff\",\n \"remote_id\": \"239741\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"transaction_type\": \"estimate\",\n \"number\": \"122\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"account\": \"account\",\n \"contact\": \"contact\",\n \"inclusive_of_tax\": true,\n \"total_amount\": \"total_amount\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"line_items\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"memo\": \"Pickleball paddles\",\n \"unit_price\": \"25.0\",\n \"quantity\": \"10.0\",\n \"item\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"account\": \"2b38c085-2620-4269-b5ec-75dd9095ed2c\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"total_line_amount\": \"total_line_amount\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"currency\": \"USD\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"memo\": \"Pickleball balls\",\n \"unit_price\": \"25.0\",\n \"quantity\": \"10.0\",\n \"item\": \"249c9faa-3045-4a31-953b-8f22d3613301\",\n \"account\": \"3e442c5d-8f51-4103-b5c9-dcee39c30a08\",\n \"tracking_categories\": [\n \"f1214c24-2702-4617-b74b-3ddecfc0d384\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"total_line_amount\": \"total_line_amount\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"remote_was_deleted\": true\n }\n ],\n \"remote_was_deleted\": true,\n \"accounting_period\": \"accounting_period\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"614c4e99-8197-4735-ac43-02a654b322c0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"bce30035-5f25-498a-86ca-ea434b2bf8fe","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/vendor-credits","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"number\": \"6\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"vendor\": \"vendor\",\n \"total_amount\": 10000,\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"inclusive_of_tax\": true,\n \"company\": \"company\",\n \"lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"net_amount\": 25.54,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"description\": \"Gifted Merge Credit\",\n \"account\": \"9d892439-5fab-4dbb-8bd8-34f7f96c7912\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"exchange_rate\": \"2.9\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121223\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"net_amount\": 10,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"description\": \"Refund for overpayment\",\n \"account\": \"9d892439-5fab-4dbb-8bd8-34f7f96c7912\"\n }\n ],\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"applied_to_lines\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"invoice\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"remote_was_deleted\": true,\n \"accounting_period\": \"accounting_period\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"bce30035-5f25-498a-86ca-ea434b2bf8fe","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"da22bcf8-5a96-4823-82c0-65b2fa4a010b","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/vendor-credits","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"number\": \"6\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"vendor\": \"vendor\",\n \"total_amount\": 10000,\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"inclusive_of_tax\": true,\n \"company\": \"company\",\n \"lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"net_amount\": 25.54,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"description\": \"Gifted Merge Credit\",\n \"account\": \"9d892439-5fab-4dbb-8bd8-34f7f96c7912\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"exchange_rate\": \"2.9\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121223\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"net_amount\": 10,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"description\": \"Refund for overpayment\",\n \"account\": \"9d892439-5fab-4dbb-8bd8-34f7f96c7912\"\n }\n ],\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"applied_to_lines\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"invoice\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\"\n }\n ],\n \"remote_was_deleted\": true,\n \"accounting_period\": \"accounting_period\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"da22bcf8-5a96-4823-82c0-65b2fa4a010b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1697ef08-83b6-449f-9b8a-7bf73f1663c2","name":"retrieve - default","request":{"urlPathTemplate":"/accounting/v1/vendor-credits/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"number\": \"6\",\n \"transaction_date\": \"2020-03-31T00:00:00Z\",\n \"vendor\": \"vendor\",\n \"total_amount\": 10000,\n \"currency\": \"XUA\",\n \"exchange_rate\": \"2.9\",\n \"inclusive_of_tax\": true,\n \"company\": \"company\",\n \"lines\": [\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121222\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"net_amount\": 25.54,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"description\": \"Gifted Merge Credit\",\n \"account\": \"9d892439-5fab-4dbb-8bd8-34f7f96c7912\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"project\": \"22e65a5d-2df5-4e6e-884a-e538d0339000\",\n \"contact\": \"908934-49j9-093f-0989-908923908\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"exchange_rate\": \"2.9\",\n \"remote_was_deleted\": false\n },\n {\n \"id\": \"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4\",\n \"remote_id\": \"121223\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"net_amount\": 10,\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"description\": \"Refund for overpayment\",\n \"account\": \"9d892439-5fab-4dbb-8bd8-34f7f96c7912\",\n \"company\": \"595c8f97-2ac4-45b7-b000-41bdf43240b5\",\n \"project\": \"project\",\n \"contact\": \"contact\",\n \"tax_rate\": \"a12e7c20-1922-9df7-s75n-edfeewnn7384\",\n \"exchange_rate\": \"2.9\",\n \"remote_was_deleted\": true\n }\n ],\n \"tracking_categories\": [\n \"b38c59b0-a9d7-4740-b1ee-5436c6751e3d\",\n \"9b840d2-686a-465a-8a8e-7b028498f8e4\",\n \"a47e11b6-c73b-4a0c-be31-130fc48177fa\"\n ],\n \"applied_to_lines\": [\n {\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"invoice\": \"5b3c1341-a20f-4e51-b72c-f3830a16c97b\",\n \"applied_date\": \"2020-03-31T00:00:00Z\",\n \"applied_amount\": \"2.9\",\n \"remote_was_deleted\": true\n }\n ],\n \"remote_was_deleted\": true,\n \"accounting_period\": \"accounting_period\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1697ef08-83b6-449f-9b8a-7bf73f1663c2","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"eee11018-2b2c-470c-b68b-a24732315486","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/accounting/v1/vendor-credits/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"eee11018-2b2c-470c-b68b-a24732315486","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1fccd694-c5d4-4cde-9f0f-b532f44c615c","name":"list - default","request":{"urlPathTemplate":"/accounting/v1/webhook-receivers","method":"GET"},"response":{"status":200,"body":"[\n {\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"1fccd694-c5d4-4cde-9f0f-b532f44c615c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e1ebb068-723b-4623-9600-8ad9b6e40e80","name":"create - default","request":{"urlPathTemplate":"/accounting/v1/webhook-receivers","method":"POST"},"response":{"status":201,"body":"{\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e1ebb068-723b-4623-9600-8ad9b6e40e80","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"413521f6-223c-445b-b3ff-8aebd4546f31","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/account-details","method":"GET"},"response":{"status":200,"body":"{\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\",\n \"integration\": \"BambooHR\",\n \"integration_slug\": \"bamboohr\",\n \"category\": \"hris\",\n \"end_user_origin_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"end_user_organization_name\": \"Waystar Royco\",\n \"end_user_email_address\": \"kendall.roy@waystar-royco.com\",\n \"status\": \"COMPLETE\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"413521f6-223c-445b-b3ff-8aebd4546f31","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"37e44a62-eab1-4b80-8b39-1181fcfd964f","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/account-token/{public_token}","method":"GET","pathParameters":{"public_token":{"equalTo":"public_token"}}},"response":{"status":200,"body":"{\n \"account_token\": \"T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB\",\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"37e44a62-eab1-4b80-8b39-1181fcfd964f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"2e308bd6-c5a0-40cf-8e4e-8c6ea4ce9112","name":"list - default","request":{"urlPathTemplate":"/crm/v1/accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"name\": \"Merge API\",\n \"description\": \"One API for all integrations\",\n \"industry\": \"API's\",\n \"website\": \"https://merge.dev/\",\n \"number_of_employees\": 276000,\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+16788879833\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"remote_updated_at\": \"2022-01-09T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/accounts\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2e308bd6-c5a0-40cf-8e4e-8c6ea4ce9112","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"89bdeb10-894f-4980-aa67-14fa5fc87284","name":"create - default","request":{"urlPathTemplate":"/crm/v1/accounts","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"name\": \"Merge API\",\n \"description\": \"One API for all integrations\",\n \"industry\": \"API's\",\n \"website\": \"https://merge.dev/\",\n \"number_of_employees\": 276000,\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+16788879833\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"remote_updated_at\": \"2022-01-09T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/accounts\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"89bdeb10-894f-4980-aa67-14fa5fc87284","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1a666cfc-aec3-4992-b6dc-7bcb273849a6","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/accounts/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"name\": \"Merge API\",\n \"description\": \"One API for all integrations\",\n \"industry\": \"API's\",\n \"website\": \"https://merge.dev/\",\n \"number_of_employees\": 276000,\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+16788879833\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"remote_updated_at\": \"2022-01-09T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/accounts\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1a666cfc-aec3-4992-b6dc-7bcb273849a6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"872b9189-91c1-4b7a-976d-e67f1396746a","name":"partialUpdate - default","request":{"urlPathTemplate":"/crm/v1/accounts/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"name\": \"Merge API\",\n \"description\": \"One API for all integrations\",\n \"industry\": \"API's\",\n \"website\": \"https://merge.dev/\",\n \"number_of_employees\": 276000,\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+16788879833\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"remote_updated_at\": \"2022-01-09T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/accounts\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"872b9189-91c1-4b7a-976d-e67f1396746a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"169538e9-ea60-4862-adf2-b2a2eea1e129","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/crm/v1/accounts/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"169538e9-ea60-4862-adf2-b2a2eea1e129","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6ae6a414-d0e4-4877-9f66-9fbe9cb526d9","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/crm/v1/accounts/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6ae6a414-d0e4-4877-9f66-9fbe9cb526d9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"8a6cab6a-fd56-4bb5-8fa7-5d92962747a5","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/accounts/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8a6cab6a-fd56-4bb5-8fa7-5d92962747a5","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"c623374d-9b0a-4d5b-bb0f-f986847cc0bf","name":"create - default","request":{"urlPathTemplate":"/crm/v1/async-passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"async_passthrough_receipt_id\": \"fd29020f-2695-445e-922e-dcd5e81903fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c623374d-9b0a-4d5b-bb0f-f986847cc0bf","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"70b3c448-635f-4e25-899e-ba8dff1835a6","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/async-passthrough/{async_passthrough_receipt_id}","method":"GET","pathParameters":{"async_passthrough_receipt_id":{"equalTo":"async_passthrough_receipt_id"}}},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"70b3c448-635f-4e25-899e-ba8dff1835a6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"8ddffe59-bcf9-4128-822c-2f398076d747","name":"list - default","request":{"urlPathTemplate":"/crm/v1/audit-trail","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b5ceea2a-7171-47ce-8090-165cfce5572c\",\n \"user_name\": \"Gil Feig\",\n \"user_email\": \"hello@merge.dev\",\n \"role\": \"ADMIN\",\n \"ip_address\": \"192.0.2.123\",\n \"event_type\": \"CREATED_REMOTE_PRODUCTION_API_KEY\",\n \"event_description\": \"Organization-wide Scopes for model hris.Employee updated from Read to Read+Write\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8ddffe59-bcf9-4128-822c-2f398076d747","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1b4c3741-c86b-4c22-a90e-0e249cd2900f","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/available-actions","method":"GET"},"response":{"status":200,"body":"{\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1b4c3741-c86b-4c22-a90e-0e249cd2900f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e9aa87f7-1ae9-49f6-9a00-e38e60f9af56","name":"list - default","request":{"urlPathTemplate":"/crm/v1/contacts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"account\": \"account\",\n \"owner\": \"owner\",\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"email_address\": \"hello@merge.dev\",\n \"email_address_type\": \"Work\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+13785579223\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/contacts\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e9aa87f7-1ae9-49f6-9a00-e38e60f9af56","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"703f4a6b-2add-4fce-a50a-237b7fc1de5d","name":"create - default","request":{"urlPathTemplate":"/crm/v1/contacts","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"account\": \"account\",\n \"owner\": \"owner\",\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"email_address\": \"hello@merge.dev\",\n \"email_address_type\": \"Work\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+13785579223\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/contacts\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"703f4a6b-2add-4fce-a50a-237b7fc1de5d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"3ace4c9f-6cad-4ba4-99bc-5ef908b7e089","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/contacts/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"account\": \"account\",\n \"owner\": \"owner\",\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"email_address\": \"hello@merge.dev\",\n \"email_address_type\": \"Work\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+13785579223\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/contacts\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3ace4c9f-6cad-4ba4-99bc-5ef908b7e089","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"4b629467-4a0f-48f7-968c-789b2fd909aa","name":"partialUpdate - default","request":{"urlPathTemplate":"/crm/v1/contacts/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"account\": \"account\",\n \"owner\": \"owner\",\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"email_address\": \"hello@merge.dev\",\n \"email_address_type\": \"Work\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+13785579223\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/contacts\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4b629467-4a0f-48f7-968c-789b2fd909aa","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6dca45a8-a06e-4a3f-9fd7-4b8f7b264e71","name":"ignoreCreate - default","request":{"urlPathTemplate":"/crm/v1/contacts/ignore/{model_id}","method":"POST","pathParameters":{"model_id":{"equalTo":"model_id"}}},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"6dca45a8-a06e-4a3f-9fd7-4b8f7b264e71","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"4c2ccc61-809a-4ea8-b7a2-8263ee1f5008","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/crm/v1/contacts/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4c2ccc61-809a-4ea8-b7a2-8263ee1f5008","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"2175ef8d-5abb-4c71-8a28-fe8cb4e35cc1","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/crm/v1/contacts/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2175ef8d-5abb-4c71-8a28-fe8cb4e35cc1","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"39236840-76ee-422d-a486-1757b4b4d407","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/contacts/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"39236840-76ee-422d-a486-1757b4b4d407","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"26c5822d-8e52-4558-9683-dd6a0c856fa3","name":"list - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"ff1ff4cb-a66b-47dc-8e2a-50388049e602\",\n \"remote_id\": \"9579977\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"order\",\n \"description\": \"Order object\",\n \"labels\": {\n \"singular\": \"Order\",\n \"plural\": \"Orders\"\n },\n \"fields\": [\n {\n \"display_name\": \"Order ID\",\n \"remote_key_name\": \"order_id\",\n \"description\": \"The unique ID for the order.\",\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ],\n \"item_schema\": {\n \"item_type\": null,\n \"item_format\": null,\n \"item_choices\": null\n }\n },\n {\n \"display_name\": \"Order Quantity\",\n \"remote_key_name\": \"order_quantity\",\n \"description\": \"The number of items ordered.\",\n \"is_required\": true,\n \"field_type\": \"number\",\n \"field_format\": \"number\",\n \"field_choices\": [\n {}\n ],\n \"item_schema\": {\n \"item_type\": null,\n \"item_format\": null,\n \"item_choices\": null\n }\n },\n {\n \"display_name\": \"Customer Type\",\n \"remote_key_name\": \"customer_type\",\n \"description\": \"The type of customer.\",\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"enumeration\",\n \"field_choices\": [\n {},\n {}\n ]\n }\n ],\n \"association_types\": [\n {\n \"key\": \"value\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"26c5822d-8e52-4558-9683-dd6a0c856fa3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"3ac8e3bf-ca1f-45e6-945d-c4851755af03","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"ff1ff4cb-a66b-47dc-8e2a-50388049e602\",\n \"remote_id\": \"9579977\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"order\",\n \"description\": \"Order object\",\n \"labels\": {\n \"singular\": \"Order\",\n \"plural\": \"Orders\"\n },\n \"fields\": [\n {\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"modified_at\": \"2024-01-15T09:30:00Z\",\n \"display_name\": \"Order ID\",\n \"remote_key_name\": \"order_id\",\n \"description\": \"The unique ID for the order.\",\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ],\n \"item_schema\": {\n \"item_type\": null,\n \"item_format\": null,\n \"item_choices\": null\n }\n },\n {\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"modified_at\": \"2024-01-15T09:30:00Z\",\n \"display_name\": \"Order Quantity\",\n \"remote_key_name\": \"order_quantity\",\n \"description\": \"The number of items ordered.\",\n \"is_required\": true,\n \"field_type\": \"number\",\n \"field_format\": \"number\",\n \"field_choices\": [\n {}\n ],\n \"item_schema\": {\n \"item_type\": null,\n \"item_format\": null,\n \"item_choices\": null\n }\n },\n {\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"modified_at\": \"2024-01-15T09:30:00Z\",\n \"display_name\": \"Customer Type\",\n \"remote_key_name\": \"customer_type\",\n \"description\": \"The type of customer.\",\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"enumeration\",\n \"field_choices\": [\n {},\n {}\n ]\n }\n ],\n \"association_types\": [\n {\n \"key\": \"value\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3ac8e3bf-ca1f-45e6-945d-c4851755af03","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"60da639e-6fc4-4837-a196-b76bb3f87025","name":"custom_object_classes_association_types_list - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{custom_object_class_id}/association-types","method":"GET","pathParameters":{"custom_object_class_id":{"equalTo":"custom_object_class_id"}}},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"5bb73c32-3c6c-4757-ab7d-7d3540a1be31\",\n \"remote_id\": \"93\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"source_object_class\": {\n \"id\": \"ff1ff4cb-a66b-47dc-8e2a-50388049e602\",\n \"origin_type\": \"CUSTOM_OBJECT\"\n },\n \"target_object_classes\": [\n {\n \"id\": \"Opportunity\",\n \"origin_type\": \"COMMON_MODEL\"\n }\n ],\n \"remote_key_name\": \"order_to_opportunity\",\n \"display_name\": \"Order to Opportunity\",\n \"cardinality\": \"ONE_TO_ONE\",\n \"is_required\": true\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"60da639e-6fc4-4837-a196-b76bb3f87025","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6bba03a3-6174-4840-85b6-a64d7b6b6528","name":"custom_object_classes_association_types_create - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{custom_object_class_id}/association-types","method":"POST","pathParameters":{"custom_object_class_id":{"equalTo":"custom_object_class_id"}}},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"5bb73c32-3c6c-4757-ab7d-7d3540a1be31\",\n \"remote_id\": \"93\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"source_object_class\": {\n \"id\": \"ff1ff4cb-a66b-47dc-8e2a-50388049e602\",\n \"origin_type\": \"CUSTOM_OBJECT\"\n },\n \"target_object_classes\": [\n {\n \"id\": \"Opportunity\",\n \"origin_type\": \"COMMON_MODEL\"\n }\n ],\n \"remote_key_name\": \"order_to_opportunity\",\n \"display_name\": \"Order to Opportunity\",\n \"cardinality\": \"ONE_TO_ONE\",\n \"is_required\": true\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6bba03a3-6174-4840-85b6-a64d7b6b6528","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"dd1c9d32-71b1-4d99-9f83-0e85a817b142","name":"custom_object_classes_association_types_retrieve - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{custom_object_class_id}/association-types/{id}","method":"GET","pathParameters":{"custom_object_class_id":{"equalTo":"custom_object_class_id"},"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"5bb73c32-3c6c-4757-ab7d-7d3540a1be31\",\n \"remote_id\": \"93\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"source_object_class\": {\n \"id\": \"ff1ff4cb-a66b-47dc-8e2a-50388049e602\",\n \"origin_type\": \"CUSTOM_OBJECT\"\n },\n \"target_object_classes\": [\n {\n \"id\": \"Opportunity\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"modified_at\": \"2024-01-15T09:30:00Z\",\n \"origin_type\": \"COMMON_MODEL\"\n }\n ],\n \"remote_key_name\": \"order_to_opportunity\",\n \"display_name\": \"Order to Opportunity\",\n \"cardinality\": \"ONE_TO_ONE\",\n \"is_required\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"dd1c9d32-71b1-4d99-9f83-0e85a817b142","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"be9cc7e4-b0ed-4cc3-acf7-e42c21e37b55","name":"custom_object_classes_association_types_meta_post_retrieve - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{custom_object_class_id}/association-types/meta/post","method":"GET","pathParameters":{"custom_object_class_id":{"equalTo":"custom_object_class_id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"be9cc7e4-b0ed-4cc3-acf7-e42c21e37b55","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"0bca0a27-07df-409a-90a0-cd933546462a","name":"custom_object_classes_custom_objects_list - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects","method":"GET","pathParameters":{"custom_object_class_id":{"equalTo":"custom_object_class_id"}}},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"da0b1963-be70-469c-9f8c-06a81d0fe759\",\n \"remote_id\": \"4183634295\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"object_class\": \"ff1ff4cb-a66b-47dc-8e2a-50388049e602\",\n \"fields\": {\n \"order_id\": \"4183634295\",\n \"order_quantity\": 50,\n \"customer_type\": \"Returning\"\n },\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0bca0a27-07df-409a-90a0-cd933546462a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6851ba11-91b0-4059-b794-f3057c22a800","name":"custom_object_classes_custom_objects_create - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects","method":"POST","pathParameters":{"custom_object_class_id":{"equalTo":"custom_object_class_id"}}},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"da0b1963-be70-469c-9f8c-06a81d0fe759\",\n \"remote_id\": \"4183634295\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"object_class\": \"ff1ff4cb-a66b-47dc-8e2a-50388049e602\",\n \"fields\": {\n \"order_id\": \"4183634295\",\n \"order_quantity\": 50,\n \"customer_type\": \"Returning\"\n },\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6851ba11-91b0-4059-b794-f3057c22a800","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"915af878-d9d0-40c7-bab3-5bd1fb04e5be","name":"custom_object_classes_custom_objects_retrieve - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/{id}","method":"GET","pathParameters":{"custom_object_class_id":{"equalTo":"custom_object_class_id"},"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"da0b1963-be70-469c-9f8c-06a81d0fe759\",\n \"remote_id\": \"4183634295\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"object_class\": \"ff1ff4cb-a66b-47dc-8e2a-50388049e602\",\n \"fields\": {\n \"order_id\": \"4183634295\",\n \"order_quantity\": 50,\n \"customer_type\": \"Returning\"\n },\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"915af878-d9d0-40c7-bab3-5bd1fb04e5be","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1cbac060-e023-4252-86ec-625e82f39635","name":"custom_object_classes_custom_objects_meta_post_retrieve - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/meta/post","method":"GET","pathParameters":{"custom_object_class_id":{"equalTo":"custom_object_class_id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1cbac060-e023-4252-86ec-625e82f39635","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"eef388e1-3146-4e91-ab66-d7bc51e57367","name":"custom_object_classes_custom_objects_remote_field_classes_list - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/custom-objects/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"eef388e1-3146-4e91-ab66-d7bc51e57367","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1565bf2b-16c5-4847-b819-f413abbe5979","name":"custom_object_classes_custom_objects_associations_list - default","request":{"urlPathTemplate":"/crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/{object_id}/associations","method":"GET","pathParameters":{"custom_object_class_id":{"equalTo":"custom_object_class_id"},"object_id":{"equalTo":"object_id"}}},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"source_object\": \"a8f5d29f-4e50-473f-8f12-27128ffcd37a\",\n \"target_object\": \"da0b1963-be70-469c-9f8c-06a81d0fe759\",\n \"association_type\": \"association_type\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1565bf2b-16c5-4847-b819-f413abbe5979","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f0b526c6-ff97-4366-9c0c-2213d49604c9","name":"custom_object_classes_custom_objects_associations_update - default","request":{"urlPathTemplate":"/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","pathParameters":{"source_class_id":{"equalTo":"source_class_id"},"source_object_id":{"equalTo":"source_object_id"},"target_class_id":{"equalTo":"target_class_id"},"target_object_id":{"equalTo":"target_object_id"},"association_type_id":{"equalTo":"association_type_id"}}},"response":{"status":200,"body":"{\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"source_object\": \"a8f5d29f-4e50-473f-8f12-27128ffcd37a\",\n \"target_object\": \"da0b1963-be70-469c-9f8c-06a81d0fe759\",\n \"association_type\": \"association_type\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f0b526c6-ff97-4366-9c0c-2213d49604c9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"8f407d0a-f3a8-4a82-8799-18d7e613c654","name":"default_scopes_retrieve - default","request":{"urlPathTemplate":"/crm/v1/default-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8f407d0a-f3a8-4a82-8799-18d7e613c654","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"742bb84b-fcfb-4e92-b5db-9081204f1f9c","name":"linked_account_scopes_retrieve - default","request":{"urlPathTemplate":"/crm/v1/linked-account-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"742bb84b-fcfb-4e92-b5db-9081204f1f9c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"31f10f0d-207b-46a1-9edd-770a2b71686b","name":"linked_account_scopes_create - default","request":{"urlPathTemplate":"/crm/v1/linked-account-scopes","method":"POST"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"31f10f0d-207b-46a1-9edd-770a2b71686b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"dfed4c4a-b73d-4d73-bc8a-070aecc3ce8b","name":"delete - default","request":{"urlPathTemplate":"/crm/v1/delete-account","method":"POST"},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"dfed4c4a-b73d-4d73-bc8a-070aecc3ce8b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"422ea9aa-6365-465a-a8d4-17a8fb122fd9","name":"list - default","request":{"urlPathTemplate":"/crm/v1/engagement-types","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"activity_type\": \"CALL\",\n \"name\": \"First Call\",\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"422ea9aa-6365-465a-a8d4-17a8fb122fd9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f63f3b72-6af8-4a57-9c00-f9309ba447a8","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/engagement-types/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"activity_type\": \"CALL\",\n \"name\": \"First Call\",\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f63f3b72-6af8-4a57-9c00-f9309ba447a8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"700f1391-8d37-4033-aa09-086cccd4f703","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/engagement-types/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"700f1391-8d37-4033-aa09-086cccd4f703","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"6d7b54e1-e40f-43a2-bac8-0a6e3e3686f8","name":"list - default","request":{"urlPathTemplate":"/crm/v1/engagements","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"content\": \"Call for negotiation\",\n \"subject\": \"Call from customer\",\n \"direction\": \"INBOUND\",\n \"engagement_type\": \"engagement_type\",\n \"start_time\": \"2022-02-10T00:00:00Z\",\n \"end_time\": \"2022-02-10T00:05:00Z\",\n \"account\": \"account\",\n \"contacts\": [\n \"a7c55bc6-2940-c80a-848e-bbfacbfdf4fg\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/engagements\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6d7b54e1-e40f-43a2-bac8-0a6e3e3686f8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"6e5d4d3d-86ad-455e-9130-e4ef6bd0d1dd","name":"create - default","request":{"urlPathTemplate":"/crm/v1/engagements","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"content\": \"Call for negotiation\",\n \"subject\": \"Call from customer\",\n \"direction\": \"INBOUND\",\n \"engagement_type\": \"engagement_type\",\n \"start_time\": \"2022-02-10T00:00:00Z\",\n \"end_time\": \"2022-02-10T00:05:00Z\",\n \"account\": \"account\",\n \"contacts\": [\n \"a7c55bc6-2940-c80a-848e-bbfacbfdf4fg\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/engagements\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6e5d4d3d-86ad-455e-9130-e4ef6bd0d1dd","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"14a4395b-b21a-487f-96a3-ff0273c61c6c","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/engagements/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"content\": \"Call for negotiation\",\n \"subject\": \"Call from customer\",\n \"direction\": \"INBOUND\",\n \"engagement_type\": \"engagement_type\",\n \"start_time\": \"2022-02-10T00:00:00Z\",\n \"end_time\": \"2022-02-10T00:05:00Z\",\n \"account\": \"account\",\n \"contacts\": [\n \"a7c55bc6-2940-c80a-848e-bbfacbfdf4fg\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/engagements\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"14a4395b-b21a-487f-96a3-ff0273c61c6c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"803427de-94c9-45e7-92fc-c3829f5ac9ab","name":"partialUpdate - default","request":{"urlPathTemplate":"/crm/v1/engagements/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"content\": \"Call for negotiation\",\n \"subject\": \"Call from customer\",\n \"direction\": \"INBOUND\",\n \"engagement_type\": \"engagement_type\",\n \"start_time\": \"2022-02-10T00:00:00Z\",\n \"end_time\": \"2022-02-10T00:05:00Z\",\n \"account\": \"account\",\n \"contacts\": [\n \"a7c55bc6-2940-c80a-848e-bbfacbfdf4fg\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/engagements\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"803427de-94c9-45e7-92fc-c3829f5ac9ab","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"89e4f4e5-f351-4894-ad59-0606ebffb2bb","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/crm/v1/engagements/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"89e4f4e5-f351-4894-ad59-0606ebffb2bb","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"411fc162-994a-49b0-b999-3e63a6eef2e4","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/crm/v1/engagements/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"411fc162-994a-49b0-b999-3e63a6eef2e4","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a6220063-4e41-43f6-a56e-5e58dcefb71d","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/engagements/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a6220063-4e41-43f6-a56e-5e58dcefb71d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"d927898b-ebc5-4a6e-b615-32bee4090615","name":"field_mappings_retrieve - default","request":{"urlPathTemplate":"/crm/v1/field-mappings","method":"GET"},"response":{"status":200,"body":"{\n \"Account\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Contact\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Lead\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Note\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Opportunity\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Stage\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"User\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Task\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Engagement\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d927898b-ebc5-4a6e-b615-32bee4090615","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"cdf47748-cb80-4ae5-aadd-3195554bfd91","name":"field_mappings_create - default","request":{"urlPathTemplate":"/crm/v1/field-mappings","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"cdf47748-cb80-4ae5-aadd-3195554bfd91","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"e84f35b8-1b2c-4c1a-8138-6cddb2bbe1b8","name":"field_mappings_destroy - default","request":{"urlPathTemplate":"/crm/v1/field-mappings/{field_mapping_id}","method":"DELETE","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":204,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e84f35b8-1b2c-4c1a-8138-6cddb2bbe1b8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"14ac2583-b0a8-40f3-9573-ca1c7e35a962","name":"field_mappings_partial_update - default","request":{"urlPathTemplate":"/crm/v1/field-mappings/{field_mapping_id}","method":"PATCH","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"14ac2583-b0a8-40f3-9573-ca1c7e35a962","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"7579df5e-ca70-45ce-aefe-be2281057449","name":"remote_fields_retrieve - default","request":{"urlPathTemplate":"/crm/v1/remote-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Account\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Contact\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Lead\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Note\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Opportunity\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Stage\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"User\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Task\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Engagement\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7579df5e-ca70-45ce-aefe-be2281057449","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a5da1f36-8eaa-4096-9db4-98a6e6e94cea","name":"target_fields_retrieve - default","request":{"urlPathTemplate":"/crm/v1/target-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Account\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Contact\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Lead\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Note\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Opportunity\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Stage\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"User\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Task\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Engagement\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a5da1f36-8eaa-4096-9db4-98a6e6e94cea","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"08a3f6b5-8456-4535-a7e4-a19e3c2c055a","name":"create - default","request":{"urlPathTemplate":"/crm/v1/generate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"08a3f6b5-8456-4535-a7e4-a19e3c2c055a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"bb2e8d63-5b92-4694-a84d-c02181916ef9","name":"list - default","request":{"urlPathTemplate":"/crm/v1/issues","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"bb2e8d63-5b92-4694-a84d-c02181916ef9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2b51af1b-50b0-4c70-b719-5763cb2ebe24","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/issues/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2b51af1b-50b0-4c70-b719-5763cb2ebe24","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"b20a4f10-4c6b-4d97-8552-fb96b65c372c","name":"list - default","request":{"urlPathTemplate":"/crm/v1/leads","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"lead_source\": \"API Blogger\",\n \"title\": \"Co-Founder\",\n \"company\": \"Merge API\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"email_address\": \"hello@merge.dev\",\n \"email_address_type\": \"Work\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+16789932455\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"remote_updated_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"converted_date\": \"2022-03-10T00:00:00Z\",\n \"converted_contact\": \"converted_contact\",\n \"converted_account\": \"converted_account\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/leads\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b20a4f10-4c6b-4d97-8552-fb96b65c372c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1c589bd9-df66-4256-b214-c5a3effb81bf","name":"create - default","request":{"urlPathTemplate":"/crm/v1/leads","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"lead_source\": \"API Blogger\",\n \"title\": \"Co-Founder\",\n \"company\": \"Merge API\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"email_address\": \"hello@merge.dev\",\n \"email_address_type\": \"Work\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+16789932455\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"remote_updated_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"converted_date\": \"2022-03-10T00:00:00Z\",\n \"converted_contact\": \"converted_contact\",\n \"converted_account\": \"converted_account\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/leads\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1c589bd9-df66-4256-b214-c5a3effb81bf","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"408192c0-0375-405f-bf55-b233df306bca","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/leads/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"lead_source\": \"API Blogger\",\n \"title\": \"Co-Founder\",\n \"company\": \"Merge API\",\n \"first_name\": \"Gil\",\n \"last_name\": \"Feig\",\n \"addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"street_1\": \"50 Bowling Green Dr\",\n \"street_2\": \"Golden Gate Park\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postal_code\": \"94122\",\n \"country\": \"US\",\n \"address_type\": \"Shipping\"\n }\n ],\n \"email_addresses\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"email_address\": \"hello@merge.dev\",\n \"email_address_type\": \"Work\"\n }\n ],\n \"phone_numbers\": [\n {\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"phone_number\": \"+16789932455\",\n \"phone_number_type\": \"Mobile\"\n }\n ],\n \"remote_updated_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"converted_date\": \"2022-03-10T00:00:00Z\",\n \"converted_contact\": \"converted_contact\",\n \"converted_account\": \"converted_account\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/leads\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"408192c0-0375-405f-bf55-b233df306bca","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"a7f3b24a-5181-4324-9040-7a2e3b301a94","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/crm/v1/leads/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a7f3b24a-5181-4324-9040-7a2e3b301a94","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"ed6cf9ec-0d7a-4ddb-97c7-2bc9827acff3","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/leads/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ed6cf9ec-0d7a-4ddb-97c7-2bc9827acff3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2ebbe583-5dd8-453d-8f07-5b77535b12e5","name":"create - default","request":{"urlPathTemplate":"/crm/v1/link-token","method":"POST"},"response":{"status":200,"body":"{\n \"link_token\": \"necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0\",\n \"integration_name\": \"Lever\",\n \"magic_link_url\": \"https://link.merge.dev/asdfjkl12345jsndfgi2i83n\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2ebbe583-5dd8-453d-8f07-5b77535b12e5","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ca44c4d0-45eb-4ae7-9799-035bd6a2a868","name":"list - default","request":{"urlPathTemplate":"/crm/v1/linked-accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"e59b1821-f85c-4e28-a6b3-1804156f3563\",\n \"category\": \"hris\",\n \"status\": \"COMPLETE\",\n \"status_detail\": \"Invalid login credentials\",\n \"end_user_origin_id\": \"3ac95cde-6c7f-4eef-afec-be710b42308d\",\n \"end_user_organization_name\": \"Foo Bar, LLC\",\n \"end_user_email_address\": \"hradmin@foobar.dev\",\n \"subdomain\": \"foobar\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"integration\": {\n \"name\": \"name\",\n \"categories\": [\n \"hris\"\n ],\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n },\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ca44c4d0-45eb-4ae7-9799-035bd6a2a868","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"17a95f4c-a1b1-41f9-9e9e-a4c56873b8d7","name":"list - default","request":{"urlPathTemplate":"/crm/v1/notes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"content\": \"Merge is hiring!\",\n \"contact\": \"contact\",\n \"account\": \"account\",\n \"opportunity\": \"opportunity\",\n \"remote_updated_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/notes\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"17a95f4c-a1b1-41f9-9e9e-a4c56873b8d7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"b4d75c18-7912-4d64-9bae-62dbbfc17492","name":"create - default","request":{"urlPathTemplate":"/crm/v1/notes","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"content\": \"Merge is hiring!\",\n \"contact\": \"contact\",\n \"account\": \"account\",\n \"opportunity\": \"opportunity\",\n \"remote_updated_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/notes\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b4d75c18-7912-4d64-9bae-62dbbfc17492","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"0b1135a8-8795-4545-aac0-8da4c10a00c4","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/notes/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"owner\": \"owner\",\n \"content\": \"Merge is hiring!\",\n \"contact\": \"contact\",\n \"account\": \"account\",\n \"opportunity\": \"opportunity\",\n \"remote_updated_at\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/notes\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0b1135a8-8795-4545-aac0-8da4c10a00c4","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6adddbf2-93fd-4cdf-89d4-135056ba17a7","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/crm/v1/notes/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6adddbf2-93fd-4cdf-89d4-135056ba17a7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"5b71a73f-815d-49df-8bd8-331f298ac1a4","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/notes/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5b71a73f-815d-49df-8bd8-331f298ac1a4","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"152f33ef-37c1-4786-9be7-d54a936c3ca0","name":"list - default","request":{"urlPathTemplate":"/crm/v1/opportunities","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Needs Integrations\",\n \"description\": \"Needs a Unified API for Integrations!\",\n \"amount\": 100000,\n \"owner\": \"owner\",\n \"account\": \"account\",\n \"stage\": \"stage\",\n \"status\": \"OPEN\",\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"close_date\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/opportunities\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"152f33ef-37c1-4786-9be7-d54a936c3ca0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1dd25032-0ca5-4cc4-867c-155998bad86a","name":"create - default","request":{"urlPathTemplate":"/crm/v1/opportunities","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Needs Integrations\",\n \"description\": \"Needs a Unified API for Integrations!\",\n \"amount\": 100000,\n \"owner\": \"owner\",\n \"account\": \"account\",\n \"stage\": \"stage\",\n \"status\": \"OPEN\",\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"close_date\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/opportunities\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1dd25032-0ca5-4cc4-867c-155998bad86a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"a67faaac-f77c-42bc-9c44-5a8fb0bccf28","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/opportunities/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Needs Integrations\",\n \"description\": \"Needs a Unified API for Integrations!\",\n \"amount\": 100000,\n \"owner\": \"owner\",\n \"account\": \"account\",\n \"stage\": \"stage\",\n \"status\": \"OPEN\",\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"close_date\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/opportunities\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a67faaac-f77c-42bc-9c44-5a8fb0bccf28","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ccfb4001-8882-4c88-ae23-45787f077e5f","name":"partialUpdate - default","request":{"urlPathTemplate":"/crm/v1/opportunities/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Needs Integrations\",\n \"description\": \"Needs a Unified API for Integrations!\",\n \"amount\": 100000,\n \"owner\": \"owner\",\n \"account\": \"account\",\n \"stage\": \"stage\",\n \"status\": \"OPEN\",\n \"last_activity_at\": \"2022-02-10T00:00:00Z\",\n \"close_date\": \"2022-02-10T00:00:00Z\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/opportunities\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ccfb4001-8882-4c88-ae23-45787f077e5f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f88b26f9-375d-4fcb-888b-7bd04134a1e0","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/crm/v1/opportunities/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f88b26f9-375d-4fcb-888b-7bd04134a1e0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"31be0ff6-2f56-42e1-8d5b-261593face8d","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/crm/v1/opportunities/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"31be0ff6-2f56-42e1-8d5b-261593face8d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2f9b798b-e323-49d7-a3d5-1026bc4b4d55","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/opportunities/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2f9b798b-e323-49d7-a3d5-1026bc4b4d55","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a83d5dcb-04b2-4769-8620-0a0de00c2e9c","name":"create - default","request":{"urlPathTemplate":"/crm/v1/passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a83d5dcb-04b2-4769-8620-0a0de00c2e9c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"9809b51f-6c9d-45e8-a880-aa91866348ac","name":"create - default","request":{"urlPathTemplate":"/crm/v1/regenerate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9809b51f-6c9d-45e8-a880-aa91866348ac","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f49656fc-0cd5-49ee-9d46-657952778e24","name":"list - default","request":{"urlPathTemplate":"/crm/v1/stages","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0358cbc6-2040-430a-848e-aafacbadf3aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Closed Won\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/stages\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f49656fc-0cd5-49ee-9d46-657952778e24","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"0cfa0dd3-1f7d-4415-9d24-e21ecd1044b9","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/stages/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"0358cbc6-2040-430a-848e-aafacbadf3aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Closed Won\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/stages\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0cfa0dd3-1f7d-4415-9d24-e21ecd1044b9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"7a2fa532-5730-46f2-81c5-266a2c35d23d","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/stages/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7a2fa532-5730-46f2-81c5-266a2c35d23d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"b2c5ce15-79e3-4c96-9791-b08edbf4818b","name":"list - default","request":{"urlPathTemplate":"/crm/v1/sync-status","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"model_name\": \"Account\",\n \"model_id\": \"crm.Account\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b2c5ce15-79e3-4c96-9791-b08edbf4818b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"8ff27b27-8b08-4172-81f9-d21d4845e84b","name":"sync_status_resync_create - default","request":{"urlPathTemplate":"/crm/v1/sync-status/resync","method":"POST"},"response":{"status":200,"body":"[\n {\n \"model_name\": \"Account\",\n \"model_id\": \"crm.Account\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"8ff27b27-8b08-4172-81f9-d21d4845e84b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"cac39759-c8bb-4dda-ae72-f58c499f9cf7","name":"list - default","request":{"urlPathTemplate":"/crm/v1/tasks","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"subject\": \"Contact about Integration Strategy\",\n \"content\": \"Follow up to see whether they need integrations\",\n \"owner\": \"owner\",\n \"account\": \"account\",\n \"opportunity\": \"opportunity\",\n \"completed_date\": \"2022-02-11T00:00:00Z\",\n \"due_date\": \"2022-02-10T00:00:00Z\",\n \"status\": \"OPEN\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/tasks\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"cac39759-c8bb-4dda-ae72-f58c499f9cf7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1fb5135f-326c-4956-8699-41971410a80a","name":"create - default","request":{"urlPathTemplate":"/crm/v1/tasks","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"subject\": \"Contact about Integration Strategy\",\n \"content\": \"Follow up to see whether they need integrations\",\n \"owner\": \"owner\",\n \"account\": \"account\",\n \"opportunity\": \"opportunity\",\n \"completed_date\": \"2022-02-11T00:00:00Z\",\n \"due_date\": \"2022-02-10T00:00:00Z\",\n \"status\": \"OPEN\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/tasks\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1fb5135f-326c-4956-8699-41971410a80a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"a8579cf9-8be4-4c55-bdf2-f49b1111ab0b","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/tasks/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"subject\": \"Contact about Integration Strategy\",\n \"content\": \"Follow up to see whether they need integrations\",\n \"owner\": \"owner\",\n \"account\": \"account\",\n \"opportunity\": \"opportunity\",\n \"completed_date\": \"2022-02-11T00:00:00Z\",\n \"due_date\": \"2022-02-10T00:00:00Z\",\n \"status\": \"OPEN\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/tasks\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a8579cf9-8be4-4c55-bdf2-f49b1111ab0b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"29e1f344-f698-4670-ba6c-ec677883d00a","name":"partialUpdate - default","request":{"urlPathTemplate":"/crm/v1/tasks/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"subject\": \"Contact about Integration Strategy\",\n \"content\": \"Follow up to see whether they need integrations\",\n \"owner\": \"owner\",\n \"account\": \"account\",\n \"opportunity\": \"opportunity\",\n \"completed_date\": \"2022-02-11T00:00:00Z\",\n \"due_date\": \"2022-02-10T00:00:00Z\",\n \"status\": \"OPEN\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/tasks\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"29e1f344-f698-4670-ba6c-ec677883d00a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"36f2b791-bc5b-4303-b703-0784819f22e8","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/crm/v1/tasks/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"36f2b791-bc5b-4303-b703-0784819f22e8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"8fb4ec92-a662-4b6e-8e34-d5b353281fd0","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/crm/v1/tasks/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8fb4ec92-a662-4b6e-8e34-d5b353281fd0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"7208e07e-13ef-41a5-aa10-c779958d68c2","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/tasks/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7208e07e-13ef-41a5-aa10-c779958d68c2","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"6d512d20-2b06-4a5c-baba-7d43c32071de","name":"list - default","request":{"urlPathTemplate":"/crm/v1/users","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0358cbc6-2040-430a-848e-aafacbadf3aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig\",\n \"email\": \"merge_is_hiring@merge.dev\",\n \"is_active\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/users\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6d512d20-2b06-4a5c-baba-7d43c32071de","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1bfd83cb-397e-416e-9ce6-d5ecaa8d9da6","name":"retrieve - default","request":{"urlPathTemplate":"/crm/v1/users/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"0358cbc6-2040-430a-848e-aafacbadf3aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig\",\n \"email\": \"merge_is_hiring@merge.dev\",\n \"is_active\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/users\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1bfd83cb-397e-416e-9ce6-d5ecaa8d9da6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ede9aee4-73b3-4320-8b71-7732b31bccfb","name":"ignoreCreate - default","request":{"urlPathTemplate":"/crm/v1/users/ignore/{model_id}","method":"POST","pathParameters":{"model_id":{"equalTo":"model_id"}}},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"ede9aee4-73b3-4320-8b71-7732b31bccfb","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6cf228fc-0dab-4090-8a08-3974edf34952","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/crm/v1/users/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6cf228fc-0dab-4090-8a08-3974edf34952","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"28c5ad2f-0e93-4b22-b6eb-9df05eb2f292","name":"list - default","request":{"urlPathTemplate":"/crm/v1/webhook-receivers","method":"GET"},"response":{"status":200,"body":"[\n {\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"28c5ad2f-0e93-4b22-b6eb-9df05eb2f292","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"3a3bb5d4-6f63-44d9-9883-02082558124b","name":"create - default","request":{"urlPathTemplate":"/crm/v1/webhook-receivers","method":"POST"},"response":{"status":201,"body":"{\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3a3bb5d4-6f63-44d9-9883-02082558124b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"622d975b-e87a-44bd-bd42-c1472828561b","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/account-details","method":"GET"},"response":{"status":200,"body":"{\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\",\n \"integration\": \"BambooHR\",\n \"integration_slug\": \"bamboohr\",\n \"category\": \"hris\",\n \"end_user_origin_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"end_user_organization_name\": \"Waystar Royco\",\n \"end_user_email_address\": \"kendall.roy@waystar-royco.com\",\n \"status\": \"COMPLETE\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"622d975b-e87a-44bd-bd42-c1472828561b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"161afbf4-abd1-4e88-a597-b7471e1ec05e","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/account-token/{public_token}","method":"GET","pathParameters":{"public_token":{"equalTo":"public_token"}}},"response":{"status":200,"body":"{\n \"account_token\": \"T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB\",\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"161afbf4-abd1-4e88-a597-b7471e1ec05e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"66a1621f-dc1f-41d5-9a47-df6421e17216","name":"create - default","request":{"urlPathTemplate":"/filestorage/v1/async-passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"async_passthrough_receipt_id\": \"fd29020f-2695-445e-922e-dcd5e81903fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"66a1621f-dc1f-41d5-9a47-df6421e17216","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"32879113-e1e3-4cff-8b31-dee52398b12a","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/async-passthrough/{async_passthrough_receipt_id}","method":"GET","pathParameters":{"async_passthrough_receipt_id":{"equalTo":"async_passthrough_receipt_id"}}},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"32879113-e1e3-4cff-8b31-dee52398b12a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"90d5c9b6-171b-453b-be88-e92c15c45f05","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/audit-trail","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b5ceea2a-7171-47ce-8090-165cfce5572c\",\n \"user_name\": \"Gil Feig\",\n \"user_email\": \"hello@merge.dev\",\n \"role\": \"ADMIN\",\n \"ip_address\": \"192.0.2.123\",\n \"event_type\": \"CREATED_REMOTE_PRODUCTION_API_KEY\",\n \"event_description\": \"Organization-wide Scopes for model hris.Employee updated from Read to Read+Write\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"90d5c9b6-171b-453b-be88-e92c15c45f05","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e2a1b85b-4794-4ea4-9eb7-6fa8f533f931","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/available-actions","method":"GET"},"response":{"status":200,"body":"{\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e2a1b85b-4794-4ea4-9eb7-6fa8f533f931","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"19b67752-5724-44ef-ab2b-7ce47f412dc6","name":"default_scopes_retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/default-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"19b67752-5724-44ef-ab2b-7ce47f412dc6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"d1e5123a-e99e-435e-bea1-338f109d85ef","name":"linked_account_scopes_retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/linked-account-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d1e5123a-e99e-435e-bea1-338f109d85ef","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"9e36ba0c-28c9-4925-9aab-00a85bf9522e","name":"linked_account_scopes_create - default","request":{"urlPathTemplate":"/filestorage/v1/linked-account-scopes","method":"POST"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9e36ba0c-28c9-4925-9aab-00a85bf9522e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"a906710c-6a04-4536-900f-b1692aa1ec96","name":"delete - default","request":{"urlPathTemplate":"/filestorage/v1/delete-account","method":"POST"},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"a906710c-6a04-4536-900f-b1692aa1ec96","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"91af2893-dbab-4040-9819-918a0c95eceb","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/drives","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"f9e3d315-d6c2-458e-85c4-fa773d6ff4a6\",\n \"remote_id\": \"2039348\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"My Drive\",\n \"remote_created_at\": \"2024-01-15T09:30:00Z\",\n \"drive_url\": \"https://drive.com/drives/2039349\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/drives\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"91af2893-dbab-4040-9819-918a0c95eceb","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"0108aaba-a008-43d5-ba8f-9766e9f542c1","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/drives/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"f9e3d315-d6c2-458e-85c4-fa773d6ff4a6\",\n \"remote_id\": \"2039348\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"My Drive\",\n \"remote_created_at\": \"2024-01-15T09:30:00Z\",\n \"drive_url\": \"https://drive.com/drives/2039349\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/drives\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0108aaba-a008-43d5-ba8f-9766e9f542c1","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"fc420613-e125-434e-b760-668e6fc6d986","name":"field_mappings_retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/field-mappings","method":"GET"},"response":{"status":200,"body":"{\n \"File\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Folder\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Drive\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Group\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"User\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"fc420613-e125-434e-b760-668e6fc6d986","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"5c234902-453c-4d79-b2ac-cdde2023cc7b","name":"field_mappings_create - default","request":{"urlPathTemplate":"/filestorage/v1/field-mappings","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5c234902-453c-4d79-b2ac-cdde2023cc7b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"cfd048b3-7f14-4c09-8f88-d560bed14282","name":"field_mappings_destroy - default","request":{"urlPathTemplate":"/filestorage/v1/field-mappings/{field_mapping_id}","method":"DELETE","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":204,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"cfd048b3-7f14-4c09-8f88-d560bed14282","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"33bb1dbf-6b10-43ab-b694-4c57411a49d4","name":"field_mappings_partial_update - default","request":{"urlPathTemplate":"/filestorage/v1/field-mappings/{field_mapping_id}","method":"PATCH","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"33bb1dbf-6b10-43ab-b694-4c57411a49d4","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"3139164a-fbaf-4cb0-8d4d-9a1960fd45c5","name":"remote_fields_retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/remote-fields","method":"GET"},"response":{"status":200,"body":"{\n \"File\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Folder\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Drive\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Group\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"User\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3139164a-fbaf-4cb0-8d4d-9a1960fd45c5","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1b83dea3-1df9-4395-874f-884300db9dc2","name":"target_fields_retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/target-fields","method":"GET"},"response":{"status":200,"body":"{\n \"File\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Folder\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Drive\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Group\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"User\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1b83dea3-1df9-4395-874f-884300db9dc2","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"234fcf4c-360c-4692-bd58-b0e5e7051a69","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/files","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"45ce474c-dhcj-43a6-754r-629f799f7d68\",\n \"remote_id\": \"12\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"merge_file_storage_launch.docx\",\n \"file_url\": \"https://drive.com/1234\",\n \"file_thumbnail_url\": \"https://drive.com/1234/thumbnail.png\",\n \"size\": 254,\n \"mime_type\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"description\": \"Use common model scopes to redact data returned in Merge's Common Models!\",\n \"folder\": \"folder\",\n \"checksum\": {\n \"type\": \"sha256\",\n \"content_hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n },\n \"permissions\": \"permissions\",\n \"drive\": \"drive\",\n \"remote_created_at\": \"2022-02-02T00:00:00Z\",\n \"remote_updated_at\": \"2022-02-03T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/files\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"234fcf4c-360c-4692-bd58-b0e5e7051a69","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2d74a16d-2527-4889-bbb8-d5c194e9a406","name":"create - default","request":{"urlPathTemplate":"/filestorage/v1/files","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"45ce474c-dhcj-43a6-754r-629f799f7d68\",\n \"remote_id\": \"12\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"merge_file_storage_launch.docx\",\n \"file_url\": \"https://drive.com/1234\",\n \"file_thumbnail_url\": \"https://drive.com/1234/thumbnail.png\",\n \"size\": 254,\n \"mime_type\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"description\": \"Use common model scopes to redact data returned in Merge's Common Models!\",\n \"folder\": \"folder\",\n \"checksum\": {\n \"type\": \"sha256\",\n \"content_hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n },\n \"permissions\": \"permissions\",\n \"drive\": \"drive\",\n \"remote_created_at\": \"2022-02-02T00:00:00Z\",\n \"remote_updated_at\": \"2022-02-03T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/files\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2d74a16d-2527-4889-bbb8-d5c194e9a406","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"349ad630-ad91-47a9-9ee9-d23cba312441","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/files/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"45ce474c-dhcj-43a6-754r-629f799f7d68\",\n \"remote_id\": \"12\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"merge_file_storage_launch.docx\",\n \"file_url\": \"https://drive.com/1234\",\n \"file_thumbnail_url\": \"https://drive.com/1234/thumbnail.png\",\n \"size\": 254,\n \"mime_type\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"description\": \"Use common model scopes to redact data returned in Merge's Common Models!\",\n \"folder\": \"folder\",\n \"checksum\": {\n \"type\": \"sha256\",\n \"content_hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n },\n \"permissions\": \"permissions\",\n \"drive\": \"drive\",\n \"remote_created_at\": \"2022-02-02T00:00:00Z\",\n \"remote_updated_at\": \"2022-02-03T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/files\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"349ad630-ad91-47a9-9ee9-d23cba312441","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"0f74880c-a0e9-4778-8dcc-2f4bafd8371c","name":"downloadRequestMetaRetrieve - default","request":{"urlPathTemplate":"/filestorage/v1/files/{id}/download/request-meta","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"url\": \"https://www.googleapis.com/drive/v3/files/234?alt=media\",\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0f74880c-a0e9-4778-8dcc-2f4bafd8371c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"08924749-5e35-41c8-99a0-cba888ec9b7a","name":"downloadRequestMetaList - default","request":{"urlPathTemplate":"/filestorage/v1/files/download/request-meta","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"url\": \"https://www.googleapis.com/drive/v3/files/234?alt=media\",\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"08924749-5e35-41c8-99a0-cba888ec9b7a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"99698957-9790-47fe-9c19-af59f3b4e014","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/filestorage/v1/files/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"99698957-9790-47fe-9c19-af59f3b4e014","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"94dc002d-0275-44e0-9665-8f697e723b66","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/folders","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"e021f7a7-74fc-4487-8e12-14180c92d3b7\",\n \"remote_id\": \"14\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"R&D\",\n \"folder_url\": \"https://drive.com/1234\",\n \"size\": 2738000,\n \"description\": \"All things R&D related at Merge!\",\n \"parent_folder\": \"parent_folder\",\n \"drive\": \"drive\",\n \"permissions\": \"permissions\",\n \"remote_created_at\": \"2024-02-02T00:00:00Z\",\n \"remote_updated_at\": \"2024-06-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/folders\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"94dc002d-0275-44e0-9665-8f697e723b66","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"14f304e0-7d10-4c54-ba33-2f3fb85ddf1d","name":"create - default","request":{"urlPathTemplate":"/filestorage/v1/folders","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"e021f7a7-74fc-4487-8e12-14180c92d3b7\",\n \"remote_id\": \"14\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"R&D\",\n \"folder_url\": \"https://drive.com/1234\",\n \"size\": 2738000,\n \"description\": \"All things R&D related at Merge!\",\n \"parent_folder\": \"parent_folder\",\n \"drive\": \"drive\",\n \"permissions\": \"permissions\",\n \"remote_created_at\": \"2024-02-02T00:00:00Z\",\n \"remote_updated_at\": \"2024-06-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/folders\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"14f304e0-7d10-4c54-ba33-2f3fb85ddf1d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"fa0debc2-9139-4887-84e6-db1e80484c94","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/folders/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"e021f7a7-74fc-4487-8e12-14180c92d3b7\",\n \"remote_id\": \"14\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"R&D\",\n \"folder_url\": \"https://drive.com/1234\",\n \"size\": 2738000,\n \"description\": \"All things R&D related at Merge!\",\n \"parent_folder\": \"parent_folder\",\n \"drive\": \"drive\",\n \"permissions\": \"permissions\",\n \"remote_created_at\": \"2024-02-02T00:00:00Z\",\n \"remote_updated_at\": \"2024-06-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/folders\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"fa0debc2-9139-4887-84e6-db1e80484c94","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"95d87f3c-151a-4bb1-9fe2-01845c1dbae4","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/filestorage/v1/folders/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"95d87f3c-151a-4bb1-9fe2-01845c1dbae4","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f6e34181-053c-4945-ba28-9d11e5fc3760","name":"create - default","request":{"urlPathTemplate":"/filestorage/v1/generate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f6e34181-053c-4945-ba28-9d11e5fc3760","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"afbe4e63-14bf-4ea1-838a-96298573c142","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/groups","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"5624aceb-0ea2-4864-ba08-354ac56b9884\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Administrators\",\n \"users\": [\n \"6e93361b-8ae7-444b-bfa2-71206cbbee24\"\n ],\n \"child_groups\": [\n \"a1f90b3c-633d-404e-a696-05cd54808676\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/groups\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"afbe4e63-14bf-4ea1-838a-96298573c142","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"0d8db516-2cf6-4697-ae2e-b11233aa49e0","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/groups/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"5624aceb-0ea2-4864-ba08-354ac56b9884\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Administrators\",\n \"users\": [\n \"6e93361b-8ae7-444b-bfa2-71206cbbee24\"\n ],\n \"child_groups\": [\n \"a1f90b3c-633d-404e-a696-05cd54808676\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/groups\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0d8db516-2cf6-4697-ae2e-b11233aa49e0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1a8878a9-05be-47ea-8a3b-056a4fef4013","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/issues","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1a8878a9-05be-47ea-8a3b-056a4fef4013","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"136960f4-a480-4e78-a2dd-c29a0ac39f04","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/issues/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"136960f4-a480-4e78-a2dd-c29a0ac39f04","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"65b4d903-42af-4e7c-b1bb-005af3b7e62f","name":"create - default","request":{"urlPathTemplate":"/filestorage/v1/link-token","method":"POST"},"response":{"status":200,"body":"{\n \"link_token\": \"necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0\",\n \"integration_name\": \"Lever\",\n \"magic_link_url\": \"https://link.merge.dev/asdfjkl12345jsndfgi2i83n\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"65b4d903-42af-4e7c-b1bb-005af3b7e62f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"391caf02-3ee4-4449-934f-0b9d84a91a22","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/linked-accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"e59b1821-f85c-4e28-a6b3-1804156f3563\",\n \"category\": \"hris\",\n \"status\": \"COMPLETE\",\n \"status_detail\": \"Invalid login credentials\",\n \"end_user_origin_id\": \"3ac95cde-6c7f-4eef-afec-be710b42308d\",\n \"end_user_organization_name\": \"Foo Bar, LLC\",\n \"end_user_email_address\": \"hradmin@foobar.dev\",\n \"subdomain\": \"foobar\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"integration\": {\n \"name\": \"name\",\n \"categories\": [\n \"hris\"\n ],\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n },\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"391caf02-3ee4-4449-934f-0b9d84a91a22","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"eb9aecdb-81c1-457b-824c-4fdeda8652a3","name":"create - default","request":{"urlPathTemplate":"/filestorage/v1/passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"eb9aecdb-81c1-457b-824c-4fdeda8652a3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"677b4e4a-4361-48af-b667-7a0c45410dd5","name":"create - default","request":{"urlPathTemplate":"/filestorage/v1/regenerate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"677b4e4a-4361-48af-b667-7a0c45410dd5","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"895e0b68-23cf-4249-a480-a37965fb222b","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/sync-status","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"model_name\": \"File\",\n \"model_id\": \"filestorage.FileStorageFile\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"895e0b68-23cf-4249-a480-a37965fb222b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"3ef819e6-c0cd-49e8-8ac4-9234022ccb2e","name":"sync_status_resync_create - default","request":{"urlPathTemplate":"/filestorage/v1/sync-status/resync","method":"POST"},"response":{"status":200,"body":"[\n {\n \"model_name\": \"File\",\n \"model_id\": \"filestorage.FileStorageFile\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"3ef819e6-c0cd-49e8-8ac4-9234022ccb2e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"329713a8-491d-489d-9199-a219102dcf56","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/users","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"83902e75-4362-4803-b76c-a7d6be292cbd\",\n \"remote_id\": \"2039349\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig\",\n \"email_address\": \"hello@merge.dev\",\n \"is_me\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/users\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"329713a8-491d-489d-9199-a219102dcf56","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"1ff590b7-2376-4ebc-ad1e-990b6bd7d54b","name":"retrieve - default","request":{"urlPathTemplate":"/filestorage/v1/users/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"83902e75-4362-4803-b76c-a7d6be292cbd\",\n \"remote_id\": \"2039349\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig\",\n \"email_address\": \"hello@merge.dev\",\n \"is_me\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/users\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1ff590b7-2376-4ebc-ad1e-990b6bd7d54b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"456b1a85-d61e-438e-a627-3df1fd9b6f1c","name":"list - default","request":{"urlPathTemplate":"/filestorage/v1/webhook-receivers","method":"GET"},"response":{"status":200,"body":"[\n {\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"456b1a85-d61e-438e-a627-3df1fd9b6f1c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"cd3b78e1-2488-4cdc-aabb-58afe6a2885e","name":"create - default","request":{"urlPathTemplate":"/filestorage/v1/webhook-receivers","method":"POST"},"response":{"status":201,"body":"{\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"cd3b78e1-2488-4cdc-aabb-58afe6a2885e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"c5d38dd7-8011-40ba-a065-344785face5e","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/account-details","method":"GET"},"response":{"status":200,"body":"{\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\",\n \"integration\": \"BambooHR\",\n \"integration_slug\": \"bamboohr\",\n \"category\": \"hris\",\n \"end_user_origin_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"end_user_organization_name\": \"Waystar Royco\",\n \"end_user_email_address\": \"kendall.roy@waystar-royco.com\",\n \"status\": \"COMPLETE\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c5d38dd7-8011-40ba-a065-344785face5e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"08562a86-519f-4334-8f61-6cd2ff5ed1f0","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/account-token/{public_token}","method":"GET","pathParameters":{"public_token":{"equalTo":"public_token"}}},"response":{"status":200,"body":"{\n \"account_token\": \"T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB\",\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"08562a86-519f-4334-8f61-6cd2ff5ed1f0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"9d351be1-e81d-4f1e-86e1-f075700ce7ab","name":"create - default","request":{"urlPathTemplate":"/hris/v1/async-passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"async_passthrough_receipt_id\": \"fd29020f-2695-445e-922e-dcd5e81903fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9d351be1-e81d-4f1e-86e1-f075700ce7ab","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"5ffc412b-9a89-4b4a-a948-273089be5855","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/async-passthrough/{async_passthrough_receipt_id}","method":"GET","pathParameters":{"async_passthrough_receipt_id":{"equalTo":"async_passthrough_receipt_id"}}},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5ffc412b-9a89-4b4a-a948-273089be5855","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6039a42d-3df6-4548-aa76-a2dc22cb17f6","name":"list - default","request":{"urlPathTemplate":"/hris/v1/audit-trail","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b5ceea2a-7171-47ce-8090-165cfce5572c\",\n \"user_name\": \"Gil Feig\",\n \"user_email\": \"hello@merge.dev\",\n \"role\": \"ADMIN\",\n \"ip_address\": \"192.0.2.123\",\n \"event_type\": \"CREATED_REMOTE_PRODUCTION_API_KEY\",\n \"event_description\": \"Organization-wide Scopes for model hris.Employee updated from Read to Read+Write\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6039a42d-3df6-4548-aa76-a2dc22cb17f6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"c2881180-96d9-4772-843d-a3414237f171","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/available-actions","method":"GET"},"response":{"status":200,"body":"{\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c2881180-96d9-4772-843d-a3414237f171","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"8ec28ea3-c5ba-4838-94f7-b6ed30acaecf","name":"list - default","request":{"urlPathTemplate":"/hris/v1/bank-info","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"fd1e0fb5-8f92-4ec9-9f32-179cf732867d\",\n \"remote_id\": \"123234\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"account_number\": \"439291590\",\n \"routing_number\": \"089690059\",\n \"bank_name\": \"Chase\",\n \"account_type\": \"SAVINGS\",\n \"remote_created_at\": \"2021-12-06T10:11:26Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/bank-info\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8ec28ea3-c5ba-4838-94f7-b6ed30acaecf","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"527d56b1-94e4-4289-8649-744ee99e941c","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/bank-info/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"fd1e0fb5-8f92-4ec9-9f32-179cf732867d\",\n \"remote_id\": \"123234\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"account_number\": \"439291590\",\n \"routing_number\": \"089690059\",\n \"bank_name\": \"Chase\",\n \"account_type\": \"SAVINGS\",\n \"remote_created_at\": \"2021-12-06T10:11:26Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/bank-info\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"527d56b1-94e4-4289-8649-744ee99e941c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"377cc973-e9d2-4a3d-aac8-d35ea3ccc88a","name":"list - default","request":{"urlPathTemplate":"/hris/v1/benefits","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3fe5ae7a-f1ba-4529-b7af-84e86dc6d232\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"provider_name\": \"Blue Shield of California\",\n \"employee_contribution\": 23.65,\n \"company_contribution\": 150,\n \"start_date\": \"2020-11-15T00:59:25Z\",\n \"end_date\": \"2021-10-15T00:23:25Z\",\n \"remote_was_deleted\": true,\n \"employer_benefit\": \"025fjlc6-6000-430a-848e-aafacbadf4fe\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/benefits\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"377cc973-e9d2-4a3d-aac8-d35ea3ccc88a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"17cd480e-0f06-4d57-b183-3176872c6fb7","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/benefits/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3fe5ae7a-f1ba-4529-b7af-84e86dc6d232\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"provider_name\": \"Blue Shield of California\",\n \"employee_contribution\": 23.65,\n \"company_contribution\": 150,\n \"start_date\": \"2020-11-15T00:59:25Z\",\n \"end_date\": \"2021-10-15T00:23:25Z\",\n \"remote_was_deleted\": true,\n \"employer_benefit\": \"025fjlc6-6000-430a-848e-aafacbadf4fe\",\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/benefits\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"17cd480e-0f06-4d57-b183-3176872c6fb7","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"073b9be6-2b98-4204-8b03-a3bacf974aa3","name":"list - default","request":{"urlPathTemplate":"/hris/v1/companies","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"1b998423-db0a-4037-a4cf-f79c60cb67b3\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"legal_name\": \"Waystar Royco, Inc.\",\n \"display_name\": \"Waystar Royco\",\n \"eins\": [\n \"12-3456789\",\n \"12-3451111\",\n \"11-0011000\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/companies\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"073b9be6-2b98-4204-8b03-a3bacf974aa3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"9ea99fdc-2fdc-4516-86dd-c9f4e7b4a046","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/companies/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"1b998423-db0a-4037-a4cf-f79c60cb67b3\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"legal_name\": \"Waystar Royco, Inc.\",\n \"display_name\": \"Waystar Royco\",\n \"eins\": [\n \"12-3456789\",\n \"12-3451111\",\n \"11-0011000\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/companies\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"9ea99fdc-2fdc-4516-86dd-c9f4e7b4a046","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"a525e7d7-7c25-4a03-b0e5-719e7d015e5e","name":"default_scopes_retrieve - default","request":{"urlPathTemplate":"/hris/v1/default-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a525e7d7-7c25-4a03-b0e5-719e7d015e5e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e16d9a20-18e0-43b9-b40c-7a037f960df6","name":"linked_account_scopes_retrieve - default","request":{"urlPathTemplate":"/hris/v1/linked-account-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e16d9a20-18e0-43b9-b40c-7a037f960df6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"69df1b72-0ad0-4730-ba5c-f09d4531ae7b","name":"linked_account_scopes_create - default","request":{"urlPathTemplate":"/hris/v1/linked-account-scopes","method":"POST"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"69df1b72-0ad0-4730-ba5c-f09d4531ae7b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f0ea3b57-1896-4244-9567-837a56d9000a","name":"delete - default","request":{"urlPathTemplate":"/hris/v1/delete-account","method":"POST"},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"f0ea3b57-1896-4244-9567-837a56d9000a","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"42901df8-1ef5-4a45-91f2-29c2e7ab14e3","name":"list - default","request":{"urlPathTemplate":"/hris/v1/dependents","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"025fjlc6-6000-430a-848e-aafacbadf4fe\",\n \"remote_id\": \"19202940\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Greg\",\n \"middle_name\": \"A\",\n \"last_name\": \"Hirsch\",\n \"relationship\": \"CHILD\",\n \"employee\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"date_of_birth\": \"1990-11-10T00:00:00Z\",\n \"gender\": \"MALE\",\n \"phone_number\": \"+1234567890\",\n \"home_location\": \"d2f972d0-2526-434b-9409-4c3b468e08f0\",\n \"is_student\": true,\n \"ssn\": \"1234567890\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/dependent\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"42901df8-1ef5-4a45-91f2-29c2e7ab14e3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"11eeafa8-25fc-4e4c-ab24-507b2b2f699d","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/dependents/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"025fjlc6-6000-430a-848e-aafacbadf4fe\",\n \"remote_id\": \"19202940\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"first_name\": \"Greg\",\n \"middle_name\": \"A\",\n \"last_name\": \"Hirsch\",\n \"relationship\": \"CHILD\",\n \"employee\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"date_of_birth\": \"1990-11-10T00:00:00Z\",\n \"gender\": \"MALE\",\n \"phone_number\": \"+1234567890\",\n \"home_location\": \"d2f972d0-2526-434b-9409-4c3b468e08f0\",\n \"is_student\": true,\n \"ssn\": \"1234567890\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/dependent\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"11eeafa8-25fc-4e4c-ab24-507b2b2f699d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"5ca13819-d2b5-4879-bcb7-4f555862e7b3","name":"list - default","request":{"urlPathTemplate":"/hris/v1/employee-payroll-runs","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"payroll_run\": \"payroll_run\",\n \"gross_pay\": 1342.67,\n \"net_pay\": 865.78,\n \"start_date\": \"2020-11-08T00:00:00Z\",\n \"end_date\": \"2020-11-09T00:00:00Z\",\n \"check_date\": \"2020-11-10T00:00:00Z\",\n \"earnings\": [\n {\n \"id\": \"babbced6-3a81-4775-8da2-490dc6385259\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_payroll_run\": \"35347df1-95e7-46e2-93cc-66f1191edca5\",\n \"amount\": 1002.34,\n \"type\": \"SALARY\"\n },\n {\n \"id\": \"babbced6-3a81-4775-8da2-490dc6385259\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_payroll_run\": \"35347df1-95e7-46e2-93cc-66f1191edca5\",\n \"amount\": 8342.34,\n \"type\": \"OVERTIME\"\n }\n ],\n \"deductions\": [\n {\n \"id\": \"5fd439fc-1b64-4755-b275-64918936c365\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_payroll_run\": \"35347df1-95e7-46e2-93cc-66f1191edca5\",\n \"name\": \"Social Security\",\n \"employee_deduction\": 34.54,\n \"company_deduction\": 78.78\n }\n ],\n \"taxes\": [\n {\n \"id\": \"e3a825fd-c38d-4095-a717-df98c4cb9ebc\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_payroll_run\": \"35347df1-95e7-46e2-93cc-66f1191edca5\",\n \"name\": \"California State Income Tax\",\n \"amount\": 100.25,\n \"employer_tax\": true\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/employee-payroll\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5ca13819-d2b5-4879-bcb7-4f555862e7b3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"058e53d5-6c8d-4c44-b79d-73909c4255a8","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/employee-payroll-runs/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"payroll_run\": \"payroll_run\",\n \"gross_pay\": 1342.67,\n \"net_pay\": 865.78,\n \"start_date\": \"2020-11-08T00:00:00Z\",\n \"end_date\": \"2020-11-09T00:00:00Z\",\n \"check_date\": \"2020-11-10T00:00:00Z\",\n \"earnings\": [\n {\n \"id\": \"babbced6-3a81-4775-8da2-490dc6385259\",\n \"remote_id\": \"52802\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_payroll_run\": \"35347df1-95e7-46e2-93cc-66f1191edca5\",\n \"amount\": 1002.34,\n \"type\": \"SALARY\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n },\n {\n \"id\": \"babbced6-3a81-4775-8da2-490dc6385259\",\n \"remote_id\": \"52802\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_payroll_run\": \"35347df1-95e7-46e2-93cc-66f1191edca5\",\n \"amount\": 8342.34,\n \"type\": \"OVERTIME\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ],\n \"deductions\": [\n {\n \"id\": \"5fd439fc-1b64-4755-b275-64918936c365\",\n \"remote_id\": \"93478612\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_payroll_run\": \"35347df1-95e7-46e2-93cc-66f1191edca5\",\n \"name\": \"Social Security\",\n \"employee_deduction\": 34.54,\n \"company_deduction\": 78.78,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/payroll-deduction\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ],\n \"taxes\": [\n {\n \"id\": \"e3a825fd-c38d-4095-a717-df98c4cb9ebc\",\n \"remote_id\": \"26806834\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_payroll_run\": \"35347df1-95e7-46e2-93cc-66f1191edca5\",\n \"name\": \"California State Income Tax\",\n \"amount\": 100.25,\n \"employer_tax\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/employee-payroll\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"058e53d5-6c8d-4c44-b79d-73909c4255a8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"237126ff-bf05-4d7d-9ce7-4bdccf5e43c9","name":"list - default","request":{"urlPathTemplate":"/hris/v1/employees","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_number\": \"2\",\n \"company\": \"company\",\n \"first_name\": \"Greg\",\n \"last_name\": \"Hirsch\",\n \"preferred_name\": \"Greg the egg\",\n \"display_full_name\": \"Cousin Greg Hirsch\",\n \"username\": \"cousingreg\",\n \"groups\": [\n \"21a54124-397f-494d-985e-3c5b330b8a68\"\n ],\n \"work_email\": \"greg@merge.dev\",\n \"personal_email\": \"greg@gmail.com\",\n \"mobile_phone_number\": \"+1234567890\",\n \"employments\": [\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"home_location\": \"home_location\",\n \"work_location\": \"work_location\",\n \"manager\": \"manager\",\n \"pay_group\": \"pay_group\",\n \"ssn\": \"1234567890\",\n \"gender\": \"MALE\",\n \"ethnicity\": \"AMERICAN_INDIAN_OR_ALASKA_NATIVE\",\n \"marital_status\": \"SINGLE\",\n \"date_of_birth\": \"1990-11-10T00:00:00Z\",\n \"start_date\": \"2020-10-11T00:00:00Z\",\n \"remote_created_at\": \"2020-10-11T00:00:00Z\",\n \"employment_status\": \"ACTIVE\",\n \"termination_date\": \"2021-10-12T00:00:00Z\",\n \"avatar\": \"http://alturl.com/h2h8m\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/people\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"237126ff-bf05-4d7d-9ce7-4bdccf5e43c9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"ad01bd1a-f186-4c04-9796-524e8f6f577e","name":"create - default","request":{"urlPathTemplate":"/hris/v1/employees","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_number\": \"2\",\n \"company\": \"company\",\n \"first_name\": \"Greg\",\n \"last_name\": \"Hirsch\",\n \"preferred_name\": \"Greg the egg\",\n \"display_full_name\": \"Cousin Greg Hirsch\",\n \"username\": \"cousingreg\",\n \"groups\": [\n \"21a54124-397f-494d-985e-3c5b330b8a68\"\n ],\n \"work_email\": \"greg@merge.dev\",\n \"personal_email\": \"greg@gmail.com\",\n \"mobile_phone_number\": \"+1234567890\",\n \"employments\": [\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"home_location\": \"home_location\",\n \"work_location\": \"work_location\",\n \"manager\": \"manager\",\n \"pay_group\": \"pay_group\",\n \"ssn\": \"1234567890\",\n \"gender\": \"MALE\",\n \"ethnicity\": \"AMERICAN_INDIAN_OR_ALASKA_NATIVE\",\n \"marital_status\": \"SINGLE\",\n \"date_of_birth\": \"1990-11-10T00:00:00Z\",\n \"start_date\": \"2020-10-11T00:00:00Z\",\n \"remote_created_at\": \"2020-10-11T00:00:00Z\",\n \"employment_status\": \"ACTIVE\",\n \"termination_date\": \"2021-10-12T00:00:00Z\",\n \"avatar\": \"http://alturl.com/h2h8m\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/people\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ad01bd1a-f186-4c04-9796-524e8f6f577e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"cf0322f5-0ffa-4f38-aca5-67843b738946","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/employees/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee_number\": \"2\",\n \"company\": \"company\",\n \"first_name\": \"Greg\",\n \"last_name\": \"Hirsch\",\n \"preferred_name\": \"Greg the egg\",\n \"display_full_name\": \"Cousin Greg Hirsch\",\n \"username\": \"cousingreg\",\n \"groups\": [\n \"21a54124-397f-494d-985e-3c5b330b8a68\"\n ],\n \"work_email\": \"greg@merge.dev\",\n \"personal_email\": \"greg@gmail.com\",\n \"mobile_phone_number\": \"+1234567890\",\n \"employments\": [\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"home_location\": \"home_location\",\n \"work_location\": \"work_location\",\n \"manager\": \"manager\",\n \"pay_group\": \"pay_group\",\n \"ssn\": \"1234567890\",\n \"gender\": \"MALE\",\n \"ethnicity\": \"AMERICAN_INDIAN_OR_ALASKA_NATIVE\",\n \"marital_status\": \"SINGLE\",\n \"date_of_birth\": \"1990-11-10T00:00:00Z\",\n \"start_date\": \"2020-10-11T00:00:00Z\",\n \"remote_created_at\": \"2020-10-11T00:00:00Z\",\n \"employment_status\": \"ACTIVE\",\n \"termination_date\": \"2021-10-12T00:00:00Z\",\n \"avatar\": \"http://alturl.com/h2h8m\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/people\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"cf0322f5-0ffa-4f38-aca5-67843b738946","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f685a13b-d085-49c3-8838-eb503c4843f3","name":"ignoreCreate - default","request":{"urlPathTemplate":"/hris/v1/employees/ignore/{model_id}","method":"POST","pathParameters":{"model_id":{"equalTo":"model_id"}}},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"f685a13b-d085-49c3-8838-eb503c4843f3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"3837f803-1987-4b06-a7c4-480399280332","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/hris/v1/employees/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3837f803-1987-4b06-a7c4-480399280332","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"5607e9b9-c673-4019-8d7f-496279e9c533","name":"list - default","request":{"urlPathTemplate":"/hris/v1/employer-benefits","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"025fjlc6-6000-430a-848e-aafacbadf4fele\",\n \"remote_id\": \"19202939\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"benefit_plan_type\": \"MEDICAL\",\n \"name\": \"Kaiser Permanente Medical Plan\",\n \"description\": \"HDHP Silver Plan\",\n \"deduction_code\": \"COL\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5607e9b9-c673-4019-8d7f-496279e9c533","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"d693dc9b-f05d-4763-8e6a-83b2af2f09e2","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/employer-benefits/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"025fjlc6-6000-430a-848e-aafacbadf4fele\",\n \"remote_id\": \"19202939\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"benefit_plan_type\": \"MEDICAL\",\n \"name\": \"Kaiser Permanente Medical Plan\",\n \"description\": \"HDHP Silver Plan\",\n \"deduction_code\": \"COL\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d693dc9b-f05d-4763-8e6a-83b2af2f09e2","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"38edc5aa-c2d4-4374-9243-9014a2313fdb","name":"list - default","request":{"urlPathTemplate":"/hris/v1/employments","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"65d8ffd0-211b-4ba4-b85a-fbe2ce220982\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"job_title\": \"Executive Assistant to Tom Wambsgans\",\n \"pay_rate\": 1.1,\n \"pay_period\": \"HOUR\",\n \"pay_frequency\": \"WEEKLY\",\n \"pay_currency\": \"XUA\",\n \"pay_group\": \"pay_group\",\n \"flsa_status\": \"EXEMPT\",\n \"effective_date\": \"2023-10-06T18:42:34Z\",\n \"employment_type\": \"FULL_TIME\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/jobs\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"38edc5aa-c2d4-4374-9243-9014a2313fdb","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a5296487-6cd6-4e74-bacf-14dac958443e","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/employments/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"65d8ffd0-211b-4ba4-b85a-fbe2ce220982\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"job_title\": \"Executive Assistant to Tom Wambsgans\",\n \"pay_rate\": 1.1,\n \"pay_period\": \"HOUR\",\n \"pay_frequency\": \"WEEKLY\",\n \"pay_currency\": \"XUA\",\n \"pay_group\": \"pay_group\",\n \"flsa_status\": \"EXEMPT\",\n \"effective_date\": \"2023-10-06T18:42:34Z\",\n \"employment_type\": \"FULL_TIME\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/jobs\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a5296487-6cd6-4e74-bacf-14dac958443e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6298d5ae-dcd1-45ea-96e7-067bcb0c2541","name":"field_mappings_retrieve - default","request":{"urlPathTemplate":"/hris/v1/field-mappings","method":"GET"},"response":{"status":200,"body":"{\n \"Benefit\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"EmployerBenefit\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Company\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"EmployeePayrollRun\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Employee\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Employment\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Location\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"PayrollRun\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Team\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"TimeOff\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"TimeOffBalance\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"BankInfo\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"PayGroup\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Group\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Dependent\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"TimesheetEntry\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6298d5ae-dcd1-45ea-96e7-067bcb0c2541","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"7e39ff3c-b910-4678-a41a-19d6b07a55be","name":"field_mappings_create - default","request":{"urlPathTemplate":"/hris/v1/field-mappings","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"7e39ff3c-b910-4678-a41a-19d6b07a55be","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"5ea14e0d-2708-45e8-9dab-a4c63ba1a4e6","name":"field_mappings_destroy - default","request":{"urlPathTemplate":"/hris/v1/field-mappings/{field_mapping_id}","method":"DELETE","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":204,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5ea14e0d-2708-45e8-9dab-a4c63ba1a4e6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"e2430ed4-a9a9-456c-8323-7e747e22e4f8","name":"field_mappings_partial_update - default","request":{"urlPathTemplate":"/hris/v1/field-mappings/{field_mapping_id}","method":"PATCH","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e2430ed4-a9a9-456c-8323-7e747e22e4f8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"02c03017-752d-4fb8-b65a-f537022ac42d","name":"remote_fields_retrieve - default","request":{"urlPathTemplate":"/hris/v1/remote-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Benefit\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"EmployerBenefit\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Company\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"EmployeePayrollRun\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Employee\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Employment\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Location\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"PayrollRun\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Team\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"TimeOff\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"TimeOffBalance\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"BankInfo\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"PayGroup\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Group\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Dependent\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"TimesheetEntry\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"02c03017-752d-4fb8-b65a-f537022ac42d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"64822c34-0b7a-426b-8def-c03aa439bf67","name":"target_fields_retrieve - default","request":{"urlPathTemplate":"/hris/v1/target-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Benefit\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"EmployerBenefit\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Company\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"EmployeePayrollRun\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Employee\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Employment\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Location\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"PayrollRun\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Team\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"TimeOff\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"TimeOffBalance\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"BankInfo\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"PayGroup\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Group\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Dependent\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"TimesheetEntry\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"64822c34-0b7a-426b-8def-c03aa439bf67","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"31d7f6a8-37ff-4398-a506-b47102b59934","name":"create - default","request":{"urlPathTemplate":"/hris/v1/generate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"31d7f6a8-37ff-4398-a506-b47102b59934","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ea96a81a-84c8-42f5-b772-d268963145ca","name":"list - default","request":{"urlPathTemplate":"/hris/v1/groups","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"134e0111-0f67-44f6-98f0-597000290bb3\",\n \"remote_id\": \"800293\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"parent_group\": \"2ef51b11-2c4e-4b02-8d1d-50592d9e96ef\",\n \"name\": \"COST_CENTER_US\",\n \"type\": \"TEAM\",\n \"is_commonly_used_as_team\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/group\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ea96a81a-84c8-42f5-b772-d268963145ca","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"692bd7b3-23a4-461b-a4d4-8129bce2456c","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/groups/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"134e0111-0f67-44f6-98f0-597000290bb3\",\n \"remote_id\": \"800293\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"parent_group\": \"2ef51b11-2c4e-4b02-8d1d-50592d9e96ef\",\n \"name\": \"COST_CENTER_US\",\n \"type\": \"TEAM\",\n \"is_commonly_used_as_team\": true,\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/group\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"692bd7b3-23a4-461b-a4d4-8129bce2456c","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"8c8959a6-403a-41bc-9964-d93b1a4150d6","name":"list - default","request":{"urlPathTemplate":"/hris/v1/issues","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8c8959a6-403a-41bc-9964-d93b1a4150d6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"2a68fdc4-a3f0-4ae7-9661-d8f2b057d4d9","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/issues/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2a68fdc4-a3f0-4ae7-9661-d8f2b057d4d9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"98424611-e531-4f01-99b7-315e00decf9b","name":"create - default","request":{"urlPathTemplate":"/hris/v1/link-token","method":"POST"},"response":{"status":200,"body":"{\n \"link_token\": \"necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0\",\n \"integration_name\": \"Lever\",\n \"magic_link_url\": \"https://link.merge.dev/asdfjkl12345jsndfgi2i83n\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"98424611-e531-4f01-99b7-315e00decf9b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"c03d832c-0318-4aae-a2bc-676d91471b74","name":"list - default","request":{"urlPathTemplate":"/hris/v1/linked-accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"e59b1821-f85c-4e28-a6b3-1804156f3563\",\n \"category\": \"hris\",\n \"status\": \"COMPLETE\",\n \"status_detail\": \"Invalid login credentials\",\n \"end_user_origin_id\": \"3ac95cde-6c7f-4eef-afec-be710b42308d\",\n \"end_user_organization_name\": \"Foo Bar, LLC\",\n \"end_user_email_address\": \"hradmin@foobar.dev\",\n \"subdomain\": \"foobar\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"integration\": {\n \"name\": \"name\",\n \"categories\": [\n \"hris\"\n ],\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n },\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c03d832c-0318-4aae-a2bc-676d91471b74","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"d4d12c61-d950-4e1a-a195-49c687286887","name":"list - default","request":{"urlPathTemplate":"/hris/v1/locations","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"f5e6a151-f44e-449a-afb1-8fd781905958\",\n \"remote_id\": \"93018402\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"NYC Office\",\n \"phone_number\": \"+1111111111\",\n \"street_1\": \"2920 Broadway\",\n \"street_2\": \"2nd Floor\",\n \"city\": \"New York \",\n \"state\": \"NY\",\n \"zip_code\": \"10027\",\n \"country\": \"AF\",\n \"location_type\": \"HOME\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/locations\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d4d12c61-d950-4e1a-a195-49c687286887","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"343d846a-625c-4878-a07d-ad75c7bbb1c0","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/locations/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"f5e6a151-f44e-449a-afb1-8fd781905958\",\n \"remote_id\": \"93018402\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"NYC Office\",\n \"phone_number\": \"+1111111111\",\n \"street_1\": \"2920 Broadway\",\n \"street_2\": \"2nd Floor\",\n \"city\": \"New York \",\n \"state\": \"NY\",\n \"zip_code\": \"10027\",\n \"country\": \"AF\",\n \"location_type\": \"HOME\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/locations\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"343d846a-625c-4878-a07d-ad75c7bbb1c0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"69601d82-9262-4d35-b464-d408333fd3a3","name":"create - default","request":{"urlPathTemplate":"/hris/v1/passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"69601d82-9262-4d35-b464-d408333fd3a3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"4992d725-7ac2-488d-821e-631619a23e16","name":"list - default","request":{"urlPathTemplate":"/hris/v1/pay-groups","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"fd1e0fb5-8f92-4ec9-9f32-179cf732867d\",\n \"remote_id\": \"800293\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"pay_group_name\": \"contractor\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/pay-group\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4992d725-7ac2-488d-821e-631619a23e16","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"0145134b-3cb1-4f49-ad42-b6fcd9832acb","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/pay-groups/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"fd1e0fb5-8f92-4ec9-9f32-179cf732867d\",\n \"remote_id\": \"800293\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"pay_group_name\": \"contractor\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/pay-group\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0145134b-3cb1-4f49-ad42-b6fcd9832acb","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"0366dce1-622f-4506-93dd-a5d9a0faafb4","name":"list - default","request":{"urlPathTemplate":"/hris/v1/payroll-runs","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"37336947-b3d4-4a4c-a310-ab6ab510e079\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"run_state\": \"PAID\",\n \"run_type\": \"REGULAR\",\n \"start_date\": \"2020-11-08T00:00:00Z\",\n \"end_date\": \"2020-11-15T00:00:00Z\",\n \"check_date\": \"2020-11-15T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/payroll\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0366dce1-622f-4506-93dd-a5d9a0faafb4","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a4fd1067-80a8-4663-a10d-a68a70483f04","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/payroll-runs/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"37336947-b3d4-4a4c-a310-ab6ab510e079\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"run_state\": \"PAID\",\n \"run_type\": \"REGULAR\",\n \"start_date\": \"2020-11-08T00:00:00Z\",\n \"end_date\": \"2020-11-15T00:00:00Z\",\n \"check_date\": \"2020-11-15T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/payroll\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a4fd1067-80a8-4663-a10d-a68a70483f04","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"0bd184f1-76fc-430f-bbd1-f23d97a6c905","name":"create - default","request":{"urlPathTemplate":"/hris/v1/regenerate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0bd184f1-76fc-430f-bbd1-f23d97a6c905","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"b7523ebb-d820-4e46-8fef-81d1f74645f8","name":"list - default","request":{"urlPathTemplate":"/hris/v1/sync-status","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"model_name\": \"Employee\",\n \"model_id\": \"hris.Employee\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b7523ebb-d820-4e46-8fef-81d1f74645f8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"cef0799f-d73a-419f-b0e0-5852f00ee199","name":"sync_status_resync_create - default","request":{"urlPathTemplate":"/hris/v1/sync-status/resync","method":"POST"},"response":{"status":200,"body":"[\n {\n \"model_name\": \"Employee\",\n \"model_id\": \"hris.Employee\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"cef0799f-d73a-419f-b0e0-5852f00ee199","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1b29ef84-e2eb-441c-84bc-96126fedbbab","name":"list - default","request":{"urlPathTemplate":"/hris/v1/teams","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"13a72919-9fae-4f54-81ca-ddfd8712a1ba\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Engineering\",\n \"parent_team\": \"parent_team\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/teams\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1b29ef84-e2eb-441c-84bc-96126fedbbab","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"e2135b5a-211e-4a1f-b53f-566774fd673f","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/teams/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"13a72919-9fae-4f54-81ca-ddfd8712a1ba\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Engineering\",\n \"parent_team\": \"parent_team\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/teams\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e2135b5a-211e-4a1f-b53f-566774fd673f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"40045563-ebc8-41ed-9158-a03be0c2dc06","name":"list - default","request":{"urlPathTemplate":"/hris/v1/time-off","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"91b2b905-e866-40c8-8be2-efe53827a0aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"approver\": \"approver\",\n \"status\": \"REQUESTED\",\n \"employee_note\": \"Moving into the new apartment Kendall Roy gave me!\",\n \"units\": \"HOURS\",\n \"amount\": 3,\n \"request_type\": \"VACATION\",\n \"start_time\": \"2020-11-10T00:00:00Z\",\n \"end_time\": \"2020-11-17T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/leave\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"40045563-ebc8-41ed-9158-a03be0c2dc06","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"b0eafd11-0339-4926-b025-6a4189173dbe","name":"create - default","request":{"urlPathTemplate":"/hris/v1/time-off","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"91b2b905-e866-40c8-8be2-efe53827a0aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"approver\": \"approver\",\n \"status\": \"REQUESTED\",\n \"employee_note\": \"Moving into the new apartment Kendall Roy gave me!\",\n \"units\": \"HOURS\",\n \"amount\": 3,\n \"request_type\": \"VACATION\",\n \"start_time\": \"2020-11-10T00:00:00Z\",\n \"end_time\": \"2020-11-17T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/leave\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b0eafd11-0339-4926-b025-6a4189173dbe","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f7fa9cee-25b5-4fa2-8702-d674aa39a747","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/time-off/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"91b2b905-e866-40c8-8be2-efe53827a0aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"approver\": \"approver\",\n \"status\": \"REQUESTED\",\n \"employee_note\": \"Moving into the new apartment Kendall Roy gave me!\",\n \"units\": \"HOURS\",\n \"amount\": 3,\n \"request_type\": \"VACATION\",\n \"start_time\": \"2020-11-10T00:00:00Z\",\n \"end_time\": \"2020-11-17T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/leave\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f7fa9cee-25b5-4fa2-8702-d674aa39a747","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"920bdf9f-7716-4e9c-bcf0-65c072fbf414","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/hris/v1/time-off/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"920bdf9f-7716-4e9c-bcf0-65c072fbf414","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"4f7b3021-99f9-4cf1-b8f7-13b12151d398","name":"list - default","request":{"urlPathTemplate":"/hris/v1/time-off-balances","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"91b2b905-e866-40c8-8be2-efe53827a0aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"balance\": 1.1,\n \"used\": 1.1,\n \"policy_type\": \"VACATION\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/leave\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4f7b3021-99f9-4cf1-b8f7-13b12151d398","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"b52a518e-fe20-45aa-949c-7762a3e0b718","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/time-off-balances/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"91b2b905-e866-40c8-8be2-efe53827a0aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"balance\": 1.1,\n \"used\": 1.1,\n \"policy_type\": \"VACATION\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/leave\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b52a518e-fe20-45aa-949c-7762a3e0b718","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"27d135d4-f3fe-44c8-afb5-8dc7222cc134","name":"list - default","request":{"urlPathTemplate":"/hris/v1/timesheet-entries","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"91b2b905-e866-40c8-8be2-efe53827a0aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"hours_worked\": 10,\n \"start_time\": \"2020-11-10T00:00:00Z\",\n \"end_time\": \"2020-11-10T00:10:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/dependent\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"27d135d4-f3fe-44c8-afb5-8dc7222cc134","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"57504e93-f856-4ce9-87e4-51339663f00d","name":"create - default","request":{"urlPathTemplate":"/hris/v1/timesheet-entries","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"91b2b905-e866-40c8-8be2-efe53827a0aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"hours_worked\": 10,\n \"start_time\": \"2020-11-10T00:00:00Z\",\n \"end_time\": \"2020-11-10T00:10:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/dependent\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"57504e93-f856-4ce9-87e4-51339663f00d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"08beacfe-bdbb-436a-8897-9e2b356db3fe","name":"retrieve - default","request":{"urlPathTemplate":"/hris/v1/timesheet-entries/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"91b2b905-e866-40c8-8be2-efe53827a0aa\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"employee\": \"employee\",\n \"hours_worked\": 10,\n \"start_time\": \"2020-11-10T00:00:00Z\",\n \"end_time\": \"2020-11-10T00:10:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/dependent\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"08beacfe-bdbb-436a-8897-9e2b356db3fe","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"4be0f111-50ba-4f7a-9f9e-a8f2bf0cc0b9","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/hris/v1/timesheet-entries/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4be0f111-50ba-4f7a-9f9e-a8f2bf0cc0b9","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"df5c0a06-9881-4bf0-80cc-844e757cd81e","name":"list - default","request":{"urlPathTemplate":"/hris/v1/webhook-receivers","method":"GET"},"response":{"status":200,"body":"[\n {\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"df5c0a06-9881-4bf0-80cc-844e757cd81e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"3830206c-80ee-42e3-8a1f-05ab43ab0e6e","name":"create - default","request":{"urlPathTemplate":"/hris/v1/webhook-receivers","method":"POST"},"response":{"status":201,"body":"{\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3830206c-80ee-42e3-8a1f-05ab43ab0e6e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ef7e5263-493d-4fdd-8997-143309b35b60","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/account-details","method":"GET"},"response":{"status":200,"body":"{\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\",\n \"integration\": \"BambooHR\",\n \"integration_slug\": \"bamboohr\",\n \"category\": \"hris\",\n \"end_user_origin_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"end_user_organization_name\": \"Waystar Royco\",\n \"end_user_email_address\": \"kendall.roy@waystar-royco.com\",\n \"status\": \"COMPLETE\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ef7e5263-493d-4fdd-8997-143309b35b60","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"4e6de166-ee5c-448d-ae61-63b194f7005b","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/account-token/{public_token}","method":"GET","pathParameters":{"public_token":{"equalTo":"public_token"}}},"response":{"status":200,"body":"{\n \"account_token\": \"T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB\",\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"id\": \"0496d4c2-42e6-4072-80b3-7b69bfdc76fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4e6de166-ee5c-448d-ae61-63b194f7005b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"78287e0b-2d8c-4fc0-8668-b0fe1fe7401f","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Waystar Royco\",\n \"domains\": [\n \"waystar-royco.com\",\n \"royco.com\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"78287e0b-2d8c-4fc0-8668-b0fe1fe7401f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"ba7770f8-2911-4866-b588-ee3c467315ad","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/accounts/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Waystar Royco\",\n \"domains\": [\n \"waystar-royco.com\",\n \"royco.com\"\n ],\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/actions\",\n \"data\": [\n \"Varies by platform\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ba7770f8-2911-4866-b588-ee3c467315ad","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"1061e78b-f6de-4ae0-8abf-9e62fbf56a70","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/async-passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"async_passthrough_receipt_id\": \"fd29020f-2695-445e-922e-dcd5e81903fd\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"1061e78b-f6de-4ae0-8abf-9e62fbf56a70","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"2b6ba87a-ab96-46a6-ad79-15da1cd490a2","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/async-passthrough/{async_passthrough_receipt_id}","method":"GET","pathParameters":{"async_passthrough_receipt_id":{"equalTo":"async_passthrough_receipt_id"}}},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2b6ba87a-ab96-46a6-ad79-15da1cd490a2","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"5aba178a-e20c-4f4f-be93-1240eca67fce","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/attachments","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"file_name\": \"Screenshot.png\",\n \"ticket\": \"ticket\",\n \"file_url\": \"http://alturl.com/p749b\",\n \"content_type\": \"jpeg\",\n \"uploaded_by\": \"28b54125-287f-494d-965e-3c5b330c9a68\",\n \"remote_created_at\": \"2022-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5aba178a-e20c-4f4f-be93-1240eca67fce","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"aa8e1ec9-c249-4db1-93df-18615761d1fb","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/attachments","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"file_name\": \"Screenshot.png\",\n \"ticket\": \"ticket\",\n \"file_url\": \"http://alturl.com/p749b\",\n \"content_type\": \"jpeg\",\n \"uploaded_by\": \"28b54125-287f-494d-965e-3c5b330c9a68\",\n \"remote_created_at\": \"2022-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"aa8e1ec9-c249-4db1-93df-18615761d1fb","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"476f44a4-ee98-4531-84ed-299e892e7c61","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/attachments/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"file_name\": \"Screenshot.png\",\n \"ticket\": \"ticket\",\n \"file_url\": \"http://alturl.com/p749b\",\n \"content_type\": \"jpeg\",\n \"uploaded_by\": \"28b54125-287f-494d-965e-3c5b330c9a68\",\n \"remote_created_at\": \"2022-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"476f44a4-ee98-4531-84ed-299e892e7c61","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"051b6581-8953-4ff2-84c8-5d321d886dda","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/ticketing/v1/attachments/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"051b6581-8953-4ff2-84c8-5d321d886dda","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f531b611-f2e7-4165-802e-ba54a165c448","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/audit-trail","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"b5ceea2a-7171-47ce-8090-165cfce5572c\",\n \"user_name\": \"Gil Feig\",\n \"user_email\": \"hello@merge.dev\",\n \"role\": \"ADMIN\",\n \"ip_address\": \"192.0.2.123\",\n \"event_type\": \"CREATED_REMOTE_PRODUCTION_API_KEY\",\n \"event_description\": \"Organization-wide Scopes for model hris.Employee updated from Read to Read+Write\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f531b611-f2e7-4165-802e-ba54a165c448","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"4998e610-5e43-4afa-81ad-c162430b119b","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/available-actions","method":"GET"},"response":{"status":200,"body":"{\n \"integration\": {\n \"name\": \"name\",\n \"abbreviated_name\": \"abbreviated_name\",\n \"categories\": [\n \"hris\"\n ],\n \"image\": \"image\",\n \"square_image\": \"square_image\",\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"api_endpoints_to_documentation_urls\": {\n \"key\": \"value\"\n },\n \"webhook_setup_guide_url\": \"webhook_setup_guide_url\",\n \"category_beta_status\": {\n \"key\": \"value\"\n }\n },\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"4998e610-5e43-4afa-81ad-c162430b119b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a41fcde0-8cf3-46c3-9767-0f6a824c5b47","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/collections","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Q1 Platform\",\n \"description\": \"For tracking all tasks related to Platform for Q1\",\n \"access_level\": \"PRIVATE\",\n \"collection_type\": \"LIST\",\n \"parent_collection\": \"parent_collection\",\n \"collection_url\": \"https://example.com\",\n \"remote_created_at\": \"2022-01-01T00:00:00Z\",\n \"remote_updated_at\": \"2022-01-01T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a41fcde0-8cf3-46c3-9767-0f6a824c5b47","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a1ca9112-b665-409e-ba8c-cf67dcd601a4","name":"viewersList - default","request":{"urlPathTemplate":"/ticketing/v1/collections/{collection_id}/viewers","method":"GET","pathParameters":{"collection_id":{"equalTo":"collection_id"}}},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"team\": \"team\",\n \"user\": \"user\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a1ca9112-b665-409e-ba8c-cf67dcd601a4","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"a16713a9-14be-4e05-bd73-30dc85fdd39e","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/collections/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Q1 Platform\",\n \"description\": \"For tracking all tasks related to Platform for Q1\",\n \"access_level\": \"PRIVATE\",\n \"collection_type\": \"LIST\",\n \"parent_collection\": \"parent_collection\",\n \"collection_url\": \"https://example.com\",\n \"remote_created_at\": \"2022-01-01T00:00:00Z\",\n \"remote_updated_at\": \"2022-01-01T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a16713a9-14be-4e05-bd73-30dc85fdd39e","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"41d21b15-3cc2-4e3e-b630-2f4347b77de5","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/comments","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"user\": \"user\",\n \"contact\": \"contact\",\n \"body\": \"When will these integrations be done? You all should use Merge.\",\n \"html_body\": \"When will these integrations be done? You all should use Merge.\",\n \"ticket\": \"ticket\",\n \"is_private\": true,\n \"remote_created_at\": \"1990-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"41d21b15-3cc2-4e3e-b630-2f4347b77de5","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"02031a8b-9e4b-42e9-b735-b919cd18c165","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/comments","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"user\": \"user\",\n \"contact\": \"contact\",\n \"body\": \"When will these integrations be done? You all should use Merge.\",\n \"html_body\": \"When will these integrations be done? You all should use Merge.\",\n \"ticket\": \"ticket\",\n \"is_private\": true,\n \"remote_created_at\": \"1990-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"02031a8b-9e4b-42e9-b735-b919cd18c165","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"f88c4d34-83b6-4385-af7b-c73868ba9f01","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/comments/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"user\": \"user\",\n \"contact\": \"contact\",\n \"body\": \"When will these integrations be done? You all should use Merge.\",\n \"html_body\": \"When will these integrations be done? You all should use Merge.\",\n \"ticket\": \"ticket\",\n \"is_private\": true,\n \"remote_created_at\": \"1990-11-10T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f88c4d34-83b6-4385-af7b-c73868ba9f01","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"359b98f9-afd0-48f7-ba06-6b6dd14cf967","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/ticketing/v1/comments/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"359b98f9-afd0-48f7-ba06-6b6dd14cf967","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"151741e5-aef5-4103-ae1f-6e84bec3b288","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/contacts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Cousin Greg\",\n \"email_address\": \"greg@waystar-royco.com\",\n \"phone_number\": \"5108890293\",\n \"details\": \"Executive Assistant to Tom Wambsgans\",\n \"account\": \"account\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"151741e5-aef5-4103-ae1f-6e84bec3b288","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"ffd2bf13-a2a8-4fcb-9154-b604fa8ecf18","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/contacts","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Cousin Greg\",\n \"email_address\": \"greg@waystar-royco.com\",\n \"phone_number\": \"5108890293\",\n \"details\": \"Executive Assistant to Tom Wambsgans\",\n \"account\": \"account\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ffd2bf13-a2a8-4fcb-9154-b604fa8ecf18","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6b0d3b7d-92ff-412e-831c-706abc0197a0","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/contacts/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Cousin Greg\",\n \"email_address\": \"greg@waystar-royco.com\",\n \"phone_number\": \"5108890293\",\n \"details\": \"Executive Assistant to Tom Wambsgans\",\n \"account\": \"account\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6b0d3b7d-92ff-412e-831c-706abc0197a0","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"3216a12a-196a-47cc-8bdb-af3f9ec0a7d1","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/ticketing/v1/contacts/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"3216a12a-196a-47cc-8bdb-af3f9ec0a7d1","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"c520d7bd-8368-4ad6-abcb-31bf7a99c3d1","name":"default_scopes_retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/default-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c520d7bd-8368-4ad6-abcb-31bf7a99c3d1","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"cc3aaad9-ebce-48d3-b06b-4b03cc750990","name":"linked_account_scopes_retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/linked-account-scopes","method":"GET"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"cc3aaad9-ebce-48d3-b06b-4b03cc750990","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"c5180760-baa9-4783-8032-68b3b1416480","name":"linked_account_scopes_create - default","request":{"urlPathTemplate":"/ticketing/v1/linked-account-scopes","method":"POST"},"response":{"status":200,"body":"{\n \"common_models\": [\n {\n \"model_name\": \"Employee\",\n \"model_permissions\": {\n \"READ\": {\n \"is_enabled\": true\n },\n \"WRITE\": {\n \"is_enabled\": false\n }\n },\n \"field_permissions\": {\n \"enabled_fields\": [\n \"avatar\",\n \"created_at\",\n \"custom_fields\",\n \"date_of_birth\",\n \"first_name\",\n \"gender\",\n \"remote_created_at\",\n \"remote_data\"\n ],\n \"disabled_fields\": [\n \"company\",\n \"employments\",\n \"groups\",\n \"home_location\",\n \"manager\",\n \"work_location\"\n ]\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c5180760-baa9-4783-8032-68b3b1416480","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"5478729b-3f19-4de9-aa97-1e1aac1826dc","name":"delete - default","request":{"urlPathTemplate":"/ticketing/v1/delete-account","method":"POST"},"response":{"status":200,"body":"\"\"","headers":{"Content-Type":"application/json"}},"uuid":"5478729b-3f19-4de9-aa97-1e1aac1826dc","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6c10792e-b609-429b-9d83-80e14c9e1036","name":"field_mappings_retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/field-mappings","method":"GET"},"response":{"status":200,"body":"{\n \"Ticket\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Comment\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Project\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Collection\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"User\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Role\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Account\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Team\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Attachment\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Tag\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ],\n \"Contact\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6c10792e-b609-429b-9d83-80e14c9e1036","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f66b1d9e-daf4-4aec-8b80-44bb8d63fd1d","name":"field_mappings_create - default","request":{"urlPathTemplate":"/ticketing/v1/field-mappings","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f66b1d9e-daf4-4aec-8b80-44bb8d63fd1d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"57e00d1e-4965-422e-aa52-c936dafde4de","name":"field_mappings_destroy - default","request":{"urlPathTemplate":"/ticketing/v1/field-mappings/{field_mapping_id}","method":"DELETE","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":204,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"57e00d1e-4965-422e-aa52-c936dafde4de","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"6568f462-5ce0-4106-be4b-689b01f77664","name":"field_mappings_partial_update - default","request":{"urlPathTemplate":"/ticketing/v1/field-mappings/{field_mapping_id}","method":"PATCH","pathParameters":{"field_mapping_id":{"equalTo":"field_mapping_id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_integration_wide\": true,\n \"target_field\": {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_organization_wide\": true\n },\n \"remote_field\": {\n \"remote_key_name\": \"example_remote_field_key\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_remote_field_key\"\n ]\n }\n }\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"6568f462-5ce0-4106-be4b-689b01f77664","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"902557fa-d2a1-4a46-b482-d8c3e23b2cb6","name":"remote_fields_retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/remote-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Ticket\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Comment\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Project\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Collection\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"User\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Role\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Account\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Team\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Attachment\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Tag\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ],\n \"Contact\": [\n {\n \"schema\": {\n \"type\": \"string\"\n },\n \"remote_key_name\": \"example_remote_key_name\",\n \"remote_endpoint_info\": {\n \"method\": \"GET\",\n \"url_path\": \"/example-url-path\",\n \"field_traversal_path\": [\n \"example_key_name\"\n ]\n },\n \"example_values\": [\n \"example\"\n ],\n \"advanced_metadata\": {\n \"id\": \"id\"\n },\n \"coverage\": 1\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"902557fa-d2a1-4a46-b482-d8c3e23b2cb6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"05a9e022-8613-4021-b7af-32f11be92c1d","name":"target_fields_retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/target-fields","method":"GET"},"response":{"status":200,"body":"{\n \"Ticket\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Comment\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Project\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Collection\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"User\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Role\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Account\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Team\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Attachment\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Tag\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ],\n \"Contact\": [\n {\n \"name\": \"example_target_field_name\",\n \"description\": \"this is a example description of a target field\",\n \"is_mapped\": \"is_mapped\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"05a9e022-8613-4021-b7af-32f11be92c1d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"270ed933-7ebe-456a-a9ce-e3a6fd668da8","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/generate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"270ed933-7ebe-456a-a9ce-e3a6fd668da8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"df4c9018-e35a-4fc6-8cf7-61bf93731f2d","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/issues","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"df4c9018-e35a-4fc6-8cf7-61bf93731f2d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f721b8a1-0997-4cf5-999f-6b86d9cf7cca","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/issues/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"ONGOING\",\n \"error_description\": \"Missing Permissions\",\n \"end_user\": {\n \"key\": \"value\"\n },\n \"first_incident_time\": \"2022-12-05T16:19:15Z\",\n \"last_incident_time\": \"2022-12-05T16:19:15Z\",\n \"is_muted\": true,\n \"error_details\": [\n \"Missing employee permissions.\",\n \"Missing time off permissions.\"\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f721b8a1-0997-4cf5-999f-6b86d9cf7cca","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"120d33b4-2bfb-4b55-b457-b44ec0d36c69","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/link-token","method":"POST"},"response":{"status":200,"body":"{\n \"link_token\": \"necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0\",\n \"integration_name\": \"Lever\",\n \"magic_link_url\": \"https://link.merge.dev/asdfjkl12345jsndfgi2i83n\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"120d33b4-2bfb-4b55-b457-b44ec0d36c69","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"8b1470d5-7d7b-4132-b31f-132ce139dadc","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/linked-accounts","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"e59b1821-f85c-4e28-a6b3-1804156f3563\",\n \"category\": \"hris\",\n \"status\": \"COMPLETE\",\n \"status_detail\": \"Invalid login credentials\",\n \"end_user_origin_id\": \"3ac95cde-6c7f-4eef-afec-be710b42308d\",\n \"end_user_organization_name\": \"Foo Bar, LLC\",\n \"end_user_email_address\": \"hradmin@foobar.dev\",\n \"subdomain\": \"foobar\",\n \"webhook_listener_url\": \"https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4\",\n \"is_duplicate\": true,\n \"integration\": {\n \"name\": \"name\",\n \"categories\": [\n \"hris\"\n ],\n \"color\": \"color\",\n \"slug\": \"slug\",\n \"passthrough_available\": true,\n \"available_model_operations\": [\n {\n \"model_name\": \"Candidate\",\n \"available_operations\": [\n \"FETCH\",\n \"CREATE\"\n ],\n \"required_post_parameters\": [\n \"remote_user_id\"\n ],\n \"supported_fields\": [\n \"first_name\",\n \"last_name\",\n \"company\",\n \"title\"\n ]\n }\n ]\n },\n \"account_type\": \"PRODUCTION\",\n \"completed_at\": \"2024-08-26T20:11:19Z\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8b1470d5-7d7b-4132-b31f-132ce139dadc","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"a875ad1a-f1ce-4a64-8fee-4e4806287ce3","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/passthrough","method":"POST"},"response":{"status":200,"body":"{\n \"method\": \"GET\",\n \"path\": \"/scooters\",\n \"status\": 200,\n \"response\": {\n \"key\": \"value\"\n },\n \"response_headers\": {\n \"X-Page-Token\": \"value\"\n },\n \"response_type\": \"JSON\",\n \"headers\": {\n \"EXTRA-HEADER\": \"value\",\n \"Authorization\": \"\"\n }\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a875ad1a-f1ce-4a64-8fee-4e4806287ce3","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ca5ead19-79e2-415d-b5d6-0b2cbd5f9664","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/projects","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Q1 Platform\",\n \"description\": \"For tracking all tasks related to Platform for Q1\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ca5ead19-79e2-415d-b5d6-0b2cbd5f9664","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"8f68e0c4-a06f-45fb-8616-e51270fdf7ab","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/projects/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Q1 Platform\",\n \"description\": \"For tracking all tasks related to Platform for Q1\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8f68e0c4-a06f-45fb-8616-e51270fdf7ab","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"d71a5743-808b-4853-8590-cca61bb8edae","name":"usersList - default","request":{"urlPathTemplate":"/ticketing/v1/projects/{parent_id}/users","method":"GET","pathParameters":{"parent_id":{"equalTo":"parent_id"}}},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig\",\n \"email_address\": \"help@merge.dev\",\n \"is_active\": true,\n \"teams\": [\n \"28b54125-287f-494d-965e-3c5b330c9a68\",\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"roles\": [\n \"23454124-387f-494d-265e-345b330c9123\"\n ],\n \"avatar\": \"https://merge.dev/user_profile_pic.png\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d71a5743-808b-4853-8590-cca61bb8edae","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"c0206747-72a6-4e9b-8f22-90bf04168dbb","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/regenerate-key","method":"POST"},"response":{"status":200,"body":"{\n \"name\": \"Remote Deployment Key 1\",\n \"key\": \"hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"c0206747-72a6-4e9b-8f22-90bf04168dbb","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"8b2df6dc-b0af-4bbe-825e-c21b7d426fb1","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/roles","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"23454124-387f-494d-265e-345b330c9123\",\n \"remote_id\": \"123\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Member\",\n \"ticket_actions\": [\n \"VIEW\",\n \"EDIT\",\n \"CREATE\"\n ],\n \"ticket_access\": \"ALL\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"8b2df6dc-b0af-4bbe-825e-c21b7d426fb1","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"29e7e504-9cd2-4450-8c6e-b3599ba4bf40","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/roles/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"23454124-387f-494d-265e-345b330c9123\",\n \"remote_id\": \"123\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Member\",\n \"ticket_actions\": [\n \"VIEW\",\n \"EDIT\",\n \"CREATE\"\n ],\n \"ticket_access\": \"ALL\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"29e7e504-9cd2-4450-8c6e-b3599ba4bf40","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"e14d9c12-6606-4787-b190-4ba710615686","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/sync-status","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"model_name\": \"Ticket\",\n \"model_id\": \"ticketing.Ticket\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"e14d9c12-6606-4787-b190-4ba710615686","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"dbb04708-60ed-443c-bdb5-1e3521685b28","name":"sync_status_resync_create - default","request":{"urlPathTemplate":"/ticketing/v1/sync-status/resync","method":"POST"},"response":{"status":200,"body":"[\n {\n \"model_name\": \"Ticket\",\n \"model_id\": \"ticketing.Ticket\",\n \"last_sync_start\": \"2021-03-30T19:44:18Z\",\n \"next_sync_start\": \"2021-03-30T20:44:18Z\",\n \"last_sync_result\": \"SYNCING\",\n \"last_sync_finished\": \"2021-03-30T19:55:18Z\",\n \"status\": \"SYNCING\",\n \"is_initial_sync\": true,\n \"selective_sync_configurations_usage\": \"IN_NEXT_SYNC\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"dbb04708-60ed-443c-bdb5-1e3521685b28","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"63633a66-374a-4038-bec5-0a94c1df2ba8","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/tags","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"name\": \"Ticketing API\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"63633a66-374a-4038-bec5-0a94c1df2ba8","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"b69e7ea6-db2f-46be-a5d3-7a10ad40233d","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/tags/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"name\": \"Ticketing API\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"b69e7ea6-db2f-46be-a5d3-7a10ad40233d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"5dc5da4a-5992-466e-a1a0-26551142c961","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/teams","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Platform\",\n \"description\": \"Platform and Integrations Team\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5dc5da4a-5992-466e-a1a0-26551142c961","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"81e02ac3-62ca-48cb-b1ca-2943e9f256e6","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/teams/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Platform\",\n \"description\": \"Platform and Integrations Team\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"81e02ac3-62ca-48cb-b1ca-2943e9f256e6","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"ee6bc75a-c8b6-46d5-94d5-e8c112ce32cd","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/tickets","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Please add more integrations\",\n \"assignees\": [\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"assigned_teams\": [\n \"4857c306-c1f9-489e-a6b6-90902f736dfe\"\n ],\n \"creator\": \"creator\",\n \"due_date\": \"2022-10-11T00:00:00Z\",\n \"status\": \"OPEN\",\n \"description\": \"Can you please add more integrations? It'll make syncing data much easier!\",\n \"collections\": [\n \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\"\n ],\n \"ticket_type\": \"incident\",\n \"account\": \"account\",\n \"contact\": \"contact\",\n \"parent_ticket\": \"parent_ticket\",\n \"attachments\": [\n \"42747df1-95e7-46e2-93cc-66f1191edca5\",\n \"92f972d0-2526-434b-9409-4c3b468e08f0\"\n ],\n \"access_level\": \"COMPANY\",\n \"tags\": [\n \"enterprise\",\n \"other-tag\"\n ],\n \"roles\": [\n \"21a54124-397f-494d-985e-3c5b330b8a68\",\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"ticket_url\": \"https://thirdpartysoftware.com/project/3/issue/1\",\n \"priority\": \"URGENT\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_updated_at\": \"2021-12-09T00:00:00Z\",\n \"completed_at\": \"2021-12-09T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"ee6bc75a-c8b6-46d5-94d5-e8c112ce32cd","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"315143b3-b297-4765-a5a3-388180278b0f","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/tickets","method":"POST"},"response":{"status":201,"body":"{\n \"model\": {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Please add more integrations\",\n \"assignees\": [\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"assigned_teams\": [\n \"4857c306-c1f9-489e-a6b6-90902f736dfe\"\n ],\n \"creator\": \"creator\",\n \"due_date\": \"2022-10-11T00:00:00Z\",\n \"status\": \"OPEN\",\n \"description\": \"Can you please add more integrations? It'll make syncing data much easier!\",\n \"collections\": [\n \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\"\n ],\n \"ticket_type\": \"incident\",\n \"account\": \"account\",\n \"contact\": \"contact\",\n \"parent_ticket\": \"parent_ticket\",\n \"attachments\": [\n \"42747df1-95e7-46e2-93cc-66f1191edca5\",\n \"92f972d0-2526-434b-9409-4c3b468e08f0\"\n ],\n \"access_level\": \"COMPANY\",\n \"tags\": [\n \"enterprise\",\n \"other-tag\"\n ],\n \"roles\": [\n \"21a54124-397f-494d-985e-3c5b330b8a68\",\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"ticket_url\": \"https://thirdpartysoftware.com/project/3/issue/1\",\n \"priority\": \"URGENT\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_updated_at\": \"2021-12-09T00:00:00Z\",\n \"completed_at\": \"2021-12-09T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"315143b3-b297-4765-a5a3-388180278b0f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"31ec6dd2-a353-43a1-a77e-d888d87ab19f","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/tickets/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Please add more integrations\",\n \"assignees\": [\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"assigned_teams\": [\n \"4857c306-c1f9-489e-a6b6-90902f736dfe\"\n ],\n \"creator\": \"creator\",\n \"due_date\": \"2022-10-11T00:00:00Z\",\n \"status\": \"OPEN\",\n \"description\": \"Can you please add more integrations? It'll make syncing data much easier!\",\n \"collections\": [\n \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\"\n ],\n \"ticket_type\": \"incident\",\n \"account\": \"account\",\n \"contact\": \"contact\",\n \"parent_ticket\": \"parent_ticket\",\n \"attachments\": [\n \"42747df1-95e7-46e2-93cc-66f1191edca5\",\n \"92f972d0-2526-434b-9409-4c3b468e08f0\"\n ],\n \"access_level\": \"COMPANY\",\n \"tags\": [\n \"enterprise\",\n \"other-tag\"\n ],\n \"roles\": [\n \"21a54124-397f-494d-985e-3c5b330b8a68\",\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"ticket_url\": \"https://thirdpartysoftware.com/project/3/issue/1\",\n \"priority\": \"URGENT\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_updated_at\": \"2021-12-09T00:00:00Z\",\n \"completed_at\": \"2021-12-09T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\",\n \"value\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"31ec6dd2-a353-43a1-a77e-d888d87ab19f","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"2e890bd1-b2a5-40ce-967b-1436c753553d","name":"partialUpdate - default","request":{"urlPathTemplate":"/ticketing/v1/tickets/{id}","method":"PATCH","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"model\": {\n \"id\": \"0958cbc6-6040-430a-848e-aafacbadf4ae\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Please add more integrations\",\n \"assignees\": [\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"assigned_teams\": [\n \"4857c306-c1f9-489e-a6b6-90902f736dfe\"\n ],\n \"creator\": \"creator\",\n \"due_date\": \"2022-10-11T00:00:00Z\",\n \"status\": \"OPEN\",\n \"description\": \"Can you please add more integrations? It'll make syncing data much easier!\",\n \"collections\": [\n \"fb8c55b6-1cb8-4b4c-9fb6-17924231619d\"\n ],\n \"ticket_type\": \"incident\",\n \"account\": \"account\",\n \"contact\": \"contact\",\n \"parent_ticket\": \"parent_ticket\",\n \"attachments\": [\n \"42747df1-95e7-46e2-93cc-66f1191edca5\",\n \"92f972d0-2526-434b-9409-4c3b468e08f0\"\n ],\n \"access_level\": \"COMPANY\",\n \"tags\": [\n \"enterprise\",\n \"other-tag\"\n ],\n \"roles\": [\n \"21a54124-397f-494d-985e-3c5b330b8a68\",\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"ticket_url\": \"https://thirdpartysoftware.com/project/3/issue/1\",\n \"priority\": \"URGENT\",\n \"remote_created_at\": \"2021-11-10T00:00:00Z\",\n \"remote_updated_at\": \"2021-12-09T00:00:00Z\",\n \"completed_at\": \"2021-12-09T00:00:00Z\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ],\n \"remote_fields\": [\n {\n \"remote_field_class\": \"remote_field_class\"\n }\n ]\n },\n \"warnings\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Unrecognized Field\",\n \"detail\": \"An unrecognized field, age, was passed in with request data.\",\n \"problem_type\": \"UNRECOGNIZED_FIELD\"\n }\n ],\n \"errors\": [\n {\n \"source\": {\n \"pointer\": \"pointer\"\n },\n \"title\": \"Missing Required Field\",\n \"detail\": \"custom_fields is a required field on model.\",\n \"problem_type\": \"MISSING_REQUIRED_FIELD\"\n }\n ],\n \"logs\": [\n {\n \"log_id\": \"99433219-8017-4acd-bb3c-ceb23d663832\",\n \"dashboard_view\": \"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832\",\n \"log_summary\": {\n \"url\": \"www.exampleintegration.com/api/v1/exampleapi\",\n \"method\": \"POST\",\n \"status_code\": 200\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"2e890bd1-b2a5-40ce-967b-1436c753553d","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"d508b809-f339-449a-ade1-ba45437d9440","name":"viewersList - default","request":{"urlPathTemplate":"/ticketing/v1/tickets/{ticket_id}/viewers","method":"GET","pathParameters":{"ticket_id":{"equalTo":"ticket_id"}}},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"088899\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"team\": \"team\",\n \"user\": \"user\"\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"d508b809-f339-449a-ade1-ba45437d9440","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"a125a051-b0ea-4287-bdfa-5e3603beee67","name":"metaPatchRetrieve - default","request":{"urlPathTemplate":"/ticketing/v1/tickets/meta/patch/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"a125a051-b0ea-4287-bdfa-5e3603beee67","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"272814f7-5307-48bc-b71f-23f306e83c2b","name":"metaPostRetrieve - default","request":{"urlPathTemplate":"/ticketing/v1/tickets/meta/post","method":"GET"},"response":{"status":200,"body":"{\n \"request_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"model\": {\n \"type\": \"object\",\n \"required\": [\n \"last_name\",\n \"first_name\",\n \"merge_categories\",\n \"new_york_city_neighborhood\",\n \"favorite_tv_shows\",\n \"favorite_watch\"\n ],\n \"properties\": {\n \"email_addresses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"email_address_type\": {\n \"type\": \"string\",\n \"title\": \"email_address_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"email_addresses\",\n \"description\": \"Array of email_addresses objects\"\n },\n \"urls\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"url_type\": {\n \"type\": \"string\",\n \"title\": \"url_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"urls\",\n \"description\": \"Array of urls objects\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"title\": \"first_name\",\n \"description\": \"The first name.\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"title\": \"last_name\",\n \"description\": \"The last name.\"\n },\n \"phone_numbers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"title\": \"value\"\n },\n \"phone_number_type\": {\n \"type\": \"string\",\n \"title\": \"phone_number_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"phone_numbers\",\n \"description\": \"Array of phone_numbers objects\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"tags\",\n \"description\": \"Array of tags names\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"title\": \"id\"\n },\n \"file_url\": {\n \"type\": \"string\",\n \"title\": \"file_url\"\n },\n \"file_name\": {\n \"type\": \"string\",\n \"title\": \"file_name\"\n },\n \"attachment_type\": {\n \"type\": \"string\",\n \"title\": \"attachment_type\"\n },\n \"integration_params\": {\n \"type\": \"object\",\n \"title\": \"integration_params\",\n \"properties\": {}\n },\n \"linked_account_params\": {\n \"type\": \"object\",\n \"title\": \"linked_account_params\",\n \"properties\": {}\n }\n }\n },\n \"title\": \"attachments\",\n \"description\": \"Array of attachments objects \"\n },\n \"merge_categories\": {\n \"type\": \"array\",\n \"categories\": {\n \"type\": \"string\",\n \"enum\": [\n \"HRIS\",\n \"ATS\",\n \"Accounting\",\n \"Ticketing\",\n \"File Storage\",\n \"CRM\",\n \"Marketing Automation\"\n ],\n \"enum_information\": [\n {\n \"value\": \"HRIS\",\n \"description\": \"Merge HRIS Category\"\n },\n {\n \"value\": \"ATS\",\n \"description\": \"Merge ATS Category\"\n },\n {\n \"value\": \"Accounting\",\n \"description\": \"Merge Accounting Category\"\n },\n {\n \"value\": \"Ticketing\",\n \"description\": \"Merge Ticketing Category\"\n },\n {\n \"value\": \"File Storage\",\n \"description\": \"Merge File Storage Category\"\n },\n {\n \"value\": \"CRM\",\n \"description\": \"Merge CRM Category\"\n },\n {\n \"value\": \"Marketing Automation\",\n \"description\": \"Merge Marketing Automation Category\"\n }\n ]\n },\n \"title\": \"Merge Categories\",\n \"description\": \"Array of Merge's Unified API Categories\"\n },\n \"new_york_city_neighborhood\": {\n \"type\": \"string\",\n \"title\": \"Borough\",\n \"description\": \"One of the 5 Boroughs of New York City\"\n },\n \"favorite_tv_shows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"title\": \"Favorite TV Shows\",\n \"description\": \"Array of TV Show objects on merge.tv_shows\"\n },\n \"favorite_watch\": {\n \"type\": \"string\",\n \"title\": \"Favorite Watch\",\n \"description\": \"Favorite watch of all time\"\n }\n }\n }\n }\n },\n \"remote_field_classes\": {\n \"key\": \"value\"\n },\n \"status\": {\n \"linked_account_status\": \"linked_account_status\",\n \"can_make_request\": true\n },\n \"has_conditional_params\": true,\n \"has_required_linked_account_params\": true\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"272814f7-5307-48bc-b71f-23f306e83c2b","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"0cff01e3-ff50-4c22-a222-12b9fb1c2808","name":"remoteFieldClassesList - default","request":{"urlPathTemplate":"/ticketing/v1/tickets/remote-field-classes","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"id\",\n \"display_name\": \"display_name\",\n \"remote_key_name\": \"remote_key_name\",\n \"description\": \"description\",\n \"is_custom\": true,\n \"is_common_model_field\": true,\n \"is_required\": true,\n \"field_type\": \"string\",\n \"field_format\": \"string\",\n \"field_choices\": [\n {}\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"0cff01e3-ff50-4c22-a222-12b9fb1c2808","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f8aa7826-8630-433c-a14d-a32ab53dd9d1","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/users","method":"GET"},"response":{"status":200,"body":"{\n \"next\": \"cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw\",\n \"previous\": \"cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ\",\n \"results\": [\n {\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig\",\n \"email_address\": \"help@merge.dev\",\n \"is_active\": true,\n \"teams\": [\n \"28b54125-287f-494d-965e-3c5b330c9a68\",\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"roles\": [\n \"23454124-387f-494d-265e-345b330c9123\"\n ],\n \"avatar\": \"https://merge.dev/user_profile_pic.png\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\"\n }\n ]\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f8aa7826-8630-433c-a14d-a32ab53dd9d1","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"5bf991a0-41f6-41b3-8a26-b9cef5ee8091","name":"retrieve - default","request":{"urlPathTemplate":"/ticketing/v1/users/{id}","method":"GET","pathParameters":{"id":{"equalTo":"id"}}},"response":{"status":200,"body":"{\n \"id\": \"17a54124-287f-494d-965e-3c5b330c9a68\",\n \"remote_id\": \"19202938\",\n \"created_at\": \"2021-09-15T00:00:00Z\",\n \"modified_at\": \"2021-10-16T00:00:00Z\",\n \"name\": \"Gil Feig\",\n \"email_address\": \"help@merge.dev\",\n \"is_active\": true,\n \"teams\": [\n \"28b54125-287f-494d-965e-3c5b330c9a68\",\n \"17a54124-287f-494d-965e-3c5b330c9a68\"\n ],\n \"roles\": [\n \"23454124-387f-494d-265e-345b330c9123\"\n ],\n \"avatar\": \"https://merge.dev/user_profile_pic.png\",\n \"remote_was_deleted\": true,\n \"field_mappings\": {\n \"organization_defined_targets\": {\n \"custom_key\": \"custom_value\"\n },\n \"linked_account_defined_targets\": {\n \"custom_key\": \"custom_value\"\n }\n },\n \"remote_data\": [\n {\n \"path\": \"/platform-endpoint\",\n \"data\": {\n \"key\": \"value\"\n }\n }\n ]\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"5bf991a0-41f6-41b3-8a26-b9cef5ee8091","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}},{"id":"7ba6b4a3-efda-41b7-a85d-9f87f5e34044","name":"list - default","request":{"urlPathTemplate":"/ticketing/v1/webhook-receivers","method":"GET"},"response":{"status":200,"body":"[\n {\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n }\n \n]","headers":{"Content-Type":"application/json"}},"uuid":"7ba6b4a3-efda-41b7-a85d-9f87f5e34044","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}},"postServeActions":[]},{"id":"f00df9d3-0851-4032-9fe2-50bf59b73aae","name":"create - default","request":{"urlPathTemplate":"/ticketing/v1/webhook-receivers","method":"POST"},"response":{"status":201,"body":"{\n \"event\": \"event\",\n \"is_active\": true,\n \"key\": \"key\"\n \n}","headers":{"Content-Type":"application/json"}},"uuid":"f00df9d3-0851-4032-9fe2-50bf59b73aae","persistent":true,"priority":3,"metadata":{"mocklab":{"created":{"at":"2020-01-01T00:00:00.000Z","via":"SYSTEM"}}}}],"meta":{"total":466}} \ No newline at end of file